Optional hook-enforced checks for the execution verify loop - #4
Merged
Conversation
A PreToolUse guard (hooks/check_step_verified.py) blocks marking a step complete in execution-log.md unless a .verified/step-NNN marker exists in the session folder. The marker is created by chaining it onto the step's real Validation command, so it exists only when the check exited 0. Fails open on anything it does not understand. Verified with six stdin cases (block/allow/other-file/in-progress/ malformed) against python3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the Loop Discipline evidence rule from prose into the harness, per the roadmap's last item.
What's here
hooks/check_step_verified.py— a Claude Code PreToolUse guard. When an Edit/Write marks stepNNNascompletein anexecution-log.md, it requires.verified/step-NNNnext to the log; missing marker → the tool call is blocked (exit 2) with instructions fed back to the agent. Fails open on everything else (other files, malformed input, non-complete rows), so it can never wedge unrelated work.hooks/README.md— how it works, per-project install with the settings.json snippet, a copy-paste self-test, and an honest-limits section (markers are friction plus an mtime audit trail, not proof — the final review loop stays).phases/05-execution.md— new Optional Hook Enforcement section: create markers only by chaining onto the step's real check (<validation command> && touch .verified/step-NNN), never by hand.Verification
Ran six stdin cases against
python3: blocks a complete-without-marker Edit (exit 2), allows with marker (0), flags only the unmarked step on a full-file Write, ignores other files, ignoresin_progressrows, and passes malformed JSON through (fail-open).Stacked on #1 (six-phase revision) — it edits the revised
phases/05-execution.md, so merge #1 first; GitHub retargets this PR tomainwhen the base branch is deleted.Ticks the third roadmap item.
🤖 Generated with Claude Code