scaffold(0001): validator + CI gate + dev-department.yaml manifest #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "scaffold/initial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Initial scaffold for
molecule-ai/molecule-dev-department. Sets up the validator, CI gate, manifest schema, and the README that documents the subtree-contract — but does NOT yet contain any workspace content. The dev-tree extraction with git history is the next PR (Phase 3c-2, task #224).What this PR contains
dev-department.yaml— root manifest. Same shape as a parent org-template'sorg.yaml(defaults + category_routing + plugin defaults + roots). Emptyroots: []for the scaffold; populated when content lands..molecule-ci/scripts/validate-tree.py— orphan / reachability / shape lint (134 lines, stdlib + PyYAML)..github/workflows/validate.yml— Gitea Actions CI gate runs the validator on every PR + push.README.md— explains the subtree contract (filesystem symlink at deploy time, parent template owns the link, this repo is not standalone-importable)..gitignore,.gitattributes—.envignored (per-workspace secrets populated at import-time, never committed); LF enforced on shell/Python/YAML.Why now
Gate the structure BEFORE moving any content. The validator is the contract — landing content first then writing the validator means we'd have to fix the content to match. Land the validator + clean (empty) tree first → CI passes → then content moves are caught the moment they violate the rules.
Validator behavior
Walks
dev-department.yaml → roots → recursive children: + !includeto build the set of workspace folders the manifest reaches. Compares againstos.walkof the filesystem to find folders containingworkspace.yaml. Reports four violation classes:..refs —children:paths that traverse upward. (Hongming Q3+Q5: atomization rule.)Local verification
These fixture results pin: empty tree passes, both violation classes are caught with exit 1.
Hostile self-review (SOP Phase 4)
os.walk(followlinks=False)— symlinked dirs INSIDE the dev-department repo are not descended. This is intentional (the dev-department is self-contained). Cross-repo symlink composition is the parent template's concern, validated separately by the parent's own CI.__include__sentinel approach to!includewalking re-implements yaml.SafeLoader behavior; if PyYAML changes how it reports!includetags, the validator could miss includes. Mitigation: an integration smoke test against the actual platformresolveYAMLIncludesGo code is the proper bound — that's molecule-core PR #102's job.category_routing:exist as workspacename:fields anywhere. That's a follow-up — filed as a parked task to add post-extraction.Refs
Initial scaffold for the dev-department subtree repo. No workspace content yet — that lands in Phase 3c-2 (extract dev tree with git history from molecule-ai-org-template-molecule-dev). Files: - dev-department.yaml manifest with defaults + category_routing, empty roots: [] (gets populated by extract). - .molecule-ci/scripts/validate-tree.py orphan / reachability lint. Walks manifest → roots → recursive children + !include, compares against filesystem, reports orphans + cross-tree '..' refs + duplicate parents + missing workspace.yaml. Exits non-zero on any violation. Stdlib only + PyYAML. - .github/workflows/validate.yml CI gate runs the validator on every PR + push to main/staging. Pinned action SHAs per saved memory feedback_pin_third_party_actions. - README.md explains subtree contract: parent template must symlink the dev-department under a short name (e.g. `dev`), workspace files_dir paths inside this repo use the symlink prefix, this repo is NOT directly importable as a standalone org template. - .gitignore ignore .env (per-workspace secrets are populated by platform import, never committed). - .gitattributes force LF on shell/Python/YAML. Verified locally: - empty tree → "OK — tree is clean", exit 0. - cross-tree `..` fixture → exit 1, FAIL with reported violation. - orphan fixture → exit 1, FAIL with reported orphan folder. Refs: - internal#77 (extraction RFC, Phase 1+2 done as comment 1886) - molecule-core#102 (symlink-resolution contract pinned by tests) - Hongming GO 2026-05-08 ("you own this feature and repos, start") - SOP Phase 3b — task #223