4.9 KiB
4.9 KiB
CONTRACT — phase2-deny-lows (phase 2 security-gate LOWs, block H4a)
- date: 2026-11-13 | flow: bugfix | branch: bugfix/phase2-deny-lows (off develop)
- status: active
REQUEST (verbatim — IMMUTABLE)
Phase 2 security gate follow-ups (2026-11-02, non-blocking): LOW awk evasions (system (, awk -f, gawk/mawk); LOW pre-existing cat x.key (no dir prefix) parity gap; doctor.sh:255 jq message should name code-limits and push-guard. safety-residuals gate LOWs (2026-11-06): rtk read -n server.key / rtk read id_rsa at repo root pass (.key/.pem/id_* rtk denies all need */; pre-existing, bench before adding).
CLARIFICATIONS
- [gated 2026-11-13, internal] bench = the push-guard suite: every new row joins the T63 "phase2 rules present" list and the T62 twin rule (an
rtk read X*row needs its*/rtk read X*twin). New deny rows:Bash(awk *system (*),Bash(gawk *system(*),Bash(gawk *system (*),Bash(mawk *system(*),Bash(mawk *system (*),Bash(awk -f *),Bash(awk * -f *); no-dir formsBash(cat *.key),Bash(cat *.key *),Bash(cat *.pem),Bash(cat *.pem *),Bash(cat id_rsa*),Bash(rtk read *.key*),Bash(*/rtk read *.key*),Bash(rtk read *.pem*),Bash(*/rtk read *.pem*),Bash(rtk read id_rsa*),Bash(*/rtk read id_rsa*). Existing*/rows stay (removal needs the T42 justified list). - [gated 2026-11-13, GATE 2 LOWs folded, round 2] 10 more rows, same bench:
Bash(cat *id_rsa*),Bash(rtk read *id_rsa*),Bash(*/rtk read *id_rsa*)(flag-before parity),Bash(cat *id_ed25519*),Bash(rtk read *id_ed25519*),Bash(*/rtk read *id_ed25519*)(the request saysid_*),Bash(gawk -f *),Bash(mawk -f *),Bash(awk *getline*),Bash(awk *| "*)(awk's other exec primitives). Collateral of the*.key/*.pemroot forms (cat x | jq .api.key) = the breadth the*/rows already have: accepted parity.python3 -c/node -estay soft_deny (BDR-125 Amendment 7). T63 ask+deny lookup → TODO line. - [gated] doctor.sh:255 wording:
jq not found: statusline, rtk-rewrite, code-limits and push-guard hooks require it(no em dash).
ACCEPTANCE CRITERIA
- The new rows are in
permissions.deny, JSON valid, no duplicate rows. CHECK: cd /home/bchanot/Documents/claude && jq -r '.permissions.deny[]' settings.json | grep -cxF -e 'Bash(awk system ()' -e 'Bash(gawk system()' -e 'Bash(mawk system()' -e 'Bash(awk -f )' -e 'Bash(awk * -f )' -e 'Bash(cat .key)' -e 'Bash(cat id_rsa)' -e 'Bash(rtk read .key)' -e 'Bash(/rtk read .key)' -e 'Bash(rtk read id_rsa)' -e 'Bash(/rtk read id_rsa)' EXPECT: 11 EVIDENCE: MET exit=0 marker-found :: 11 - Round-2 rows present. CHECK: cd /home/bchanot/Documents/claude && jq -r '.permissions.deny[]' settings.json | grep -cxF -e 'Bash(cat id_rsa)' -e 'Bash(*/rtk read id_rsa)' -e 'Bash(cat id_ed25519)' -e 'Bash(rtk read id_ed25519)' -e 'Bash(gawk -f *)' -e 'Bash(mawk -f *)' -e 'Bash(awk getline)' -e 'Bash(awk | ")' EXPECT: 8 EVIDENCE: MET exit=0 marker-found :: 8
- No duplicate deny row. CHECK: cd /home/bchanot/Documents/claude && jq -r '.permissions.deny[]' settings.json | sort | uniq -d | wc -l EXPECT: 0 EVIDENCE: MET exit=0 marker-found :: 0
- push-guard suite green with the rows benched (T63 list extended, T62 twins satisfied). CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/push-guard.test.sh 2>&1 | tail -1 EXPECT: all suites green EVIDENCE: MET exit=0 marker-found :: all suites green
- T63 list names the new rows (both rounds). CHECK: cd /home/bchanot/Documents/claude && grep -cF -e 'Bash(awk -f *)' -e 'Bash(cat .key)' -e 'Bash(rtk read id_rsa)' -e 'Bash(cat id_ed25519)' -e 'Bash(awk getline)' lib/tests/push-guard.test.sh EXPECT: 5 EVIDENCE: MET exit=0 marker-found :: 5
- doctor.sh jq message names code-limits and push-guard. CHECK: cd /home/bchanot/Documents/claude && grep -c 'jq not found: statusline, rtk-rewrite, code-limits and push-guard hooks require it' doctor.sh EXPECT: 1 EVIDENCE: MET exit=0 marker-found :: 1
- settings-related suites green:
make test suite=lib/tests/rtk-rewrite.test.sh, shellcheck -x doctor.sh. CHECK: cd /home/bchanot/Documents/claude && shellcheck -x doctor.sh && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/rtk-rewrite.test.sh 2>&1 | tail -1 EXPECT: all suites green EVIDENCE: MET exit=0 marker-found :: all suites green - make test green (manual, bun on PATH).
(manual: run 2026-11-13 16:30 → every suite green except lib/tests/mods.test.sh, red since the claude CLI auto-updated to 2.1.323 at 16:24:
plugin validate --strictnow type-checks register.test.ts (3 TS2339 narrowings) and model-router (13 warnings); unrelated to this diff (settings/doctor/push-guard), tracked as its own H item)
FILE SCOPE
settings.json (permissions.deny rows only), lib/tests/push-guard.test.sh (T63 list), doctor.sh (:255 one line). docs/SETTINGS.md or README deny inventory → STEP 7. TODO lines → STEP 8.