@haposoft/cafekit 0.18.0 → 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 (83) hide show
  1. package/README.md +1 -1
  2. package/bin/__tests__/codex-hooks.test.js +169 -236
  3. package/bin/__tests__/codex-native.test.js +54 -114
  4. package/bin/__tests__/develop-contract.test.js +101 -1361
  5. package/bin/__tests__/legacy-authority-decoupled.test.js +14 -19
  6. package/bin/__tests__/package-inventory.test.js +1 -395
  7. package/bin/__tests__/spec-narrowing.test.js +30 -134
  8. package/bin/__tests__/specs-v2-execution-closeout.test.js +0 -372
  9. package/bin/__tests__/test-runtime-dependency-closure.cjs +1 -2
  10. package/bin/__tests__/validator-grounding.test.js +17 -2929
  11. package/bin/lib/managed-writer.js +2 -3
  12. package/bin/phases/codex-runtime.js +6 -3
  13. package/bin/phases/copy-payload.js +13 -28
  14. package/bin/phases/omp-runtime.js +6 -3
  15. package/package.json +2 -3
  16. package/src/claude/agents/code-auditor.md +9 -6
  17. package/src/claude/agents/debugger.md +3 -9
  18. package/src/claude/agents/docs-keeper.md +4 -7
  19. package/src/claude/agents/git-ops.md +2 -4
  20. package/src/claude/agents/implementer.md +6 -7
  21. package/src/claude/agents/inspector.md +2 -0
  22. package/src/claude/agents/project-manager.md +2 -2
  23. package/src/claude/agents/spec-maker.md +4 -4
  24. package/src/claude/agents/test-runner.md +8 -11
  25. package/src/claude/agents/ui-ux-designer.md +0 -1
  26. package/src/claude/hooks/__tests__/spec-gate.test.js +170 -330
  27. package/src/claude/hooks/__tests__/spec-state-touched.test.js +26 -0
  28. package/src/claude/hooks/spec-gate.cjs +8 -63
  29. package/src/claude/hooks/spec-state.cjs +47 -38
  30. package/src/claude/migration-manifest.json +12 -7
  31. package/src/claude/output-styles/coding-level-0-eli5.md +9 -9
  32. package/src/claude/output-styles/coding-level-1-junior.md +3 -3
  33. package/src/claude/output-styles/coding-level-2-mid.md +3 -3
  34. package/src/claude/output-styles/coding-level-3-senior.md +2 -2
  35. package/src/claude/output-styles/coding-level-4-lead.md +5 -5
  36. package/src/claude/output-styles/coding-level-5-god.md +6 -6
  37. package/src/claude/rules/ai-dev-rules.md +1 -2
  38. package/src/claude/rules/workflow.md +1 -1
  39. package/src/claude/scripts/spec-receipt.cjs +0 -114
  40. package/src/claude/scripts/spec-resolver.cjs +41 -457
  41. package/src/claude/scripts/workflow-policy.cjs +3 -1801
  42. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  43. package/src/claude/skills/chrome-devtools/SKILL.md +14 -31
  44. package/src/claude/skills/code-review/SKILL.md +25 -108
  45. package/src/claude/skills/code-review/references/spec-compliance-review.md +4 -7
  46. package/src/claude/skills/develop/SKILL.md +22 -70
  47. package/src/claude/skills/develop/references/subagent-patterns.md +0 -6
  48. package/src/claude/skills/research/SKILL.md +24 -55
  49. package/src/claude/skills/sync/SKILL.md +12 -34
  50. package/src/claude/skills/sync/references/rebind-and-audit.md +2 -2
  51. package/src/claude/skills/test/SKILL.md +39 -123
  52. package/src/claude/skills/test/references/execution-strategy.md +11 -22
  53. package/src/claude/skills/ui-ux/SKILL.md +1 -1
  54. package/src/claude/skills/ui-ux-pro-max/SKILL.md +24 -79
  55. package/src/claude/skills/web-testing/SKILL.md +2 -20
  56. package/src/codex/hooks/lib/spec-receipt.cjs +2 -30
  57. package/src/codex/hooks/lib/spec-utils.cjs +6 -45
  58. package/src/codex/hooks/spec-gate.cjs +11 -68
  59. package/src/codex/hooks/spec-state.cjs +37 -41
  60. package/src/common/AGENTS.md +4 -10
  61. package/bin/__tests__/change-firewall.semantic-firewall.test.js +0 -2133
  62. package/bin/__tests__/finalizer-pass-gate.semantic-firewall.test.js +0 -342
  63. package/bin/__tests__/release-preflight.semantic-firewall.test.js +0 -586
  64. package/bin/__tests__/review-receipt-c2.semantic-firewall.test.js +0 -378
  65. package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +0 -665
  66. package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +0 -1132
  67. package/src/claude/hooks/lib/context.cjs +0 -527
  68. package/src/claude/hooks/lib/detect.cjs +0 -474
  69. package/src/claude/scripts/change-firewall.cjs +0 -1748
  70. package/src/claude/scripts/spec-authoring-digest.cjs +0 -151
  71. package/src/claude/scripts/spec-authoring-validation.cjs +0 -126
  72. package/src/claude/scripts/spec-final-state.cjs +0 -290
  73. package/src/claude/scripts/spec-ground.cjs +0 -650
  74. package/src/claude/scripts/spec-readiness.cjs +0 -425
  75. package/src/claude/scripts/spec-scaffold.cjs +0 -2317
  76. package/src/claude/scripts/spec-semantic-model.cjs +0 -396
  77. package/src/claude/scripts/validate-spec-output.cjs +0 -3914
  78. package/src/claude/skills/code-review/references/verification-gate.md +0 -41
  79. package/src/claude/skills/specs/templates/design.md +0 -82
  80. package/src/claude/skills/specs/templates/requirements-init.md +0 -8
  81. package/src/claude/skills/specs/templates/requirements.md +0 -42
  82. package/src/claude/skills/specs/templates/spec-state.json +0 -56
  83. package/src/claude/skills/specs/templates/task.md +0 -47
@@ -12,17 +12,13 @@ metadata:
12
12
  ---
13
13
  # Research — proportional evidence for a decision
14
14
 
15
- Return a decision-ready answer, not a search diary or an unsorted option list.
16
- Research evaluates choices; it does not implement them or invent certainty.
15
+ Return a decision-ready answer, not a search diary or an unsorted option list. Research evaluates choices; it does not implement them or invent certainty.
17
16
 
18
- ## 1. Frame the decision
17
+ ## Frame the decision
19
18
 
20
- Restate the decision, project constraints, affected consumers, and what evidence
21
- would change the answer. Inspect current repository sources first whenever local
22
- fit matters. Ask the user only when a missing choice materially changes scope or
23
- safety; otherwise label bounded assumptions and continue.
19
+ Restate the decision, project constraints, affected consumers, and what evidence would change the answer. Inspect current repository sources first whenever local fit matters. Ask the user only when a missing choice materially changes scope or safety; otherwise label bounded assumptions and continue.
24
20
 
25
- ## 2. Select depth
21
+ ## Select depth
26
22
 
27
23
  Choose the smallest depth that can support the decision:
28
24
 
@@ -32,56 +28,29 @@ Choose the smallest depth that can support the decision:
32
28
  | Standard | Several viable options or a material integration choice | Verify material claims across at least two independent authoritative sources where available; compare fit and tradeoffs. |
33
29
  | Deep | High blast radius, hard-to-reverse architecture, security/compliance, substantial cost, or conflicting evidence | Complete Standard, then run a separate contradiction-and-gap round; use at least three independent sources for disputed material claims where available. |
34
30
 
35
- Escalate depth when evidence conflicts, a primary source is missing, or a finding
36
- changes the decision boundary. Do not inflate source counts with mirrors or
37
- articles that repeat the same upstream claim. Stop when new evidence no longer
38
- changes the ranking, limitations, or unresolved gaps.
31
+ Escalate depth when evidence conflicts, a primary source is missing, or a finding changes the decision boundary. Do not inflate source counts with mirrors or articles that repeat the same upstream claim. Stop when new evidence no longer changes the ranking, limitations, or unresolved gaps.
39
32
 
40
- ## 3. Gather evidence
33
+ ## Gather evidence
41
34
 
42
35
  - Repository claims: cite a resolvable `path:line` anchor from current bytes.
43
- - External claims: prefer current official documentation, standards, research
44
- papers, maintainer material, and release notes. Browse when facts may have
45
- changed; record the source date or applicable version.
46
- - For each material claim record: claim, URL or repository anchor, authority,
47
- date/version, applicability to this project, and status
48
- `confirmed | inferred | unresolved`.
49
- - A source count is not confidence. Explain conflicts, missing primary evidence,
50
- version mismatch, and why a source does or does not apply.
51
-
52
- Use delegated researchers only as optional acceleration when two or more
53
- independent evidence tracks can be bounded. The controller owns the question,
54
- source reconciliation, and final recommendation. If delegation is unavailable,
55
- unauthorized, or not useful, research sequentially with the same evidence bar.
56
- When a researcher's report feeds the answer, keep its `Depth:` line, its status labels and its `path:line` anchors, reconciled with your own evidence.
57
-
58
- ## 4. Synthesize
59
-
60
- For comparisons, rank only viable options and name a winner when evidence and
61
- project fit support one. For every ranked option include fit, decisive evidence,
62
- tradeoffs, adoption/operational risks, and limitations. If evidence cannot choose
63
- a winner, return `unresolved` plus the smallest fact or experiment that would.
64
-
65
- Use the four mandatory H2 sections from
66
- `.claude/skills/specs/templates/research.md`. Keep claim records and comparisons
67
- inside `## Evidence Summary`; do not add or reorder mandatory H2 headings.
68
-
69
- ## 5. Output and persistence
70
-
71
- Default to a concise answer in chat. Persist only when:
72
-
73
- 1. one explicitly resolved active Spec requires durable `research.md`; save to
74
- that exact `specs/<feature>/research.md`, preserving its existing lifecycle; or
75
- 2. the user explicitly requests a durable report and approves its destination.
76
-
77
- Do not create a Spec or `_shared` archive merely to save an answer. The
78
- controller performs any authorized write after reviewing and redacting the
79
- output; delegated researchers never write reports or task state. Always state
80
- depth used, decisive evidence, recommendation, limitations, and unresolved gaps.
81
- Give every material claim in the answer its status in parentheses — `(confirmed)`, `(inferred)` or `(unresolved)` — in English whatever the answer's language.
36
+ - External claims: prefer current official documentation, standards, research papers, maintainer material, and release notes. Browse when facts may have changed; record the source date or applicable version.
37
+ - For each material claim record: claim, URL or repository anchor, authority, date/version, applicability to this project, and status `confirmed | inferred | unresolved`.
38
+ - A source count is not confidence. Explain conflicts, missing primary evidence, version mismatch, and why a source does or does not apply.
39
+
40
+ Use delegated researchers only as optional acceleration when two or more independent evidence tracks can be bounded. The controller owns the question, source reconciliation, and final recommendation. If delegation is unavailable, unauthorized, or not useful, research sequentially with the same evidence bar. When a researcher's report feeds the answer, keep its `Depth:` line, its status labels and its `path:line` anchors, reconciled with your own evidence.
41
+
42
+ ## Synthesize
43
+
44
+ For comparisons, rank only viable options and name a winner when evidence and project fit support one. For every ranked option include fit, decisive evidence, tradeoffs, adoption/operational risks, and limitations. If evidence cannot choose a winner, return `unresolved` plus the smallest fact or experiment that would.
45
+
46
+ Use the four mandatory H2 sections from `.claude/skills/specs/templates/research.md`. Keep claim records and comparisons inside `## Evidence Summary`; do not add or reorder mandatory H2 headings.
47
+
48
+ ## Output and persistence
49
+
50
+ Default to a concise answer in chat. Persist only when: one explicitly resolved active Spec requires durable `research.md`; save to that exact `specs/<feature>/research.md`, preserving its existing lifecycle; or the user explicitly requests a durable report and approves its destination.
51
+
52
+ Do not create a Spec or `_shared` archive merely to save an answer. The controller performs any authorized write after reviewing and redacting the output; delegated researchers never write reports or task state. Always state depth used, decisive evidence, recommendation, limitations, and unresolved gaps. Give every material claim in the answer its status in parentheses — `(confirmed)`, `(inferred)` or `(unresolved)` — in English whatever the answer's language.
82
53
 
83
54
  ## Handoff boundary
84
55
 
85
- Research may recommend Brainstorm or Specs when a material product/design choice
86
- remains. It never starts Develop, edits implementation code, claims user approval,
87
- or presents source/installed evidence as live-system proof.
56
+ Research may recommend Brainstorm or Specs when a material product/design choice remains. It never starts Develop, edits implementation code, claims user approval, or presents source/installed evidence as live-system proof.
@@ -12,9 +12,7 @@ metadata:
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
 
@@ -28,45 +26,25 @@ state. Never infer proof, approval, review independence, or product readiness.
28
26
  /cf:sync
29
27
  ```
30
28
 
31
- Resolve one regular direct-child task inside `specs/<feature>/`. Reject path
32
- escape, symlink, ambiguity, missing `plan.md`, duplicate Status fields, and
33
- 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.
34
30
 
35
31
  ## Task synchronization
36
32
 
37
- 1. Read the task Outcome, Acceptance, Dependencies, Verification Plan, current
38
- Status, and Receipt before editing.
39
- 2. Starting or resuming changes only Status to `in_progress`. Update only
40
- checkboxes whose implementation is real.
41
- 3. Blocking changes Status to `blocked` and records a concrete blocker; it does
42
- not create proof.
43
- 4. Done requires a current inline Receipt with `Verification: PASS`, exact
44
- Command, `Exit: 0`, runtime-bound Base/Head, non-empty fenced output, and any
45
- required negative/reachability/artifact proof.
46
- 5. Write or replace the Receipt before changing Status to `done`. Missing,
47
- stale, contradictory, placeholder, failure, or zero-test evidence keeps the
48
- task `in_progress` or `blocked`.
49
- 6. Re-read the file after the surgical edit and confirm exactly one Status and
50
- 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.
51
39
 
52
- `sync-finalize` is the only promotion path for `FLASH_UNVERIFIED`. It requires
53
- fresh canonical PASS proof, revalidates Base/Head and artifacts, clears the
54
- flash blocker, then derives `done`. Caller-supplied promotion booleans and a
55
- 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.
56
41
 
57
42
  ## Audit
58
43
 
59
- Scan only `specs/<feature>/task-*.md` beside `plan.md`. Compare plan task rows,
60
- task filenames, dependencies, Status, acceptance mapping, and Receipts. Report
61
- missing files, unknown rows, cycles, duplicate fields, done-without-proof,
62
- 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.
63
45
 
64
- An audit writes nothing until the user confirms the named changes; then repair
65
- deterministic formatting drift only and never pick a winner in a semantic conflict.
66
- Read `references/rebind-and-audit.md` before a rebind, a bare call, or a file
67
- report, and `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.
68
47
 
69
48
  ## Docs impact
70
49
 
71
- When a task becomes done, report `Docs impact: none|minor|major`. Create no docs
72
- work for `none`; update only affected existing docs for minor or major.
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.
@@ -46,8 +46,8 @@ Never archive, move, rename, or delete a packet, change the specs root, or edit
46
46
  ## Bare call
47
47
 
48
48
  `/cf:sync` without arguments audits every process-first packet under the specs
49
- root and writes nothing. Report legacy (`spec.json`) and archived packets
50
- without touching them. End by asking with `AskUserQuestion` when the host has
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
51
  it, otherwise ask in text and stop. Only a reply that arrives after the report
52
52
  and names the changes counts as confirmation; an instruction given before the
53
53
  report, such as "close everything", does not.
@@ -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,37 +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. For Ordinary non-Spec testing, before any `PASS` or `PASS_WITH_WARNINGS`,
91
- read the tests that cover the target or changed code (every test file when
92
- the suite is small). When an assertion or its pass condition depends on a
93
- nondeterministic source — the clock, randomness, the network, shared
94
- filesystem state or test order — the verdict is `FAIL`, naming the source,
95
- even when every run passes. When only setup depends on one, rerun just the
96
- suspect tests at least twice more; any differing outcome is `FAIL` as flaky.
97
- A single green run of such a test is not `PASS`. This step does not apply to
98
- process-first Named probes, which run exactly once.
99
- 5. Inspect negative paths, runtime reachability, and declared artifacts.
100
- 6. Capture tracked, untracked, and ignored project-command drift separately
101
- from runtime Head. Never silently clean or hide project changes.
102
- 7. Redact sensitive material, validate the complete proof object, then return a
103
- 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.
104
65
 
105
66
  Required proof follows the behavior:
106
67
 
@@ -113,45 +74,23 @@ Required proof follows the behavior:
113
74
  | layout, focus, labels, keyboard | viewport/visual/accessibility check |
114
75
  | regression | reproduction before fix plus passing regression |
115
76
  | security/performance | only when requirement, risk, or boundary requires it |
116
-
117
77
  ## Process-first proof handoff
118
-
119
78
  The machine payload is canonical UTF-8 JSON with exact top-level keys:
120
-
121
79
  ```text
122
- schema_version, target, verdict, command, exit, counts, provenance,
123
- proof_level, expected, observed, reachability, artifacts, branches,
124
- 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
125
81
  ```
126
82
 
