@haposoft/cafekit 0.16.7 → 0.18.1

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 (231) hide show
  1. package/README.md +14 -22
  2. package/bin/__tests__/codex-hooks-ownership.test.js +2 -2
  3. package/bin/__tests__/codex-hooks.test.js +169 -272
  4. package/bin/__tests__/codex-native.test.js +100 -202
  5. package/bin/__tests__/develop-contract.test.js +122 -1413
  6. package/bin/__tests__/docs-sync-on-demand.test.js +93 -0
  7. package/bin/__tests__/grok-envelope.test.js +0 -56
  8. package/bin/__tests__/hook-payload.test.js +4 -6
  9. package/bin/__tests__/legacy-authority-decoupled.test.js +154 -0
  10. package/bin/__tests__/legacy-hooks-retired.test.js +221 -0
  11. package/bin/__tests__/omp-bridge.test.js +20 -17
  12. package/bin/__tests__/omp-hooks.test.js +0 -19
  13. package/bin/__tests__/optional-skill-inventory.test.js +112 -4
  14. package/bin/__tests__/orca-session.test.js +0 -2
  15. package/bin/__tests__/package-inventory.test.js +90 -925
  16. package/bin/__tests__/runtime-dir.test.js +0 -3
  17. package/bin/__tests__/runtime-schema.test.js +3 -2
  18. package/bin/__tests__/skill-routing-source.test.js +27 -15
  19. package/bin/__tests__/spec-narrowing.test.js +30 -161
  20. package/bin/__tests__/specs-v2-execution-closeout.test.js +0 -437
  21. package/bin/__tests__/test-runtime-dependency-closure.cjs +1 -2
  22. package/bin/__tests__/ui-ux-skill.test.js +101 -0
  23. package/bin/__tests__/usage-hook-retired.test.js +114 -0
  24. package/bin/__tests__/validator-grounding.test.js +18 -2949
  25. package/bin/lib/managed-writer.js +2 -3
  26. package/bin/phases/codex-runtime.js +27 -0
  27. package/bin/phases/copy-payload.js +13 -28
  28. package/bin/phases/omp-runtime.js +25 -0
  29. package/package.json +2 -3
  30. package/src/claude/CLAUDE.md +3 -10
  31. package/src/claude/agents/brainstormer.md +7 -3
  32. package/src/claude/agents/code-auditor.md +44 -56
  33. package/src/claude/agents/debugger.md +8 -88
  34. package/src/claude/agents/deployer.md +3 -5
  35. package/src/claude/agents/docs-keeper.md +6 -14
  36. package/src/claude/agents/git-ops.md +2 -4
  37. package/src/claude/agents/implementer.md +12 -16
  38. package/src/claude/agents/inspector.md +4 -3
  39. package/src/claude/agents/project-manager.md +9 -17
  40. package/src/claude/agents/researcher.md +9 -3
  41. package/src/claude/agents/spec-maker.md +15 -15
  42. package/src/claude/agents/test-runner.md +8 -11
  43. package/src/claude/agents/ui-ux-designer.md +0 -1
  44. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -1
  45. package/src/claude/hooks/__tests__/spec-gate.test.js +244 -333
  46. package/src/claude/hooks/__tests__/spec-state-touched.test.js +160 -0
  47. package/src/claude/hooks/__tests__/state.test.js +68 -0
  48. package/src/claude/hooks/__tests__/statusline.test.js +140 -11
  49. package/src/claude/hooks/agent.cjs +2 -1
  50. package/src/claude/hooks/lib/hook-payload.cjs +2 -2
  51. package/src/claude/hooks/rules.cjs +2 -1
  52. package/src/claude/hooks/session.cjs +0 -1
  53. package/src/claude/hooks/spec-gate.cjs +17 -83
  54. package/src/claude/hooks/spec-state.cjs +142 -39
  55. package/src/claude/hooks/state.cjs +21 -2
  56. package/src/claude/migration-manifest.json +42 -22
  57. package/src/claude/output-styles/coding-level-0-eli5.md +9 -9
  58. package/src/claude/output-styles/coding-level-1-junior.md +3 -3
  59. package/src/claude/output-styles/coding-level-2-mid.md +3 -3
  60. package/src/claude/output-styles/coding-level-3-senior.md +2 -2
  61. package/src/claude/output-styles/coding-level-4-lead.md +5 -5
  62. package/src/claude/output-styles/coding-level-5-god.md +6 -6
  63. package/src/claude/rules/ai-dev-rules.md +2 -3
  64. package/src/claude/rules/hook-protocols.md +8 -15
  65. package/src/claude/rules/manage-docs.md +9 -23
  66. package/src/claude/rules/orchestrator.md +3 -4
  67. package/src/claude/rules/review-audit-self-decision.md +3 -3
  68. package/src/claude/rules/skill-domain-routing.md +1 -3
  69. package/src/claude/rules/skill-workflow-routing.md +4 -5
  70. package/src/claude/rules/state-sync.md +3 -12
  71. package/src/claude/rules/workflow.md +11 -19
  72. package/src/claude/runtime.schema.json +5 -3
  73. package/src/claude/scripts/generate-skill-catalog.cjs +7 -6
  74. package/src/claude/scripts/provenance.cjs +23 -5
  75. package/src/claude/scripts/spec-receipt.cjs +24 -121
  76. package/src/claude/scripts/spec-resolver.cjs +41 -458
  77. package/src/claude/scripts/workflow-policy.cjs +3 -1801
  78. package/src/claude/settings/settings.json +1 -32
  79. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  80. package/src/claude/skills/{question → ask}/SKILL.md +9 -75
  81. package/src/claude/skills/brainstorm/SKILL.md +43 -131
  82. package/src/claude/skills/chrome-devtools/SKILL.md +14 -31
  83. package/src/claude/skills/code-review/SKILL.md +29 -81
  84. package/src/claude/skills/code-review/references/spec-compliance-review.md +4 -8
  85. package/src/claude/skills/debug/SKILL.md +29 -149
  86. package/src/claude/skills/develop/SKILL.md +26 -83
  87. package/src/claude/skills/develop/references/parallel-waves.md +0 -8
  88. package/src/claude/skills/develop/references/quality-gate.md +15 -13
  89. package/src/claude/skills/develop/references/subagent-patterns.md +0 -6
  90. package/src/claude/skills/docs/SKILL.md +2 -2
  91. package/src/claude/skills/docs/references/update-workflow.md +1 -1
  92. package/src/claude/skills/fix/SKILL.md +153 -0
  93. package/src/claude/skills/{hotfix → fix}/references/diagnosis-protocol.md +2 -2
  94. package/src/claude/skills/{hotfix → fix}/references/parallel-patterns.md +2 -2
  95. package/src/claude/skills/{hotfix → fix}/references/prevention-gate.md +3 -3
  96. package/src/claude/skills/{hotfix → fix}/references/review-cycle.md +1 -1
  97. package/src/claude/skills/git/SKILL.md +48 -9
  98. package/src/claude/skills/git/references/commit-protocols.md +35 -16
  99. package/src/claude/skills/git/references/worktree-blueprint.md +42 -6
  100. package/src/claude/skills/orca/SKILL.md +9 -8
  101. package/src/claude/skills/research/SKILL.md +17 -46
  102. package/src/claude/skills/scout/SKILL.md +61 -0
  103. package/src/claude/skills/{inspect → scout}/references/internal-inspection.md +26 -10
  104. package/src/claude/skills/specs/SKILL.md +22 -29
  105. package/src/claude/skills/specs/references/review.md +8 -6
  106. package/src/claude/skills/specs/references/templates.md +34 -41
  107. package/src/claude/skills/sync/SKILL.md +16 -45
  108. package/src/claude/skills/sync/references/rebind-and-audit.md +59 -0
  109. package/src/claude/skills/sync/references/sync-protocols.md +4 -13
  110. package/src/claude/skills/test/SKILL.md +39 -104
  111. package/src/claude/skills/test/references/execution-strategy.md +93 -21
  112. package/src/claude/skills/test/references/failure-triage.md +1 -1
  113. package/src/claude/skills/ui-ux/LICENSE +21 -0
  114. package/src/claude/skills/ui-ux/SKILL.md +497 -0
  115. package/src/claude/skills/ui-ux/references/brand-tokens.md +90 -0
  116. package/src/claude/skills/ui-ux/references/budgets.md +113 -0
  117. package/src/claude/skills/ui-ux/references/checklist.md +271 -0
  118. package/src/claude/skills/ui-ux/references/components/accordion.md +246 -0
  119. package/src/claude/skills/ui-ux/references/components/avatar.md +153 -0
  120. package/src/claude/skills/ui-ux/references/components/banner.md +43 -0
  121. package/src/claude/skills/ui-ux/references/components/breadcrumb.md +201 -0
  122. package/src/claude/skills/ui-ux/references/components/button.md +142 -0
  123. package/src/claude/skills/ui-ux/references/components/card.md +113 -0
  124. package/src/claude/skills/ui-ux/references/components/charts.md +376 -0
  125. package/src/claude/skills/ui-ux/references/components/chat.md +132 -0
  126. package/src/claude/skills/ui-ux/references/components/choice-controls.md +369 -0
  127. package/src/claude/skills/ui-ux/references/components/comment-thread.md +17 -0
  128. package/src/claude/skills/ui-ux/references/components/description-list.md +116 -0
  129. package/src/claude/skills/ui-ux/references/components/empty-state.md +98 -0
  130. package/src/claude/skills/ui-ux/references/components/file-upload.md +107 -0
  131. package/src/claude/skills/ui-ux/references/components/inline-edit.md +128 -0
  132. package/src/claude/skills/ui-ux/references/components/input.md +161 -0
  133. package/src/claude/skills/ui-ux/references/components/list-row.md +56 -0
  134. package/src/claude/skills/ui-ux/references/components/loading.md +198 -0
  135. package/src/claude/skills/ui-ux/references/components/logo.md +147 -0
  136. package/src/claude/skills/ui-ux/references/components/otp-input.md +43 -0
  137. package/src/claude/skills/ui-ux/references/components/quantity-input.md +100 -0
  138. package/src/claude/skills/ui-ux/references/components/range-slider.md +16 -0
  139. package/src/claude/skills/ui-ux/references/components/small-controls.md +340 -0
  140. package/src/claude/skills/ui-ux/references/components/sortable-header.md +86 -0
  141. package/src/claude/skills/ui-ux/references/components/tag-input.md +14 -0
  142. package/src/claude/skills/ui-ux/references/components/timeline.md +38 -0
  143. package/src/claude/skills/ui-ux/references/components/tree.md +30 -0
  144. package/src/claude/skills/ui-ux/references/design-process.md +650 -0
  145. package/src/claude/skills/ui-ux/references/layouts/app-kanban.html +303 -0
  146. package/src/claude/skills/ui-ux/references/layouts/app.md +1369 -0
  147. package/src/claude/skills/ui-ux/references/layouts/form.md +430 -0
  148. package/src/claude/skills/ui-ux/references/layouts/overlay.md +552 -0
  149. package/src/claude/skills/ui-ux/references/layouts/pricing.md +204 -0
  150. package/src/claude/skills/ui-ux/references/locked-rules.md +35 -0
  151. package/src/claude/skills/ui-ux/references/principles.md +408 -0
  152. package/src/claude/skills/ui-ux/references/refactor.md +245 -0
  153. package/src/claude/skills/ui-ux/references/responsive.md +195 -0
  154. package/src/claude/skills/ui-ux/references/review.md +528 -0
  155. package/src/claude/skills/ui-ux/references/rules-color.md +623 -0
  156. package/src/claude/skills/ui-ux/references/rules-form.md +235 -0
  157. package/src/claude/skills/ui-ux/references/rules-state.md +680 -0
  158. package/src/claude/skills/ui-ux/references/rules-type.md +369 -0
  159. package/src/claude/skills/ui-ux/references/styles.md +311 -0
  160. package/src/claude/skills/ui-ux/references/system.md +219 -0
  161. package/src/claude/skills/ui-ux/references/tailwind-v4-traps.md +237 -0
  162. package/src/claude/skills/ui-ux/references/tokens.css +362 -0
  163. package/src/claude/skills/ui-ux/scripts/lint-skill.mjs +216 -0
  164. package/src/claude/skills/ui-ux/scripts/package.json +9 -0
  165. package/src/claude/skills/ui-ux/scripts/probe.mjs +4447 -0
  166. package/src/claude/skills/ui-ux-pro-max/SKILL.md +25 -80
  167. package/src/claude/skills/web-testing/SKILL.md +2 -20
  168. package/src/claude/status.cjs +149 -144
  169. package/src/codex/AGENTS.md +8 -13
  170. package/src/codex/hooks/agent.cjs +2 -1
  171. package/src/codex/hooks/lib/spec-receipt.cjs +4 -32
  172. package/src/codex/hooks/lib/spec-utils.cjs +6 -52
  173. package/src/codex/hooks/rules.cjs +2 -1
  174. package/src/codex/hooks/session.cjs +0 -2
  175. package/src/codex/hooks/spec-gate.cjs +13 -81
  176. package/src/codex/hooks/spec-state.cjs +37 -41
  177. package/src/codex/hooks.json +0 -20
  178. package/src/codex/rules/state-sync.md +3 -12
  179. package/src/common/AGENTS.md +6 -12
  180. package/src/omp/extensions/cafekit-bridge.mjs +6 -6
  181. package/bin/__tests__/change-firewall.semantic-firewall.test.js +0 -2133
  182. package/bin/__tests__/finalizer-pass-gate.semantic-firewall.test.js +0 -342
  183. package/bin/__tests__/release-preflight.semantic-firewall.test.js +0 -586
  184. package/bin/__tests__/review-receipt-c2.semantic-firewall.test.js +0 -378
  185. package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +0 -665
  186. package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +0 -1132
  187. package/src/claude/hooks/__tests__/completion-authority.test.js +0 -990
  188. package/src/claude/hooks/__tests__/semantic-review-authority.test.js +0 -259
  189. package/src/claude/hooks/completion-authority-check.cjs +0 -56
  190. package/src/claude/hooks/completion-authority-state.cjs +0 -527
  191. package/src/claude/hooks/completion-authority.cjs +0 -163
  192. package/src/claude/hooks/lib/context.cjs +0 -616
  193. package/src/claude/hooks/lib/detect.cjs +0 -474
  194. package/src/claude/hooks/semantic-review-authority.cjs +0 -154
  195. package/src/claude/hooks/task-scaffold-guard.cjs +0 -114
  196. package/src/claude/hooks/usage.cjs +0 -197
  197. package/src/claude/scripts/change-firewall.cjs +0 -1748
  198. package/src/claude/scripts/spec-authoring-digest.cjs +0 -151
  199. package/src/claude/scripts/spec-authoring-validation.cjs +0 -126
  200. package/src/claude/scripts/spec-final-state.cjs +0 -290
  201. package/src/claude/scripts/spec-ground.cjs +0 -650
  202. package/src/claude/scripts/spec-readiness.cjs +0 -425
  203. package/src/claude/scripts/spec-scaffold.cjs +0 -2317
  204. package/src/claude/scripts/spec-semantic-model.cjs +0 -396
  205. package/src/claude/scripts/validate-spec-output.cjs +0 -3941
  206. package/src/claude/skills/code-review/references/verification-gate.md +0 -46
  207. package/src/claude/skills/delegate/SKILL.md +0 -124
  208. package/src/claude/skills/delegate/references/codex-delegation.md +0 -71
  209. package/src/claude/skills/delegate/references/grok-delegation.md +0 -84
  210. package/src/claude/skills/hotfix/SKILL.md +0 -289
  211. package/src/claude/skills/inspect/SKILL.md +0 -142
  212. package/src/claude/skills/loop/SKILL.md +0 -114
  213. package/src/claude/skills/loop/references/bounded-loop-protocol.md +0 -104
  214. package/src/claude/skills/loop/references/metric-and-guard-contract.md +0 -76
  215. package/src/claude/skills/route/SKILL.md +0 -94
  216. package/src/claude/skills/route/references/agent-timing.md +0 -46
  217. package/src/claude/skills/route/references/chaining-patterns.md +0 -53
  218. package/src/claude/skills/route/references/task-taxonomy.md +0 -48
  219. package/src/claude/skills/specs/templates/design.md +0 -82
  220. package/src/claude/skills/specs/templates/requirements-init.md +0 -8
  221. package/src/claude/skills/specs/templates/requirements.md +0 -42
  222. package/src/claude/skills/specs/templates/spec-state.json +0 -56
  223. package/src/claude/skills/specs/templates/task.md +0 -47
  224. package/src/codex/hooks/completion-authority-check.cjs +0 -67
  225. package/src/codex/hooks/completion-authority-state.cjs +0 -527
  226. package/src/codex/hooks/completion-authority.cjs +0 -109
  227. package/src/codex/hooks/semantic-review-authority.cjs +0 -130
  228. package/src/codex/hooks/task-scaffold-guard.cjs +0 -63
  229. /package/src/claude/skills/{question → ask}/templates/question.md +0 -0
  230. /package/src/claude/skills/{hotfix → fix}/references/escalation-tactics.md +0 -0
  231. /package/src/claude/skills/{hotfix → fix}/references/workflow-specialized.md +0 -0
