Repository navigation
feat: adopt constitution layering in worker briefs - #3454
derickdsouza wants to merge 3 commits into
Conversation
Put constitution-layering in the generated ship project-memory contract so workers specialize in local-* files instead of replacing shared rule files.
…nd scripts catalog
Confidence Score: 5/5The PR appears safe to merge, with both worker-delivery surfaces consistently using the same shared contract owner. The helper is sourced before use in both generation paths, its output is rendered into the intended worker-facing sections, and the changed tests cover the resulting contract without revealing a conflicting runtime or repository invariant. Reviews (1): Last reviewed commit: "no-mistakes(document): Document layering..." | Re-trigger Greptile |
|
@kunchenguid friendly nudge: this PR comes from a fork, so GitHub needs a maintainer to approve workflow runs before CI can start (the 'Approve and run' prompt on the checks panel). Could you approve when you have a moment? Happy to adjust anything in the meantime. |
|
Speaking as Kun's firstmate: first-time fork CI approved after a full-thread + full-diff review (no Inspected HEAD Contract-class: new-default. This is always-on new worker-brief law: every ship brief and every promoted scout is told a shared worker-facing rule file is never same-name overridable and specialization belongs in VISION.md per-rule
This wait is on CI (and no-mistakes), not the author or the captain. Will not auto-merge on green. |
|
Closing per maintainer-side decision: this fork will keep its changes local rather than sending them upstream. Apologies for the noise. |
Intent
Adopt the constitution-layering discipline into firstmate's worker-facing rule-file contract, per the captain's ruling of 2026-09-01 ("1 = adopt", harbor #107).
The discipline: shared worker-facing rule files are law and are never same-name overridden by a project; project specialization lives in separate, clearly-namespaced local-* style files. This keeps shared rules drift-free across every project a worker touches. It matches the captain's own standing config practice (global config is law, local files specialize under distinct names).
Requirements:
Constraints:
Accepted later requirement (firstmate decision key promoted-scouts-layering): promoted scouts must receive the layering contract. fm-promote.sh already renders the delivery DoD contracts for promoted workers, so extend that same rendering to include the layering/project-memory contract sections. Add or extend the colocated scaffold test to pin that promoted briefs carry the layering line. Keep everything else as-is.
Implementation choices already made (not mistakes):
What Changed
Final changed paths and statuses:
Risk Assessment
✅ Low: The change is a tightly bounded contract addition: one sentence with a single shared owner rendered into two already-existing delivery surfaces, pinned by colocated behavioral tests that execute the real generation paths, with no reachable path producing a wrong or missing contract.
Testing
Ran the two colocated test files covering the change (all passing), reproduced both real generation paths end-to-end with the actual CLIs to confirm the layering sentence reaches the worker-facing ship brief and the promoted scout's delivered message, confirmed scout/secondmate scaffolds and AGENTS.md carry no duplicate restatement, and verified at the base commit that both new assertions fail, establishing them as genuine regression tests. No failures; worktree left clean.
Evidence: Generated ship brief (worker-facing surface) with layering line in Project memory section
Source: Generated ship brief (worker-facing surface) with layering line in Project memory section
Evidence: Promoted scout's ship-instructions.md carrying the layering contract
Source: Promoted scout's ship-instructions.md carrying the layering contract
Evidence: Message actually delivered to the promoted worker (captured via the fm-send.sh delivery command promotion printed), layering line at line 11 directly above the Definition of done
Source: Message actually delivered to the promoted worker (captured via the fm-send.sh delivery command promotion printed), layering line at line 11 directly above the Definition of done
Evidence: fm-promote.sh transcript: kind=scout→ship flip, mode/yolo recorded, ship instructions written, delivery command printed
Source: fm-promote.sh transcript: kind=scout→ship flip, mode/yolo recorded, ship instructions written, delivery command printed
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-brief.test.sh (all pass, incl. test_ship_project_memory_wording pinning the layering line in the generated ship brief)bash tests/fm-task-delivery.test.sh (all pass, incl. test_promotion_delivers_the_real_definition_of_done asserting the delivered payload carries the layering contract for no-mistakes/direct-PR/local-only)manual e2e:FM_HOME=$DEMO ./bin/fm-brief.sh layering-demo-ship fixture-project --mode no-mistakesthen inspected generated brief.md Project memory sectionmanual e2e:./bin/fm-promote.sh layering-demo-scout --mode no-mistakes --yolo offwith kind=scout task record, then executed the printed fm-send.sh delivery command via a capturing stub and asserted the delivered payload contains the layering lineone-owner check:grep -rn "A shared worker-facing rule file is law" --include='*.sh' --include='*.md' .shows the sentence only in bin/fm-dod-lib.sh plus the two pinning tests; scout and secondmate generated briefs confirmed free of itbase-commit regression check: ran fm-brief.sh and fm-promote.sh extracted from 355f46f against temp FM_HOME; layering line absent in both generated outputs, proving the new assertions fail before the fix✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.