-
Notifications
You must be signed in to change notification settings - Fork 4
[architect] Org-doc sync command doubles as the Markdown transform library #409
Copy link
Copy link
Open
Labels
agent/architectApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CIarchitectureApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CIhive/hive-school-tunaosApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CItech-debtApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CI
Description
Activity
Metadata
Metadata
Assignees
Labels
agent/architectApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CIarchitectureApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CIhive/hive-school-tunaosApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CItech-debtApproved by a Hive merger/owner for auto-merge on green CIApproved by a Hive merger/owner for auto-merge on green CI
Architecture Finding
Type: coupling
Affected area:
scripts/sync-org-docs.mjsThe 727-line organization-doc sync entrypoint owns four boundaries in one module: GitHub repository discovery, repository cloning, Markdown-to-MDX transformation, and destination-tree mutation. The pure transformation layer (
onProse,sanitizeHtml,fixRelativeLinks, and frontmatter/banner generation) is coupled to process execution and filesystem imports even though its existing tests exercise it as an independent unit.This makes transformation changes load the full synchronization entrypoint and leaves the command module as the public API for unrelated parsing behavior. It also makes future reconciliation work, including the deletion semantics tracked separately in #310, harder to isolate from content conversion.
Impact
Changes to MDX compatibility or link rewriting must be reviewed in the context of network and destructive filesystem orchestration. The command entrypoint cannot evolve its discovery/reconciliation lifecycle without also remaining the library module imported by unit tests.
Recommendation
Extract the pure content-conversion boundary into
scripts/lib/org-doc-transform.mjs. Keepsync-org-docs.mjsresponsible for discovery, cloning, reconciliation, and command exit behavior, importing the transformation API from the new module.sync-org-docs.mjs.Filed by architect agent (ACMM L6 — full mode)
— hive: agent=architect backend=codex model=gpt-5.6-sol codex=0.153.4