@punks/cli 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/AGENTS.md +2 -0
  2. package/dist/BASELINE_CHANGELOG.md +47 -1
  3. package/dist/CHANGELOG.md +36 -0
  4. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  5. package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +48 -0
  6. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -1
  7. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +8 -0
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +20 -22
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/SKILL.md +18 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/references/migration.md +10 -0
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +99 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +3 -2
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/high-signal-tests.md +17 -3
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/{CONTEXT-FORMAT.md → GLOSSARY-FORMAT.md} +9 -9
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/SKILL.md +12 -12
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -2
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +1 -1
  30. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  31. package/dist/baseline/scaffold-baseline/skills/misc/wait-what/SKILL.md +1 -1
  32. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +5 -7
  33. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +25 -50
  34. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +22 -27
  35. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +10 -28
  36. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  37. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +1 -1
  38. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +2 -9
  39. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +8 -6
  40. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +5 -8
  41. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +14 -29
  42. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +32 -45
  43. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +1 -2
  44. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +12 -86
  45. package/dist/baseline/scaffold-baseline.json +5 -5
  46. package/dist/baseline/scaffold-baseline.tgz +0 -0
  47. package/dist/data/AGENTS.md +2 -0
  48. package/dist/index.js +15 -15
  49. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -7
  50. package/dist/skills/agnostic/docs/rule-authoring/SKILL.md +18 -0
  51. package/dist/skills/agnostic/docs/rule-authoring/references/migration.md +10 -0
  52. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  53. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  54. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  55. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +99 -0
  56. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  57. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  58. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  59. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  60. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  61. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  62. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  63. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  64. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  65. package/dist/skills/agnostic/quality/tdd/SKILL.md +3 -2
  66. package/dist/skills/agnostic/quality/tdd/high-signal-tests.md +17 -3
  67. package/dist/skills/agnostic/requirements/domain-modeling/{CONTEXT-FORMAT.md → GLOSSARY-FORMAT.md} +9 -9
  68. package/dist/skills/agnostic/requirements/domain-modeling/SKILL.md +12 -12
  69. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -2
  70. package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +1 -1
  71. package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  72. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +29 -0
  73. package/dist/skills/misc/wait-what/SKILL.md +1 -1
  74. package/dist/skills/phases/delivery-phase/SKILL.md +5 -7
  75. package/dist/skills/phases/delivery-phase/phases/review.md +25 -50
  76. package/dist/skills/phases/delivery-phase/phases/router.md +20 -25
  77. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +10 -28
  78. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  79. package/dist/skills/phases/review-phase/phases/prepare-review.md +1 -1
  80. package/dist/skills/phases/review-phase/phases/retain-report.md +2 -9
  81. package/dist/skills/phases/review-phase/phases/return-route.md +8 -6
  82. package/dist/skills/phases/review-phase/phases/run-review.md +5 -8
  83. package/dist/skills/phases/review-phase/references/durable-report.md +14 -29
  84. package/dist/skills/phases/review-phase/references/state-graph.md +6 -19
  85. package/dist/skills/phases/review-phase/references/targets.md +1 -2
  86. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +11 -91
  87. package/package.json +9 -71
