chore(contract): phase 2 STEP 3 gate [gated] (plan r3, amendments a-c, interactive ask fact), criteria 11-15
This commit is contained in:
1 parent
fccdb1e8c9
commit
eb29e8ce5e
1 file changed
+29
-4
@@ -40,6 +40,10 @@ Brainstorm answers `[gated 2026-11-02]` (user: "oui aux recommandations", recomm
|
||||
8. Code-limits hook: once per file per session (TMPDIR sentinel keyed on session_id), added lines from `git diff -U0` when the file is tracked else new_string/content, columns in characters, extensions sh bash ts js mjs py rs jq, fires in sub-agents too.
|
||||
9. Dead deny entries: removal is the user's hand edit (list handed over); P41: README and SETTINGS.md corrected, the template ask list stays.
|
||||
|
||||
Plan challenge round 1 (2026-11-02, correctness FATAL(8), robustness FATAL(5), simplicity CONCERNS(1)) → plan r2; three amendments reverse or widen gated answers and await the user at the STEP 3 gate: (a) answer 2: the guard latches on any skill run in the session instead of adding 16 routing rows; (b) answer 5: `Bash(git -C * merge *)` dropped, `Bash(bash "*gitflow.sh" finish*)` added; (c) answer 7: extra shell and `cat` flag forms, each bench-approved. See the spec § R2 amendments.
|
||||
|
||||
STEP 3 gate `[gated 2026-11-02]` (user: "oui aux trois, le prompt s'affiche, lance"): plan r3 (`docs/superpowers/plans/2026-11-02-phase2-guards.md`, fccdb1e) approved; amendments (a) skill latch instead of rows, (b) `git -C * merge *` dropped + quoted finish rule, (c) extra shell and `cat` flag forms (bench-approved only) accepted. Interactive fact, user-run 2026-11-02 in an auto-mode session with `--settings '{"permissions":{"ask":["Bash(git merge *)"]}}'`: `git merge -h` raised the prompt "Ask rule Bash(git merge *) overrides auto mode for this command" (Yes / No). Task 8 may state that `ask` prompts under auto mode.
|
||||
|
||||
## ACCEPTANCE CRITERIA (seed, enriched at STEP 3 `[gated]`)
|
||||
1. settings.json `permissions.ask` holds the merge-gate rules decided at the brainstorm; each is proven in the bench (`run.sh` analogue, `--setting-sources local`) to prompt/deny the finish and merge forms and to leave `gitflow.sh start` and plain git free; the bench rows are saved under `.claude/tasks/plans/<date>-phase2-bench/`.
|
||||
2. settings.json `permissions.ask` gains the shell forms and `permissions.deny` gains `Bash(awk *system(*` plus the `rtk read` twins decided at the brainstorm, each proven in the bench; no existing deny entry removed (T41/T42 green); `Bash(/*)` absent.
|
||||
@@ -55,10 +59,31 @@ Brainstorm answers `[gated 2026-11-02]` (user: "oui aux recommandations", recomm
|
||||
9. Proof recorded (plan, journal): the routing bench L3 prompt enters a skill in a clone under the guard; the long-brief replay; `/close` ritual finishes after one click (user-run, interactive); guard off = today.
|
||||
10. TODO: phase 2 item ticked with what shipped; folded items (docker mount spellings, P41) closed or re-queued with the measured fact; T42 dead-entry drop handed to the user.
|
||||
|
||||
## FILE SCOPE (seed from STEP 0d KEY COMPONENTS; final at STEP 3)
|
||||
11. `[gated 2026-11-02]` Bench: `.claude/tasks/plans/2026-11-02-phase2-bench/` holds run.sh, bench.sh, cases.tsv, results.tsv (permissionMode column, every kept row `auto`), rtk.tsv, approved.txt and phase2.jq; a rule is in approved.txt only when every row naming it hit its want and one of them expects ASKED/DENIED; M3q (quoted finish form) ASKED.
|
||||
CHECK: cd /home/bchanot/Documents/claude/.claude/tasks/plans/2026-11-02-phase2-bench && [ -s approved.txt ] && grep -qF 'Bash(bash "*gitflow.sh" finish*)' approved.txt && awk -F'\t' '$2=="M3q"' results.tsv | tail -1 | grep -q 'ASKED' && echo BENCH-OK
|
||||
EXPECT: BENCH-OK
|
||||
EVIDENCE: pending
|
||||
12. `[gated 2026-11-02]` Guard: register.test.ts holds the GUARD tests of plan Task 3 + R3 (redirect before any skill, free paths, `~/.claude` and worktrees are code, sub-agent free, latch across a typed apply skill and a model-loaded unrowed skill, sub-agent Skill call does not latch, route-tool phase for one turn, typed /route, /route clear and /route off→on re-arm, /model hand pick does not open, /clear re-arms, `/../` paths are code); the mods suite is green.
|
||||
CHECK: cd /home/bchanot/Documents/claude && [ "$(/usr/bin/grep -c "^test('GUARD:\|^ test(\`GUARD:" mods/model-router/hooks/register.test.ts)" -ge 14 ] && a=$(make test suite=lib/tests/mods.test.sh 2>&1) && printf '%s\n' "$a" | grep -q 'all suites green' && echo GUARD-OK
|
||||
EXPECT: GUARD-OK
|
||||
EVIDENCE: pending
|
||||
13. `[gated 2026-11-02]` Hooks: the rtk suite holds T11-T13 and the pin matches; the code-limits suite passes 14 checks; both hooks shellcheck clean and ≤ 80 columns.
|
||||
CHECK: cd /home/bchanot/Documents/claude && (cd hooks && sha256sum -c .rtk-hook.sha256 >/dev/null) && a=$(make test suite=lib/tests/rtk-rewrite.test.sh 2>&1) && printf '%s\n' "$a" | grep -q 'all suites green' && b=$(make test suite=lib/tests/code-limits.test.sh 2>&1) && printf '%s\n' "$b" | grep -q 'PASS=14 FAIL=0' && shellcheck hooks/rtk-rewrite.sh hooks/code-limits.sh && [ "$(awk 'length($0) > 80' hooks/code-limits.sh | wc -l)" = 0 ] && echo HOOKS-OK
|
||||
EXPECT: HOOKS-OK
|
||||
EVIDENCE: pending
|
||||
14. `[gated 2026-11-02]` Settings: every approved rule and every rtk read twin is present (push-guard T62, T63 green), no old entry left any permissions or autoMode list (set check against develop), `hooks.PostToolUse` registers code-limits, the branch diff of settings.json carries no `theme`, `model` or `switchModelsOnFlag` change.
|
||||
CHECK: cd /home/bchanot/Documents/claude && a=$(make test suite=lib/tests/push-guard.test.sh 2>&1) && printf '%s\n' "$a" | grep -q 'all suites green' && [ "$(jq -n --slurpfile o <(git show develop:settings.json) --slurpfile n <(git show HEAD:settings.json) '[["permissions","allow"],["permissions","ask"],["permissions","deny"],["autoMode","allow"],["autoMode","soft_deny"],["autoMode","hard_deny"]] | map(. as $p | ($o[0] | getpath($p)) - ($n[0] | getpath($p))) | add | length')" = 0 ] && git show HEAD:settings.json | jq -e '.hooks.PostToolUse[] | select(.hooks[0].command == "bash ~/.claude/hooks/code-limits.sh")' >/dev/null && ! git diff develop..HEAD -- settings.json | grep -qE '^[-+] *"(theme|model|switchModelsOnFlag)"' && echo SETTINGS-OK
|
||||
EXPECT: SETTINGS-OK
|
||||
EVIDENCE: pending
|
||||
15. `[gated 2026-11-02]` Release and capitalize: no `SPAN: finish` or `finish+tag` left in skills, agents, lib, README.md, USAGE.md; release-candidate STEP 5 runs `gitflow.sh finish` and `git tag -a` in the main loop; capitalize 5C and STEP 6 name the declined-prompt outcome.
|
||||
CHECK: cd /home/bchanot/Documents/claude && ! /usr/bin/grep -rqn 'SPAN: finish\|finish+tag' skills agents lib README.md USAGE.md && /usr/bin/grep -q 'git tag -a v<X.Y.Z> main' skills/release-candidate/SKILL.md && /usr/bin/grep -qi 'declined' skills/capitalize/SKILL.md && echo RELEASE-OK
|
||||
EXPECT: RELEASE-OK
|
||||
EVIDENCE: pending
|
||||
|
||||
## FILE SCOPE (final, STEP 3 `[gated 2026-11-02]`)
|
||||
- settings.json (`permissions.ask`, `permissions.deny`, `autoMode.hard_deny/soft_deny`, `hooks.PostToolUse`) through the index recipe
|
||||
- hooks/rtk-rewrite.sh, hooks/.rtk-hook.sha256, lib/tests/rtk-rewrite.test.sh
|
||||
- hooks/code-limits.sh (new), lib/tests/code-limits.test.sh (new)
|
||||
- mods/model-router/hooks/register.ts, register.test.ts, routing.json (rows for unrowed code-writing skills if decided)
|
||||
- CLAUDE.global.md, README.md, templates/settings/SETTINGS.md, templates/settings/settings.json (P41), lib/tests/doctrine-citers.test.sh, lib/tests/push-guard.test.sh (T41 list if entries are added to the lock), lib/effort-shift.md (ceiling citers)
|
||||
- .claude/tasks/plans/<date>-phase2-bench/ (bench rows), .claude/tasks/TODO.md, docs/superpowers/{specs,plans} (transient), CHANGELOG.md
|
||||
- mods/model-router/hooks/register.ts, register.test.ts
|
||||
- CLAUDE.global.md, README.md, templates/settings/SETTINGS.md, lib/tests/push-guard.test.sh (T62, T63), skills/release-candidate/SKILL.md, agents/release-executor.md, skills/capitalize/SKILL.md (5C declined prompt)
|
||||
- .claude/tasks/plans/2026-11-02-phase2-bench/ (bench, approved.txt, phase2.jq, long-brief.txt), .claude/tasks/TODO.md, docs/superpowers/{specs,plans} (transient), CHANGELOG.md
|
||||
Reference in new issue
Block a user