@@ -1,14 +1,6 @@
1
1
  # Process-first plan, task, and receipt templates
2
2
 
3
- Use these as compact starting points. Remove unused examples and placeholders
4
- before C2. The primary layout is always flat:
5
-
6
- ```text
7
- specs/<feature>/
8
- ├── plan.md
9
- ├── task-01-<slug>.md
10
- └── task-NN-<slug>.md
11
- ```
3
+ Use these as compact starting points. Remove unused examples and placeholders before GATE-REVIEW. The primary layout is always flat: `specs/<feature>/` holds `plan.md` beside `task-01-<slug>.md` through `task-NN-<slug>.md`, with no task subdirectory.
12
4
 
13
5
  ## `plan.md` template
14
6
 
@@ -18,7 +10,7 @@ Keep the plan short enough to scan as one index, normally under 100 lines.
18
10
  # <Feature name>
19
11
  Specs-Contract: process-first-ready-v1
20
12
 
21
- ## Scope decision (C1 — YYYY-MM-DD)
13
+ ## Scope decision (GATE-SCOPE — YYYY-MM-DD)
22
14
  - Existing: <reusable code with path:line>
23
15
  - Minimum change: <required behavior>
24
16
  - Expansion signals: <none or evidence>
@@ -27,6 +19,11 @@ Specs-Contract: process-first-ready-v1
27
19
  ## Out of scope
