@punks/cli 5.2.1 → 5.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 (76) hide show
  1. package/README.md +2 -2
  2. package/dist/BASELINE_CHANGELOG.md +37 -0
  3. package/dist/CHANGELOG.md +20 -0
  4. package/dist/baseline/scaffold-baseline/baseline.json +15 -5
  5. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -0
  6. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +16 -0
  7. package/dist/baseline/scaffold-baseline/data/hooks/format-edited-file.mjs +59 -17
  8. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.mjs +7 -1
  9. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.test.ts +43 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +2 -2
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +24 -21
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  30. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  31. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  32. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +6 -3
  33. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +4 -2
  34. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +5 -1
  35. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +15 -9
  36. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +13 -26
  37. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  38. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +31 -14
  39. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +12 -4
  40. package/dist/baseline/scaffold-baseline.json +5 -5
  41. package/dist/baseline/scaffold-baseline.tgz +0 -0
  42. package/dist/data/hooks/format-edited-file.d.mts +5 -0
  43. package/dist/data/hooks/format-edited-file.mjs +52 -15
  44. package/dist/data/scripts/managed-lint-runner.mjs +7 -1
  45. package/dist/index.js +56 -1129
  46. package/dist/skills/agnostic/cli/hi-cli/references/commands.md +2 -2
  47. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +9 -6
  48. package/dist/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  49. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  50. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  51. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  52. package/dist/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  53. package/dist/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  54. package/dist/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  55. package/dist/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  56. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  57. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  58. package/dist/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  59. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  60. package/dist/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  61. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  62. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  63. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  64. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  65. package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  66. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  67. package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  68. package/dist/skills/phases/delivery-phase/SKILL.md +6 -3
  69. package/dist/skills/phases/delivery-phase/phases/plan.md +4 -2
  70. package/dist/skills/phases/delivery-phase/phases/review.md +5 -1
  71. package/dist/skills/phases/delivery-phase/phases/router.md +15 -9
  72. package/dist/skills/phases/delivery-phase/phases/spec.md +13 -26
  73. package/dist/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  74. package/dist/skills/phases/requirements-phase/SKILL.md +31 -14
  75. package/dist/skills/phases/review-phase/phases/prepare-review.md +12 -4
  76. package/package.json +3 -2
@@ -5,6 +5,11 @@ explicitly parked with an owner and resume trigger.
5
5
 
6
6
  Required inputs:
7
7
 
8
+ - current retained sibling `ARCHITECTURE.md` satisfying the
9
+ [architecture artifact contract](../../create-architecture/references/artifact-contract.md),
10
+ with `status: compiled`, `readiness: agent-ready`, verified immutable blob URL
11
+ and exact identity; its capability, grill status/log, glossary and referenced
12
+ evidence must match the current confirmed sources
8
13
  - actor, outcome, capability boundary, non-goals, and constraints
9
14
  - accepted functional behavior and observable success
10
15
  - accepted implementation and testing decisions, when any were made upstream
@@ -17,6 +22,41 @@ Required inputs:
17
22
  Provider backlog items may supply evidence. Compilation never requires a
18
23
  preselected provider delivery item.
19
24
 
