Repository navigation
refactor(storage): storage redesign package and async typed reads - #4118
Merged
Merged
Conversation
Records the architect run that redesigned TraceDecay storage after the 2026-10-16 incidents: per-repository class files (journal, memory, evidence, derived) on one bounded executor, fenced TRUNCATE checkpoints, per-stream dead letters, class budgets, repository identity through aliases, and an eleven-step cutover. The trail and the arena, judge and interrogate evidence ship beside it.
StoreRuntimeClientLease::dispatch_read and its attachment port are now async and take an Arc probe, matching dispatch_submit. The repository attachment runs the read as one job on the native blocking pool, so a native worker awaiting a fact, observation or external-source read no longer parks on reader admission or the reader's reply. The seven production callers await the read; the sync remote query port, which runs on the blocking pool, waits through block_on. A rusqlite_suite test awaits a typed read on a native worker and asserts the native reader-wait counter does not move. Refs #4085
|
ScriptedAlchemy
enabled auto-merge
October 16, 2026 09:32
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
This was referenced Oct 16, 2026
ScriptedAlchemy
disabled auto-merge
October 16, 2026 11:30
This was referenced Oct 16, 2026
This was referenced Oct 16, 2026
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.
Summary
This PR opens the storage redesign and ships its first step.
docs/plans/storage/). After the 2026-10-16 incidents (153 GB of unmeasured growth, a 6-day ingest freeze, a 229 MB WAL ratchet, native-worker reader waits, a store per clone, writes into unlinked files), TraceDecay storage was redesigned through the architect playbook: grounding, an arena of four whole-shape candidates, a cross-judge, synthesis, and an interrogate pass. The result is per-repository class files (journal, memory, evidence, derived) on one bounded executor, fenced TRUNCATE checkpoints, per-stream dead letters, class budgets, repository identity through aliases, and an eleven-step cutover.decisions.tsvis the decision trail andevidence/holds the artifacts behind it. The plan index now points at it as the storage authority.StoreRuntimeClientLease::dispatch_readand its attachment port are now async and take anArcprobe, matchingdispatch_submit. The repository attachment runs the read as one job on the native blocking pool, so a native worker that awaits a fact, observation or external-source read no longer parks on reader admission or the reader's reply. All seven production callers await it. The remote exact-observation query port is still synchronous and runs on the blocking pool, so it waits throughnative_runtime::block_on, which refuses on a native thread; step 5 makes that port async.Test plan
bazel test //crates/tracedecay-rusqlite-runtime:rusqlite_suite. A new test awaits a typed read on a native worker and asserts the native reader-wait counter does not move. Mutatingdispatch_readto read inline makes the test fail (left 1, right 0).bazel test --config=clippyfor//crates/tracedecay-session-memory:unit_test,//crates/tracedecay-runtime-core:unit_test(504 tests),//crates/tracedecay-store-runtime:unit_testand//crates/tracedecay-global-db:unit_testbazel build --config=clippy //crates/tracedecay:runtime_acceptance_suite //crates/tracedecay-project:unit_testrustfmt_check_2024for every touched crate//crates/tracedecay:daemon_suite,:mcp_suite,:session_suite,:unit_testin CIRefs #4085