127
- `schema_version` is exactly `test-proof-v1`; unknown keys block. Branch IDs map
128
- one-to-one to exact unique Named probes. The digest is lowercase SHA-256 of
129
- stable JSON excluding only `payload_sha256`. Exact field shapes, nullable
130
- pre-execution `BLOCKED` rules, and aggregation live in
131
- `references/execution-strategy.md`.
132
-
133
- Only all required branches passing with exact command, exit 0, executed > 0,
134
- failed/skipped 0, matching Base/Head, `reachability.status: PASS`, valid artifact
135
- hashes, and safe redaction can aggregate `PASS`. Aggregate in this order:
136
- `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`.
137
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`.
138
86
  ## Persistent-write and authentication boundary
139
-
140
- - `.hapo/test-memory.json` is optional read-only context. Hash absent/present
141
- bytes before and after; never create, merge, or update it during proof.
142
- - Put only Test-owned temporary files outside the project and clean them.
143
- Never create Test-owned reports, caches, lazy installs, or auth state.
144
- - For authenticated UI proof, prefer the project's own auth helper. Otherwise
145
- use only an explicitly selected user-controlled profile bound to a confirmed
146
- HTTPS or localhost origin, identity, permissions, and action scope.
147
- - Block cross-origin redirects and destructive production actions without fresh
148
- consent. Never ask for, export, paste, or persist cookies or tokens.
149
- - Redact Authorization, Cookie, Set-Cookie, session tokens, credentials, and
150
- scoped PII from commands, headers/bodies, logs, screenshots, and reports.
151
- 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`.
152
92
 
153
93
  ## Verdict and report
154
-
155
94
  ```markdown
156
95
  ## Test Verdict
157
96
 
@@ -170,35 +109,12 @@ hashes, and safe redaction can aggregate `PASS`. Aggregate in this order:
170
109
  - [controller handoff, exact failure, or changed prerequisite]
171
110
  ```
172
111
 
173
- Do not place the full JSON payload, secrets, verbose raw logs, or screenshots in
174
- the concise report. `PASS_WITH_WARNINGS` remains unfinished; only literal
175
- validated `PASS` may be synchronized by the controller.
176
-
177
- When the target's task can be read — a process-first packet, or a packet
178
- `BLOCKED` while it is classified that still holds exactly one regular flat task
179
- with a readable `Command` and `Named probes` — end the final message with the
180
- concise report, then a `### Machine handoff (test-proof-v1)` heading and exactly
181
- one fenced `json` block holding the validated payload. The handoff block follows
182
- the report and is not part of it. No further fenced block follows it. A
183
- pre-execution `BLOCKED` takes the same placement; its shape is in
184
- `references/execution-strategy.md` §4. For any other target, end with the
185
- report and the line `No payload: target not identifiable.`
186
-
187
- ## Legacy workflow compatibility
188
-
189
- A valid legacy packet keeps the v2.1 adapter, legacy task resolution, and its
190
- separate receipt path. Do not write process-first inline proof into it. If
191
- legacy proof identities conflict or the packet is mixed/malformed, return
192
- `BLOCKED`; never choose one source or migrate it during unrelated testing.
193
-
194
- Flash legacy behavior remains proof-only: testing may make a current
195
- `FLASH_UNVERIFIED` task eligible for trusted sync-finalize, but never promotes
196
- state or unblocks dependents itself. Only explicit trusted sync-finalize may
197
- 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.
198
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.
199
117
  ## References
200
-
201
- - `references/execution-strategy.md` — routing, payload schema, aggregation,
202
- blast radius, UI safety, and report separation.
118
+ - `references/execution-strategy.md` — routing, payload schema, aggregation, blast radius, UI safety, and report separation.
203
119
  - `references/failure-triage.md` — failure classification and four verdicts.
204
120
  - `references/test-memory.md` — optional read-only historical context.
@@ -20,27 +20,20 @@ marker. Resolve all accepted paths inside the target feature directory.
20
20
  marker, malformed or duplicate task fields, symlink, directory, device, or
21
21
  other nonregular flat marker returns `BLOCKED`.
22
22
 
23
- ### Legacy markers
23
+ ### Packets the runtime no longer reads
24
24
 
25
- - Legacy markers are `spec.json`, nested legacy tasks, or separate legacy
26
- receipts. Detect them even when orphaned or broken.
27
- - Legacy is selected only when a regular schema-valid `spec.json` has one
28
- consistent identity and registry resolving every contained nested task and
29
- receipt, and no flat marker exists.
30
- - Orphan nested tasks/receipts, absent or schema-invalid root, conflicting
31
- identities, symlinks, nonregular markers, or unresolved/out-of-root entries
32
- return `BLOCKED`.
25
+ - A packet directory with no `plan.md` that holds the old JSON planning state is not
26
+ read by CafeKit. Return `BLOCKED` and name it; never migrate it while testing.
27
+ - Other files beside a valid `plan.md` do not change its classification.
33
28
 
