Repository navigation
Description
Part of epic #2850.
Context
The schedule service (packages/ui-server/src/schedules/service.ts, routes in packages/ui-server/src/routes/schedules.ts) commits on the app connection:
propose,packages/ui-server/src/schedules/service.ts:488(insert:532-536);approve,:549(:563-574);publish,:581(:615-638), withcompletePublication:415-448andcompleteRetirement:454-462;cancel,:725(:733-756);reopen,:804, withadoptRestoredRoot:772-781andreconcile:466-478,:830-852.
rootInfo (:172-185) writes once, during boot (ready, :883, awaited at packages/ui-server/src/app.ts:756).
Scope
Move the route writes to the write worker. Each route answers what it answered before, once its commit has landed. Publication stays ordered with the Git work it records: a step that must observe Git between statements keeps that order, and the PR records how.
Out of scope
rootInfo's boot-time write.schedules/admission.ts, which is not wired into the hosted app.- The cron runner's schedule execution.
Acceptance criteria
- Each moved write commits on the
ui.dbwrite worker (openSqliteWriter,packages/ui-server/src/db/write-worker.ts) atsynchronous=FULL, keeping its transaction contents and its order relative to journal, Activity and the other worker writes. - A focused test fails if a moved write runs on the app connection (
APP_CONNECTION_WRITEviawatchWriteSites,packages/ui-server/tests/helpers/write-sites.ts) or commits below FULL (SQLITE_WRITE_BELOW_FULL). Mutation receipts in the PR show each guard failing on its named assertion. - Every reader that relied on the write having committed when the call returned still sees it (awaits the write, or waits for writes submitted before it). Refusal classes are kept across the worker.
- Before/after receipts on the native pi UID 1000 cell under three
dd … conv=fsyncwriters (tests: attribute recurring one-second native hosted health timeouts #2416 method, turn wait joined): no window ≥ 250 ms afterreadyattributed to a moved writer, or a recorded reason the cell does not exercise it.
Verification
bun run test packages/ui-server, bun run test ./tests, bun run check:pr --base origin/main, and the native hosted proof (scripts/prove-native-host.ts) under the fixture lock, with and without the fsync load.
Contract impact
None expected. A retyped public signature (api-report/ui-server.txt) needs the classification in docs/integration-contract/package-api.md checked first.
Activity
schlessera commentedon Oct 26, 2026
Claim
bk3003-20261026-schedules: implementing the pre-selected schedules write-worker slice onfix/3003-schedules-offloop-044. Publication and retirement keep their existing SQL and file ordering.schlessera commentedon Oct 26, 2026
Draft implementation handoff: #3015
Head
7405e78084f4138eee9362df96f94dc92a3efbe0; tested merged base07fbce896099b87903bb994e3b6a939f232669fd. Shared-worker schedule ledger writes preserve FULL, transaction contents and Git/file ordering.Local proof passed: focused 39; UI-server 4,114; root 1,966; preflight 755; tsc/lint; packed consumers; both full native matrices (without load and under three fsync writers). All 24 mutations failed on the claimed assertions and were restored. The Pi UID 1000 cell does not call schedule writers, so no before/after lag attribution is claimed. The earlier root scratch-writability failure remains recorded in #3010; the refreshed complete root run passed.
Main advanced to
b99489b3cwhile the last already-started suite was finishing. No additional heavy command remained to start; the coordinator must judge overlap, refresh and obtain combined-candidate confirmation. PR remains draft, milestone 0.44.0. No ready transition or merge performed.