Skip to content

Line snapshots seal only admitted paths - #444

Merged
renmengye merged 2 commits into
mainfrom
fix/salvage-admission
Sep 30, 2026
Merged

renmengye merged 2 commits into
mainfrom
fix/salvage-admission

Conversation

@renmengye

Copy link
Copy Markdown
Member

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.
  • The filtering uses a private index, so the working tree and the real index are untouched for whatever runs next.
  • The line branch never receives an out-of-scope change, and the agent keeps its notes and admitted work instead of losing the whole snapshot.

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

…eep work and line memory

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@renmengye renmengye added the autoresearch:review Request a fresh advisory review of this PR's current state label Sep 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head 4aec883b — reviewer hermes/gpt-5.6-terra.

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.

@renmengye
renmengye merged commit 6184764 into main Sep 30, 2026
5 checks passed
@renmengye
renmengye deleted the fix/salvage-admission branch September 30, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoresearch:review Request a fresh advisory review of this PR's current state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant