Skip to content

Run the repository's pre-commit, husky and lefthook checks as proof obligations - #130

Merged
QuintinBotes merged 6 commits into
mainfrom
goal/98-hook-proofs
Nov 24, 2026
Merged

QuintinBotes merged 6 commits into
mainfrom
goal/98-hook-proofs

Conversation

@QuintinBotes

@QuintinBotes QuintinBotes commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Closes #98

What changed

Slice commits skip git hooks (core.hooksPath=/dev/null); the docs now say so and why. Planning also adds a lint obligation per configured hook system, run through the broker (slice worktree, OS sandbox, no network): pre-commit (pre-commit run --all-files), husky (sh .husky/pre-commit), lefthook (lefthook run pre-commit). Detection: runtime/plan/hooks.mjs.

Scenario to test map

Scenario Test (tests/unit/plan/hook-obligations.test.mjs)
1. Docs state hooks are skipped and why docs/security-model.md, docs/commands.md (no test)
2. Config present adds obligation one test each: pre-commit, husky, lefthook (.yml and .lefthook.yaml); all three at once gives three
3. No config adds none a repository without a hook configuration adds none
4. Failing obligation fails, output names check a failing hook fails the obligation and its output names the check; passing hook passes
Edge: network hook not run against a real hook; the sandbox has no network, so it fails or times out via the broker's existing timeout

Tests written first, seen failing (1 pass, 7 fail), then 8 of 8.

Checks

  • Full npm test: 3597 tests; the known requireHumanTTY failure plus one I caused (language-registry guard on an extension list in hooks.mjs), fixed and re-run with the hook and registry tests: 13 of 13 pass. Changed-area run (plan, artifacts, schemas, broker, cli): 469 pass, 1 known failure.
  • Missing-tool tests: missing pre-commit and lefthook give a waivable obligation (husky unchanged); a fake pre-commit on PATH runs, and its failure fails the obligation.
  • After merging origin/main and the missing-tool change: full npm test 3614 tests, 3604 pass, only the known requireHumanTTY failure.
  • CHANGELOG entry under Unreleased.

Decisions for a person

  • Obligation kind is lint (no schema change); a dedicated kind would need a schema and migration.
  • pre-commit and lefthook are looked up on PATH at planning time. A missing tool makes the obligation requires_human, so a person can waive it; husky (plain sh) is unchanged.
  • pre-commit run --all-files checks the whole tree, not only the slice diff; scoping is follow-up Scope hook obligations to the slice's changed files #137.

🤖 Generated with Claude Code

QuintinBotes and others added 6 commits November 23, 2026 23:12
…bligations

Slice commits skip git hooks (core.hooksPath=/dev/null). Planning now adds a sandboxed broker obligation per configured hook system, and the security model and apply docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lled

A pre-commit or lefthook obligation whose binary is absent came back
inconclusive and could not be waived, so every slice was blocked. Planning
now looks the tool up on PATH and, if it is missing, makes the obligation
requires_human. Husky runs through sh and is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bubblewrap sandbox mounts a fresh /tmp, so a hook tool installed in a PATH directory under /tmp vanished (execvp: No such file). Bind such directories back read-only, as is already done for the project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuintinBotes
QuintinBotes merged commit fc14daf into main Nov 24, 2026
12 checks passed
@QuintinBotes
QuintinBotes deleted the goal/98-hook-proofs branch November 24, 2026 08:06
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.

Say that slice commits skip the repository's git hooks, and run those checks as proof

1 participant