@@ -0,0 +1,99 @@
1
+ # Architecture Convergence
2
+
3
+ Use this branch when a plan can change cumulative code ownership. `SPEC.md` owns the accepted target architecture; the saved plan derives its execution contract and later execution checks conformance against it.
4
+
5
+ ## Classify Applicability
6
+
7
+ Persist `architecture_applicability: local | architecture-bearing` with evidence.
8
+
9
+ - `local`: one bounded responsibility, with no domain-owner, public-seam, composition, or cross-domain
10
+ dependency change. Keep the ordinary task graph and `codebase_design_notes`; record why this branch does
11
+ not apply.
12
+ - `architecture-bearing`: multiple stories or tasks change one capability cumulatively; or any task crosses
13
+ an ownership boundary, changes composition, changes a public seam, introduces a domain, migrates callers,
14
+ or changes cross-domain dependencies.
15
+
16
+ Classification is complete when every planned location and consumer is covered by one outcome. A plan
17
+ cannot use `local` merely because each task looks small in isolation.
18
+
19
+ ## Derive the Contract
20
+
21
+ Read the accepted technical decisions and verification seams in `SPEC.md`. If the target topology, dependency direction, boundaries, or public seams are absent or contradictory, return to `requirements-grill`; do not invent a competing target.
22
+
23
+ For backend scope, invoke `$backend-domain-structure` and read its layout reference. Derive honest feature,
24
+ platform/composition, integration, persistence, model, and public-boundary ownership from the repository.
25
+
26
+ For frontend scope, invoke `$frontend-domain-structure` and read its agnostic reference. Apply the invariant-owner,
27
+ domain-worthiness, public-entrypoint, one-way, and acyclic dependency rules. For React scope, also read its
28
+ React addendum and classify route composition, components, hooks, providers, and behavior-test seams.
29
+
30
+ For mixed scope, apply both theories at their respective boundaries. Preserve repository vocabulary and
31
+ existing honest owners. Completion requires every changed responsibility and dependency edge to be grounded
32
+ in the applicable theory and current code evidence.
33
+
34
+ ## Persist the Architecture Contract
35
+
36
+ For an architecture-bearing plan, invoke `$show-me` while authoring **each persisted view** below. Save the
37
+ smallest visual that preserves exact owners, edges, order, labels, and uncertainty next to a terse textual
38
+ conclusion. These views are normative `PLAN.md` content, not a conversational summary.
39
+
40
+ ### Target Ownership Topology
41
+
42
+ Show the target domains/modules and composition roots as a shallow tree or ownership map. For every owner,
43
+ state its responsibility, public entrypoint, owned paths, and responsibilities it must not absorb. Ownership
44
+ means semantic policy and behavior, not file placement alone.
45
+
46
+ ### Declared Dependency Graph
47
+
48
+ Show every changed or newly relevant cross-owner edge. Label allowed edges with the public seam they traverse;
49
+ list forbidden static imports and forbidden semantic calls. Require one-way, acyclic dependencies and deliberate
50
+ public entrypoints under the applicable frontend/backend theory.
51
+
52
+ ### Responsibility Acceptance Criteria
53
+
54
+ Give every target owner observable acceptance criteria proving that its policy, orchestration, persistence,
55
+ integration, transport, or presentation responsibility lives there. Include focused behavior and architecture
56
+ checks; file existence alone is insufficient evidence. Each criterion records a stable `criterion_id`, its
57
+ owner, observable assertion, evidence command or inspection, and `due_architecture_wave`. Every criterion id
58
+ must map to at least one task and exactly one due wave.
59
+
60
+ ### Architecture Waves
61
+
62
+ Show ordered architecture waves separately from worker parallelism:
63
+
64
+ ```text
65
+ boundary establishment
66
+ vertical slice / caller migration
67
+ continuous convergence checkpoint
68
+ next slice
69
+ continuous convergence checkpoint
70
+ final closure
71
+ ```
72
+
73
+ Each wave has a stable `architecture_wave` id distinct from worker `wave_boundary`; it names its topology delta,
74
+ entry dependencies, criterion ids due in that wave, allowed temporary seams, and checkpoint. Vertical delivery
75
+ remains behavior-complete; architecture work is not deferred wholesale to final closure.
76
+
77
+ ### Public Seam Contract
78
+
79
+ Name each consumer-facing command, result, port, event, component, hook, or entrypoint affected by the plan;
80
+ list its owner and allowed consumers. A task that changes the declared public seam must amend the plan contract
81
+ before dependent work continues.
82
+
83
+ ### Migration Ledger
84
+
85
+ For every temporary seam record its introducing task, reason, allowed consumers, removal task, expiry wave, and
86
+ removal proof. Undeclared temporary seams are drift. Final closure requires the migration ledger to be empty.
87
+
88
+ ## Shape Continuous Convergence
89
+
90
+ Every architecture-bearing task declares `architecture_wave`, `behavior_owner`, `integration_surface`,
91
+ `public_seam`, `topology_delta`, `forbidden_ownership`, `temporary_seams`, and
92
+ `responsibility_acceptance_criteria`. Each architecture wave ends with a **continuous convergence checkpoint**
93
+ that compares cumulative implementation with all persisted views: actual ownership, allowed and forbidden edges,
94
+ public-seam amendments, topology delta, and migration-ledger additions/removals. The checkpoint evaluates every
95
+ criterion due through the current wave and regression-checks every criterion previously met. Missing, failing,
96
+ or regressed evidence blocks dependent waves.
97
+
98
+ Final closure confirms the target responsibilities, graph, public seams, and acceptance evidence; all migration
99
+ entries are removed. It is a zero-drift proof, not the first consolidation pass.
@@ -8,6 +8,7 @@ The generated `PLAN.md` is the execution handoff. It must stand alone without hi
8
8
 
9
9
  Include:
10
10
 
11
+ - `architecture_applicability: local | architecture-bearing` with evidence
11
12
  - initial situation
12
13
  - issue or problem statement
13
14
  - proposed solution shape
@@ -22,6 +23,12 @@ Include:
22
23
  - validation gates per `Tn` task and dependency wave
23
24
  - unresolved questions
24
25
 
26
+ When `architecture_applicability: architecture-bearing`, also include the normative **Target Ownership
27
+ Topology**, **Declared Dependency Graph**, **Responsibility Acceptance Criteria**, **Architecture Waves**,
28
+ **Public Seam Contract**, and **Migration Ledger** defined in
29
+ [architecture-convergence.md](architecture-convergence.md). Persist each view using `$show-me`; the migration
30
+ ledger starts with every planned temporary seam and final closure requires it to be empty.
31
+
25
32
  `unresolved questions` is not a hiding place for skipped planning. Include only `$grilling`-deferred, externally blocked, or non-blocking questions, and state why each remains open.
26
33
 
27
34
  Each wave contains every currently unblocked task whose `owned_paths` are
