Skip to content

fix(session): commit an in-place evidence index append - #1536

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-10954-commit-an-in-place-append-of-the-evidence-index
Oct 20, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-10954-commit-an-in-place-append-of-the-evidence-index

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • commit() now restats evidence-archive/index.jsonl on 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.
  • An unchanged index is compared by size, mtime, and inode and is not re-read. A no-op still does not walk every tool-output blob.

Test plan

  • bun test ./src/session/optimized-context-store.test.ts (82 pass, 0 fail)

@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

CL-10954

@corbits-triage

corbits-triage Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Fail

@TheGreatAxios, please address the following:

  • required checks are failing: static-analysis, session-store perf baseline

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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 — rememberPublishedTree sets publishedEvidenceIndex from 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 TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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 TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@TheGreatAxios
TheGreatAxios merged commit 10c30e7 into main Oct 20, 2026
14 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10954-commit-an-in-place-append-of-the-evidence-index branch October 20, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant