forked from bchanot/claude
chore(memory): phase 2 guards — BDR-136, LRN-256/257, EVAL-056, BLK-018 resolved, journal; TODO security follow-ups
This commit is contained in:
1 parent
69a0b9b10c
commit
fd31640b9c
6 files changed
+28
No files matched your search
@@ -1921,3 +1921,13 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
|
||||
- **Pattern**: `bash lib/gates.sh run <contract>` REWRITES the `EVIDENCE:` lines of the contract file. Re-running a merged contract's gates for an audit: (1) oracles frozen on a base SHA (`c1-*.sh` vs develop 017a28b) read NOT-MET on later GATED changes (phase 5 added a pack-extras line to `rules/web-building.md`; 3330f0b restored "(dispatcher applies)" → 209/205 chars; 7899670 dropped `memory:`), (2) a CHECK string pinned to a test name goes stale after a review rename (`T10h-no-jq-rc0` → `T10h-empty-path-rc0`, 0b59687). Neither is a repo defect.
|
||||
- **Context**: 2026-11-02 BDR-125 re-verification, 5 contracts re-gated: phase 5 / memory v2 write / minors MET, phase 0 UNMET(1), phase 1 UNMET(2), all explained by `git log -S`.
|
||||
- **Apply**: on a re-audit, run gates, attribute each NOT-MET with `git log -S'<text>' -- <file>` to a gated commit, then `git checkout -- <contract>` to keep the ship-time evidence (historical record). Never commit re-run evidence over a merged contract.
|
||||
|
||||
## LRN-256 — Permission matcher facts CLI 2.1.316: quote in a pattern never matches, star spans a quoted argument, sourced functions unseen, ask prompts under auto (2026-11-02)
|
||||
- **Pattern**: Claude Code permission matcher, CLI 2.1.316, measured headless auto mode + one interactive check (2026-11-02): (a) literal quote inside a rule pattern never matches (`Bash(bash "*gitflow.sh" finish*)` RAN on the quoted command); (b) `*` spans a quoted argument: `Bash(bash *gitflow.sh finish*)` asks on `bash "$HOME/.claude/lib/gitflow.sh" finish`; (c) a sourced function call (`source …; gitflow_finish`) not seen by `Bash(gitflow_finish*)`; (d) `echo … | bash -s` not seen by `Bash(bash -s*)` (pre-existing `Bash(* | bash -*)` deny does catch it); (e) `head -5 .env` escapes `Bash(head .env)`, `Bash(head * .env*)` catches it; (f) an ask prompts interactively under auto: "Ask rule Bash(git merge *) overrides auto mode for this command"; (g) an ask hit inside a headless sub-agent raises a request and never runs.
|
||||
- **Context**: phase 2 bench `.claude/tasks/plans/2026-11-02-phase2-bench/` (results.tsv M*/S*/H*/C*/R*/L*, G1); supersedes the "ask inert under auto" reading of LRN-155.
|
||||
- **Apply**: every new permission rule gets an isolated bench row (positive + negative + control) before landing; never rely on a quote in a pattern; spell finish call sites `bash … gitflow.sh finish`.
|
||||
|
||||
## LRN-257 — Headless permission bench: cd off the pipe, auto-mode controls, permissionMode per row, approve a rule only on all its rows (2026-11-02)
|
||||
- **Pattern**: headless permission bench (`claude -p --setting-sources local --settings <file>`): (1) `printf … | cd "$4" && claude -p` runs the cd in a pipe subshell and claude reads the caller's stdin (the cases file) → `cd` on its own line, every call `</dev/null`; (2) controls carry `allow Bash(*)` + `defaultMode: auto` (+ `skipAutoPermissionPrompt`), else default mode asks everything; (3) parse the stream-json `system/init` `permissionMode` per row, reject rows not `auto`; (4) verdict = DENIED ("has been denied") / ASKED ("requested permissions") / else RAN (a non-zero command exit is still RAN); (5) a rule is approved only when every row naming it hits its want and one row expects ASKED/DENIED; (6) append-only results, ids selectable, full run in background.
|
||||
- **Context**: phase 2 plan r1 bench broken (correctness BLOCKER), fixed r2/r3; run 2026-11-02, 41 cases + controls, all `auto`.
|
||||
- **Apply**: reuse `.claude/tasks/plans/2026-11-02-phase2-bench/run.sh` + `bench.sh` for any future rule (docker mount spellings, `rtk read * .env*` twins).
|
||||
Reference in new issue
Block a user