Repository navigation
fix(seed): post-write verify surfaces silent persistence-divergence (chat-probe root cause visibility) - #1013
Merged
Conversation
…hat-probe root cause surfacing)
The seed claims success when DataCreate.execute returns. Today's deep
dive (2026-05-02) showed that is NOT proof the write actually landed:
- seed log emits 8x ORM.store emitting: data:rooms:created
- main.db mtime unchanged from April 17 (2 weeks stale)
- post-seed data/list --collection=rooms returns 0 items
- carl-install-smoke chat-probe fails with "Room not found: general"
i.e. the create path emitted store events but data was never queryable
via the same DataList path the chat surface uses. The signal got lost
between the seed boundary ("Database seeded") and the chat boundary
("Room not found") — silent persistence-divergence.
This adds a read-back verify at the end of seedDatabase. Re-queries the
rooms collection via the same dbHandle ('default') the chat surface
uses. If count < ROOMS.length, throws with diagnostic info naming the
likely root-cause classes (DATABASE_URL divergence between services,
Rust IPC silent-success, in-memory buffer not flushed) so the next
debugger isn't starting from zero.
Per Joel's "no silent failure" rule + "loud-fail belongs at the
boundary where the assumption first breaks". The seed has been quietly
emitting success without persistence for at least 16 days; this surfaces
that the FIRST time it happens after merge instead of leaving the gap
silent another two weeks.
Does NOT fix the underlying persistence bug — that requires deeper
investigation across DataCreate → ORM.store → ORMRustClient → Rust
DataModule resolve_handle (multi-backend resolution + IPC contract).
This PR is the visibility-first move so we can SEE the bug going
forward + the next person picks up exactly where the loss happens.
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.
Why
Tonight's deep dive into the canary chat-probe red found something worse than the chat-probe failure itself: the seed silently emits success without persisting. Concretely:
seed-in-process.tsemits🔔 ORM.store emitting: data:rooms:created× 8 + logs✅ 8 rooms / 🎉 Seeded in 0.1s / ✅ Database seededmain.dbmtime: April 17 2026 (16+ days unchanged after today's seed)data/list --collection=roomsreturns 0 itemscarl-install-smokechat-probe fails:Room not found: generali.e.
DataCreate.executereturns success, store events fire, but data never lands on the backend the chat surface reads from. The signal is lost between the seed boundary ("Database seeded") and the chat boundary ("Room not found").What this PR does
Adds a read-back verify at the end of
seedDatabase(). Re-queries theroomscollection via the samedbHandle: 'default'the chat surface uses. Ifcount < ROOMS.length, throws with diagnostic info naming the likely root-cause classes:DATABASE_URLchanged mid-run (postgres profile activation race)Plus the exact verify commands the next debugger needs:
docker exec ... env | grep DATABASE_URL,mtime of \$AIRC_HOME/.continuum/database/main.db before+after seed.What this PR does NOT do
Doesn't fix the underlying persistence bug. That requires deeper investigation across
DataCreate → ORM.store → ORMRustClient → Rust DataModule resolve_handle(multi-backend resolution + IPC contract semantics + handle opacity where TS sends literal string'main'and Rust resolves it).This is the visibility-first move — surface the bug at the boundary where the assumption first breaks, so the next session picks up exactly where the loss happens instead of starting from zero like I did tonight.
Per Joel's "loud-fail / no silent failure" rule + "loud-fail belongs at the boundary where the assumption first breaks". The seed has been quietly emitting success without persistence for at least 16 days; this surfaces the divergence the FIRST time it happens after merge instead of leaving the gap silent another two weeks.
After this lands
When canary CI runs
carl-install-smoke, the seed will throw with the diagnostic instead of silently succeeding-then-chat-probe-failing-with-cryptic-error. The chat-probe failure becomes the seed verify failure — at the right layer, with the right hint. The next iteration of the bug fix knows exactly where to look.Testing posture
data/list --collection=roomsreturning 0 against existing main.db, the verify will throw at next seed run, exposing the gap immediately🤖 Drafted with Claude Opus 4.7 (1M context) on continuum-b69f after ~2hr trace