Commit Graph
16052 Commits
Author SHA1 Message Date
Brennan Benson a2490987f9 refactor: integrate direct item and lifecycle reads 2026-11-08 09:14:16 -08:00
Brennan Benson 3d5eaedac6 Merge commit '866cbad6069' into brennanb2025/native-chat-sqlite-host 2026-11-08 09:03:44 -08:00
Brennan Benson c96a72725a refactor: persist queue pause and turn scope authority 2026-11-08 09:03:22 -08:00
Brennan Benson 866cbad606 refactor: read current chat items directly from domain rows
Replace the facade-backed item reads with readJournalDomainItems(db, target, operation),
which runs synchronously on the caller's reader snapshot against journal_items, aliases,
tombstones, name memberships and current submission attempts. Each read seeks a typed
scalar index and decodes only the rows it returns; the continuation export pages items
and sends in bounded keyset chunks.

journal-domain-item-read-columns.ts supplies the item-read columns, their indexes and the
pure per-revision extractor for frozen 001 and the single item/import upsert. Lifecycle
reads and the point-read dispatch are wired separately during the runtime flip.
2026-11-08 08:57:24 -08:00
Brennan Benson fb218275cc refactor: share exact current item persistence 2026-11-08 08:53:24 -08:00
Brennan Benson 52f547dde0 refactor: route text snapshots through direct message commands 2026-11-08 08:42:33 -08:00
Brennan Benson 582754d86f refactor: project Stop notes in their writer transaction 2026-11-08 08:22:37 -08:00
Brennan Benson ac9c052d02 refactor: write current chat items once per revision 2026-11-08 08:06:00 -08:00
Brennan Benson 7f482fbd0a refactor: wire bounded retired chat maintenance 2026-11-08 07:54:43 -08:00
Brennan Benson ba5c193736 Merge bounded retired chat maintenance 2026-11-08 07:52:53 -08:00
Brennan Benson e704b1f5bd refactor: freeze the native chat schema and index visible names 2026-11-08 07:50:38 -08:00
Brennan Benson 83399f46ad fix: pack retired journal deletes by payload size 2026-11-08 07:48:46 -08:00
Brennan Benson 32d6482322 fix: bound retired journal cleanup work per chat 2026-11-08 07:44:07 -08:00
Brennan Benson 2e50bfe3ee Merge bounded chat history selection 2026-11-08 07:37:05 -08:00
Brennan Benson 1488df73ce fix: restart unfinished chat imports from the original store 2026-11-08 07:36:33 -08:00
Brennan Benson c8b8f16696 fix: select domain history by stored size before reading bodies
Backward, tail and hydrate pages now take each header's sent size and current
submission size from the bounded header query, admit whole sequence groups by
those sizes, and only then load the admitted bodies and submissions. An
oversized lone group becomes placeholders without decoding its bodies. Forward
pages pick the longest event prefix whose touched rows fit by the same sizes
before the existing replay builder reads current rows. The roster finds each
unnamed subagent's earliest visible naming row through one indexed lookup per
id instead of scanning every naming row.