34
29
  ### Precedence truth table
35
30
 
36
- | Flat state | Legacy state | Result |
31
+ | Flat state | Old planning state without `plan.md` | Result |
37
32
  |---|---|---|
38
- | valid | absent | process-first |
39
- | absent | valid | legacy adapter |
33
+ | valid | any | process-first |
34
+ | invalid | any | `BLOCKED` |
35
+ | absent | present | `BLOCKED`: unsupported, move the work to a `plan.md` packet |
40
36
  | absent | absent | ordinary non-Spec scope |
41
- | any marker | any marker | `BLOCKED` mixed state |
42
- | invalid | absent | `BLOCKED` |
43
- | absent | invalid | `BLOCKED` |
44
37
 
45
38
  Do not infer that an invalid marker is absent. Testing never repairs, migrates,
46
39
  renames, deletes, or chooses between conflicting packet identities.
@@ -181,7 +174,7 @@ packet failed classification after the repository had a commit:
181
174
  },
182
175
  "proof_level": "source",
183
176
  "expected": "both Named probes pass under `node --test test/login.test.js`",
184
- "observed": "BLOCKED before execution: specs/user-auth also holds spec.json, a legacy marker",
177
+ "observed": "BLOCKED before execution: specs/user-auth/task-01-login.md is a symlink",
185
178
  "reachability": {
186
179
  "status": "BLOCKED",
187
180
  "evidence": [
@@ -287,9 +280,5 @@ Do not paste verbose raw output, full JSON, credentials, PII, or screenshots int
287
280
  the report. Do not write a report file during proof. Process-first Status and
288
281
  inline `## Receipt` remain controller-only.
289
282
 
290
- ## Legacy workflow compatibility
291
-
292
- After a valid legacy route, preserve its v2.1 task/receipt adapter and existing
293
- proof rules. Separate legacy receipts remain legacy-only. Never search for or
294
- create a separate receipt for a process-first task, and never copy a legacy
295
- receipt into a flat task.
283
+ Proof for a process-first task lives only in its inline `## Receipt`; never
284
+ search for or create a receipt file beside it.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cf:ui-ux
3
- description: "Build, review, or redesign an in-app screen (dashboard, list, table, form, settings, modal) the way a designer works: brief, 2–3 wireframes, the user picks, then build with the project's own components and measure the page with a browser probe. Other routes on request: review an existing UI ('xem giúp', 'review', 'nhìn rối', 'what's wrong'), rebuild keeping the brand ('giữ brand', 'keep the brand'), rebuild in the skill's own style ('bỏ style cũ'), refactor keeping the look ('chuyển sang Tailwind'), build right away ('dựng luôn', 'just build it'), design system first ('UI kit', 'component library'), a simple logo ('làm logo', 'design a logo'), or fix one component. Triggers: 'dựng màn', 'thiết kế', 'làm UI cho đẹp', 'làm lại UX', 'build a page', 'design this screen', 'redesign', 'make it look good', 'ecommerce', 'ui-ux', 'evon'. Landing pages, storefronts and blogs are not covered (it still builds them, with a warning)."
3
+ description: "Build, review, or redesign an in-app screen (dashboard, list, table, form, settings, modal) the way a designer works: brief, 2–3 wireframes, the user picks, then build with the project's own components and measure the page with a browser probe. On request it also reviews an existing UI, rebuilds with or without the current brand, refactors styling while keeping the look, builds immediately without wireframes, builds a design system or component kit first, makes a simple logo, or fixes one component, for Vietnamese or English requests ('dựng màn', 'thiết kế', 'làm UI cho đẹp', 'làm lại UX', 'xem giúp', 'nhìn rối', 'giữ brand', 'bỏ style cũ', 'dựng luôn', 'làm logo', 'build a page', 'redesign', 'ui-ux', 'evon'). Landing pages, storefronts and blogs are not covered (it still builds them, with a warning)."
4
4
  license: MIT
5
5
  user-invocable: true
6
6
  when_to_use: "Invoke to build, review, or redesign an app screen with wireframes and a measured probe; for palette, font, or UX-guideline lookups use cf:ui-ux-pro-max."