@@ -62,6 +69,25 @@ Every task must include:
62
69
  - `runtime_evidence`
63
70
  - `runtime_cleanup`
64
71
 
72
+ Every architecture-bearing task must also include:
73
+
74
+ - `architecture_wave`
75
+ - `behavior_owner`
76
+ - `integration_surface`
77
+ - `public_seam`
78
+ - `topology_delta`
79
+ - `forbidden_ownership`
80
+ - `temporary_seams`
81
+ - `responsibility_acceptance_criteria`
82
+
83
+ These fields bind the task to cumulative ownership rather than file placement. Local-plan tasks omit them;
84
+ their plan-level applicability evidence and ordinary `codebase_design_notes` are the explicit escape hatch.
85
+
86
+ `architecture_wave` is a stable architecture sequence id, for example `A2`; `wave_boundary` remains the worker
87
+ parallelism id. `responsibility_acceptance_criteria` lists the stable criterion ids this task advances or proves.
88
+ Every listed id must exist in the plan-level Responsibility Acceptance Criteria view, whose entry declares its
89
+ `due_architecture_wave`. Each criterion maps to at least one task and exactly one due architecture wave.
90
+
65
91
  `backlog_item_id` and `backlog_item_url` reference the owning product-facing story, not a task-owned backlog record.
66
92
 
67
93
  `owned_paths` lists the exact write scope assigned to the task. Tasks in the
@@ -142,4 +168,12 @@ Use `not_applicable` for the other runtime fields when `runtime_validation: not_
142
168
  - **runtime_target**: Supported local API and background worker.
143
169
  - **runtime_evidence**: Public response plus correlated persisted state and worker completion.
144
170
  - **runtime_cleanup**: Tag fixtures with a unique run id; remove only resources carrying that id.
171
+ - **architecture_wave**: A2
172
+ - **behavior_owner**: Target domain or module responsible for the changed behavior.
173
+ - **integration_surface**: Composition, transport, UI, or caller surface consuming the owner.
174
+ - **public_seam**: Declared entrypoint and command/result/port contract, or unchanged.
175
+ - **topology_delta**: Exact owner or dependency edge moved toward the target topology.
176
+ - **forbidden_ownership**: Policy or mechanics this task must keep outside its owner.
177
+ - **temporary_seams**: Ledger entries introduced or removed by this task, or none.
178
+ - **responsibility_acceptance_criteria**: [RAC-2, RAC-3]
145
179
  ```
@@ -16,23 +16,21 @@ Before finalizing task boundaries:
16
16
 
17
17
  1. List every concrete `location` each task may touch.
18
18
  2. For each location, inspect the `AGENTS.md` chain from repo root to the nearest scoped file.
19
- 3. Read the final `## Skills` table with `Skill | Exact trigger` in every
20
- applicable scoped file and select only non-phase rows whose exact trigger
21
- matches the task.
22
- 4. Verify each selected skill exists in `.agents/skills/` or another installed
23
- skill source visible to the agent.
24
- 5. Open each selected installed skill's `SKILL.md`; that installed file is
25
- workflow authority while finalizing the task's boundary, validation, RED
26
- target, and review mode.
19
+ 3. Read every applicable `Skill | What / when` table and select only rows whose
20
+ exact `What / when` trigger matches the task.
21
+ 4. Verify each selected skill exists in `.agents/skills/` or an installed skill
22
+ source visible to the agent.
23
+ 5. Open each selected skill's complete `SKILL.md` before finalizing the task's
24
+ boundary, validation, RED target, and review mode.
27
25
  6. Add the merged, deduplicated union from every touched scope to the task as
28
26
  `assigned_skills`.
29
27
  7. For every implementation-applicable item, add exactly one
30
28
  `implementation_skill_guidance` entry with the exact skill identity and its
31
29
  concise applicable behavior. Planning-only items remain provenance without a
32
30
  guidance entry.
33
-
34
- Root `AGENTS.md` stays table-free. Phase wrappers remain global orchestration
35
- entrypoints and are excluded from scoped tables.
31
+ 8. Classify architecture applicability using `architecture-convergence.md` before locking dependencies and
32
+ waves. For architecture-bearing plans, derive task boundaries and architecture waves from the persisted
33
+ target ownership topology, dependency graph, responsibility criteria, public seams, and migration ledger.
36
34
 
37
35
  If a task spans multiple scopes, include all selected skills from all touched
38
36
  scopes. If a matching row names a missing skill, keep the task planned but
@@ -55,10 +53,15 @@ Preserve `$swarm-planner` behavior:
55
53
  - validations per task
56
54
  - parallel execution waves
57
55
  - risks and mitigations
58
- - explicit `assigned_skills` per task from exact scoped trigger
56
+ - explicit `assigned_skills` per task from exact scoped `What / when` trigger
59
57
  matches, with task design shaped by those skills
60
58
  - complete one-to-one `implementation_skill_guidance` for every
61
59
  implementation-applicable assigned skill
60
+ - architecture-bearing task fields `architecture_wave`, `behavior_owner`, `integration_surface`, `public_seam`,
61
+ `topology_delta`, `forbidden_ownership`, `temporary_seams`, and `responsibility_acceptance_criteria`
62
+ - stable criterion ids mapped to at least one task and exactly one due architecture wave
63
+ - a continuous convergence checkpoint after every architecture wave that checks all criteria due through the
64
+ current wave and regression-checks previously met criteria
62
65
  - a final `plan-reviewer` subagent review for missing deps, missing
63
66
  `owned_paths`, missing `wave_boundary`, ordering issues, edge cases, invalid
64
67
  parallelism, unsafe write overlap, missing RED targets, missing validation,
@@ -41,15 +41,15 @@ implementation tasks.
41
41
 
42
42
  1. Resolve the target spec folder by checking, in order: `apps/wiki/content/docs/project/specs/<domain>/<spec>/`, legacy `apps/wiki/specs/<domain>/<spec>/`, then `docs/specs/<domain>/<spec>/`.
43
43
  2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
44
- 3. Read `references/parallel.md`, parse the plan graph, and build the first unblocked wave.
44
+ 3. Read `references/parallel.md`, parse the plan graph, and build the first unblocked wave. When the plan is architecture-bearing, also read and enforce `references/architecture-conformance.md`.
45
45
  4. Launch scoped workers for the current wave using
46
46
  `references/parallel-worker-brief.md`. Forward every guidance item unchanged,
47
47
  preserving its `implementation_skill_guidance` skill and behavior fields.
48
48
  5. After each validated wave, update `PLAN.md`, `IMPLEMENTATION-NOTES.md`, and
49
49
  spec-linked tech debt before advancing. Require exactly one skill-application
50
- evidence record per guidance entry. Use `$show-me` for a derived wave board
51
- when it materially improves operator orientation; the shared artifacts remain
52
- authoritative.
50
+ evidence record per guidance entry. For architecture-bearing plans, run the
51
+ cumulative conformance checkpoint after every architecture wave and persist
52
+ its `$show-me` evidence; a failed checkpoint blocks dependent waves.
53
53
  6. Use `$codebase-design` vocabulary while reviewing each worker change: interface, seam, adapter, depth, leverage, locality, and test surface.
54
54
  7. Resolve implementation debt as soon as it appears. Do not leave "later" work, TODOs, temporary compromises, or vague follow-up debt.
55
55
  8. If a debt item needs a product/scope decision outside the active goal, stop and run a very small `$requirements-phase` clarification before continuing.
@@ -61,7 +61,7 @@ implementation tasks.
61
61
  classification. A mismatch is runtime evidence: route it to
62
62
  `debugging-phase`. If the required interaction capability is unavailable,
63
63
  record the explicit blocker and keep affected acceptance criteria blocked.
64
- 13. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
64
+ 13. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract. Architecture-bearing plans also require final zero-drift closure and an empty migration ledger.
65
65
  14. Invoke `$show-me` to present the implementation notes, final code changes,
66
66
  acceptance status, and manual review path from finalized
67
67
  `IMPLEMENTATION-NOTES.md`, the diff, and recorded evidence. The presentation
@@ -106,3 +106,4 @@ at the same gate. That branch owns the complete run.
106
106
  - Worker-wave execution: see [references/parallel.md](references/parallel.md)
107
107
  - Plan parsing and wave construction: see [references/parallel-orchestration.md](references/parallel-orchestration.md)
108
108
  - Worker brief contract: see [references/parallel-worker-brief.md](references/parallel-worker-brief.md)
109
+ - Architecture-bearing wave checkpoints and final closure: see [references/architecture-conformance.md](references/architecture-conformance.md)
@@ -34,6 +34,16 @@ where the guidance was assessed.
34
34
  | ---- | ----- | ------ | --------- | --------------------------------------------- |
35
35
  | | | | | |
36
36
 
37
+ ## Architecture Conformance Evidence
38
+
39
+ Persist the `$show-me` ownership tree, dependency graph, wave delta, or seam
40
+ diff beside each conclusion. Use one row after every architecture wave and one
41
+ for final closure. Local plans remove this section.
42
+
43
+ | Architecture wave id | Target ownership topology and observed state | Declared dependency graph and observed state | Due criterion ids, evidence, and prior-met regression status | Public seam delta | Migration ledger delta, expiry waves, and final empty-ledger status | Validation evidence | Verdict or exact drift |
44
+ | -------------------- | -------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------ | ----------------- | ------------------------------------------------------------------- | ------------------- | ---------------------- |
45
+ | | | | | | | | |
46
+
37
47
  ## UI Evidence Links
38
48
 
39
49
  | Surface | Viewport | Before | After | Notes |
