Skip to content

Fail closed on bad hook input and settle the Morvali Creek calls - #11

Merged
prathikcannotcode merged 2 commits into
mainfrom
fix/guard-input-and-fallbacks
Nov 12, 2026
Merged

prathikcannotcode merged 2 commits into
mainfrom
fix/guard-input-and-fallbacks

Conversation

@prathikcannotcode

Copy link
Copy Markdown
Owner

Carries Vigil's 11 November guardrail review (prathikcannotcode/Vigil#10) over to Aranya, and answers the calls the Morvali Creek run had to make on its own (examples/morvali-creek.run-1/SCORE.md, "Where a skill was confusing").

What was wrong

Each of these was reproduced against main at 3240241 before the fix.

  • The write-guard exited 0, which allows, for not json, {} and a Write with no path. NotebookEdit wasn't in the matcher at all, so it could write to catalog/provisions.json.
  • validate-on-write exited 0 on an event it couldn't read.
  • A finding citing Water Act "s.999" with catalog_id: water-1974 validated clean. This is bug 3 in the Morvali score.
  • AGENTS.md had no fallbacks. The Morvali run logged 15 calls it had to make without guidance.

What changes

  • Fails closed. Malformed events, a file tool with no path, and NotebookEdit outside the layout all exit 2. TodoWrite still passes, because it writes no file.
  • Instrument ids vouch for the whole Act only. A finding on an instruments entry fails if its provision names a numbered section, para, rule, schedule or appendix. "The Act as a whole", "Hazardous Waste Rules 2016" and "the Act's 2010 amendment" still pass. All 18 Morvali findings still validate.
  • AGENTS.md gains Vigil's five fallbacks and two new sections that settle the run's open calls:
    • an uncatalogued section gets a flag
    • alternative calculator inputs go in matters/{id}/inputs/
    • a filing date never forces expert validation
    • risks are named without a view on the outcome
    • AGENTS.md wins over conflicting instructions
  • Schemas.
    • matter.json gains other_forums, model and aranya_version.
    • Flags accept target.kind: "case".
    • matters/*/inputs/*.json is checked against injury-params.schema.json.
  • Docs. SECURITY.md, the changelog (it also covers Close four write-guard bypasses #8), three skill lines, and the README test count.

Read by eye

Aranya's write-guard blocked agent edits to .claude/scripts, .claude/schemas and .claude/settings.json, as it should. Those edits were applied through the shell under maintainer direction, so no hook checked them.

Known limits

  • A part named without a number, such as "General Condition", still passes on an instrument id.
  • A finding on a section's own entry that also names a different section is not checked.

SECURITY.md states both.

Checks

  • npm run validate -- --strict: 43 data files, 5 skills, 0 errors
  • npm test: 30 tests, 28 pass, 2 skipped on Windows (symlink and bash hook), 0 fail
  • The Morvali run's 18 findings, 2 alternative input files, matter.json and flags.jsonl validate under the new rules
  • New tests shown to fail on the old code (the same inputs were confirmed by hand to pass before the fix)
  • Linux CI

🤖 Generated with Claude Code

prathikcannotcode and others added 2 commits November 11, 2026 20:27
Carries Vigil's 11 November guardrail review over to Aranya and answers
the calls the Morvali Creek run had to make on its own.

- The write-guard blocks an event it cannot read, a file tool with no
  path, and NotebookEdit outside the layout. The post-write validator
  reports an unreadable event instead of skipping it.
- A finding that names a numbered section, para, rule or schedule on an
  instrument-level catalog_id fails validation (Morvali run bug 3).
- AGENTS.md gains the fallbacks and settles the run's open calls.
- matter.json gains other_forums, model and aranya_version; flags accept
  kind "case"; matters/*/inputs/*.json is schema-checked.

Guard, schema and settings edits were applied through the shell under
maintainer direction, since the write-guard blocks agent edits there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The instrument-level check rejected any numbered part cited on an
instrument entry. cpcb-ec-2019 is catalogued as an instrument, but its
summary quotes clauses 1.3.2, 1.5.1 and the rest, so a correct finding
citing "clause 1.5.1" failed validation. The check now passes a part the
entry's own summary names as a whole reference, and still rejects
"s.999" on water-1974, which has no summary.

Known limit, in the code and SECURITY.md: a number the summary uses for
something else (the scale factor 1.5) passes as a clause.

Applied through the shell under maintainer direction, since the
write-guard blocks agent edits to .claude/scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@prathikcannotcode
prathikcannotcode merged commit bd06afe into main Nov 12, 2026
1 check passed
@prathikcannotcode
prathikcannotcode deleted the fix/guard-input-and-fallbacks branch November 12, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant