feat: CANT-191 — the catenary_client package, its SQLite binding and migrator, and the journal (CANT-42a) #127
All Vouch review confidence checks passed
Residual risk 0.42 = Change Risk (0.50) × (1 − Review Confidence (0.17)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 573 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 29% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #127"
general
weight: 0.35
github-actions[bot]
CANT-191(CANT-42a, Mode A /evidence) — the floor the rest of the Dart client's protocol half stands on. Spec: the approved plan onCANT-42, rev 2, every ruling on option 0.What is here
dart-client/, packagecatenary_client(ruling 0 → a sibling; nothing underdart/is moved or edited). It depends oncatenary_wireby path and onpackage:sqlite3.lib/src/db.dart— the versioned open.PRAGMA synchronous = FULLon every connection, and an in-process migrator overPRAGMA user_version: numbered SQL steps, run inside oneBEGIN IMMEDIATE, so a file is at a whole version or at the one before.catenary.dbholdsjournal_meta,messages,conversations,users,countedandcredential(ruling 1 → two files). Wire records are stored as the generated codec's JSON beside the columns the store queries by.lib/src/journal.dart—Journal,StagedJournalandMemoryJournal, ported fromweb/src/transport/journal.ts: one copy of the rules, two commits.lib/src/sqlite_journal.dart—SqliteJournal, ported fromidb-journal.ts: one transaction per write, the mirror swapped only afterCOMMITreturns, the wipe (counted log included, a freshgenerationstamped in the wipe's own transaction), and theJournalStalerefusal with its reload.midWrite,splitCursorandignoreGenerationare the reference's seam and negative controls.lib/src/faults.dart— the switch list under the TypeScript names. The journal reads two of them here; the test that enumeratesfaults.tsagainst it isCANT-192's criterion.verify.shresolves, analyzes and tests the package inside the existingcommand -v dartguard;ci.ymlresolves it.gen:checkand the staleness-guard step are unedited.The binding, proved first
package:sqlite33.7.0 opens a file-backed database on this box:dart run,dart testanddart build cliall work, through the package's native-asset build hook, which fetches a prebuilt SQLite (3.53.4) rather than linking the systemlibsqlite3.so.0.dart compile exeis refused ('dart compile' does not support build hooks, use 'dart build' instead), so the driver inCANT-194is built withdart build cli, which emitsbundle/bin/<name>besidebundle/lib/libsqlite3.so. The package needs SDK^3.10.0for that reason, wheredart/says^3.6.0. Whether it opens a file in CI is what this PR's ownverify.shrun answers.Criteria (from the plan), and the test that holds each
| criterion | where |
|---|---|
| No file under
lib/orbin/importspackage:flutter,dart:uior a Flutter plugin; a test fails when one does; resolves and analyzes clean |test/source_test.dart, with the rule proved against planted imports and planted pubspecs;dart analyzeinverify.sh|| [ruling 0 → 0] the package is at
dart-client/, no path underdart/moved,gen:checkand the staleness guard pass unedited | the diff;verify.sh||
SqliteJournalopens a file-backed database,synchronousFULL, fresh file to currentuser_version, same journal tests asMemoryJournal|test/sqlite_journal_test.dart› the binding and the migrator;test/journal_test.dartruns every rule against both journals || A wipe, in both journals; fresh generation, one transaction; counted once after a wipe; credential row unchanged |
journal_test.dart(both);sqlite_journal_test.dart› obligation 4 || Two
SqliteJournalinstances over one file |sqlite_journal_test.dart› two contexts, withignoreGenerationas the control || [ruling 1 → 0], the journal half | the journal and credential tables are in
catenary.dband nooutboxtable is;source_test.dartfails if journal or transport code names the outbox's file. The wipe leaving outbox entries in place, and the outbox's side of the source-shape test, areCANT-196's |Two things that differ from the reference, on purpose
IdbJournalwrites its mirror's count. With one writer they are the same number; with two contexts that each wipe once, the file says two.busy_timeout. The plan statessynchronous = FULLand is silent on the journal mode; the default keeps the database a single file.Verified
./verify.shgreen locally with the database lane running (CATENARY_TEST_DATABASE_URLset):dart test (+40: All tests passed!).🤖 Generated with Claude Code