Repository navigation
hookprobe: a run is not blamed for what the service itself wrote to its inputs - #53
Merged
Merged
Conversation
…ts inputs Found re-shooting the docs pictures: two runs overlapping on a demo stack, the first one's report offered a plain fact, the service applied it to CLAUDE.md (memory auto-apply is on by default), and the second run ended flagged "rewrote its own inputs" — the tamper warning on its record and its runbook skipped. An operator's save or a finished run's runbook while a run is out did the same. Every service write to the input surface (the memory writer, the post-run runbook steps, and every console write door through one middleware) is now recorded as digest steps; the engine takes a mark beside its fingerprint, and a change is let off only when the service's steps since the mark lead from where the run started to where it ended. A run that edits the memory before or after the service does is still caught; an old step excuses nothing. Read back on a live stack: a real run with the memory page saved mid-run ends with no input changes. Mutation-checked.
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.
The defect. The investigator compares a digest of its input surface (CLAUDE.md,
.claude/, the prompt, configured files) before and after every run, and a run whose inputs changed is marked in the console and has its runbook skipped. But the service writes that surface itself while runs are out:HOOKPROBE_MEMORY_AUTO_APPLYis on by default);Every run in flight was blamed for those. Found re-shooting the docs pictures (#52): five runs, two at a time. The run still going when the first finished ended with
run rewrote its own inputs: modified /data/CLAUDE.md.The fix.
inputs.service_writes(*roots)records each file the service changed as a step from one digest to the next./v1/memory,/v1/skills,/v1/agentsand/v1/system-prompt(one middleware, so a door added later is covered).inputs.service_mark()before its fingerprint.changes(before, after, since=mark)lets a change off only when the service's steps since the mark, followed in order from where the run started, end where it ended.Still caught:
Verified
tests/test_inputs.py: the service's writes followed in order, run edits before and after them caught, an old step excusing nothing, and the suggestion queue's auto-apply end to end.tests/test_contract.py: an operator's save through two doors while a run is out.tests/test_engine_loop.py: the mark reaching the comparison inside a run. The first fails with the mark removed.scripts/assert_guards_are_tested.py: a new mutation turns the excuse into "any change once a mark is given"; caught.input_changes: [], and no warning in the log.bash scripts/gate.sh: STACK GATE GREEN; hookprobe 953 passed, 1 skipped.Decision note:
.agents/notes/implemented/2026-11-12-a-run-is-not-blamed-for-the-services-own-writes.md. Not deployed.