28
20
  - <deliberate exclusion>
29
21
 
22
+ ## Decisions
23
+ | ID | Chosen | Rejected | Why | Load-bearing assumption | Break signal → response |
24
+ |---|---|---|---|---|---|
25
+ | D-01 | <chosen path> | <rejected alternative> | <evidence-backed reason> | <assumption that must hold> | <observable signal> → <pre-decided response> |
26
+
30
27
  ## Coverage profile
31
28
  | ID | Outcome | Change kinds | Material surfaces | Ambiguity/action | Risk/evidence | Required proof |
32
29
  |---|---|---|---|---|---|---|
@@ -38,9 +35,9 @@ Specs-Contract: process-first-ready-v1
38
35
  | AC-01 | When <trigger>, the system shall <response>. | `<command>` |
39
36
 
40
37
  ## Tasks
41
- | # | Task | Criteria | Primary ownership | Dependencies | Status |
42
- |---|---|---|---|---|---|
43
- | 01 | <one outcome> | AC-01 | `src/example.ts` | - | blocked |
38
+ | # | Task | Priority | Criteria | Primary ownership | Dependencies | Status |
39
+ |---|---|---|---|---|---|---|
40
+ | 01 | <one outcome> | P1 | AC-01 | `src/example.ts` | - | blocked |
44
41
 
45
42
  ## Review log
46
43
  - Round 1: <findings accepted/rejected/revised>; sweep <result>.
@@ -48,6 +45,7 @@ Specs-Contract: process-first-ready-v1
48
45
 
49
46
  Each acceptance ID must map to at least one task and one proof. A task with no
50
47
  criterion is scope drift; a criterion with no task or proof is not executable.
48
+ `Priority`: P1 means the outcome is unusable without it, P2 is needed for acceptance, P3 improves it. Number tasks in priority order so the plan table, the filename order, and the queue agree.
51
49
 
52
50
  ## `task-NN-*.md` template
53
51
 
