Repository navigation
perf(native-chat): share saved text across journal revisions - #29132
brennanb2025 wants to merge 15 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
|
Closing: the piece storage is careful work, but it's a one-way schema-5 migration (rolling back to an older Orca refuses to open chats) with no current-head measurements, and it conflicts in six files including #28966's journal writer changes. Please re-propose once the dependent cadence change has proven it needs it. |
ELI5
Long chat replies repeatedly saved the same beginning as they grew. That makes more frequent progress updates expensive. This prerequisite stores shared text pieces so saved chats retain their full history with less repeated text; save timing stays unchanged here.
What Changed
Each revision keeps its original identity and metadata, while immutable text pieces share the unchanged beginning and store the changed tail. Authoritative final replacements, including shorter replies, keep their existing meaning. Transactions, ownership and cursor order retain their existing meaning. After a save commits, connected clients receive the current message from the host’s in-memory state. Reopening or explicitly reading saved history still checks the database; if saved text becomes damaged during a live reply, that damage is discovered on the next saved-history read or reopen.
The database moves atomically to schema 5. Existing raw rows remain readable, and an earlier experimental compatibility view is removed during migration. An unchanged older Orca already refuses a newer database before opening its chats; this PR uses that existing boundary. Paired and SSH clients still receive complete existing messages from the execution host and do not read its database file.
Why
Saving less often makes progress stall; keeping full copies beside pieces retains the storage cost. Sharing text beneath the logical journal preserves complete history without retaining every repeated beginning. The common pattern informs appended text and final replacement. Complete historical revisions, full existing wire messages and host-owned decoding are intended differences needed by Orca's cursor and mixed-peer contracts.
This does not promise linear network traffic or constant historical replay cost. Older binaries on a migrated profile use the existing update-required refusal. Saved-file downgrade compatibility is outside the supported contract; mixed client/server versions remain supported.
Linked Issue
Maintainer prerequisite for the save-timing work tracked in #28984.
Visual Proof
Real signed-in-agent hidden Electron comparison on M4Air is pending capacity. No current rendered result or screenshot is claimed.
Testing
The retained proof ran the earlier production checkpoint c3b9759. It supports the schema transition at that checkpoint; it does not validate the newer live-publication code. Each of the 156 reported source hashes was independently matched to its pinned commit, and all 262 transferred artifact lengths and hashes were checked. The original failed scratch oracle remains failed: a new oracle follows the unchanged older binary's contract of identical main-file bytes and absent or empty WAL, while recording SHM bookkeeping.
The historical 6.6-second older-reader result on the experimental schema-4 view remains valid. This change removes that view at a supported version boundary; it does not claim to optimize that query. Wider performance acceptance remains pending.
This checkout has no dependencies or installed hook wrappers, so its pre-commit hook could not execute; no bypass flag was used. CI supplies the static-analysis gate. Current head is 75e27ce; a full current workflow is missing while the branch conflicts. Historical green runs are not evidence for this head.
AI Disclosure
Review
The first review found repeated full-prefix storage. Later review corrected unnecessary historical dependency traversal. A runtime panel then blocked the experimental compatibility view and a separate fractional-clock deadline bug. First-hand released-source inspection established the existing newer-schema refusal contract, and the decider adopted private schema-5 storage. The amended plan was independently checked before implementation. The latest review found unnecessary full-history allocation for activity-only updates; the narrow correction skips it for caught-up clients and awaits targeted checks. The unchanged subscriber performance gates, real remote QA, final integration and exact-head CI remain open, so the PR stays a draft.
Agent skill upstream boundary
Notes
The execution host owns journal access for local, SSH and paired clients. No new wire operation, capability requirement, renderer message, setting or agent-specific policy is introduced. Windows Subsystem for Linux storage classifications include the physical tables. Remaining unmeasured platform, transport and responsiveness cases are not claimed verified.
Checklist
Author: @BrennanKB5
Current verification checkpoint: a focused Windows run on the preceding head collected 122 tests and found one extra history reduction during reconnect. The current head restores lazy reconnect work reads; that unchanged test, the subscriber performance gates, real signed-in-agent Electron comparison and final CI are pending. No current readiness claim.