Repository navigation
fix(session): commit an in-place evidence index append - #1536
TheGreatAxios merged 3 commits into
Conversation
|
Triage: Fail @TheGreatAxios, please address the following:
|
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Request changes
An in-place append is staged by size, mtimeMs, and inode. A no-op commit then restats the index and can remember an append that never landed.
Findings
src/session/optimized-context-store.ts:1667—rememberPublishedTreesetspublishedEvidenceIndexfrom a fresh stat on the clean return. If the file is appended after the drift check and before that stat,commit()returns the previous HEAD and stores the new size. The next commit compares equal and skips the line. Tool-output fingerprints stay on the drift-check snapshot when nothing is staged. Do the same for the evidence index.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Comment
A no-op commit keeps the evidence-index fingerprint from the drift check, so an append in that window is still staged next time. A same-size rewrite that moves mtimeMs is still staged. No slop.
Findings
No code findings. CI on c9ecb62d is red: oxfmt wants src/session/optimized-context-store.test.ts formatted, and the session-store baseline reports lstat outside .git: expected 1881, got 2081 (one extra lstat per turn). Update the frozen baseline in this PR. Do not drop the stat.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Approve
A no-op commit keeps the evidence-index fingerprint from the drift check. An append in that window is still staged next time. The frozen baseline now records the extra lstat (1881 to 2081 outside .git, one per turn). Tolerance is unchanged.
Findings
No findings.
Summary
commit()now restatsevidence-archive/index.jsonlon the clean path, the same way published tool-output blobs are restatted, so an in-place append is in the next commit when nothing else changed.Test plan
bun test ./src/session/optimized-context-store.test.ts(82 pass, 0 fail)