25
+ ## Architecture source and traceability contract
26
+
27
+ Before compiling, verify the retained architecture commit/ref, blob URL and
28
+ bytes. Resolve its source identities and decision selectors against the current
29
+ confirmed grill status/log; a timestamp or stored URL alone proves no freshness.
30
+ Missing, stale or conflicting architecture produces `spec-not-ready` with the
31
+ exact gap routed to Requirements Phase / `requirements-grill`. Preserve the
32
+ existing canonical pair until both proposed artifacts and their mapping agree.
33
+
34
+ Read the [Spec traceability contract](../../create-architecture/references/artifact-contract.md#spec-traceability).
35
+ An initial architecture may have a pending map because the spec does not exist
36
+ yet. Draft real `OUT-###` and `AC-###` identities before completing that map in
37
+ `ARCHITECTURE.md`. Preserve existing codes when their meaning is unchanged;
38
+ retire superseded codes explicitly and never reuse them for another requirement.
39
+ Every outcome and criterion must resolve through the canonical mapping to stable
40
+ architecture selectors and exact source Q/log-entry evidence anchors. Follow the
41
+ contract's justified no-structural-counterpart rule where applicable. Never
42
+ invent a question, design decision or rationale to fill a row.
43
+
44
+ The amendment changes traceability metadata only. Pending, dangling, stale,
45
+ unsupported or incomplete mappings block `spec-written` and downstream handoff.
46
+ Resolve the whole proposed pair before writes, retain the enriched architecture,
47
+ then bind its final immutable blob URL, commit, path and content identity in the
48
+ spec's `Architecture Source` and frontmatter `links`. Retain the spec afterward.
49
+ Architecture uses spec codes as lookup keys, without a reverse immutable spec
50
+ identity or a link into a future commit. Return both immutable URLs as the pair.
51
+
52
+ Give each outcome and criterion a backlink to `#spec-traceability` labeled with
53
+ its spec code, plus links to the relevant architecture selectors. Keep the many-to-many map in architecture;
54
+ backlinks in the spec are navigation, not a competing mapping table. Preserve
55
+ applicable source-question IDs and decision selectors beside accepted constraints
56
+ and technical decisions, including exact accepted libraries/versions, helpers,
57
+ APIs/paths, algorithms, configuration and protocols. Link the companion's narrative
58
+ and diagrams instead of copying them. Retain confirmed rationale; never infer it.
59
+
20
60
  ## Dependency output contract
21
61
 
22
62
  Serialize both sections in every compiled spec:
@@ -53,11 +53,19 @@ Avoid:
53
53
  - ensure frontmatter has a non-empty string `title`, especially for specs saved
54
54
  directly in routed Fumadocs trees
55
55
  - ensure frontmatter contains `readiness: agent-ready`
56
+ - verify `Architecture Source` and frontmatter `links` name the exact retained
57
+ sibling architecture; its current source identities agree with the spec
58
+ - verify accepted architecture constraints and concrete technical details are
59
+ incorporated with decision selectors; links alone do not preserve decisions
56
60
  - ensure `Dependency Readiness` records `No Stack Required` or `Ready` with
57
61
  evidence
58
62
  - ensure `Branch/Base Intent` records accepted parent/base constraints or
59
63
  `Not applicable`
60
64
  - ensure every outcome passes the one-way coverage contract
65
+ - validate the [Spec traceability contract](../../create-architecture/references/artifact-contract.md#spec-traceability):
66
+ every real outcome and criterion has a complete source-grounded architecture
67
+ mapping; its spec backlinks resolve to the final retained architecture
68
+ - preserve unchanged spec codes; explicitly retire superseded codes
61
69
  - remove all template scaffolding and empty irrelevant sections
62
70
  - ensure the document reads cleanly without ghost instructions
63
71
  - check that terminology matches repository domain language
@@ -9,7 +9,7 @@ description: Implement an agent-ready spec folder through a plan-derived Executi
9
9
 
10
10
  - **Role:** higher-order execution orchestrator
11
11
  - **Entrypoint type:** public entrypoint
12
- - **Upstream:** agent-ready spec folder with `SPEC.md` and `PLAN.md`
12
+ - **Upstream:** current retained agent-ready `ARCHITECTURE.md` / `SPEC.md` pair and execution-ready `PLAN.md`
13
13
  - **Delegates to:** `$tdd`, `$codebase-design`, `$simplify`, tiny `$requirements-phase` sessions for debt ambiguity, and internal scoped-worker orchestration
14
14
  - **Downstream:** `docs-ingest-phase` when the resulting spec folder should be ingested into domain knowledge
15
15
  - **Entry conditions:** existing agent-ready spec folder; stop and use `create-plan` if `PLAN.md` is missing
@@ -57,7 +57,9 @@ Provider mechanics remain inside `write-backlog`.
57
57
  ## Quick start
58
58
 
59
59
  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>/`.
60
- 2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
60
+ 2. Read `references/lifecycle.md` and verify its required Architecture/SPEC pair
61
+ before any direct or resumed execution, including local plans and repair.
62
+ Follow the shared execution contract exactly.
61
63
  3. Read `references/parallel.md`, parse the plan graph, and compute the complete eligible Execution Frontier. When the plan is architecture-bearing, also read and enforce `references/architecture-conformance.md`.
62
64
  4. Launch scoped workers for the eligible tasks using
63
65
  `references/parallel-worker-brief.md`. Forward every guidance item unchanged,
@@ -4,14 +4,18 @@ Use this contract when `PLAN.md` declares architecture applicability as
4
4
  `architecture-bearing`. A `local` plan keeps the normal task design checks and
5
5
  does not invent an architecture contract during execution.
6
6
 
7
- The plan is authoritative. Execute its **Target Ownership Topology**, **Declared
8
- Dependency Graph**, **Responsibility Acceptance Criteria**, **Architecture Waves**,
7
+ The plan owns execution detail derived from the retained Architecture/SPEC pair.
8
+ Execute its **Target Ownership Topology**, **Declared Dependency Graph**,
9
+ **Responsibility Acceptance Criteria**, **Architecture Waves**,
9
10
  public seam contract, and migration ledger. Execution may clarify
10
11
  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.
12
+ no owner, edge, criterion, wave, seam, migration, or task contract.
13
+
14
+ A change to accepted architecture decisions pauses dependent execution and
15
+ returns the exact gap to Requirements Phase / `requirements-grill`; refresh the
16
+ pair before `$create-plan`. Execution-only contract changes within accepted bounds
17
+ route through `$create-plan` on the same spec folder for architecture convergence
18
+ and plan review. Reload the amended plan before dispatching more architecture-bearing work.
15
19
 
16
20
  ## Load the theory
17
21
 
@@ -8,7 +8,7 @@ Execution uses plan-derived tasks and parent-owned Task Gates. Read
8
8
  [parallel.md](parallel.md) for Execution Frontier and Active Write Scope rules;
9
9
  shared lifecycle rules remain here.
10
10
 
11
- ## 1. Require an existing agent-ready spec folder
11
+ ## 1. Require the current agent-ready Architecture/SPEC pair
12
12
 
13
13
  Execution must stay grounded in the first matching spec folder:
14
14
 
@@ -18,13 +18,17 @@ Execution must stay grounded in the first matching spec folder:
18
18
 
19
19
  Required files:
20
20
 
21
+ - `ARCHITECTURE.md`
21
22
  - `SPEC.md`
22
23
  - `PLAN.md`
23
24
 
24
- If `SPEC.md` is missing, stop and report the resolved path error.
25
-
26
- Require `readiness: agent-ready`; no separate spec review or approval state is
27
- needed.
25
+ Before any execution or resumed repair, apply the
26
+ **Architecture/SPEC Pair Complete** gate in the installed `delivery-phase`
27
+ skill's `references/artifact-state.md`,
28
+ including direct invocation, existing work and `local` plans. Missing, stale or
29
+ conflicting proof routes the exact gap to Requirements Phase /
30
+ `requirements-grill`. Require the plan to reference that same retained pair.
31
+ Compiler readiness needs no separate spec review or approval state.
28
32
 
29
33
  If `PLAN.md` is missing, stop and use `create-plan`. Do not auto-generate plans from this skill.
30
34
 
@@ -34,7 +38,7 @@ Accept either:
34
38
 
35
39
  - a domain plus spec folder name
36
40
  - a full spec folder path
37
- - a direct `SPEC.md` or `PLAN.md` path
41
+ - a direct `ARCHITECTURE.md`, `SPEC.md` or `PLAN.md` path
38
42
 
39
43
  Normalize to the containing spec folder before doing any work.
40
44
 
@@ -43,10 +47,19 @@ Normalize to the containing spec folder before doing any work.
43
47
  Read, in this order:
44
48
 
45
49
  1. `apps/wiki/AGENTS.md`
46
- 2. `<resolved-spec-folder>/SPEC.md`
47
- 3. `<resolved-spec-folder>/PLAN.md`
48
- 4. `<resolved-spec-folder>/IMPLEMENTATION-NOTES.md` if present
49
- 5. `docs/reference/tech-debt/<domain>/<spec>.md` if present
50
+ 2. `<resolved-spec-folder>/ARCHITECTURE.md`
51
+ 3. `<resolved-spec-folder>/SPEC.md`
52
+ 4. `<resolved-spec-folder>/PLAN.md`
53
+ 5. `<resolved-spec-folder>/IMPLEMENTATION-NOTES.md` if present
54
+ 6. `docs/reference/tech-debt/<domain>/<spec>.md` if present
55
+
56
+ Carry the pair's exact retained source identities and required architecture
57
+ decision selectors, mapped spec codes and source Q evidence in worker Context Pointers, Read Dependencies and Relevant
58
+ Input Sets. Recheck them before dependent dispatch, Task Gates and finalization.
59
+ Refresh changed sources through existing freshness gates; preserve unaffected
60
+ proof and historical review lineage. Missing plan pointers return to
61
+ `create-plan`; missing or conflicting accepted design returns to Requirements
62
+ Phase / `requirements-grill`.
50
63
 
51
64
  When `PLAN.md` declares architecture applicability as `architecture-bearing`,
52
65
  also read [architecture-conformance.md](architecture-conformance.md) before
@@ -15,6 +15,9 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
15
15
  legible to an agent. Trace intake, state, control, feedback, recovery, and
16
16
  handoff through that tower. Account for each applicable surface with
17
17
  evidence, or record why it does not apply.
18
+ For software flows, apply Flow failure lenses below. Account for each lens
19
+ with grounded findings, an explicit unknown, or a reason it does not apply.
20
+ Surface material gaps as candidate decisions within the accepted scope.
18
21
  3. Derive the smallest changes that make the system agent-intuitive (clear
19
22
  meaning), agent-ergonomic (efficient control), and agent-accretive (reusable
20
23
  verified knowledge benefiting later runs). For each candidate, state
@@ -26,3 +29,22 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
26
29
  4. Return evidence-grounded observations and unresolved decisions. Completion
27
30
  requires every observation to trace to evidence or an explicit unknown.
28
31
  Observations remain candidates until the caller accepts them.
32
+
33
+ ### Flow failure lenses
34
+
35
+ Approach the problem through an end-to-end control-flow, state-consistency and failure-recovery lens. Examine:
36
+
37
+ 1. Entry points and path convergence: where can this behavior start? Do equivalent actions reach the same rules, or take divergent/bypass paths?
38
+ 2. Critical execution paths: what must happen, in which order? Where does execution branch, wait, delegate or continue asynchronously?
39
+ 3. State ownership and authority: what state changes, who owns it, who may change it, and which representation is authoritative?
40
+ 4. Transaction and side-effect boundaries: what commits together? Which effects occur outside that boundary? What intermediate states can become visible?
41
+ 5. Concurrency and stale state: what if two actors run this simultaneously, or state changes between validation and execution?
42
+ 6. Idempotency and retries: what happens when a request is repeated, execution resumes, or an acknowledgement is lost after success?
43
+ 7. Partial failure and recovery: what remains after failure at each boundary? Can we safely retry, reconcile, compensate or roll back?
44
+ 8. Execution lifetime and durability: what survives a disconnect, cancellation or process crash? Who owns unfinished work?
45
+ 9. Lifecycle and dependency transitions: what happens during creation, update, replacement and removal? What still depends on the old state?
46
+ 10. Completion and observability: what proves the requested outcome occurred? Can an operator distinguish accepted, applied, running, failed and partially complete?
47
+
48
+ Use these lenses to surface missing architectural decisions before treating the flow as understood. Ground concerns in the actual system; propose mechanisms only for supported risks.
49
+
50
+ Completion: each applicable lens is covered by evidence or an explicit unknown; non-applicable lenses have a reason. Each material gap is recorded as a candidate decision, with its evidence or unknown and the guarantee at stake.
@@ -35,7 +35,8 @@ Both workflows can happen in one long session, but keep the responsibilities dis
35
35
  - Give `$domain-modeling` the active status glossary before the first question. Invoke it whenever a round changes terminology, relationships, or domain decisions, and persist its accepted results through `artifact-output` before continuing.
36
36
  - Inspect relevant routed learning artifacts before grilling requirements that depend on known behavior, prior bugs, project conventions, or domain facts.
37
37
  - Before `$grilling` constructs the first frontier, identify every active code- or architecture-bearing branch and complete the technical grounding in `grilling-flow`. Ground each branch in current code evidence, then ask code-grounded questions about its applicable topology, dependency direction and injection, seams, boundaries, persistence, and module shape. Each technical question states the observed constraint and the code consequence of the decision. Persist accepted design in the grill artifacts; keep `GLOSSARY.md` glossary-only.
38
- - After technical grounding, complete `$brainstorm` before the first frontier. Add its unresolved decisions to the design tree; treat all output as candidate material until accepted. Rerun only when accepted decisions change the active system boundary.
38
+ - After technical grounding, complete `$brainstorm` before the first frontier. Add its unresolved decisions to the design tree; treat all output as candidate material until accepted.
39
+ - **Response-set checkpoint:** After every `$grilling` response set, including an incomplete frontier response, record supplied answers through `artifact-output`, then invoke `$brainstorm` against updated decisions and evidence before computing and persisting the next frontier or requesting closure. Recheck its applicable lenses, reusing still-valid evidence and tracing changed decisions through affected paths and dependent branches. Add newly exposed uncertainties and decisions to the existing technical grounding record and design tree. The review is complete when every new material finding is resolved, queued, or explicitly parked/deferred; queued findings remain open under the existing branch and grill closure rules. Preserve stable question IDs and accepted decisions; surface contradictions as explicit questions.
39
40
  - Prefer conservative defaults once enough context exists.
40
41
  - If the user authorizes auto-pinning defaults, record obvious remaining defaults without needless extra questions.
41
42
  - Treat parked branches as preserved knowledge, not deleted scope.
@@ -134,8 +134,9 @@ After each response set:
134
134
  1. Process every supplied answer separately against its stable question id.
135
135
  2. Add answered decisions to the log and mark those ids `answered` in status.
136
136
  3. Leave omitted questions `unanswered`; do not infer an answer or drop them from status.
137
- 4. Persist the updated status, including the frontier and branch dashboard, before continuing.
138
- 5. When the frontier is empty, set confirmation to `pending`; set it to `confirmed` only after the user explicitly confirms shared understanding.
137
+ 4. Complete the [response-set checkpoint](../SKILL.md#core-behavior).
138
+ 5. Compute the next frontier and persist the updated status, including the frontier and branch dashboard, before continuing.
139
+ 6. When the frontier is empty, set confirmation to `pending`; set it to `confirmed` only after the user explicitly confirms shared understanding.
139
140
 
140
141
  ## Status File Contract
141
142
 
@@ -11,7 +11,7 @@ disable-model-invocation: true
11
11
  `delivery-phase` is a reusable phase router.
12
12
 
13
13
  1. Read [phases/router.md](phases/router.md).
14
- 2. Inspect only enough issue, spec, plan, notes, diff, retained review, durable
14
+ 2. Inspect only enough issue, architecture, spec, plan, notes, diff, retained review, durable
15
15
  handoff, validation, and docs state to choose the current gate.
16
16
  3. If approved artifact links or UI Evidence links are present, carry them as routing evidence.
17
17
  4. Load exactly one phase file from `phases/`.
@@ -29,7 +29,7 @@ Within accepted bounds, full delivery grants its selected inner steps the author
29
29
  ## Phase Files
30
30
 
31
31
  - [phases/router.md](phases/router.md): choose the next phase from artifacts and evidence.
32
- - [phases/spec.md](phases/spec.md): create or repair the agent-ready spec.
32
+ - [phases/spec.md](phases/spec.md): route missing or stale Architecture/SPEC proof to Requirements Phase.
33
33
  - [phases/backlog.md](phases/backlog.md): verify or project the agent-ready spec into delivery backlog items.
34
34
  - [phases/plan.md](phases/plan.md): create or repair the execution-ready plan.
35
35
  - [phases/implement.md](phases/implement.md): execute the accepted plan.
@@ -43,7 +43,10 @@ Within accepted bounds, full delivery grants its selected inner steps the author
43
43
  ## Router Rules
44
44
 
45
45
  - Read `router.md` and its continuity contract before selecting exactly one phase.
46
- - Reuse fresh matching authority; activate child skills only from their selected phase.
46
+ - Require the [Architecture/SPEC pair](references/artifact-state.md#architecturespec-pair-complete)
47
+ before dependent dispatch in every entry mode, including local and resumed
48
+ delivery. Reuse fresh matching authority; activate child skills only from
49
+ their selected phase.
47
50
  - Full Delivery continues within accepted bounds. Other modes emit one common
48
51
  Phase Result and stop at their requested boundary.
49
52
  - [references/context-continuity.md](references/context-continuity.md) owns
@@ -1,6 +1,6 @@
1
1
  # Plan Phase
2
2
 
3
- Use this phase when a matching spec exists but no execution-ready `PLAN.md`
3
+ Use this phase when a matching Architecture/SPEC pair exists but no execution-ready `PLAN.md`
4
4
  exists, or the plan is stale, vague, or missing validation gates.
5
5
 
6
6
  ## Delegate
@@ -9,7 +9,9 @@ Load `create-plan` only after this phase is selected.
9
9
 
10
10
  ## Checks Before Delegating
11
11
 
12
- - Verify the spec still matches the requested goal.
12
+ - Verify the [Architecture/SPEC pair](../references/artifact-state.md#architecturespec-pair-complete)
13
+ still matches the requested goal. Carry both retained source identities and
14
+ decision selectors into plan Context Pointers and task Read Dependencies.
13
15
  - Preserve tracker hierarchy and every child-story or sub-issue requirement.
14
16
  - Require dependencies, Active Write Scopes, Read Dependencies, Shared Runtime
15
17
  Resources, Relevant Input Set identities, validation gates, review routing and
@@ -6,7 +6,11 @@ current snapshot.
6
6
 
7
7
  ## Prepare Review
8
8
 
9
- 1. Require implementation, applicable task checks and Task Gates, Verification,
9
+ 1. Recheck the [Architecture/SPEC pair](../references/artifact-state.md#architecturespec-pair-complete)
10
+ before review or retained-state resume. Carry the exact architecture identity
11
+ and required decision selectors as governing review sources alongside Spec
12
+ and plan, including in the frozen Review Packet.
13
+ Require implementation, applicable task checks and Task Gates, Verification,
10
14
  parent shared-summary reconciliation, Architecture Checkpoints and final
11
15
  acceptance evidence. Missing or stale proof returns the exact owning gate;
12
16
  it cannot enter Code Review. Review consumes Verification evidence while
@@ -8,10 +8,16 @@ Choose one next phase from current durable authority.
8
8
  2. Preserve terminal `human_steering_required` until current user direction
9
9
  resolves the required decision. New boundary evidence selects
10
10
  [human-steering.md](human-steering.md).
11
- 3. For failed tasks or repair evidence, apply
11
+ 3. Before any dependent dispatch, require the
12
+ [Architecture/SPEC Pair Complete gate](../references/artifact-state.md#architecturespec-pair-complete)
13
+ for every delivery, including existing, resumed and local work. Missing,
14
+ stale or conflicting architecture/spec proof routes the exact gap to
15
+ Requirements Phase / `requirements-grill` before review, repair, debug,
16
+ implementation or closeout can resume. Preserve review lineage and counts.
17
+ 4. For failed tasks or repair evidence, apply
12
18
  [failure continuity](../references/failure-continuity.md). Independent eligible
13
19
  work continues through the implementation owner's gates.
14
- 4. Recover review lineage, valid completed ordinals and durable active repair
20
+ 5. Recover review lineage, valid completed ordinals and durable active repair
15
21
  state separately from current evidence freshness. Review due, retention pending,
16
22
  unrouted findings, or budget decisions select [review.md](review.md), the sole
17
23
  delivery review-transition authority. It validates bounds and target before
@@ -21,21 +27,21 @@ Choose one next phase from current durable authority.
21
27
  Route legacy `focused_validation` to its recorded implementation/debugging
22
28
  owner and `clean_handoff` to remaining docs or closeout after checking proof.
23
29
  Reuse recorded run IDs and debt keys; a resume cannot consume them twice.
24
- 5. Before planning, require a matching agent-ready `SPEC.md` with verified remote
30
+ 6. Before planning, require the pair's agent-ready `SPEC.md` with verified remote
25
31
  retention and its current Write Backlog result through the
26
- [Spec Complete and Backlog Projection Complete gates](../references/artifact-state.md).
32
+ [Backlog Projection Complete gate](../references/artifact-state.md#backlog-projection-complete).
27
33
  Missing, stale or contradictory required proof routes the exact gap to
28
- Requirements Phase before planning. It owns Requirements Grill, Create Spec
29
- and Write Backlog. Valid current proof proceeds without a new approval gate;
34
+ Requirements Phase before planning. It owns Requirements Grill, Create Architecture,
35
+ Create Spec and Write Backlog. Valid current proof proceeds without a new approval gate;
30
36
  optional Finder context is passed only when supplied, never manufactured.
31
- 6. A missing or stale execution plan selects [plan.md](plan.md). Incomplete plan
37
+ 7. A missing or stale execution plan selects [plan.md](plan.md). Incomplete plan
32
38
  work, invalidated implementation evidence or an observed provider lifecycle
33
39
  fact lacking exact readback selects [implement.md](implement.md).
34
- 7. Completed implementation needing Code Review selects [review.md](review.md).
40
+ 8. Completed implementation needing Code Review selects [review.md](review.md).
35
41
  Accepted repair follows that same transition authority's Focused Repair
36
42
  Validation and risk-triggered second-pass rules. Passing ordinary focused
37
43
  checks proceed without automatically reopening Code Review.
38
- 8. Remaining docs-affecting work selects [docs-ingest.md](docs-ingest.md), otherwise
44
+ 9. Remaining docs-affecting work selects [docs-ingest.md](docs-ingest.md), otherwise
39
45
  [closeout.md](closeout.md). A fresh completed closeout needs no repeated mutation.
40
46
 
41
47
  Read only the selected phase. Each exit emits the common Phase Result. Full
@@ -1,36 +1,23 @@
1
1
  # Spec Phase
2
2
 
3
- Use this phase when no matching agent-ready `SPEC.md` exists, or the current
4
- spec is stale, contradictory, or missing required scope.
3
+ Use this phase when the required Architecture/SPEC pair is missing, stale or
4
+ conflicting. Apply the
5
+ [Architecture/SPEC Pair Complete gate](../references/artifact-state.md#architecturespec-pair-complete).
5
6
 
6
7
  ## Delegate
7
8
 
8
- Load `create-spec` only after this phase is selected.
9
-
10
- ## Checks Before Delegating
11
-
12
- - Confirm the bounded goal, issue, tracker item, or requested capability.
13
- - Reuse existing spec artifacts when they match the requested scope.
14
- - Treat child stories, sub-issues, acceptance criteria, constraints, and non-goals as required input, not loose references.
15
- - If requirements are unsettled, return the compiler's `spec-not-ready` result
16
- and route each named gap upstream instead of interviewing here.
9
+ Return the bounded goal, exact artifact/decision gap and current source pointers
10
+ to Requirements Phase. It owns `requirements-grill -> create-architecture ->
11
+ create-spec -> write-backlog`. Pass optional Finder context only when supplied.
12
+ Reuse matching current retained artifacts; unsettled decisions return to
13
+ `requirements-grill` before either compiler runs.
17
14
 
18
15
  ## Completion State
19
16
 
20
- Write or verify:
21
-
22
- - matching `SPEC.md`
23
- - `readiness: agent-ready`
24
- - `spec-written`
25
- - verify the retained ref contains the spec commit
26
- - construct and verify a stable blob URL before backlog
27
- - source issue/tracker/spec folder
28
-
29
- Then stop or re-enter `delivery-phase` for routing.
30
-
31
- This completion state satisfies the downstream spec gate. Do not add a spec
32
- review or approval stop unless the user explicitly requested a HITL checkpoint.
17
+ Verify the retained Architecture/SPEC pair and its exact identities, verified
18
+ immutable blob URLs and source selectors. Backlog projection must name that
19
+ spec identity. Compiler readiness needs no additional approval gate.
33
20
 
34
21
  Emit the [common Phase Result](../references/context-continuity.md#common-phase-result)
35
- with pointers to this completion evidence. Continue only in Full Delivery;
36
- otherwise stop at the requested boundary.
22
+ with pointers to the resulting proof or exact gap. Continue only in Full
23
+ Delivery; otherwise stop at the requested boundary.
@@ -2,6 +2,43 @@
2
2
 
3
3
  Use this reference when deciding whether a phase is complete enough to skip.
4
4
 
5
+ ## Architecture/SPEC Pair Complete
6
+
7
+ Require this pair for every delivery, including fresh, existing, resumed and
8
+ local work, before planning, implementation, review, repair, debugging, docs or
9
+ closeout dispatch. `architecture_applicability` controls plan convergence detail,
10
+ never whether `ARCHITECTURE.md` is required.
11
+
12
+ - The sibling `ARCHITECTURE.md` satisfies the
13
+ artifact contract in the installed `create-architecture` skill's
14
+ `references/artifact-contract.md`
15
+ with `status: compiled` and `readiness: agent-ready`; `SPEC.md` satisfies
16
+ **Spec Complete** below. Both name the same capability and current accepted
17
+ grill decisions.
18
+ - Verify retained commit/ref, immutable blob URL and matching bytes for each
19
+ artifact. The spec's `Architecture Source` and `links` identify that exact
20
+ retained architecture, not a mutable path or a different revision.
21
+ - Resolve architecture source identities and decision selectors against current
22
+ grill status/log, glossary and required evidence. Use existing
23
+ [Context Pointers and freshness rules](context-continuity.md), not timestamps.
24
+ Spec requirements, outcomes and acceptance criteria remain authoritative;
25
+ accepted design constraints come from the architecture companion and are
26
+ incorporated in the spec. Neither silently overrides the other.
27
+ - Verify complete **Spec traceability** under that architecture contract: every
28
+ current `OUT-###` / `AC-###` resolves to stable architecture selectors (or its
29
+ justified no-structural-counterpart entry) and exact source Q/log-entry evidence
30
+ anchors. Check the real codes, selectors, anchors and spec backlinks against
31
+ the retained pair and current decisions. Pending, dangling, stale, unsupported
32
+ or incomplete mapping blocks dispatch; route the exact gap to Requirements.
33
+ - Carry both source identities and required decision selectors in the action's
34
+ Context Pointers. Changed inputs invalidate affected dependent proof; keep
35
+ historical review lineage, report identities and completed ordinals intact.
36
+ - A missing, stale, conflicting or unreconstructable pair blocks its dependent
37
+ action and routes the exact artifact, selector and missing proof to
38
+ Requirements Phase / `requirements-grill`. Recompile architecture before spec
39
+ when accepted decisions change. Legacy/local artifacts have no exemption;
40
+ matching current proof adds no human approval gate.
41
+
5
42
  ## Spec Complete
6
43
 
7
44
  - A matching agent-ready `SPEC.md` has `readiness: agent-ready`; its scope is
@@ -17,7 +54,8 @@ Use this reference when deciding whether a phase is complete enough to skip.
17
54
 
18
55
  ## Plan Complete
19
56
 
20
- - `PLAN.md` exists and matches the spec.
57
+ - `PLAN.md` exists and matches the current Architecture/SPEC pair, carrying
58
+ both source identities and required decision selectors through Context Pointers.
21
59
  - One uniform `task_identity_mode` applies. In `provider-task` mode every `Tn`
22
60
  resolves one stable provider Task ID and URL, preserves the same `V*`, and
23
61
  mirrors native blocker edges through `depends_on`. In `planning-only` mode
@@ -7,11 +7,12 @@ disable-model-invocation: true
7
7
  # Requirements Phase
8
8
 
9
9
  Requirements Phase is independently invocable. It is the only orchestration
10
- route for `requirements-grill -> create-spec -> write-backlog`.
10
+ route for `requirements-grill -> create-architecture -> create-spec -> write-backlog`.
11
11
 
12
12
  ## Inputs
13
13
 
14
- - Direct bounded requirements input. This route creates no Fog or Finder
14
+ - Direct bounded requirements input, including any narrower caller-supplied
15
+ provider projection boundary. This route creates no Fog or Finder
15
16
  artifact and no Grilling provider item implicitly.
16
17
  - Optional Finder context, only when the caller supplies a Fog, Finder child,
17
18
  Research child, Prototype child, or durable Finder handoff. Resolve the exact
@@ -32,24 +33,40 @@ workflow or a Finder lifecycle owner.
32
33
  interview. Research recommendations are evidence, not decisions. Complete
33
34
  this step when every material branch is accepted or explicitly parked.
34
35
  4. When the user confirms shared understanding and the remaining branches are
35
- closed or explicitly parked, invoke `create-spec` immediately. Create Spec
36
- compiles the accepted outcomes without choosing provider Story or Task
37
- identities.
38
- 5. Require `create-spec` to push or explicitly retain the spec commit, verify
39
- the retained ref contains the spec commit, and construct and verify a stable
40
- blob URL before `write-backlog` can run. A local SHA plus path is
41
- insufficient; otherwise return the compiler's atomic `spec-not-ready`
42
- result.
43
- 6. After `spec-written`, pass the verified stable blob URL and current provider
36
+ closed or explicitly parked, invoke `create-architecture` with the current
37
+ grill status and log. Require its
38
+ artifact contract in the installed `create-architecture` skill's
39
+ `references/artifact-contract.md`:
40
+ sibling `ARCHITECTURE.md`, `status: compiled`, `readiness: agent-ready`, exact
41
+ source identities and accepted details, and verified retained blob URL.
42
+ Architecture compilation precedes `SPEC.md` and requires no spec input.
43
+ An `architecture-not-ready` result returns each exact gap to its upstream
44
+ owner; unresolved decisions return to `requirements-grill`.
45
+ 5. After `architecture-written`, invoke `create-spec` with that exact retained
46
+ architecture and the same confirmed sources. Create Spec assigns real outcome
47
+ and criterion codes, completes the architecture's canonical Spec traceability
48
+ mapping, and retains the enriched architecture before binding its final
49
+ immutable identity in the spec. This metadata amendment accepts no new design.
50
+ The compiler preserves source question anchors and unchanged codes/selectors.
51
+ This order applies to every delivery, including existing, resumed and local
52
+ work; reuse only current, matching retained artifacts with complete mapping.
53
+ 6. Require `create-spec` to verify both retained artifact URLs and the spec's
54
+ reference to the enriched architecture, then push or explicitly retain the
55
+ spec commit before `write-backlog` can run. Pending or unresolved mappings and
56
+ local-only artifacts return the compiler's atomic `spec-not-ready` result.
57
+ 7. Honor the caller's accepted provider projection boundary; missing authority
58
+ returns a blocked backlog delta while retaining the compiled pair.
59
+ After `spec-written`, pass the verified stable blob URL and current provider
44
60
  evidence to `write-backlog`. Write Backlog derives the Stories, Tasks, and
45
61
  blocker graph supported by the accepted result. With no prior Finder
46
62
  projection, it may reuse, enrich, or create the accepted placement through
47
63
  Product Area, Initiative, and Epic before placing those delivery items. Each
48
64
  Story is a shippable product outcome. Each Task is atomic, independently
49
65
  ownable, and understandable from its Story and stable specification.
50
- 7. Return one stable Requirements result naming the retained specification and
51
- its verified stable blob URL, plus the Write Backlog result and exact
52
- residual delta. The result is ready for `delivery-phase` and `create-plan`.
66
+ 8. Return one stable Requirements result naming the retained architecture and
67
+ specification, their exact identities and verified stable blob URLs, plus the
68
+ Write Backlog result and exact residual delta. The result is ready for
69
+ `delivery-phase` and `create-plan`.
53
70
 
54
71
  ## Boundary
55
72
 
@@ -12,7 +12,7 @@ and no valid later-state evidence already owns the run.
12
12
  - accepted-bounds identity, scope, and primitive evidence
13
13
  - delivery Git/diff or standalone artifact target primitives
14
14
  - governing Spec, Standards, scoped guidance, named-skill, plan, and
15
- implementation-note sources
15
+ implementation-note sources; retained Architecture for delivery mode
16
16
  - delivery-goal identity and retained-report candidates for delivery mode
17
17
  - caller evidence needed to explain a retry, failure, or current route
18
18
 
@@ -29,7 +29,14 @@ reconciles retained-pass recovery, and owns the exit evidence.
29
29
  1. Validate accepted bounds and normalize the smallest-certain supported target
30
30
  before reading or evaluating any delivery review counter. Unsupported target
31
31
  or invalid bounds evidence is terminal even when a delivery counter is 2 or a preserved legacy 3.
32
- 2. Recompute the accepted-bounds hash, normalized target, inclusive scope,
32
+ 2. For delivery mode, verify the
33
+ [Architecture/SPEC pair](../../delivery-phase/references/artifact-state.md#architecturespec-pair-complete)
34
+ before review preparation continues. Missing, stale or conflicting proof returns
35
+ `review_context_blocked` with the exact gap for Requirements Phase /
36
+ `requirements-grill`, preserving lineage and completed ordinals. Include the
37
+ architecture's exact retained identity and required decision selectors in
38
+ governing sources and Review Packet facts; use existing source-set hashing.
39
+ Recompute the accepted-bounds hash, normalized target, inclusive scope,
33
40
  snapshot hash, governing source paths and blob hashes, and source-set hash
34
41
  from primitive current evidence.
35
42
  3. Derive delivery lineage only from stable delivery-goal identity. Derive
@@ -68,8 +75,9 @@ reconciles retained-pass recovery, and owns the exit evidence.
68
75
  `recovered review_count + 1` and derive `review_run_id` from lineage and that
69
76
  ordinal. In standalone mode derive `review_run_id` from lineage and
70
77
  `snapshot12`.
71
- 6. Freeze the [Review Packet](../references/review-packet.md), including Spec,
72
- plan, skill guidance, Verification evidence and relevant dependency pointers.
78
+ 6. Freeze the [Review Packet](../references/review-packet.md), including
79
+ Architecture for delivery mode, Spec, plan, skill guidance, Verification
80
+ evidence and relevant dependency pointers.
73
81
  Assemble complete `review_running` predecessor evidence. Preparation ends
74
82
  before any review lens, validation command, report write, retention action,
75
83
  counter projection, or repair routing.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.09.23-66535546",
5
- "tag": "baseline/stable/2026.09.23-66535546",
6
- "commit": "66535546af2cdfab73f8fe1438ee8295ebee45f1",
4
+ "version": "2026.09.24-84dd3d24",
5
+ "tag": "baseline/stable/2026.09.24-84dd3d24",
6
+ "commit": "84dd3d249f6a9a9e420e48c940c9629337314a5e",
7
7
  "archive": "scaffold-baseline.tgz",
8
- "archiveSha256": "d0dc830487f1120bf35dfc73ece36a26f330c9b8b2eb2aa643a5ddee5009ab90",
8
+ "archiveSha256": "137a941b9b4d380cf37b1355c7e69b81b1bb9e8fb169015d57af83d93bf838ac",
9
9
  "compatibility": {
10
- "cliVersionRange": ">=5.2.1 <5.3.0"
10
+ "cliVersionRange": ">=5.2.2 <5.3.0"
11
11
  }
12
12
  }
Binary file
@@ -13,6 +13,11 @@ export interface ProviderLintFeedback {
13
13
  }
14
14
 
15
15
  export declare const testHooks: {
16
+ readonly copyLintMirror: (
17
+ root: string,
18
+ mirror: string,
19
+ requiredInputs: readonly string[],
20
+ ) => void;
16
21
  readonly codexStateFilePath: (root: string, sessionId: string) => string;
17
22
  readonly renderProviderFeedback: (
18
23
  provider: string,