@@ -73,6 +71,9 @@ Status: blocked
73
71
  - Create: `test/a.test.ts`
74
72
  - Read: `src/caller.ts`
75
73
 
74
+ ## Steps
75
+ 1. <ordered action on one owned file → expected observation>
76
+
76
77
  ## Acceptance
77
78
  - AC-01: <task-local measurable condition>
78
79
 
@@ -87,6 +88,9 @@ Status: blocked
87
88
  - Counterexample: <material alternative behavior that must make this proof fail>
88
89
  - Artifacts: <required artifact path plus digest algorithm/comparison rule, or explicitly ephemeral with cleanup rule>
89
90
 
91
+ ## Failure Protocol
92
+ On a failed Step or Verification Plan run: stop; do not widen scope, change the Command, or weaken a test; record observed versus expected; repair only the cited cause; after three failed rounds, stop and ask the user.
93
+
90
94
  ## Receipt
91
95
  <!-- Fill only after execution; see canonical form below. -->
92
96
  ````
@@ -94,18 +98,20 @@ Status: blocked
94
98
  Trace `Command → Named probe → Reachability → Oracle`. Aggregate suites name the
95
99
  owning concrete probe. `Required proof` is a planned level set, not execution
96
100
  evidence: known but unrun proof may be `pending`; `UNKNOWN` reachability blocks
97
- `pending`; missing, failed, or unavailable required evidence blocks `done`/C3.
101
+ `pending`; missing, failed, or unavailable required evidence blocks `done`/GATE-DONE.
98
102
  Levels stay separate and never promote one another. Run mutation or destructive
99
103
  negative controls only on disposable copies under a verified temporary root,
100
104
  never tracked worktree or canonical source bytes.
101
105
  For every required level in each referenced CP row, map its named probe and
102
106
  reachability here; one command may own several explicitly named level probes.
107
+ Verification compares observed output with the Oracle; a judgment such as "looks right" is not a verification.
108
+ Example failure: the Command exits 1 with `expected 3 files, found 2` → record observed versus expected, add the missing writer, and rerun the same Command; never delete the assertion.
103
109
 
104
110
  ## Status matrix
105
111
 
106
112
  | Status condition | Persisted state |
107
113
  |---|---|
108
- | C1/C2 decision open | `blocked` |
114
+ | GATE-SCOPE/GATE-REVIEW decision open | `blocked` |
109
115
  | accepted finding open or `UNKNOWN` reachability | `blocked` |
110
116
  | every non-dependency blocker closed | `pending` |
111
117
  | named task dependency not done | keep `pending`; queue gates it |
@@ -138,16 +144,13 @@ bare PASS claim without the command output.
138
144
 
139
145
  ## EARS sentence patterns
140
146
 
141
- Use the narrowest pattern that describes observable behavior:
142
-
143
147
  1. **Ubiquitous:** `The <system> shall <response>.`
144
148
  2. **Event-driven:** `When <trigger>, the <system> shall <response>.`
145
149
  3. **State-driven:** `While <state>, the <system> shall <response>.`
146
150
  4. **Unwanted behavior:** `If <fault>, the <system> shall <response>.`
147
151
  5. **Optional feature:** `Where <feature is enabled>, the <system> shall <response>.`
148
152
 
149
- Avoid implementation detail unless it is a user-approved contract. Replace
150
- "fast", "robust", and "works" with a measurable threshold or observation.
153
+ Use the narrowest pattern that describes observable behavior. Avoid implementation detail unless it is a user-approved contract. Replace "fast", "robust", and "works" with a measurable threshold or observation.
151
154
 
152
155
  ## Example Mapping rule
153
156
 
@@ -157,7 +160,7 @@ Classify ambiguity in every affected CP row:
157
160
  |---|---|
158
161
  | `none` | proceed |
159
162
  | `examples-needed` | add two or three examples only for an already decided rule; promote to `decision-needed` if an example changes observable behavior |
160
- | `decision-needed` | ask the user at C1/C2 and keep affected tasks blocked |
163
+ | `decision-needed` | ask the user at GATE-SCOPE/GATE-REVIEW and keep affected tasks blocked |
161
164
  | `design-needed` | after user-owned decisions settle, route material competing technical designs through Brainstorm |
162
165
 
163
166
  Do not let examples choose a product outcome: retention of 30 versus 90 days is
@@ -165,7 +168,7 @@ Do not let examples choose a product outcome: retention of 30 versus 90 days is
165
168
 
166
169
  ## No-invention and conditional boundary contracts
167
170
 
168
- Before implementation handoff, apply the **no-invention gate**: if two implementations conform to the packet text yet can produce different externally observable output, state, error, security, or compatibility behavior, surface the missing choice as an explicit C1 or C2 question and block handoff.
171
+ Before implementation handoff, apply the **no-invention gate**: if two implementations conform to the packet text yet can produce different externally observable output, state, error, security, or compatibility behavior, surface the missing choice as an explicit GATE-SCOPE or GATE-REVIEW question and block handoff.
169
172
 
170
173
  For a Specs route, `plan.md` owns one `## Coverage profile` row per externally observable outcome; direct and Brainstorm-only routes do not persist it. Change kinds are multi-valued (`add`, `modify`, `fix`, `refactor`, `remove`, `migrate`, `integrate`), and unfamiliar kinds or surfaces use `other:<verbatim>` rather than disappearing. Each task references its CP IDs; authoring, review, edge, and proof obligations union only inside affected rows/tasks. Rederive affected CP rows after any accepted scope, outcome, criteria, ownership, dependency, risk, or proof delta before task status.
171
174
 
@@ -186,15 +189,11 @@ For every required row, name each listed choice exactly; labels such as “JSON
186
189
 
187
190
  ## Twelve edge-case dimensions
188
191
 
189
- For each material boundary, select relevant dimensions rather than filling a
190
- ceremonial matrix:
192
+ For each material boundary, select relevant dimensions rather than filling a ceremonial matrix:
191
193
 
192
- - Input shape, identity, state, order: malformed/duplicate/bounds, wrong actor,
193
- partial/stale state, replay/reordering.
194
- - Concurrency, dependency, failure, recovery: races/cancellation, version drift,
195
- timeout/nonzero exit, retry/rollback/cleanup.
196
- - Persistence, integration, security/privacy, observability/proof: partial
197
- writes, registration/reachability, traversal/secrets, artifacts/provenance.
194
+ - Input shape, identity, state, order: malformed/duplicate/bounds, wrong actor, partial/stale state, replay/reordering.
195
+ - Concurrency, dependency, failure, recovery: races/cancellation, version drift, timeout/nonzero exit, retry/rollback/cleanup.
196
+ - Persistence, integration, security/privacy, observability/proof: partial writes, registration/reachability, traversal/secrets, artifacts/provenance.
198
197
 
199
198
  `Crash` means abrupt unhandled termination before the claimed catch point; a catchable failure returns/raises an error or exits nonzero. Never use them interchangeably.
200
199
 
@@ -203,17 +202,11 @@ verification probe. Do not duplicate it across all three.
203
202
 
204
203
  ## Quality and saturation checks
205
204
 
206
- Before C2 confirm:
205
+ Before GATE-REVIEW confirm:
207
206
 
208
- - every repository fact has current evidence or `[UNVERIFIED]`;
209
- - every acceptance criterion maps to task and proof;
210
- - task ownership does not overlap within a proposed parallel wave;
211
- - dependencies are acyclic and refer to real task numbers;
212
- - commands are runnable from the named work context;
213
- - negative, recovery, and reachability probes exist where risk requires them;
214
- - every ambiguity follows its required action; examples only clarify decided rules;
215
- - the latest consistency sweep reports zero unresolved contradictions.
207
+ - evidence: every repository fact has a current citation or `[UNVERIFIED]`, and the sampled citations were re-run;
208
+ - mapping: each acceptance criterion reaches a task and a proof; ownership does not overlap inside one parallel wave; dependencies are acyclic and name real task files;
209
+ - proof: commands run from the named work context, and negative, recovery, and reachability probes exist where risk requires them;
210
+ - closure: each ambiguity followed its required action, examples only clarify decided rules, and the latest consistency sweep reports zero unresolved contradictions.
216
211
 
217
- Stop expanding when a fresh reviewer finds no new material failure with new
218
- evidence, the 12 dimensions yield no uncovered relevant boundary, and every
219
- accepted C2 finding is represented exactly once.
212
+ Stop expanding when a fresh reviewer finds no new material failure with new evidence, the 12 dimensions yield no uncovered relevant boundary, and each accepted GATE-REVIEW finding is represented exactly once.
@@ -1,20 +1,18 @@
1
1
  ---
2
2
  name: cf:sync
3
- description: "Synchronize process-first task Status and inline Receipts without inventing proof; also preserves existing legacy Specs state."
3
+ description: "Synchronize process-first task Status and inline Receipts without inventing proof."
4
4
  user-invocable: true
5
5
  when_to_use: "Invoke after implementation or verification changes a task's real state, or to audit a feature packet for drift."
6
6
  category: utilities
7
7
  keywords: [sync, state, tracking, consistency]
8
- argument-hint: "<feature> <task-file> <pending|in_progress|paused|blocked|done|sync-finalize> [blocker] | audit <feature>"
8
+ argument-hint: "<feature> <task-file> <pending|in_progress|paused|blocked|done|sync-finalize> [blocker] | audit <feature> | rebind <feature> [task-file] | (none: audit all, write nothing)"
9
9
  metadata:
10
10
  author: haposoft
11
11
  version: "3.0.0"
12
12
  ---
13
13
  # Sync — file-state synchronization
14
14
 
15
- Synchronize only observed state. For the primary process-first layout, the
16
- single `Status:` field and inline `## Receipt` in each flat task file are the
17
- state. Never infer proof, approval, review independence, or product readiness.
15
+ Synchronize only observed state. For the primary process-first layout, the single `Status:` field and inline `## Receipt` in each flat task file are the state. Never infer proof, approval, review independence, or product readiness.
18
16
 
19
17
  ## Commands
20
18
 
@@ -24,56 +22,29 @@ state. Never infer proof, approval, review independence, or product readiness.
24
22
  /cf:sync <feature> <task-NN-slug.md> done
25
23
  /cf:sync <feature> <task-NN-slug.md> sync-finalize
26
24
  /cf:sync audit <feature>
25
+ /cf:sync rebind <feature> [<task-NN-slug.md>]
26
+ /cf:sync
27
27
  ```
28
28
 
29
- Resolve one regular direct-child task inside `specs/<feature>/`. Reject path
30
- escape, symlink, ambiguity, missing `plan.md`, duplicate Status fields, and
31
- unsupported status values.
29
+ Resolve one regular direct-child task inside `specs/<feature>/`. Reject path escape, symlink, ambiguity, missing `plan.md`, duplicate Status fields, and unsupported status values.
32
30
 
33
31
  ## Task synchronization
34
32
 
35
- 1. Read the task Outcome, Acceptance, Dependencies, Verification Plan, current
36
- Status, and Receipt before editing.
37
- 2. Starting or resuming changes only Status to `in_progress`. Update only
38
- checkboxes whose implementation is real.
39
- 3. Blocking changes Status to `blocked` and records a concrete blocker; it does
40
- not create proof.
41
- 4. Done requires a current inline Receipt with `Verification: PASS`, exact
42
- Command, `Exit: 0`, runtime-bound Base/Head, non-empty fenced output, and any
43
- required negative/reachability/artifact proof.
44
- 5. Write or replace the Receipt before changing Status to `done`. Missing,
45
- stale, contradictory, placeholder, failure, or zero-test evidence keeps the
46
- task `in_progress` or `blocked`.
47
- 6. Re-read the file after the surgical edit and confirm exactly one Status and
48
- one Receipt section.
33
+ - Read the task Outcome, Acceptance, Dependencies, Verification Plan, current Status, and Receipt before editing.
34
+ - Starting or resuming changes only Status to `in_progress`. Update only checkboxes whose implementation is real.
35
+ - Blocking changes Status to `blocked` and records a concrete blocker; it does not create proof.
36
+ - Done requires a current inline Receipt with `Verification: PASS`, exact Command, `Exit: 0`, runtime-bound Base/Head, non-empty fenced output, and any required negative/reachability/artifact proof.
37
+ - Write or replace the Receipt before changing Status to `done`. Missing, stale, contradictory, placeholder, failure, or zero-test evidence keeps the task `in_progress` or `blocked`.
38
+ - Re-read the file after the surgical edit and confirm exactly one Status and one Receipt section.
49
39
 
50
- `sync-finalize` is the only promotion path for `FLASH_UNVERIFIED`. It requires
51
- fresh canonical PASS proof, revalidates Base/Head and artifacts, clears the
52
- flash blocker, then derives `done`. Caller-supplied promotion booleans and a
53
- marker alone have no authority.
40
+ `sync-finalize` is the only promotion path for `FLASH_UNVERIFIED`. It requires fresh canonical PASS proof, revalidates Base/Head and artifacts, clears the flash blocker, then derives `done`. Caller-supplied promotion booleans and a marker alone have no authority.
54
41
 
55
42
  ## Audit
56
43
 
57
- Scan only `specs/<feature>/task-*.md` beside `plan.md`. Compare plan task rows,
58
- task filenames, dependencies, Status, acceptance mapping, and Receipts. Report
59
- missing files, unknown rows, cycles, duplicate fields, done-without-proof,
60
- proof-on-unfinished-task, and overlapping ownership.
44
+ Scan only `specs/<feature>/task-*.md` beside `plan.md`. Compare plan task rows, task filenames, dependencies, Status, acceptance mapping, and Receipts. Report missing files, unknown rows, cycles, duplicate fields, done-without-proof, proof-on-unfinished-task, and overlapping ownership.
61
45
 
62
- Repair deterministic formatting drift only. A semantic conflict, missing
63
- evidence, or ownership decision requires user or implementation input; do not
64
- pick a winner. After any edit, report exact files changed and unresolved items.
65
-
66
- Read `references/sync-protocols.md` for surgical update and audit rules.
46
+ An audit writes nothing until the user confirms the named changes; then repair deterministic formatting drift only and never pick a winner in a semantic conflict. Read `references/rebind-and-audit.md` before a rebind, a bare call, or a file report, and `references/sync-protocols.md` for surgical update and audit rules.
67
47
 
68
48
  ## Docs impact
69
49
 
70
- When a task becomes done, report `Docs impact: none|minor|major`. Create no docs
71
- work for `none`; update only affected existing docs for minor or major.
72
-
73
- ## Legacy workflow compatibility
74
-
75
- If `specs/<feature>/spec.json` exists, use the legacy adapter instead: preserve
76
- its machine authority, `task_registry`, nested `tasks/task-R*.md`, timestamps,
77
- typed topology, separate receipts, `workflow_policy`, `planning_depth`, lane,
78
- and `execution_tier`. Keep JSON and Markdown synchronized, retain the exact
79
- legacy sync-finalize contract, and require its feature receipt at closeout.
50
+ When a task becomes done, report `Docs impact: none|minor|major`. Create no docs work for `none`; update only affected existing docs for minor or major.
@@ -0,0 +1,59 @@
1
+ # Rebind, bare call, and the changed-files report
2
+
3
+ Read this before a rebind, a call without arguments, or any report of files
4
+ changed. Every rule here exists because a past sync run broke it.
5
+
6
+ ## Snapshot first
7
+
8
+ Before the first edit, record `git status --porcelain -uall` and the sha256 of
9
+ every path it lists. A file that was already modified is not yours to claim.
10
+
11
+ ## Rebind
12
+
13
+ `/cf:sync rebind <feature> [<task-NN-slug.md>]` refreshes the Receipt of tasks
14
+ that are already `done`. Any other Status is reported and not written.
15
+
16
+ 1. Take each task's Command exactly as the validator does: the last top-level
17
+ `- Command:` of its Verification Plan before the first `###` sub-heading,
18
+ or, when there is none at top level, the last `- Command:` under the
19
+ sub-headings. That one Command is the one you run and write.
20
+ 2. Run every selected Command verbatim, each once as one shell, so stdout,
21
+ stderr and the exit code cover the whole command. Never pipe it through
22
+ `| tail`, never redirect only its last `&&` link to a log, never edit it.
23
+ 3. A Command that exits non-zero, prints a failure marker, or runs zero
24
+ required tests never yields PASS. Set `Status: blocked` and, right under
25
+ the `Status:` line, add one line
26
+ `Blocker: rebind <date>: <Command> exited <code> (<failing test line>)`;
27
+ keep the old Receipt, and put this line directly under its `## Receipt`
28
+ heading:
29
+ `Not current proof: the rebind run of this Command exited <code>; the record below is historical.`
30
+ 4. After all Commands have run, run the provenance command once, exactly as
31
+ Develop names it:
32
+ `node .claude/scripts/provenance.cjs --project-root . --specs-root specs --spec-file <task file> --feature-name <feature> --session <any label> --json`
33
+ Copy its `Base` and `Head` fields into each passing Receipt. Never type,
34
+ compute, shorten, or `sed`-edit Base or Head, and never write a Receipt
35
+ from output that a run in this call did not print.
36
+ 5. Run the provenance command again. If Head moved, say so and do not claim
37
+ the receipts current.
38
+ 6. Re-read each edited task: exactly one `Status:` and one `## Receipt`.
39
+
40
+ ## Never silence the gate
41
+
42
+ A Stop-gate block is answered with fresh evidence or with a reported blocker.
43
+ Never archive, move, rename, or delete a packet, change the specs root, or edit
44
+ `.claude/` (including `runtime.json`) or any hook so the gate goes quiet.
45
+
46
+ ## Bare call
47
+
48
+ `/cf:sync` without arguments audits every process-first packet under the specs
49
+ root and writes nothing. Report archived packets, and packet directories without
50
+ `plan.md` that CafeKit no longer reads, without touching them. End by asking with `AskUserQuestion` when the host has
51
+ it, otherwise ask in text and stop. Only a reply that arrives after the report
52
+ and names the changes counts as confirmation; an instruction given before the
53
+ report, such as "close everything", does not.
54
+
55
+ ## Report files from git
56
+
57
+ After the last edit, take the snapshot again and report every path whose
58
+ status line or sha256 changed. List changes that were already there before the
59
+ first edit apart from your own. Never write "no files changed" from memory.
@@ -40,23 +40,14 @@ provenance, and path or artifact mismatch.
40
40
 
41
41
  - Plan row without task file: report missing; do not synthesize scope.
42
42
  - Task file without plan row: report unknown; do not silently adopt it.
43
- - Done without valid Receipt: downgrade only when the repair is deterministic,
44
- otherwise block and request direction.
43
+ - Done without valid Receipt: after the user confirms, downgrade when the repair is deterministic,
44
+ otherwise report and request direction.
45
45
  - Receipt on unfinished task: preserve it only if it is clearly historical;
46
46
  otherwise report the conflict.
47
- - Missing or cyclic dependency: block affected tasks.
48
- - Overlapping write ownership in one proposed wave: serialize or request an
47
+ - Missing or cyclic dependency: report; block affected tasks only after the user confirms.
48
+ - Overlapping write ownership in one proposed wave: report and request an
49
49
  ownership decision.
50
50
  - Acceptance ID not mapped both ways: report traceability drift.
51
51
 
52
52
  After a repair, re-read every changed file and print a concise mismatch/fix/
53
53
  unresolved summary. Never claim execution proof from the audit itself.
54
-
55
- ## Legacy workflow compatibility
56
-
57
- For `spec.json` packets, resolve exact `task_registry` paths and synchronize
58
- registry timestamps plus nested task Markdown. Validate the canonical separate
59
- receipt (with legacy inline Evidence only as the supported fallback), reject
60
- conflicting proof identities, preserve classified minimum and planning_depth,
61
- and use the installed legacy policy for lane, execution_tier, Flash promotion,
62
- and final feature closeout.
@@ -12,57 +12,36 @@ metadata:
12
12
  ---
13
13
  # Test — execution proof owner
14
14
 
15
- `cf:test` executes the smallest adequate real verification and owns the
16
- canonical execution result. For process-first work it returns one typed proof
17
- handoff to the controller; it never writes task state or the inline Receipt.
18
- Review consumes validated proof and never invents or duplicates execution.
15
+ `cf:test` executes the smallest adequate real verification and owns the canonical execution result. For process-first work it returns one typed proof handoff to the controller; it never writes task state or the inline Receipt. Review consumes validated proof and never invents or duplicates execution.
19
16
 
20
17
  ## Usage
