Skip to content

Optional hook-enforced checks for the execution verify loop - #4

Merged
hexcon merged 2 commits into
six-phase-revisionfrom
hook-enforced-checks
Jul 6, 2026
Merged

Optional hook-enforced checks for the execution verify loop#4
hexcon merged 2 commits into
six-phase-revisionfrom
hook-enforced-checks

Conversation

@hexcon

@hexcon hexcon commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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 step NNN as complete in an execution-log.md, it requires .verified/step-NNN next 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.
  • SKILL.md files list and README tree/roadmap updated.

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, ignores in_progress rows, 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 to main when the base branch is deleted.

Ticks the third roadmap item.

🤖 Generated with Claude Code

hexcon added 2 commits July 6, 2026 10:40
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.
Resolves the README overlap from PR #3 and #4 editing adjacent lines:
keep both repo-tree entries (examples/, hooks/) and tick both roadmap
items. Also ticks the LICENSE roadmap line, already ticked on main by
PR #2, so the eventual merge to main does not conflict on it again.
@hexcon
hexcon merged commit 2f9c0a9 into six-phase-revision Jul 6, 2026
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