Repository navigation
fix(facade): MongoDB streams can seal, so hosts' journal maintenance runs - #102
Merged
M3gA-Mind merged 1 commit intoNov 11, 2026
Merged
Conversation
…runs The facade built MongoStreams with no blob store, so seal() returned Unsupported(StreamSeal) for every facade user on MongoDB. OpenHuman's journal maintenance stops a scope's pass on that error: its one-time backfill never completed and retention never deleted sealed journals, so run journals accumulated on MongoDB. Its scope move refused sealed legacy streams, and tinyagents' and the storage kit's seal paths failed the same way. The plain MongoDB engine now builds the scope's MongoBlobStore first and gives it to the streams. The conditioned engine exposes no blob port (GridFS writes cannot join the condition's transaction), so its streams get their own MongoBlobStore for the sealed log only: it is written before the guarded marker transaction and deleted if that fails. Part of tinyhumansai#49
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This was referenced Nov 11, 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.
Part of #49. Not breaking.
Summary
The facade built
MongoStreamswith no blob store (config/mod.rs, plain and conditioned MongoDB engines), soseal()returnedUnsupported(StreamSeal)for every facade user on MongoDB. Nothing outside this repo attaches a blob store itself or checksStreamSealfirst, so every caller failed:storage/journal_maintenance.rs, every 6 h): its one-time backfill seals inactive journals withseal(..).await?. The Unsupported error ended the scope's pass, so the backfill marker was never written, the same "journal maintenance failed; retrying" warning repeated every sweep, and retention (delete_sealed_stream) never ran. Run journals accumulated on MongoDB.storage/scope_move.rs) refused to move a sealed legacy stream onto MongoDB ("target cannot preserve sealed state").Store::seal, the storage-kit seal policy and stream migration failed the same way.Fix
MongoBlobStorefirst and gives it toMongoStreams(with_blob_store). Streams then advertiseStreamSeal.MongoBlobStorefor the sealed log only. That's safe because the seal writes the log before the guarded marker transaction and deletes it if that transaction fails (MongoStreams::conditioned's documented contract).Validation
On a Linux build host, merged onto main 6372924:
cargo test --locked -p tinystoragedrivers --features mongodb mongo_sealagainst a live replica set: 2 passed. Against a standalone mongod: the plain test passes; the conditioned test reports its expected skip (no transactions, so no conditioned bundle).config/mod.rs, both tests fail. The streams don't advertiseStreamSeal, and the conditioned seal returnsUnsupported(StreamSeal).cargo test --workspace --all-features --locked: 857 passed, 0 failed, 1 ignored.-D warnings(0 items),cargo fmt --check, rustdoc-D warnings,cargo check -p tinystoragedrivers --no-default-featuresand with--features mongodb.Tests (
config/mod_mongo_seal_tests.rs, live MongoDB)facade_mongo_streams_seal_read_and_delete_a_sealed_stream: the journal-maintenance lifecycle throughtinystoragedrivers::open. It appends, seals, reads the sealed log, checks appends are refused, then deletes the sealed stream byinfo().sealed_ms.facade_mongo_conditioned_streams_seal_while_blobs_stay_unsupported: a conditioned bundle seals while its blob port stays unsupported.Reaching OpenHuman
OpenHuman pins tinystoragedrivers
5e8c8378. The fix applies after a release that includes it and an OpenHuman pin bump.Manual check on a MongoDB-backed OpenHuman: finish an agent run, wait for the first maintenance sweep (10 min). The log shows no "journal maintenance failed" warning, and the run's journal stream is sealed.