21
-
22
18
  ```text
23
- /cf:test
24
- /cf:test --full
19
+ /cf:test [--full]
25
20
  /cf:test <scope-or-path>
26
21
  /cf:test <feature-name>
27
- /cf:test specs/<feature>
28
- /cf:test specs/<feature>/task-NN-<slug>.md
29
- /cf:test --ui <url>
30
- /cf:test --ui-auth <url>
31
- /cf:test --ui-flow <url>
22
+ /cf:test specs/<feature>[/task-NN-<slug>.md]
23
+ /cf:test --ui|--ui-auth|--ui-flow <url>
32
24
  ```
33
-
34
25
  ## Hard gates
35
-
36
26
  - Never claim a pass without executing the exact relevant command.
37
27
  - Never mock, weaken, delete, or skip a failing assertion to obtain green.
38
- - Missing tooling, a missing command, nonzero exit, or zero executed tests is
39
- never `PASS`. Do not auto-install project-local tooling during proof.
40
- - Preserve exact commands, counts, output, reachability, proof level, Base,
41
- Head, artifact hashes, and redaction labels.
42
- - Source, installed, and live proof are distinct. Live adherence is
43
- `[UNVERIFIED]` without a host invocation.
44
- - Use only `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`. Unknown, malformed,
45
- partial, contradictory, duplicate, skipped, or stale proof fails closed.
46
-
28
+ - Missing tooling, a missing command, nonzero exit, or zero executed tests is never `PASS`. Do not auto-install project-local tooling during proof.
29
+ - Preserve exact commands, counts, output, reachability, proof level, Base, Head, artifact hashes, and redaction labels.
30
+ - Source, installed, and live proof are distinct. Live adherence is `[UNVERIFIED]` without a host invocation.
31
+ - Use only `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`. Unknown, malformed, partial, contradictory, duplicate, skipped, or stale proof fails closed.
47
32
  ## Target routing
48
-
49
- Classify current filesystem bytes before selecting tests. Use `lstat` so broken
50
- links count as markers. Never migrate or repair packet state while testing.
33
+ Classify current filesystem bytes before selecting tests. Use `lstat` so broken links count as markers. Never migrate or repair packet state while testing.
51
34
 
52
35
  | Observed state | Route |
53
36
  |---|---|
54
- | Valid regular `plan.md` with `Specs-Contract: process-first-ready-v1`, one or more valid regular flat `task-NN-*.md`, and no legacy marker | Process-first |
55
- | Any flat marker that is orphaned, malformed, duplicated, symlinked, nonregular, or mixed with a legacy marker | `BLOCKED` |
56
- | Valid regular legacy root resolving every nested task and separate receipt, with no flat marker | Legacy adapter |
57
- | Orphan, malformed, symlinked, nonregular, identity-conflicting, or mixed legacy state | `BLOCKED` |
58
- | No flat or legacy marker | Ordinary non-Spec testing |
37
+ | Valid regular `plan.md` with `Specs-Contract: process-first-ready-v1` and one or more valid regular flat `task-NN-*.md` | Process-first |
38
+ | Any flat marker that is orphaned, malformed, duplicated, symlinked, or nonregular | `BLOCKED` |
39
+ | A packet directory with no `plan.md` that holds the old JSON planning state | `BLOCKED`: CafeKit no longer reads it; move the work to a `plan.md` packet |
40
+ | No flat marker | Ordinary non-Spec testing |
59
41
 
60
- A flat marker is a direct-child `plan.md` or `task-NN-*.md`. A legacy marker is
61
- `spec.json`, a nested legacy task, or a separate legacy receipt. See
62
- `references/execution-strategy.md` for the complete validation truth table.
42
+ A flat marker is a direct-child `plan.md` or `task-NN-*.md`. See `references/execution-strategy.md` for the complete validation truth table.
63
43
 
64
44
  ## Spec-Aware Mode
65
-
66
45
  <SCOPE-GATE>
67
46
  For a feature target, test only current accepted scope, the active task's exact
68
47
  Verification Plan, and reachable runtime surfaces. Missing or orphaned
@@ -70,28 +49,19 @@ reachability fails even when a command exits successfully.
70
49
  </SCOPE-GATE>
71
50
 
72
51
  For a process-first feature:
73
-
74
- 1. Read current `plan.md` and flat task bytes. Select only a contained regular
75
- task whose dependencies allow proof.
76
- 2. Use the task's exact `Command`, exact unique `Named probes`, `Reachability`,
77
- `Oracle`, `Counterexample`, required proof level, and artifact declaration.
78
- 3. Run the smallest adequate proof. `--full` expands scope but cannot weaken
79
- the Verification Plan or substitute unrelated green tests.
80
- 4. Return exactly one canonical `test-proof-v1` object. Do not edit `plan.md`,
81
- `Status:`, the task's `## Receipt`, or any sibling task.
82
- 5. The Develop controller validates the payload, recomputes its digest, checks
83
- current provenance, and alone writes process-first Status and inline Receipt.
84
-
52
+ - Read current `plan.md` and flat task bytes. Select only a contained regular task whose dependencies allow proof.
53
+ - Use the task's exact `Command`, exact unique `Named probes`, `Reachability`, `Oracle`, `Counterexample`, required proof level, and artifact declaration.
54
+ - Run the smallest adequate proof. `--full` expands scope but cannot weaken the Verification Plan or substitute unrelated green tests.
55
+ - Return exactly one canonical `test-proof-v1` object. Do not edit `plan.md`, `Status:`, the task's `## Receipt`, or any sibling task.
56
+ - The Develop controller validates the payload, recomputes its digest, checks current provenance, and alone writes process-first Status and inline Receipt.
85
57
  ## Execution
86
-
87
- 1. Detect commands from task and repository files; never invent them.
88
- 2. Run a cheap compile or typecheck precheck when the project provides one.
89
- 3. Execute the exact task command and all named probes with real counts.
90
- 4. Inspect negative paths, runtime reachability, and declared artifacts.
91
- 5. Capture tracked, untracked, and ignored project-command drift separately
92
- from runtime Head. Never silently clean or hide project changes.
93
- 6. Redact sensitive material, validate the complete proof object, then return a
94
- concise human report separately from the machine handoff.
58
+ - Detect commands from task and repository files; never invent them.
59
+ - Run a cheap compile or typecheck precheck when the project provides one.
60
+ - Execute the exact task command and all named probes with real counts.
61
+ - For Ordinary non-Spec testing, before any `PASS` or `PASS_WITH_WARNINGS`, read the tests that cover the target or changed code (every test file when the suite is small). When an assertion or its pass condition depends on a nondeterministic source — the clock, randomness, the network, shared filesystem state or test order — the verdict is `FAIL`, naming the source, even when every run passes. When only setup depends on one, rerun just the suspect tests at least twice more; any differing outcome is `FAIL` as flaky. A single green run of such a test is not `PASS`. This step does not apply to process-first Named probes, which run exactly once.
62
+ - Inspect negative paths, runtime reachability, and declared artifacts.
63
+ - Capture tracked, untracked, and ignored project-command drift separately from runtime Head. Never silently clean or hide project changes.
64
+ - Redact sensitive material, validate the complete proof object, then return a concise human report separately from the machine handoff.
95
65
 