The sent-size column and the subagent-name relation are a new migration body
for the central migration list; item writers call the bounds write after each
upsert.
2026-11-08 07:31:25 -08:00
Brennan Benson 010bc1aaf8 perf: request chat checkpoints only at frame pressure 2026-11-08 07:29:15 -08:00
Brennan Benson 8c13d01790 refactor: initialize the chat store from profile metadata only 2026-11-08 07:22:47 -08:00
Brennan Benson 3ba1a9fbd3 refactor: integrate bounded journal maintenance 2026-11-08 07:07:41 -08:00
Brennan Benson 48c06a33ab Merge bounded domain maintenance 2026-11-08 07:05:54 -08:00
Brennan Benson 282836c6f9 fix: use the common journal WAL size target 2026-11-08 07:05:11 -08:00
Brennan Benson f123d03c7f Replace journal maintenance deadlines with bounded periodic work 2026-11-08 07:03:05 -08:00
Brennan Benson 2653b38aff fix: project dependent Stop notes in domain history 2026-11-08 06:46:03 -08:00
Brennan Benson c6c0fb3581 fix: coordinate journal WAL pressure with writer admission 2026-11-08 06:39:57 -08:00
Brennan Benson fc149b3ad3 Merge typed one-way chat import 2026-11-08 06:27:50 -08:00
Brennan Benson f4eb428cb6 refactor: reuse the domain item command for ordinary rows 2026-11-08 06:27:39 -08:00
Brennan Benson 2988a1a066 refactor: import frozen chats as typed domain rows, ready last
Replace the staging reducer conversion and its generic table/column export
with a one-way domain import. A reader restores the copied legacy source with
the existing pure interpretation, reading in short statements with no
transaction spanning the restore, and returns bounded typed pages (items,
tombstones, aliases, attempts, receipts, queue cards, provider activity).
The writer inserts each page through its named statement keyed by restored
identities, so an interrupted import resumes idempotently. The chat head is
written last and is the ready mark: a ready chat never reads its frozen
source again, and the source watermark compare and retry loop are gone.
2026-11-08 06:24:39 -08:00
Brennan Benson c3bc240e88 refactor: migrate the current queue through one ordered list 2026-11-08 06:02:34 -08:00
Brennan Benson 74cd498733 Merge current queue row replacement 2026-11-08 05:57:55 -08:00
Brennan Benson bb25d58f9d fix: decode frozen queue rows with optional fields 2026-11-08 05:57:39 -08:00
Brennan Benson de308dfb90 refactor: keep one current queue row with skinny edit holds
Queue cards live in one row per chat/epoch/message, updated in place. A
content or state change advances the row revision; edit holds name that
revision instead of copying body, fingerprint, state or consumed attempt.
Moves read only ordering headers and update only positions, returning
placements. Queued admission provenance is a column on the attempt,
backfilled from the exact named former card version (missing => not
personal), so card versions and source-card columns are removed.
2026-11-08 05:55:18 -08:00
Brennan Benson 6d489cd5d1 refactor: initialize the chat domain store with numbered migrations 2026-11-08 05:45:14 -08:00
Brennan Benson 5dae0b92d5 refactor: use one chat durability mode and ready batch selector 2026-11-08 05:22:30 -08:00
Brennan Benson 0374d7b3c9 Await test-owned chat store retirement before cleanup 2026-11-08 04:53:57 -08:00
Brennan Benson 983fb2b2bb Install domain queue ordering and preserve addressed card versions 2026-11-08 04:40:41 -08:00
Brennan Benson 7480d8b10a Keep the chat writer owned until runtime retirement completes 2026-11-08 04:40:12 -08:00
Brennan Benson d0acf70982 Merge named native chat queue commands 2026-11-08 04:34:29 -08:00
Brennan Benson f1489e5dee Write native chat queue cards as named domain SQL commands
Queue insert, edit, hold, withdraw and move now select the addressed current
card rows, apply the existing queue policy and copy-replace card versions in
the caller's writer transaction, with one sequence and replay event per
producing command. Order is a typed position column with message-id ties;
replaced versions stay only while a submission attempt names them, and
withdraw/edit retire their edit leases in the same transaction.
2026-11-08 04:33:05 -08:00
Brennan Benson 1a46edf55a Narrow ready message requests without a cast 2026-11-08 04:23:32 -08:00
Brennan Benson 028029adda Bound replay retention and batch ready chat messages 2026-11-08 04:17:07 -08:00
Brennan Benson 3523f57df1 Merge bounded native chat domain history 2026-11-08 04:08:17 -08:00
Brennan Benson aa9ad85713 Read native chat history directly from domain rows by bounded keyset windows
Domain schema v2 adds the history metadata the reader selects on (hidden, root,
subagent row/group, named subagent IDs, turn marker), backfilled once from saved
v1 payloads; every message upsert writes it from the merged current item.

Tail/before/hydrate pick a bounded newest-first header window (the existing
2x limit reach, counted over every row so sparse-root chats stay bounded,
completing the boundary sequence group) before decoding bodies. Forward
catch-up selects an ordered event window, resets below the pruned cursor or
across a gap, and returns current rows and current submissions for the touched
identities. All reads share one reader snapshot.
2026-11-08 04:06:43 -08:00
Brennan Benson ed9f36d898 Merge persisted native chat edit leases 2026-11-08 04:01:31 -08:00
Brennan Benson 4d8295be3a Retain a bounded native chat replay tail 2026-11-08 04:01:20 -08:00
Brennan Benson 2b53cdd45e Persist queued message edit leases with named SQL commands 2026-11-08 04:00:21 -08:00
Brennan Benson 162b898e36 Write native chat messages through named SQL commands 2026-11-08 03:27:30 -08:00
Brennan Benson 11df66e7d0 Retain streamed text durability and bound SQL writer batches 2026-11-08 02:16:02 -08:00
Brennan Benson d634f2a5a2 Read restart and child retirement facts through SQL-ready queries 2026-11-08 02:13:02 -08:00
Brennan Benson 9f9e375103 Merge bounded lifecycle journal reads 2026-11-08 02:09:14 -08:00
Brennan Benson f726d562bd Answer restart and outgrown-child lifecycle reads in one journal snapshot
Adds latestPrompt, restartProgress and outgrownChild named reads on both
journal backends. Each answers from one reader snapshot: the newest root
user prompt through the existing user-prompt index, the logical epoch with
sends accepted after a cursor, and child sign-out evidence (input rejection
or a root status at the child's execution fence) with the newest turn end
and the next send's message body. Callers are converted separately.
2026-11-08 02:08:40 -08:00