core icon indicating copy to clipboard operation
core copied to clipboard

Harden required enforcement failures and document fail-open versus fail-closed behaviour

Open tcballard opened this issue 1 month ago • 0 comments

Outcome

A failed required validation or policy load cannot be mistaken for a successful check. This tracks the enforcement follow-up from the 12 October 2026 infrastructure brief.

Current evidence and boundary

The Claude Code recipe explicitly documents blocking structural findings but failing open on internal errors. ADR-067 permits the specific Claude Code pre-edit seam alongside post-edit validation; it does not promise generic agent interception or semantic verdicts.

This is a scoped hardening proposal, not a claim that all listed failure cases are reproduced bugs.

Scope and acceptance criteria

  • [ ] Audit the existing CLI, CI and generated hook paths; identify which checks are advisory and which are required.
  • [ ] Distinguish valid, structural rejection, missing required input, unreadable input, invalid configuration and internal execution failure in machine-readable results and exit handling.
  • [ ] Define and document explicit failure behaviour. Required checks block on failure; advisory checks remain visibly advisory. Record the decision and migration implications before changing the documented hook default.
  • [ ] For supported Claude Code versions, evaluate command/HTTP hook onFailure: "block"; older versions receive a documented compatible path or an actionable unsupported-version error.
  • [ ] Verify missing executable, timeout, malformed output, unreadable required corpus/configuration, and unexpected exit status. No case may produce a successful enforcement receipt.
  • [ ] Verify retry, resumed sessions, delegation and plugin/configuration reload at supported integration boundaries; record any harness-owned limits rather than claiming cross-tool containment.
  • [ ] Keep validation deterministic and offline, MCP read-only, and post-edit/CI checks as the backstop. Document recovery without silently weakening enforcement.

Implementation should follow the repository's corpus-first decision/requirement workflow and preserve existing JSON contracts.

Upstream evidence

tcballard avatar Oct 12 '26 08:10 tcballard