mirror of
https://github.com/hanzoai/chat.git
synced 2026-09-30 20:51:17 +00:00
The Mongo->SQLite cutover finished. chat-docdb is deleted, MONGO_URI is unset,
and all 29 domains are served from the embedded SQLite file on the PVC. What was
left behind was scaffolding that reads as live.
- Remove the CHAT_STORE_DUALWRITE seam. Phase 4 is done: the flag is unset in
the live container, and with it unset applySqliteOverrides never constructed a
DualWriteModel anyway. The mirror existed to keep Mongo current as a rollback
target and there is no Mongo to roll back to, so the escape hatch was already
unusable. DualWriteModel + its spec, the export, the flag branch, and the
stale comments in Role/Transaction/token/session all go.
- Drop `logger.info('Connected to MongoDB')`. It fired unconditionally one line
after connectDb() logged that it was skipping Mongo, so the boot log asserted
a connection that had just been declined.
- Retarget the authStore SQLite spec from DualWriteModel to DocModel rather than
deleting it. It is the regression proof for the P1 that broke cold logins; the
coverage is worth keeping, only the model shape changed.
- Rewrite the LLM.md store section, which still described Mongo as the live
parallel store and told the reader that ripping it means data loss.
express-mongo-sanitize STAYS, and the comment above it now says why: the SQLite
engine still interprets $eq/$ne/$in/$or/$regex in filters and $set/$inc/$push in
updates, so a {"$ne": null} reaching a filter is operator injection against
SQLite exactly as it was against Mongo. The guard outlived the database it is
named for. mongoose, mongoMeili and keyvMongo also stay -- see LLM.md for why
each is a migration rather than a sweep.
Verified: data-schemas rollup build clean, DualWrite absent from the bundle,
createModels resolves flagged collections to DocModel and unflagged to mongoose.
Store suite is identical to origin/main (same 5 pre-existing meili failures,
minus exactly the 10 dual-write tests removed).
Co-authored-by: Hanzo Dev <[email protected]>