Repository navigation
fix(ui-server): commit schedule ledger steps on the write worker - #3015
Merged
Merged
Conversation
4 tasks
# Conflicts: # docs/decisions/sqlite-write-worker.md
schlessera
marked this pull request as ready for review
October 26, 2026 14:47
This was referenced Oct 26, 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.
Closes #3003
Refs #2850 (epic)
What changed
Schedule proposals, approvals, publication, cancellation and operator reconciliation commit on the shared SQLite write worker at
synchronous=FULL. Each route answers after the ledger steps it depends on have committed. Schedule refusals retain their class, code and HTTP status.Why this shape
Follows the write-worker decision and the merged slices #2933, #2949, #2992 and #2994. Existing transaction bodies and
BEGIN IMMEDIATEmodes are preserved. A source inventory matches all 16 original SQL write statements.Publication keeps its boundaries: qualify Git, commit the pending receipt and approval consumption, recheck Git and publish the approved file, then commit activation or quarantine. Cancellation commits the task/occurrence/Queue changes and receipt together before retiring the file; retirement is recorded afterward. A late publisher of a cancelled task journals retirement again. Reopening awaits restored-root adoption and reconciliation before its own transaction.
The excluded boot-time
rootInfoinsert remains inline. Unwired admission and cron execution are unchanged. No public API or machine-contract change; noCONTRACT:commit. Includes a patch changeset for@schlessera/brain-ui-server.Proof
Candidate head:
7405e78084f4138eee9362df96f94dc92a3efbe0.Merged base:
07fbce896099b87903bb994e3b6a939f232669fd(refreshed at the coordinator's request).Initial baseline:
e69ade40513eea1e1aacf636a8da27bb9bd647a1.Main advanced to
b99489b3cbe27fa739fd4d19117cab2cc78f72f3while the last already-started UI-server run was finishing. No heavy commands remained to start. Per the coordinator's notice, these receipts remain attributed to the head/base above for overlap judgment; the newer base is not merged or qualified here. It changes inbox lifecycle procedures, app registration, citations/API reports and native-harness wiring; it does not change the schedule service files orinbox/store.ts. A fresh combined candidate remains the coordinator's responsibility.07fbce896: 11 failures withAPP_CONNECTION_WRITE, no module-load error.propose,approve,publish,activate,quarantine,retired,retireAgain,pauseDrifted,cancel,adoptRestoredRoot, andreopento the app connection: each selected named test fails withAPP_CONNECTION_WRITE(11/11). Individually lower each same procedure tosynchronous=NORMALafter the worker probe is armed: each fails withSQLITE_WRITE_BELOW_FULL(11/11). All mutations restored. The quarantine test captures its refusal, so either guard surfaces atSCHEDULE_FILE_CONFLICT_CLASS_KEPTwith the guard message in the received error.schedule worker refusals…failsSCHEDULE_WORKER_HTTP_REFUSAL_STATUS(503 versus 409).schedule publication observes Git…failsSCHEDULE_GIT_CHECK_BETWEEN_COMMITS.bunx --no-install tsc --noEmitandbun run lint: pass.bun run check:pr --base origin/mainthrough the heavy wrapper: passed, 755 tests across 29 files, 5,033 assertions, zero failures.bun run test ./teststhrough the heavy wrapper: passed, 1,966 tests across 179 files, 74,414 assertions, zero failures. The previously failing Claude interactive policy-boundary test passed in this complete run.bun run test packages/ui-serverthrough the heavy wrapper: passed, 4,114 tests across 346 files, 28,465 assertions, zero failures.native.lock, without load (401.379 s) and under three concurrentdd bs=1M count=1024 conv=fsyncwriters (444.830 s; successful iterations [780, 783, 784]). Every owned fixture provided complete cleanup receipts. AppArmor is unavailable on this host; these do not qualify AppArmor enforcement.Earlier complete receipts at head
942897313c06a31499c2509cbc3357598aaa436dremain retained: 4,096 UI-server tests across 345 files (28,404 assertions), 755 preflight tests across 29 files (5,033 assertions), packed-consumer probes, and both full native matrices passed. Its root run had 1,965 pass / 1 fail: Claude interactiveAREAS_WRITABLE, expected[true, true], received[false, true]. That occurrence is recorded in #3010. The complete isolated policy-boundary file passes on both pristine07fbce896and this refreshed head: 19 tests and 587 assertions each. These controls establish the isolated results, not a cause or repair for the full-suite symptom. The failed receipt is preserved.Native lag coverage: the pi UID 1000 admission cell makes no schedule requests and begins with an empty operational database. It exercises only the excluded boot root insert, so it cannot provide before/after lag attribution for this group. The separate native schedule control invokes
gitCheckIgnored, not proposal/publication SQL. No latency improvement is inferred from an unexercised writer. Actual schedule commits, replay, Git ordering, cancellation/retirement races, Queue changes and HTTP refusals are covered by the real-worker tests.Citation audit: no repository citations point to
schedules/service.ts; the app wiring changes one existing line without moving cited lines. Decision documentation changes only this writer group.Mutation test mapping (each row was run independently for both app-routing and lowered-durability mutations, exit 1 in all 22 runs):
proposeschedule propose commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLapproveschedule approve commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLpublishschedule publish commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLactivateschedule publish commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLquarantineschedule quarantine commitsAPP_CONNECTION_WRITE(captured refusal)SQLITE_WRITE_BELOW_FULL(captured refusal)retiredschedule cancel commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLretireAgaina schedule cancelled during publicationAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLpauseDriftedschedule reconcile commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLcancelschedule cancel commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLadoptRestoredRootschedule adopt commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLreopenschedule reopen commitsAPP_CONNECTION_WRITESQLITE_WRITE_BELOW_FULLThese tests live in
packages/ui-server/tests/schedule-writes-offloop.test.ts. Restored focused command:bun run test packages/ui-server/tests/schedule-writes-offloop.test.ts packages/ui-server/tests/schedule-service.test.ts packages/ui-server/tests/schedule-recovery.test.ts. Mutations select the named test with-t; the two additional named assertions above also fail with exit 1. No mutation failed at module load.Checklist
docs/reflect the change, or nothing documented moved.docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.Anything left open
Draft only. All required local proof passed on the recorded head/base. The coordinator must judge the overlap with newer main
b99489b3c, refresh the branch and obtain fresh combined-candidate confirmation before ready status or merge. The earlier full-root scratch-writability failure is retained and tracked in #3010; isolated07fbce896and refreshed-head controls and the refreshed complete root suite pass. This does not establish a cause or repair for the earlier symptom. Native lag attribution does not cover schedule requests, as explained above.