Repository navigation
fix(read): bound three unbounded read and queue paths - #5706
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94ebe018d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6650b5dd57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The deferred write-effect queue kept a receipt for every distinct ingest batch for the process lifetime; nothing read them, so only in-flight keys are now retained (yooge). A full insight rebuild enumerated every session id into four archive-sized collections per prepare, and past the plan's target ceiling refused to plan at all; the full scope is now identified by scope, generation and recipe (buuxr). Session reads re-hashed every attachment blob on every read; read-path verification now re-hashes only when the blob file's identity changed (1gxyu). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
… ctime A failed deferred write effect is kept as a retry obligation and retried at the next enqueue, with its staleness key reported, instead of being dropped. The read-verification memo includes ctime, so a permission, owner or content change forces a re-hash, and an unreadable blob reads as unavailable rather than raising. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…shing Three findings on the deferred effect queue and read verification: - An enqueue that ran between a worker recording a failure and releasing its pending key cleared the failure, and the resubmit was rejected as still pending, so the obligation was lost. Failure recording and the pending release now share one critical section, and a retry moves from failed to pending in another. - During a sustained outage every failed batch was retained and resubmitted at each enqueue. Failures now coalesce per effect and database into one obligation over the union of session IDs, so retained state is bounded by the sessions owed, and the insight invalidation binds that union in chunks. - Concurrent cold reads of one blob each streamed a full hash. A per- identity in-flight future now makes later readers wait for and reuse the first result. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
6650b5d to
f9af111
Compare
Summary
Bounds three read/queue paths from the read-bounds bug family: yooge, buuxr, 1gxyu.
Problem
DeferredEffectQueuestored a receipt pereffect:staleness_keyfor the process lifetime. The key embeds the batch's session ids, so it grew with every distinct ingest batch in a long-running daemon. No production code reads those receipts.list_summaries(limit=1_000_000)and built four archive-sized collections (manifest JSON, targets, target refs) perprepare, twice per mutation.applyignores them for the full scope. On an archive past the plan's target ceiling,build_planrefused to plan the rebuild at all.BlobStore.verify, which streams and SHA-256s the whole blob, so reading a session with large attachments cost their full size every time.Solution
archive.write_effect.failed. The unused receipt API is removed.BlobStore.verify_for_read, which hash-verifies once and then trusts the result while the blob file keeps the same device, inode, size and nanosecond mtime; any change forces a full re-hash. The memo is a pacing bound (eviction only re-hashes).verify/verify_allstay uncached integrity checks.Already fixed on master, recorded on the beads: fvsjn (per-session bounds, #5381) and 0bn4p (facet scope bound with a named
facet_scope_truncatedgap and shared cancellation).Verification
devtools testover the three new test files plustest_mutation_actuators.pyandtest_blob_store.py: all passed exceptTestSessionExcisionActuator::test_prepare_and_apply_expose_marker_carrier_terminal_evidence, which fails withUnclassifiedSessionCarrierError: raw_existence_changes— a table added on master by fix(storage): bound live frontier admission with journals #5657 without an excision carrier declaration, not touched here.devtools schema closure: all five production files are IN; this must land before the fresh build.Residuals
verify_for_readdoes not detect an in-place rewrite that restores the same size and nanosecond mtime.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4