@@ -0,0 +1,100 @@
1
+ # Architecture Conformance
2
+
3
+ Use this contract when `PLAN.md` declares architecture applicability as
4
+ `architecture-bearing`. A `local` plan keeps the normal task design checks and
5
+ does not invent an architecture contract during execution.
6
+
7
+ The plan is authoritative. Execute its **Target Ownership Topology**, **Declared
8
+ Dependency Graph**, **Responsibility Acceptance Criteria**, **Architecture Waves**,
9
+ public seam contract, and migration ledger. Execution may clarify
10
+ evidence. An evidence-only clarification may be recorded locally when it changes
11
+ no owner, edge, criterion, wave, seam, migration, or task contract. Any target
12
+ contract change pauses execution and routes back through `$create-plan` on the
13
+ same spec folder for architecture convergence authoring and plan review. Reload
14
+ the amended plan before dispatching more architecture-bearing work.
15
+
16
+ ## Load the theory
17
+
18
+ Before the first architecture wave, load `$backend-domain-structure` for
19
+ backend scope and `$frontend-domain-structure` for frontend scope. Read their
20
+ required references. Use their responsibility classifiers, public boundaries,
21
+ and dependency direction to interpret the plan against the actual repository.
22
+ Preserve project-native folder names: responsibility is authoritative; an
23
+ example tree is not.
24
+
25
+ When an accepted amendment changes the target contract, re-ground the affected
26
+ scope in `$backend-domain-structure` and `$frontend-domain-structure` as
27
+ applicable, including their required references. Rewrite every affected
28
+ `$show-me` persisted view from the amended authority before execution resumes.
29
+
30
+ Invoke `$show-me` to render each persisted architecture evidence view from the
31
+ authoritative plan and observed code. Persist the smallest useful ownership
32
+ tree, dependency graph, wave delta, or seam diff beside its textual conclusion
33
+ in `IMPLEMENTATION-NOTES.md`. The view preserves plan labels, status,
34
+ uncertainty, and violations; it introduces no architecture decision.
35
+
36
+ ## Before dispatch
37
+
38
+ For each architecture wave:
39
+
40
+ 1. Resolve its required starting topology and dependency state from the prior
41
+ checkpoint.
42
+ 2. Map every task's `architecture_wave`, `behavior_owner`,
43
+ `integration_surface`, `public_seam`, `topology_delta`,
44
+ `forbidden_ownership`, `temporary_seams` including `expiry_wave`, and
45
+ `responsibility_acceptance_criteria` including each `criterion_id` and
46
+ `due_wave` into its worker brief unchanged.
47
+ 3. Verify the tasks collectively advance the declared architecture wave and
48
+ have responsibility acceptance criteria that can be evidenced.
49
+ 4. Block dispatch when a prerequisite checkpoint failed or the wave would
50
+ introduce an undeclared dependency, public seam change, or temporary seam.
51
+
52
+ Dispatch is ready when every architecture-bearing task has an accountable
53
+ owner, expected graph delta, seam contract, and checkable responsibility bound.
54
+
55
+ ## Cumulative conformance checkpoint
56
+
57
+ Run a cumulative conformance checkpoint after every architecture wave, before
58
+ computing the next wave. Inspect the whole affected graph, not only the latest
59
+ diff:
60
+
61
+ - compare actual responsibility placement with the Target Ownership Topology;
62
+ - compare static imports and semantic calls with the Declared Dependency Graph;
63
+ - prove every Responsibility Acceptance Criterion due through the current
64
+ architecture wave, keyed by `criterion_id`, with changed artifacts and focused
65
+ validation;
66
+ - rerun each previously met criterion as a regression check and revoke its met
67
+ status when current evidence fails;
68
+ - reconcile every planned `topology_delta` and `forbidden_ownership` rule;
69
+ - detect public seam additions, removals, signature changes, aliases, and deep
70
+ imports, and reconcile each with the public seam contract;
71
+ - reconcile the migration ledger: introducing task, reason, allowed consumers,
72
+ removal task, expiry wave, current status, and removal proof;
73
+ - reject undeclared temporary seams and migrations due through the current
74
+ architecture wave whose removal proof is absent;
75
+ - run the narrowest available architecture, import-boundary, cycle, type, and
76
+ focused behavior checks.
77
+
78
+ Record the checkpoint in `PLAN.md` and under `## Architecture Conformance
79
+ Evidence` in `IMPLEMENTATION-NOTES.md`. Include expected state, observed state,
80
+ evidence, violations, public seam delta, migration delta, and verdict. A failed
81
+ checkpoint blocks dependent architecture waves. Repair the current wave or
82
+ route a target-contract amendment through `$create-plan`; final closure is not
83
+ the first cleanup pass.
84
+
85
+ ## Final closure
86
+
87
+ After the last architecture wave, rerun the checkpoint across the complete
88
+ affected topology. Closure requires:
89
+
90
+ - zero drift from the Target Ownership Topology and Declared Dependency Graph;
91
+ - every Responsibility Acceptance Criterion met with cited evidence;
92
+ - every public seam change declared and accepted;
93
+ - the entire migration ledger is empty, with removal proof for every retired
94
+ temporary seam;
95
+ - no expired or undeclared temporary seam remains;
96
+ - focused architecture and behavior validation is green.
97
+
98
+ Keep the spec incomplete when closure fails. Record exact drift and the task or
99
+ decision required to remove it; never convert in-goal architecture drift into
100
+ generic tech debt.
@@ -47,6 +47,10 @@ Read, in this order:
47
47
  4. `<resolved-spec-folder>/IMPLEMENTATION-NOTES.md` if present
48
48
  5. `docs/reference/tech-debt/<domain>/<spec>.md` if present
49
49
 
50
+ When `PLAN.md` declares architecture applicability as `architecture-bearing`,
51
+ also read [architecture-conformance.md](architecture-conformance.md) before
52
+ dispatching the first wave.
53
+
50
54
  If package or framework behavior matters, inspect source with `opensrc --modify false` before guessing.
51
55
 
52
56
  ## 4. Prepare execution notes
@@ -60,6 +64,9 @@ Use [../assets/IMPLEMENTATION-NOTES-TEMPLATE.md](../assets/IMPLEMENTATION-NOTES-
60
64
  - For tasks with `runtime_validation: required`, load [runtime-product-validation.md](runtime-product-validation.md) and keep `## Runtime Validation Evidence` current.
61
65
  - For visibly exercisable acceptance criteria, keep `## Behavior Verification
62
66
  Evidence` current using the template contract.
67
+ - For architecture-bearing plans, seed `## Architecture Conformance Evidence`
68
+ from the persisted architecture contract and keep one cumulative checkpoint
69
+ per architecture wave plus final closure.
63
70
  - Seed `## Skill Application Evidence` from every task's
64
71
  `implementation_skill_guidance`. Preserve each guidance item unchanged and
65
72
  create exactly one evidence row for it.
@@ -136,6 +143,9 @@ After each completed wave:
136
143
  status, and how/where pointer against changed artifacts; for
137
144
  `not_applicable`, verify why and where the guidance was assessed
138
145
  - update `IMPLEMENTATION-NOTES.md` with non-obvious decisions, surprises, or deviations
146
+ - for architecture-bearing plans, run the cumulative conformance checkpoint
147
+ after every architecture wave; persist the `$show-me` view, textual conclusion,
148
+ graph and ownership evidence, public-seam delta, migration-ledger delta, and verdict
139
149
  - for UI implementation changes, record durable before/after screenshot asset links in `IMPLEMENTATION-NOTES.md`
140
150
  - for required runtime validation, record the scenario, public action, correlation or provenance ids, observed result, durable evidence, cleanup, and status or exact blocker in `IMPLEMENTATION-NOTES.md`
141
151
  - persist each `$verify-behavior` result under `## Behavior Verification
@@ -183,6 +193,11 @@ Re-read `SPEC.md` acceptance criteria and mark each one:
183
193
 
184
194
  Record a reason for every unmet or blocked item in `IMPLEMENTATION-NOTES.md`.
185
195
 
196
+ For architecture-bearing plans, acceptance also audits every Responsibility
197
+ Acceptance Criterion against the cumulative evidence. A failed topology,
198
+ dependency, public-seam, or migration-ledger checkpoint keeps affected criteria
199
+ unmet or blocked.
200
+
186
201
  Acceptance that depends on required runtime validation is `met` only when its recorded evidence is conclusive. An exact blocker makes it `blocked`.
187
202
 
188
203
  Visibly exercisable acceptance is `met` only when its Behavior Verification
@@ -223,11 +238,19 @@ Before reporting back:
223
238
  - ensure **Skill Application Evidence** has exact one-to-one cardinality with
224
239
  plan guidance; allowed statuses are `loaded`, `applied`, and
225
240
  `not_applicable`
241
+ - ensure **Architecture Conformance Evidence**, when applicable, contains every
242
+ wave checkpoint and final closure; closure proves zero drift and an empty
243
+ migration ledger
226
244
  - ensure **Remaining work** matches any unmet or blocked criteria
227
245
  - ensure no in-goal debt remains as TODO, follow-up cleanup, or vague later-work text
228
246
  - ensure every tech-debt ledger entry has exact blocker/decision/owner/next action
229
- - set `SPEC.md` frontmatter `status: implemented`
230
- - set `PLAN.md` `**Status:** Complete` when that line exists
247
+ - set `SPEC.md` frontmatter `status: implemented` and `PLAN.md` `**Status:**
248
+ Complete` only when every acceptance criterion is met, every reachable task is
249
+ complete, and any architecture-bearing plan has successful final architecture
250
+ closure
251
+ - preserve the current blocked or incomplete `SPEC.md` and `PLAN.md` statuses
252
+ when any acceptance item, task, checkpoint, or final architecture closure is
253
+ unmet or blocked
231
254
  - ensure the PR body, PR comment, or PR-ready handoff snippet includes the same UI evidence links when UI changed
232
255
 
233
256
  ## 13. Final report shape
@@ -30,6 +30,16 @@ For each task, extract:
30
30
  - acceptance criteria
31
31
  - validation
32
32
  - `tdd_target`
33
+ - `architecture_wave`
34
+ - `behavior_owner`
35
+ - `integration_surface`
36
+ - `public_seam`
37
+ - `topology_delta`
38
+ - `forbidden_ownership`
39
+ - `temporary_seams`
40
+ - each temporary seam's `expiry_wave`
41
+ - `responsibility_acceptance_criteria`
42
+ - each criterion's `criterion_id` and `due_wave`
33
43
  - `assigned_skills`
34
44
  - `implementation_skill_guidance`
35
45
  - `review_mode`
@@ -81,7 +91,10 @@ After the workers return:
81
91
  entry and no unmatched record
82
92
  5. verify each record against the worker result and changed artifacts
83
93
  6. ensure non-obvious deviations or surprises were written into `IMPLEMENTATION-NOTES.md`
84
- 7. retry or escalate failed work instead of quietly advancing
94
+ 7. for an architecture wave, run the cumulative conformance checkpoint in
95
+ [architecture-conformance.md](architecture-conformance.md), render and persist
96
+ its `$show-me` evidence, and block dependent waves on any violation
97
+ 8. retry or escalate failed work instead of quietly advancing
85
98
 
86
99
  Move to the next wave only after the current wave is validated and logged.
87
100
 
@@ -108,6 +121,9 @@ A task is complete only when all of the following are true:
108
121
  - any non-obvious deviations are reflected in `IMPLEMENTATION-NOTES.md`
109
122
  - skill-application evidence has exact one-to-one cardinality with forwarded
110
123
  guidance
124
+ - architecture-bearing tasks satisfy their responsibility acceptance criteria,
125
+ declared topology delta, dependency constraints, public seam contract, and
126
+ migration-ledger obligations at the cumulative checkpoint
111
127
 
112
128
  If any of these are missing, the task is not done yet.
113
129
 
@@ -20,6 +20,16 @@ Every worker brief should include:
20
20
  - `tdd_target`
21
21
  - `tdd_status`
22
22
  - `codebase_design_notes`
23
+ - `architecture_wave`
24
+ - `behavior_owner`
25
+ - `integration_surface`
26
+ - `public_seam`
27
+ - `topology_delta`
28
+ - `forbidden_ownership`
29
+ - `temporary_seams`
30
+ - each temporary seam's `expiry_wave`
31
+ - `responsibility_acceptance_criteria`
32
+ - each criterion's `criterion_id` and `due_wave`
23
33
  - `red_command`
24
34
  - `expected_red_failure`
25
35
  - `green_command`
@@ -61,6 +71,7 @@ Each worker brief should require:
61
71
  `loaded`, `applied`, or `not_applicable` status, and a how/where pointer;
62
72
  `not_applicable` also states why and where it was assessed
63
73
  19. refusing completion for required runtime validation without conclusive recorded evidence; returning an exact blocker leaves the task blocked
74
+ 20. for an architecture-bearing task, implementing toward the declared ownership topology and dependency graph, proving each due `responsibility_acceptance_criteria` item by `criterion_id`, and reporting every public-seam and migration-ledger delta with its architecture wave
64
75
 
65
76
  ## Worker output contract
66
77
 
@@ -77,6 +88,9 @@ Require the worker to return:
77
88
  - one skill-application evidence record for every forwarded guidance item,
78
89
  preserving the exact skill identity
79
90
  - anything blocked or risky, with exact reason and required decision
91
+ - architecture evidence: observed ownership and dependency delta,
92
+ responsibility-acceptance proof keyed by `criterion_id`, public-seam delta,
93
+ and temporary-seam status including `expiry_wave`
80
94
 
81
95
  ## Scope rule
82
96
 
@@ -21,6 +21,9 @@ unblocked. Keep the wave boundary and parent validation.
21
21
  - unchanged guidance forwarding and exactly one verified skill-application
22
22
  evidence record per guidance entry
23
23
  - clear reporting of retries, issues, or blockers
24
+ - for architecture-bearing plans, cumulative ownership, dependency,
25
+ responsibility-acceptance, public-seam, and migration-ledger evidence after
26
+ every architecture wave
24
27
 
25
28
  ## Loop rule
26
29
 
@@ -30,3 +33,7 @@ Keep iterating wave by wave until:
30
33
  - or a real blocker remains and is reported honestly
31
34
 
32
35
  Retry failed work or report the exact blocker before advancing.
36
+
37
+ An architecture wave advances only after its cumulative conformance checkpoint
38
+ passes. Final closure confirms zero drift and an empty migration ledger; it is
39
+ never the first consolidation pass.
@@ -34,11 +34,11 @@ If the current code already passes the new test, do not fake RED. Isolate the pr
34
34
 
35
35
  **Core principle**: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
36
36
 
37
- For assertion choices, use [high-signal-tests.md](high-signal-tests.md): move tests one semantic level above the change and verify durable behavior through the nearest public seam.
37
+ For test selection and assertions, use [high-signal-tests.md](high-signal-tests.md): keep tests only when they prove durable product or capability behavior through an owned public seam.
38
38
 
39
39
  **Good tests** are integration-style: they exercise real code paths through public APIs. They describe _what_ the system does, not _how_ it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
40
40
 
41
- **Bad tests** are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
41
+ **Low-signal tests** spend maintenance without protecting owned behavior. Cull existence and registration checks, assertions already satisfied by typechecking, simulated third-party behavior or provider-shape assumptions, shape/contract checks standing in for a feature, low-value UI wiring, and regressions whose only value is blocking reversion. Keep the owned behavior and culling rules co-located in [high-signal-tests.md](high-signal-tests.md).
42
42
 
43
43
  See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
44
44
 
@@ -133,6 +133,7 @@ After all tests pass, look for [refactor candidates](refactoring.md):
133
133
  [ ] Test describes behavior, not implementation
134
134
  [ ] Test uses public interface only
135
135
  [ ] Assertions preserve the product/capability invariant
136
+ [ ] Test proves behavior owned by this system; typechecking or a third party's suite cannot provide the same evidence
136
137
  [ ] Test would survive internal refactor
137
138
  [ ] Code is minimal for this test
138
139
  [ ] No speculative features added
@@ -8,14 +8,28 @@ High-signal tests verify durable behavior through the nearest public seam:
8
8
 
9
9
  - CLI command output or exit status
10
10
  - HTTP route response
11
- - component interaction and visible outcome
11
+ - user-critical interaction and visible outcome
12
12
  - exported API result
13
- - persisted contract or generated artifact
13
+ - persisted product outcome or generated artifact consumed as a feature
14
14
 
15
15
  Move the test one semantic level above the change. If you changed a helper, test the capability that uses it. If you changed formatting, test the stable contract that formatting serves.
16
16
 
17
17
  Prefer observable outcomes over helper calls, private state, call order, intermediate shapes, and internal module boundaries.
18
18
 
19
+ ## Cull Low-Signal Tests
20
+
21
+ Keep a test only when its failure proves an owned product or capability behavior broke. Cull tests that only prove:
22
+
23
+ - a feature, module, route, or command exists or registers; execute the public capability and assert its meaningful outcome instead
24
+ - code has a valid type or shape already enforced by typechecking
25
+ - a third-party provider behaves as documented, including mocks or fixtures that reproduce its response shape; the provider owns that contract
26
+ - an object, schema, generated file, or wire shape matches a contract without proving a feature behavior
27
+ - UI wiring, rendering trivia, or cosmetic UX details; retain only user-critical workflows, accessibility behavior, and failure recovery
28
+ - a command is discoverable or registered without proving what running it does
29
+ - a past change cannot be reverted; retain a regression only when it names and protects an enduring capability invariant
30
+
31
+ Owned compatibility is the boundary. Keep exact protocol or artifact assertions only when this repository owns that public compatibility and a consumer-visible capability depends on it. For provider integrations, test the behavior our adapter owns—mapping our inputs, handling our failures, and producing our public outcome—without recreating or asserting the provider's contract.
32
+
19
33
  ## Choose Assertions
20
34
 
21
35
  Assert the strongest stable meaning, not the most convenient internal shape.
@@ -36,4 +50,4 @@ Write regressions as product or capability invariants, not bug-scar tombstones.
36
50
  - Keep the old failure mode only as setup or context when needed.
37
51
  - Avoid asserting the accidental old shape unless that shape is now a contract.
38
52
 
39
- Ask: would this test still be valuable after the implementation is completely rewritten? If yes, it is probably high signal.
53
+ Ask: would this test still protect a named product capability after the implementation is completely rewritten? If not, cull it.
@@ -1,4 +1,4 @@
1
- # CONTEXT.md Format
1
+ # GLOSSARY.md Format
2
2
 
3
3
  ## Structure
4
4
 
@@ -31,18 +31,18 @@ _Avoid_: Client, buyer, account
31
31
 
32
32
  ## Single vs multi-context repos
33
33
 
34
- **Single context (most repos):** One `CONTEXT.md` at the repo root.
34
+ **Single context (most repos):** One `GLOSSARY.md` at the repo root.
35
35
 
36
- **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
36
+ **Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
37
 
38
38
  ```md
39
39
  # Context Map
40
40
 
41
41
  ## Contexts
42
42
 
43
- - [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
44
- - [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
45
- - [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
43
+ - [Ordering](./src/ordering/GLOSSARY.md) — receives and tracks customer orders
44
+ - [Billing](./src/billing/GLOSSARY.md) — generates invoices and processes payments
45
+ - [Fulfillment](./src/fulfillment/GLOSSARY.md) — manages warehouse picking and shipping
46
46
 
47
47
  ## Relationships
48
48
 
@@ -53,8 +53,8 @@ _Avoid_: Client, buyer, account
53
53
 
54
54
  The skill infers which structure applies:
55
55
 
56
- - If `CONTEXT-MAP.md` exists, read it to find contexts
57
- - If only a root `CONTEXT.md` exists, single context
58
- - If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
56
+ - If `GLOSSARY-MAP.md` exists, read it to find contexts
57
+ - If only a root `GLOSSARY.md` exists, single context
58
+ - If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved
59
59
 
60
60
  When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.