@haposoft/cafekit 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/bin/__tests__/claude-settings.test.js +123 -0
- package/bin/__tests__/codex-ask-guard.test.js +123 -0
- package/bin/__tests__/codex-ask-projection.test.js +51 -0
- package/bin/__tests__/codex-hooks-ownership.test.js +80 -1
- package/bin/__tests__/codex-hooks.test.js +938 -237
- package/bin/__tests__/codex-native-hook-boundaries.test.js +136 -0
- package/bin/__tests__/codex-native.test.js +222 -149
- package/bin/__tests__/codex-projection-parity.test.js +314 -0
- package/bin/__tests__/codex-quiet-hooks.test.js +170 -0
- package/bin/__tests__/codex-research-projection.test.js +70 -0
- package/bin/__tests__/codex-specs-projection.test.js +76 -0
- package/bin/__tests__/develop-contract.test.js +102 -1362
- package/bin/__tests__/docs-sync-on-demand.test.js +25 -20
- package/bin/__tests__/inspect-paths.test.js +183 -0
- package/bin/__tests__/installer-safety.test.js +335 -0
- package/bin/__tests__/legacy-authority-decoupled.test.js +14 -19
- package/bin/__tests__/legacy-hooks-retired.test.js +18 -8
- package/bin/__tests__/omp-bridge.test.js +66 -12
- package/bin/__tests__/omp-hooks.test.js +11 -5
- package/bin/__tests__/orca-session.test.js +7 -0
- package/bin/__tests__/package-inventory.test.js +1 -395
- package/bin/__tests__/privacy-paths.test.js +317 -0
- package/bin/__tests__/spec-narrowing.test.js +30 -134
- package/bin/__tests__/specs-v2-execution-closeout.test.js +0 -372
- package/bin/__tests__/test-runtime-dependency-closure.cjs +1 -2
- package/bin/__tests__/usage-hook-retired.test.js +5 -3
- package/bin/__tests__/validator-grounding.test.js +17 -2929
- package/bin/install.js +25 -0
- package/bin/lib/codex-install.js +134 -12
- package/bin/lib/context.js +1 -1
- package/bin/lib/managed-writer.js +2 -3
- package/bin/phases/claude-runtime.js +91 -25
- package/bin/phases/claude-settings.js +22 -1
- package/bin/phases/codex-hooks.js +96 -33
- package/bin/phases/codex-runtime.js +45 -49
- package/bin/phases/copy-payload.js +11 -28
- package/bin/phases/omp-runtime.js +6 -3
- package/package.json +2 -3
- package/src/claude/CLAUDE.md +4 -0
- package/src/claude/agents/code-auditor.md +9 -6
- package/src/claude/agents/debugger.md +3 -9
- package/src/claude/agents/docs-keeper.md +4 -7
- package/src/claude/agents/git-ops.md +2 -4
- package/src/claude/agents/implementer.md +6 -7
- package/src/claude/agents/inspector.md +2 -0
- package/src/claude/agents/project-manager.md +2 -2
- package/src/claude/agents/spec-maker.md +4 -4
- package/src/claude/agents/test-runner.md +8 -11
- package/src/claude/agents/ui-ux-designer.md +0 -1
- package/src/claude/gitignore +3 -0
- package/src/claude/hooks/__tests__/installed-root.test.js +111 -0
- package/src/claude/hooks/__tests__/precompact.test.js +206 -10
- package/src/claude/hooks/__tests__/privacy-block.test.js +27 -0
- package/src/claude/hooks/__tests__/session-writeenv.test.js +25 -0
- package/src/claude/hooks/__tests__/spec-gate.test.js +311 -340
- package/src/claude/hooks/__tests__/spec-state-touched.test.js +230 -8
- package/src/claude/hooks/__tests__/state.test.js +207 -7
- package/src/claude/hooks/__tests__/update-check.test.js +88 -0
- package/src/claude/hooks/agent.cjs +7 -6
- package/src/claude/hooks/inspect-block.cjs +15 -63
- package/src/claude/hooks/lib/inspect-paths.cjs +304 -0
- package/src/claude/hooks/lib/parser.cjs +1 -1
- package/src/claude/hooks/lib/privacy-command-analysis.cjs +191 -17
- package/src/claude/hooks/lib/privacy-paths.cjs +313 -0
- package/src/claude/hooks/lib/project-root.cjs +15 -0
- package/src/claude/hooks/lib/rules-reservation.cjs +36 -0
- package/src/claude/hooks/lib/spec-touch.cjs +67 -0
- package/src/claude/hooks/lib/update-check.cjs +77 -0
- package/src/claude/hooks/precompact.cjs +8 -15
- package/src/claude/hooks/privacy-block.cjs +23 -205
- package/src/claude/hooks/rules.cjs +6 -28
- package/src/claude/hooks/session.cjs +34 -117
- package/src/claude/hooks/spec-gate.cjs +17 -89
- package/src/claude/hooks/spec-state.cjs +89 -96
- package/src/claude/hooks/state.cjs +96 -51
- package/src/claude/migration-manifest.json +20 -8
- package/src/claude/output-styles/coding-level-0-eli5.md +9 -9
- package/src/claude/output-styles/coding-level-1-junior.md +3 -3
- package/src/claude/output-styles/coding-level-2-mid.md +3 -3
- package/src/claude/output-styles/coding-level-3-senior.md +2 -2
- package/src/claude/output-styles/coding-level-4-lead.md +5 -5
- package/src/claude/output-styles/coding-level-5-god.md +6 -6
- package/src/claude/rules/ai-dev-rules.md +1 -2
- package/src/claude/rules/hook-protocols.md +1 -1
- package/src/claude/rules/workflow.md +1 -1
- package/src/claude/runtime.json +0 -3
- package/src/claude/scripts/generate-skill-catalog.cjs +2 -2
- package/src/claude/scripts/provenance.cjs +14 -0
- package/src/claude/scripts/spec-receipt.cjs +0 -114
- package/src/claude/scripts/spec-resolver.cjs +41 -457
- package/src/claude/scripts/workflow-policy.cjs +3 -1801
- package/src/claude/settings/settings.json +1 -1
- package/src/claude/skills/agent-browser/SKILL.md +1 -1
- package/src/claude/skills/ai-multimodal/scripts/check_setup.py +8 -68
- package/src/claude/skills/ai-multimodal/scripts/gemini_batch_process.py +6 -28
- package/src/claude/skills/chrome-devtools/SKILL.md +14 -31
- package/src/claude/skills/code-review/SKILL.md +25 -108
- package/src/claude/skills/code-review/references/spec-compliance-review.md +4 -7
- package/src/claude/skills/develop/SKILL.md +22 -70
- package/src/claude/skills/develop/references/subagent-patterns.md +0 -6
- package/src/claude/skills/git/SKILL.md +1 -1
- package/src/claude/skills/git/references/worktree-blueprint.md +1 -1
- package/src/claude/skills/research/SKILL.md +24 -55
- package/src/claude/skills/sync/SKILL.md +12 -34
- package/src/claude/skills/sync/references/rebind-and-audit.md +2 -2
- package/src/claude/skills/test/SKILL.md +39 -123
- package/src/claude/skills/test/references/execution-strategy.md +11 -22
- package/src/claude/skills/ui-ux/SKILL.md +1 -1
- package/src/claude/skills/ui-ux-pro-max/SKILL.md +24 -79
- package/src/claude/skills/web-testing/SKILL.md +2 -20
- package/src/codex/AGENTS.md +8 -0
- package/src/codex/hooks/ask-guard.cjs +54 -0
- package/src/codex/hooks/inspect-block.cjs +11 -7
- package/src/codex/hooks/lib/inspect-paths.cjs +1 -199
- package/src/codex/hooks/lib/privacy-paths.cjs +1 -0
- package/src/codex/hooks/lib/privacy-state.cjs +98 -16
- package/src/codex/hooks/lib/rules-reservation.cjs +38 -0
- package/src/codex/hooks/lib/secret-keywords.cjs +1 -0
- package/src/codex/hooks/lib/spec-receipt.cjs +2 -30
- package/src/codex/hooks/lib/spec-session-touch.cjs +100 -0
- package/src/codex/hooks/lib/spec-touch.cjs +3 -0
- package/src/codex/hooks/lib/spec-utils.cjs +6 -45
- package/src/codex/hooks/lib/update-check.cjs +1 -0
- package/src/codex/hooks/precompact.cjs +39 -0
- package/src/codex/hooks/privacy-approval.cjs +28 -17
- package/src/codex/hooks/privacy-block.cjs +9 -215
- package/src/codex/hooks/rules.cjs +4 -30
- package/src/codex/hooks/secret-output-guardrail.cjs +1 -1
- package/src/codex/hooks/session.cjs +47 -11
- package/src/codex/hooks/spec-gate.cjs +32 -74
- package/src/codex/hooks/spec-state.cjs +68 -46
- package/src/codex/hooks/state.cjs +25 -4
- package/src/codex/hooks.json +39 -7
- package/src/codex/rules/hook-protocols.md +13 -6
- package/src/common/AGENTS.md +4 -10
- package/src/omp/extensions/cafekit-bridge.mjs +12 -4
- package/src/omp/hooks/privacy-block.cjs +24 -206
- package/bin/__tests__/change-firewall.semantic-firewall.test.js +0 -2133
- package/bin/__tests__/finalizer-pass-gate.semantic-firewall.test.js +0 -342
- package/bin/__tests__/release-preflight.semantic-firewall.test.js +0 -586
- package/bin/__tests__/review-receipt-c2.semantic-firewall.test.js +0 -378
- package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +0 -665
- package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +0 -1132
- package/src/claude/hooks/lib/context.cjs +0 -527
- package/src/claude/hooks/lib/detect.cjs +0 -474
- package/src/claude/scripts/change-firewall.cjs +0 -1748
- package/src/claude/scripts/spec-authoring-digest.cjs +0 -151
- package/src/claude/scripts/spec-authoring-validation.cjs +0 -126
- package/src/claude/scripts/spec-final-state.cjs +0 -290
- package/src/claude/scripts/spec-ground.cjs +0 -650
- package/src/claude/scripts/spec-readiness.cjs +0 -425
- package/src/claude/scripts/spec-scaffold.cjs +0 -2317
- package/src/claude/scripts/spec-semantic-model.cjs +0 -396
- package/src/claude/scripts/validate-spec-output.cjs +0 -3914
- package/src/claude/skills/code-review/references/verification-gate.md +0 -41
- package/src/claude/skills/specs/templates/design.md +0 -82
- package/src/claude/skills/specs/templates/requirements-init.md +0 -8
- package/src/claude/skills/specs/templates/requirements.md +0 -42
- package/src/claude/skills/specs/templates/spec-state.json +0 -56
- package/src/claude/skills/specs/templates/task.md +0 -47
- package/src/codex/rules/state-sync.md +0 -60
|
@@ -12,10 +12,7 @@ metadata:
|
|
|
12
12
|
---
|
|
13
13
|
# Develop — implement, prove, synchronize
|
|
14
14
|
|
|
15
|
-
Implement only the explicitly requested scope. For a process-first feature,
|
|
16
|
-
`plan.md` and flat tasks are the durable packet; one closeout owner coordinates
|
|
17
|
-
verification, review, sync, and docs impact without borrowing evidence.
|
|
18
|
-
Develop never starts merely because Specs finished. The user invokes it.
|
|
15
|
+
Implement only the explicitly requested scope. For a process-first feature, `plan.md` and flat tasks are the durable packet; one closeout owner coordinates verification, review, sync, and docs impact without borrowing evidence. Develop never starts merely because Specs finished. The user invokes it.
|
|
19
16
|
|
|
20
17
|
## Usage and pre-state guard
|
|
21
18
|
|
|
@@ -28,8 +25,7 @@ Develop never starts merely because Specs finished. The user invokes it.
|
|
|
28
25
|
/cf:develop <feature> --notes
|
|
29
26
|
```
|
|
30
27
|
|
|
31
|
-
`--notes` is opt-in. Only then load `references/implementation-notes-template.html`;
|
|
32
|
-
record decisions, scope exceptions, risks, gaps, and verification limits. Never create it by default.
|
|
28
|
+
`--notes` is opt-in. Only then load `references/implementation-notes-template.html`; record decisions, scope exceptions, risks, gaps, and verification limits. Never create it by default.
|
|
33
29
|
|
|
34
30
|
Before any state mutation, reject `--flash` combined with `--parallel`:
|
|
35
31
|
|
|
@@ -41,31 +37,22 @@ The pair exits `2` before a task edit, receipt, worktree, subagent, or commit. D
|
|
|
41
37
|
|
|
42
38
|
## Resolve the work packet
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
- Resolve one `specs/<feature>/plan.md` plus flat `task-NN-*.md`; an explicit task path wins.
|
|
41
|
+
- Read GATE-SCOPE scope, exclusions, acceptance mapping, ownership, and task order.
|
|
42
|
+
- A task is unblocked only when every named dependency is `done` with a valid current inline Receipt.
|
|
43
|
+
- Without a packet, work directly only when the change is clear, isolated, reversible, and low-risk.
|
|
48
44
|
|
|
49
45
|
Ambiguity, overlapping ownership, a dependency cycle, or a missing Verification Plan is a blocker. Do not guess.
|
|
50
46
|
|
|
51
47
|
### Accepted process-first fast path
|
|
52
48
|
|
|
53
|
-
When line two is `Specs-Contract: process-first-ready-v1`, reuse the accepted GATE-SCOPE/GATE-REVIEW.
|
|
54
|
-
Perform only a narrow freshness scout for target revision, scope drift, ownership
|
|
55
|
-
conflict, and dependency/state changes. Reopen GATE-SCOPE only for evidenced scope drift;
|
|
56
|
-
do not research, replan, or add a routine user gate before a real blocker or GATE-DONE.
|
|
57
|
-
This is a source instruction contract, not a parser/runtime or live-model guarantee;
|
|
58
|
-
live-model adherence is `[UNVERIFIED]` without a host invocation.
|
|
49
|
+
When line two is `Specs-Contract: process-first-ready-v1`, reuse the accepted GATE-SCOPE/GATE-REVIEW. Perform only a narrow freshness scout for target revision, scope drift, ownership conflict, and dependency/state changes. Reopen GATE-SCOPE only for evidenced scope drift; do not research, replan, or add a routine user gate before a real blocker or GATE-DONE. This is a source instruction contract, not a parser/runtime or live-model guarantee; live-model adherence is `[UNVERIFIED]` without a host invocation.
|
|
59
50
|
|
|
60
|
-
Load the plan index into working context once. Later byte rereads are narrow drift
|
|
61
|
-
checks; load only the active task's referenced coverage-profile rows, Outcome,
|
|
62
|
-
Scope, Ownership, Steps, Acceptance, Dependencies, Verification Plan, Failure Protocol, owned code, and consumers.
|
|
51
|
+
Load the plan index into working context once. Later byte rereads are narrow drift checks; load only the active task's referenced coverage-profile rows, Outcome, Scope, Ownership, Steps, Acceptance, Dependencies, Verification Plan, Failure Protocol, owned code, and consumers.
|
|
63
52
|
|
|
64
53
|
## Current-byte selection
|
|
65
54
|
|
|
66
|
-
Reread current plan/task bytes before each selection and controller write. Concurrent
|
|
67
|
-
Develop invocations are unsupported; detected state, task, or owned-path drift stops
|
|
68
|
-
before any Status or Receipt write.
|
|
55
|
+
Reread current plan/task bytes before each selection and controller write. Concurrent Develop invocations are unsupported; detected state, task, or owned-path drift stops before any Status or Receipt write.
|
|
69
56
|
|
|
70
57
|
| Current bytes | Feature mode | Explicit task mode |
|
|
71
58
|
|---|---|---|
|
|
@@ -77,89 +64,54 @@ before any Status or Receipt write.
|
|
|
77
64
|
| No task is active | Select the first dependency-valid `pending` row in `plan.md` order. | Start only the exact pending target when dependencies are valid. |
|
|
78
65
|
| Status is missing, duplicate, or unknown | Stop as malformed state. | Stop as malformed state. |
|
|
79
66
|
|
|
80
|
-
Feature mode repeats this selection only after the current task closes. Specific-task
|
|
81
|
-
mode never touches a sibling and returns after its successful sync without chaining or GATE-DONE.
|
|
67
|
+
Feature mode repeats this selection only after the current task closes. Specific-task mode never touches a sibling and returns after its successful sync without chaining or GATE-DONE.
|
|
82
68
|
|
|
83
69
|
## Modes
|
|
84
70
|
|
|
85
71
|
### Sequential feature or specific task
|
|
86
72
|
|
|
87
|
-
The controller sets the selected task's single `Status:` to `in_progress`.
|
|
88
|
-
Implement its Outcome and Acceptance only. Keep one unblocked task at a time;
|
|
89
|
-
never start the next before proof, review, and sync finish for the current task.
|
|
73
|
+
The controller sets the selected task's single `Status:` to `in_progress`. Implement its Outcome and Acceptance only. Keep one unblocked task at a time; never start the next before proof, review, and sync finish for the current task.
|
|
90
74
|
|
|
91
75
|
### Parallel (`--parallel [N]`)
|
|
92
76
|
|
|
93
|
-
Load `references/parallel-waves.md`. Require disjoint writes, satisfied dependencies,
|
|
94
|
-
isolated worktrees, a bounded wave, and one controller writer; otherwise work sequentially.
|
|
77
|
+
Load `references/parallel-waves.md`. Require disjoint writes, satisfied dependencies, isolated worktrees, a bounded wave, and one controller writer; otherwise work sequentially.
|
|
95
78
|
|
|
96
79
|
### Flash (`--flash`)
|
|
97
80
|
|
|
98
|
-
Load `references/quality-gate.md`. Flash is an explicit speed trade-off, never completion: run a
|
|
99
|
-
cheap preflight, skip dedicated tests, keep `Status: in_progress` with `FLASH_UNVERIFIED` and the
|
|
100
|
-
blocker `awaiting /cf:test <feature>`, do not unblock dependents or report PASS, and
|
|
101
|
-
stop this invocation without chaining.
|
|
102
|
-
Only a later explicit non-Flash invocation may recover the task.
|
|
103
|
-
It treats Flash output as ephemeral, inspects current bytes and the owned diff, and obtains fresh
|
|
104
|
-
canonical proof through the trusted sync-finalize path. Never weaken, delete, or rewrite tests to make Flash look complete.
|
|
81
|
+
Load `references/quality-gate.md`. Flash is an explicit speed trade-off, never completion: run a cheap preflight, skip dedicated tests, keep `Status: in_progress` with `FLASH_UNVERIFIED` and the blocker `awaiting /cf:test <feature>`, do not unblock dependents or report PASS, and stop this invocation without chaining. Only a later explicit non-Flash invocation may recover the task. It treats Flash output as ephemeral, inspects current bytes and the owned diff, and obtains fresh canonical proof through the trusted sync-finalize path. Never weaken, delete, or rewrite tests to make Flash look complete.
|
|
105
82
|
|
|
106
83
|
## Task cycle
|
|
107
84
|
|
|
108
85
|
### 1. Scout
|
|
109
86
|
|
|
110
|
-
Trace entrypoints, callers, dependents, registration, errors, and owned files.
|
|
111
|
-
Read the test or probe that will judge this task before implementing against it.
|
|
112
|
-
Compilation does not prove an unmounted UI, unregistered route, uncalled service,
|
|
113
|
-
or missing consumer.
|
|
87
|
+
Trace entrypoints, callers, dependents, registration, errors, and owned files. Read the test or probe that will judge this task before implementing against it. Compilation does not prove an unmounted UI, unregistered route, uncalled service, or missing consumer.
|
|
114
88
|
|
|
115
|
-
For an interrupted `in_progress` task, preserve and inspect current owned changes;
|
|
116
|
-
discard ephemeral, remembered, or prior-attempt proof; compare unmet Acceptance
|
|
117
|
-
against current task bytes and owned diff. Do not blindly replay a non-idempotent
|
|
118
|
-
mutation. Resume only unmet work, then run fresh verification.
|
|
89
|
+
For an interrupted `in_progress` task, preserve and inspect current owned changes; discard ephemeral, remembered, or prior-attempt proof; compare unmet Acceptance against current task bytes and owned diff. Do not blindly replay a non-idempotent mutation. Resume only unmet work, then run fresh verification.
|
|
119
90
|
|
|
120
91
|
### 2. Implement
|
|
121
92
|
|
|
122
93
|
Unless under `--flash` or the command costs money or writes artifacts, run the task's exact Verification Plan command once before changing anything and expect it to fail; this pre-change run is not a repair round.
|
|
123
94
|
Passing before any change, outside a resumed task, means the plan cannot judge the work and is a blocker; so is a failure naming something other than the unmet Acceptance, which is a blocker to raise, not a defect to work around while implementing. A failure from the command itself — a wrong path, a missing tool or module, the environment — is BLOCKED, not FAIL, even when the runner reports `not ok` and even when the Acceptance or a test file shows the right command: set the task's single `Status:` to `blocked` with a `Blocker:` line naming the command and its error, write no Receipt, revert any edit made in this run, and report; you may suggest a corrected command for the plan, but never run it as proof.
|
|
124
95
|
|
|
125
|
-
Honor Scope, Ownership, Acceptance, and Dependencies. Do not silently replace named contracts;
|
|
126
|
-
scope expansion requires evidence and a return to GATE-SCOPE, not implementation convenience.
|
|
127
|
-
Load `references/subagent-patterns.md` when dispatch helps; only the controller writes Status or Receipt.
|
|
96
|
+
Honor Scope, Ownership, Acceptance, and Dependencies. Do not silently replace named contracts; scope expansion requires evidence and a return to GATE-SCOPE, not implementation convenience. Load `references/subagent-patterns.md` when dispatch helps; only the controller writes Status or Receipt.
|
|
128
97
|
|
|
129
98
|
### 3. Verify, review, and close
|
|
130
99
|
|
|
131
|
-
The test owner executes each exact Verification Plan and records real output. The
|
|
132
|
-
review owner evaluates correctness, security, scope, and reachability without
|
|
133
|
-
manufacturing proof. Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; only literal PASS can close.
|
|
100
|
+
The test owner executes each exact Verification Plan and records real output. The review owner evaluates correctness, security, scope, and reachability without manufacturing proof. Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; only literal PASS can close.
|
|
134
101
|
|
|
135
|
-
Load `references/quality-gate.md`. Remediate an observed failure (a blocked Command is not a failure to remediate), then rerun only
|
|
136
|
-
affected proof/review. Do not blind-retry a blocked environment. One repair round is one
|
|
137
|
-
observed failure plus its repair and rerun, from proof or from review alike. After three
|
|
138
|
-
failed repair rounds, stop and ask the user.
|
|
102
|
+
Load `references/quality-gate.md`. Remediate an observed failure (a blocked Command is not a failure to remediate), then rerun only affected proof/review. Do not blind-retry a blocked environment. One repair round is one observed failure plus its repair and rerun, from proof or from review alike. After three failed repair rounds, stop and ask the user.
|
|
139
103
|
|
|
140
|
-
**The Receipt is written last, after proof and review have both passed**; writing it earlier
|
|
141
|
-
and reopening the task is a defect, not a shortcut. After a real pass, the controller writes the task's final inline `## Receipt` with
|
|
142
|
-
`Verification: PASS`, exact `Command`, `Exit: 0`, `Base:` and `Head:` copied from the `Base` and `Head` fields of `node .claude/scripts/provenance.cjs --project-root . --specs-root specs --spec-file <task file> --feature-name <feature> --session <any label> --json` run after the last change outside the specs root (never typed or computed by hand),
|
|
143
|
-
non-empty current output, and required negative/reachability/artifact proof; then it
|
|
144
|
-
sets `Status: done` and only implemented checkboxes. Missing, stale, contradictory,
|
|
145
|
-
zero-test, placeholder, marker-only, skipped, or remembered proof is unfinished.
|
|
104
|
+
**The Receipt is written last, after proof and review have both passed**; writing it earlier and reopening the task is a defect, not a shortcut. After a real pass, the controller writes the task's final inline `## Receipt` with `Verification: PASS`, exact `Command`, `Exit: 0`, `Base:` and `Head:` copied from the `Base` and `Head` fields of `node .claude/scripts/provenance.cjs --project-root . --specs-root specs --spec-file <task file> --feature-name <feature> --session <any label> --json` run after the last change outside the specs root (never typed or computed by hand), non-empty current output in a fenced block, and required negative/reachability/artifact proof; then it sets `Status: done` and only implemented checkboxes. Missing, stale, contradictory, zero-test, placeholder, marker-only, skipped, or remembered proof is unfinished.
|
|
146
105
|
|
|
147
106
|
### 4. Finish the requested boundary
|
|
148
107
|
|
|
149
|
-
Reread the task after sync and recompute the queue from current bytes. Specific-task
|
|
150
|
-
mode has already returned. Full-feature mode continues one task at a time, then runs
|
|
151
|
-
the named feature-level integration and reachability checks. Before GATE-DONE, apply the
|
|
152
|
-
quality-gate final-Head fixed point; show current evidence and limitations, and let
|
|
153
|
-
the user decide completion.
|
|
108
|
+
Reread the task after sync and recompute the queue from current bytes. Specific-task mode has already returned. Full-feature mode continues one task at a time, then runs the named feature-level integration and reachability checks. Before GATE-DONE, apply the quality-gate final-Head fixed point; show current evidence and limitations, and let the user decide completion.
|
|
154
109
|
|
|
155
|
-
Evaluate docs impact from behavior actually changed: `none` means report only;
|
|
156
|
-
`minor` or `major` updates only affected existing docs through the docs flow.
|
|
110
|
+
Evaluate docs impact from behavior actually changed: `none` means report only; `minor` or `major` updates only affected existing docs through the docs flow.
|
|
157
111
|
|
|
158
112
|
## Definition of done
|
|
159
113
|
|
|
160
|
-
Done requires satisfied acceptance, reachable behavior, current executable proof,
|
|
161
|
-
stable Base/Head binding, resolved blocking review findings, and no scope substitution.
|
|
162
|
-
`PASS_WITH_WARNINGS`, `NO_TESTS`, `FLASH_UNVERIFIED`, or review-only pass cannot close.
|
|
114
|
+
Done requires satisfied acceptance, reachable behavior, current executable proof, stable Base/Head binding, resolved blocking review findings, and no scope substitution. `PASS_WITH_WARNINGS`, `NO_TESTS`, `FLASH_UNVERIFIED`, or review-only pass cannot close.
|
|
163
115
|
|
|
164
116
|
## Attached references
|
|
165
117
|
|
|
@@ -50,9 +50,3 @@ After interruption, preserve the owned diff but discard ephemeral handoffs and
|
|
|
50
50
|
remembered proof. Do not tell an implementation worker to repeat a non-idempotent
|
|
51
51
|
action blindly; scope the resumed brief to unmet Acceptance and require fresh
|
|
52
52
|
verification. Concurrent invocations remain unsupported, so drift blocks handoff.
|
|
53
|
-
|
|
54
|
-
## Legacy workflow compatibility
|
|
55
|
-
|
|
56
|
-
When the selected packet is legacy, include its persisted lane snapshot and
|
|
57
|
-
obligations in the dispatch, but do not let workers edit that state or infer an
|
|
58
|
-
independent result from a role label.
|
|
@@ -24,7 +24,7 @@ Present options via AskUserQuestion — header "Git Operation": commit / push /
|
|
|
24
24
|
`gh repo view --json defaultBranchRef` or `origin/HEAD`; never assume `main`/`develop`.
|
|
25
25
|
- `finish`: fresh `git status` + verification, then present exactly 4 options:
|
|
26
26
|
merge locally / push + PR / keep branch-worktree / discard (typed confirmation, as in the worktree lifecycle: `remove <dir-name>` / `delete <branch>`).
|
|
27
|
-
- `worktree <desc>`: sibling dir `../<project>-<branch>` for isolated setup, branched from the current branch unless the user names a base, hydrating the installer-ignored `.claude/`, `.codex/`, `.agents/` it lacks. Git alone is enough (plus `rsync`); Orca, Herdr and
|
|
27
|
+
- `worktree <desc>`: sibling dir `../<project>-<branch>` for isolated setup, branched from the current branch unless the user names a base, hydrating the installer-ignored `.claude/`, `.codex/`, `.agents/` it lacks. Git alone is enough (plus `rsync`); Orca, Herdr and the host's own worktree are optional shortcuts, never required.
|
|
28
28
|
- `worktree list | remove <dir> | prune`: lifecycle in `references/worktree-blueprint.md` — never lose uncommitted, ignored or unmerged work: before `git worktree remove`, check `git -C <dir> status --porcelain --ignored` and `git -C <dir> log --oneline <base>..HEAD`, never `--force`, and anything they show needs the typed `remove <dir-name>`; use `git worktree prune` for a missing directory, never `rm -rf`.
|
|
29
29
|
|
|
30
30
|
## Hard rules for `commit`
|
|
@@ -19,7 +19,7 @@ Tuỳ theo `<feature-description>`, hãy sinh ra một cái tên nhánh dạng K
|
|
|
19
19
|
*Lưu ý: Nếu User chủ động gõ tên có sẵn mã Jira (TD-1234) hoặc tên tuyệt đối thì bỏ qua prefix Type.*
|
|
20
20
|
|
|
21
21
|
### Bước 3: Khởi Sinh Worktree (Sibling Pattern)
|
|
22
|
-
**Mặc định luôn là cấp Sibling (`../`)**: skill không bao giờ tự tạo worktree lồng bên trong repo. Một đường dẫn lồng
|
|
22
|
+
**Mặc định luôn là cấp Sibling (`../`)**: skill không bao giờ tự tạo worktree lồng bên trong repo. Một đường dẫn lồng dưới runtime đã bị ignore chỉ chấp nhận khi chính người dùng hoặc công cụ host đã đặt tên và tạo ra nó; khi còn worktree lồng, không chạy `git clean -fdx` ở root repo vì nó xoá cả thư mục bị ignore.
|
|
23
23
|
|
|
24
24
|
Lối tắt tùy chọn (không bắt buộc, không phải điều kiện): `claude --worktree`, Orca, Herdr. Chỉ cần `git` (thêm `rsync` cho Bước 4); máy không có công cụ nào khác vẫn làm đủ mọi bước.
|
|
25
25
|
|
|
@@ -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
|
-
##
|
|
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
|
-
##
|
|
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
|
-
##
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
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
|
|
55
|
-
| Any flat marker that is orphaned, malformed, duplicated, symlinked,
|
|
56
|
-
|
|
|
57
|
-
|
|
|
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`.
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
|
|
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.
|