chore(contract): phase 2 merge-gate rulings [gated] (16 replaces 11, criterion 1 residual, 5 and 7 amended)

This commit is contained in:
bchanot committed 2026-11-02 20:29:23 +01:00
1 parent b30cf2b7b3
commit a17dcaeb4a
1 file changed
+7 -3
@@ -44,6 +44,8 @@ Plan challenge round 1 (2026-11-02, correctness FATAL(8), robustness FATAL(5), s
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.
Merge-gate review `[gated 2026-11-02]` (user answers after GATE 1 ECARTS(6)): criterion 16 replaces 11; criterion 1's `gitflow_finish*` clause abandoned as a stated residual; criterion 5 amended: matcher `Edit|Write` (NotebookEdit cannot report: `.ipynb` is outside the extension list) and no temp HOME in the suite (the hook never reads HOME; it finds lib/ from its own resolved path), per plan r3 conf 7; criterion 7 amended: the gitflow section gains the enforcement sentence and keeps its prose (only "finish on an explicit human signal" is now enforced), per the approved spec. Criterion 9's `/close` one-click check runs after the merge, from develop, by the user (a chore branch /close creates is the only one it finishes; on this feature branch it commits in place).
## 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.
@@ -70,7 +72,7 @@ STEP 3 gate `[gated 2026-11-02]` (user: "oui aux trois, le prompt s'affiche, lan
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: MET exit=0 marker-found :: HOOKS-OK
EVIDENCE: NOT-MET exit=1 (nonzero) ::
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
@@ -80,12 +82,14 @@ STEP 3 gate `[gated 2026-11-02]` (user: "oui aux trois, le prompt s'affiche, lan
EXPECT: RELEASE-OK
EVIDENCE: MET exit=0 marker-found :: RELEASE-OK
16. (PROPOSED 2026-11-02 by the controller, pending the user; replaces 11) Bench: the directory holds run.sh, bench.sh, cases.tsv, results.tsv (permissionMode column, every row `auto`), rtk.tsv, approved.txt, phase2.jq; approved.txt holds `Bash(bash *gitflow.sh finish*)`; the quoted call-site form `bash "$HOME/…/gitflow.sh" finish` is ASKED under it, isolated (M3x) and with the live settings (L6).
16. `[gated 2026-11-02]` (replaces 11, user-approved) Bench: the directory holds run.sh, bench.sh, cases.tsv, results.tsv (permissionMode column, every row `auto`), rtk.tsv, approved.txt, phase2.jq; approved.txt holds `Bash(bash *gitflow.sh finish*)`; the quoted call-site form `bash "$HOME/…/gitflow.sh" finish` is ASKED under it, isolated (M3x) and with the live settings (L6).
CHECK: cd /home/bchanot/Documents/claude/.claude/tasks/plans/2026-11-02-phase2-bench && for f in run.sh bench.sh cases.tsv results.tsv rtk.tsv approved.txt phase2.jq; do [ -s "$f" ] || exit 1; done && grep -qF 'Bash(bash *gitflow.sh finish*)' approved.txt && awk -F'\t' '$2=="M3x"' results.tsv | tail -1 | grep -q 'ASKED' && awk -F'\t' '$2=="L6"' results.tsv | tail -1 | grep -q 'ASKED' && ! awk -F'\t' '$2 ~ /^[A-Z][0-9]/ && $6 != "" && $6 != "auto"' results.tsv | grep -q . && echo BENCH-OK
EXPECT: BENCH-OK
EVIDENCE: MET exit=0 marker-found :: BENCH-OK
ABANDON: 11 the M3q clause is impossible: the permission matcher does not match a literal quote inside a pattern (M3q `Bash(bash "*gitflow.sh" finish*)` RAN, M6q RAN), so that rule cannot be approved; the clause's purpose (the quoted finish form every skill types is asked) is met by `Bash(bash *gitflow.sh finish*)` (M3x ASKED isolated, L6 ASKED live); handoff: criterion 16 proposed, the user accepts or rejects it at the merge gate.
ABANDON: 1 the `Bash(gitflow_finish*)` clause is impossible as a static rule: the bench shows the sourced-function form `source …/gitflow.sh; gitflow_finish` RAN under it (M5), so it is not added; the form rests on the soft_deny "Static rule blind spots" entry and is named in README "Static rule limits"; no skill types it (they all type `bash … gitflow.sh finish`, asked). User-accepted residual 2026-11-02.
ABANDON: 11 the M3q clause is impossible: the permission matcher does not match a literal quote inside a pattern (M3q `Bash(bash "*gitflow.sh" finish*)` RAN, M6q RAN), so that rule cannot be approved; the clause's purpose (the quoted finish form every skill types is asked) is met by `Bash(bash *gitflow.sh finish*)` (M3x ASKED isolated, L6 ASKED live); handoff: criterion 16, approved by the user 2026-11-02.
## 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