96
66
  Required proof follows the behavior:
97
67
 
@@ -104,45 +74,23 @@ Required proof follows the behavior:
104
74
  | layout, focus, labels, keyboard | viewport/visual/accessibility check |
105
75
  | regression | reproduction before fix plus passing regression |
106
76
  | security/performance | only when requirement, risk, or boundary requires it |
107
-
108
77
  ## Process-first proof handoff
109
-
110
78
  The machine payload is canonical UTF-8 JSON with exact top-level keys:
111
-
112
79
  ```text
113
- schema_version, target, verdict, command, exit, counts, provenance,
114
- proof_level, expected, observed, reachability, artifacts, branches,
115
- raw_output, redactions, payload_sha256
80
+ schema_version, target, verdict, command, exit, counts, provenance, proof_level, expected, observed, reachability, artifacts, branches, raw_output, redactions, payload_sha256
116
81
  ```
117
82
 
118
- `schema_version` is exactly `test-proof-v1`; unknown keys block. Branch IDs map
119
- one-to-one to exact unique Named probes. The digest is lowercase SHA-256 of
120
- stable JSON excluding only `payload_sha256`. Exact field shapes, nullable
121
- pre-execution `BLOCKED` rules, and aggregation live in
122
- `references/execution-strategy.md`.
123
-
124
- Only all required branches passing with exact command, exit 0, executed > 0,
125
- failed/skipped 0, matching Base/Head, `reachability.status: PASS`, valid artifact
126
- hashes, and safe redaction can aggregate `PASS`. Aggregate in this order:
127
- `FAIL` > `BLOCKED` > `PASS_WITH_WARNINGS` > `PASS`.
83
+ `schema_version` is exactly `test-proof-v1`; unknown keys block. Branch IDs map one-to-one to exact unique Named probes. The digest is lowercase SHA-256 of stable JSON excluding only `payload_sha256`. Exact field shapes, nullable pre-execution `BLOCKED` rules, and aggregation live in `references/execution-strategy.md`.
128
84
 
85
+ Only all required branches passing with exact command, exit 0, executed > 0, failed/skipped 0, matching Base/Head, `reachability.status: PASS`, valid artifact hashes, and safe redaction can aggregate `PASS`. Aggregate in this order: `FAIL` > `BLOCKED` > `PASS_WITH_WARNINGS` > `PASS`.
129
86
  ## Persistent-write and authentication boundary
130
-
131
- - `.hapo/test-memory.json` is optional read-only context. Hash absent/present
132
- bytes before and after; never create, merge, or update it during proof.
133
- - Put only Test-owned temporary files outside the project and clean them.
134
- Never create Test-owned reports, caches, lazy installs, or auth state.
135
- - For authenticated UI proof, prefer the project's own auth helper. Otherwise
136
- use only an explicitly selected user-controlled profile bound to a confirmed
137
- HTTPS or localhost origin, identity, permissions, and action scope.
138
- - Block cross-origin redirects and destructive production actions without fresh
139
- consent. Never ask for, export, paste, or persist cookies or tokens.
140
- - Redact Authorization, Cookie, Set-Cookie, session tokens, credentials, and
141
- scoped PII from commands, headers/bodies, logs, screenshots, and reports.
142
- If safe proof is impossible, return `BLOCKED`.
87
+ - `.hapo/test-memory.json` is optional read-only context. Hash absent/present bytes before and after; never create, merge, or update it during proof.
88
+ - Put only Test-owned temporary files outside the project and clean them. Never create Test-owned reports, caches, lazy installs, or auth state.
89
+ - For authenticated UI proof, prefer the project's own auth helper. Otherwise use only an explicitly selected user-controlled profile bound to a confirmed HTTPS or localhost origin, identity, permissions, and action scope.
90
+ - Block cross-origin redirects and destructive production actions without fresh consent. Never ask for, export, paste, or persist cookies or tokens.
91
+ - Redact Authorization, Cookie, Set-Cookie, session tokens, credentials, and scoped PII from commands, headers/bodies, logs, screenshots, and reports. If safe proof is impossible, return `BLOCKED`.
143
92
 
144
93
  ## Verdict and report
145
-
146
94
  ```markdown
147
95
  ## Test Verdict
148
96
 
@@ -161,25 +109,12 @@ hashes, and safe redaction can aggregate `PASS`. Aggregate in this order:
161
109
  - [controller handoff, exact failure, or changed prerequisite]
162
110
  ```
163
111
 
164
- Do not place the full JSON payload, secrets, verbose raw logs, or screenshots in
165
- the concise report. `PASS_WITH_WARNINGS` remains unfinished; only literal
166
- validated `PASS` may be synchronized by the controller.
167
-
168
- ## Legacy workflow compatibility
169
-
170
- A valid legacy packet keeps the v2.1 adapter, legacy task resolution, and its
171
- separate receipt path. Do not write process-first inline proof into it. If
172
- legacy proof identities conflict or the packet is mixed/malformed, return
173
- `BLOCKED`; never choose one source or migrate it during unrelated testing.
174
-
175
- Flash legacy behavior remains proof-only: testing may make a current
176
- `FLASH_UNVERIFIED` task eligible for trusted sync-finalize, but never promotes
177
- state or unblocks dependents itself. Only explicit trusted sync-finalize may
178
- promote it.
112
+ Do not place the full JSON payload, secrets, verbose raw logs, or screenshots in the concise report. `PASS_WITH_WARNINGS` remains unfinished; only literal validated `PASS` may be synchronized by the controller.
179
113
 
114
+ When the target's task can be read — a process-first packet, or a packet `BLOCKED` while it is classified that still holds exactly one regular flat task with a readable `Command` and `Named probes` — end the final message with the concise report, then a `### Machine handoff (test-proof-v1)` heading and exactly one fenced `json` block holding the validated payload. The handoff block follows the report and is not part of it. No further fenced block follows it. A pre-execution `BLOCKED` takes the same placement; its shape is in `references/execution-strategy.md` §4. For any other target, end with the report and the line `No payload: target not identifiable.`
115
+ ## Flash proof
116
+ Flash behavior remains proof-only: testing may make a current `FLASH_UNVERIFIED` task eligible for trusted sync-finalize, but never promotes state or unblocks dependents itself. Only explicit trusted sync-finalize may promote it.
180
117
  ## References
181
-
182
- - `references/execution-strategy.md` — routing, payload schema, aggregation,
183
- blast radius, UI safety, and report separation.
118
+ - `references/execution-strategy.md` — routing, payload schema, aggregation, blast radius, UI safety, and report separation.
184
119
  - `references/failure-triage.md` — failure classification and four verdicts.
185
120
  - `references/test-memory.md` — optional read-only historical context.