Line snapshots seal only admitted paths - #444
Merged
Merged
Conversation
…eep work and line memory Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Round 1 — reviewed head 1d9526b3 — reviewer summarizer:hermes/gpt-5.6-terra over coverage+credentials+deployment+general+lifecycle+prose.
terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.
Verdict: no defects found.
No findings were reported by any review lens. Rejected findings: none.
# Conflicts: # CHANGELOG.md
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.
Follow-up to #442. A research-line snapshot publishes the agent's working tree to its line branch at the end of an attempt, and on a crash as salvage. #442 kept rejected trees off the normal ending paths, but an exception right after a scope refusal could still let salvage push a tree with out-of-scope changes. Separately, a run that ended normally with one stray file sealed that file onto the line.
What changes
_push_line_snapshot(every caller: normal endings, salvage, wake and publish tails) seals only admitted paths: out-of-scope tracked changes are restored to their content in the snapshot's parent (or dropped if absent there), out-of-scope untracked files are left out, and everything admitted, including line memory, is sealed as before. One bounded log line names the dropped paths. Out-of-scope session commits also stay out of line history.Compatibility (RELEASING.md)
No persisted-state format change. Existing line branches are unchanged; only future snapshots filter. Rollback returns to sealing the full tree.
Tests
A normal ending with a stray untracked file seals admitted work and line memory without it (mutation-checked); a protected tracked file edited is sealed at its parent content; a crash right after a scope refusal leaves no out-of-scope change on the line; clean trees are unchanged. Gate: 2620 passed, 6 skipped; ruff, format, mypy clean.
Built by codex from my brief; my cross-review changed the first version (which skipped the whole snapshot and lost the run's notes) to filter instead.
🤖 Generated with Claude Code