Commit edf7b31
feat(v1.8): AGENTS.md enforcement + empirical enforcement (#22)
* feat(v1.8): AGENTS.md enforcement + empirical enforcement
6 new hook ports, 2 guides, 1 smoke test, updated normalize lib.
Two Codex adversarial passes — 6 findings fixed before tag.
Hooks:
- agentsmd-bash-gate.sh (normalize + __NH_CONFLICT__ fail-closed + scoped allowlist)
- agentsmd-session-inject.sh
- three-failure-stop-gate.sh (normalize Grok payloads)
- claim-evidence-gate-dispatch.sh
- claim-evidence-gate.sh (bash floor, Gate 4)
- aof-eval-opportunity-counter.sh (env-var secret scrub + whitespace trim)
Guides:
- guides/advanced/when-to-write-a-hook.md (advisory exception + dedup question)
- guides/advanced/go-hook-dispatch-pattern.md
Tests:
- tests/smoke/hooks/grok-shape-normalize.sh (8/8 pass)
Docs:
- AGENT_FRAMEWORK.md v1.7 → v1.8, §5.3 matrix +5 rows
- CHANGELOG.md v1.8 section
- README.md + examples/hooks/README.md updated
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix(v1.8): resolve 5 PRM-INFRA-001 Stage 1 findings before ship
HIGH agentsmd-bash-gate: remove broad case-arm allowlist (cat *AGENTS.md
bypass); replaced with anchored grep -qF on $AGENTS_PATH only.
HIGH three-failure-stop-gate: add no-op stubs for bc_record_exit/bc_write
when breadcrumb-lib.sh is absent — prevents exit-code corruption (127)
masking legitimate exit 2 blocks.
MED aof-eval-opportunity-counter: fix python3 silent-continue in
insert_opportunity (|| return on json-encode failure); use json.dumps
for tool_name and session_id to prevent JSON injection.
MED claim-evidence-gate: extract ALL backtick-quoted paths per hit, not
just the first — multi-path claims now check every cited path.
MED smoke test: add snake_case control payload to Test 6 to prevent
false-green from gate-blocks-everything scenario.
Smoke: 9/9 pass.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent d7b3237 commit edf7b31
15 files changed
Lines changed: 1420 additions & 53 deletions
File tree
- docs/superpowers/plans
- examples/hooks
- lib
- guides/advanced
- tests/smoke/hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
327 | 337 | | |
328 | 338 | | |
329 | 339 | | |
| |||
371 | 381 | | |
372 | 382 | | |
373 | 383 | | |
374 | | - | |
| 384 | + | |
375 | 385 | | |
376 | 386 | | |
377 | 387 | | |
| |||
391 | 401 | | |
392 | 402 | | |
393 | 403 | | |
| 404 | + | |
| 405 | + | |
394 | 406 | | |
395 | 407 | | |
396 | 408 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
| 421 | + | |
409 | 422 | | |
410 | 423 | | |
411 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
7 | 75 | | |
8 | 76 | | |
9 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | | - | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
0 commit comments