Skip to content

ui-server: schedule proposals and publication commit on the write worker #3003

Closed

Description

@schlessera

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), with completePublication :415-448 and completeRetirement :454-462;
  • cancel, :725 (:733-756);
  • reopen, :804, with adoptRestoredRoot :772-781 and reconcile :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.db write worker (openSqliteWriter, packages/ui-server/src/db/write-worker.ts) at synchronous=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_WRITE via watchWriteSites, 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=fsync writers (tests: attribute recurring one-second native hosted health timeouts #2416 method, turn wait joined): no window ≥ 250 ms after ready attributed 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

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p1Scheduled into the current or next milestone.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Oct 26, 2026
  2. added this to the 0.44.0 milestone on Oct 26, 2026
  3. self-assigned this
    on Oct 26, 2026
  4. schlessera commented on Oct 26, 2026

    @schlessera
    OwnerAuthor

    Claim bk3003-20261026-schedules: implementing the pre-selected schedules write-worker slice on fix/3003-schedules-offloop-044. Publication and retirement keep their existing SQL and file ordering.

  5. schlessera commented on Oct 26, 2026

    @schlessera
    OwnerAuthor

    Draft implementation handoff: #3015

    Head 7405e78084f4138eee9362df96f94dc92a3efbe0; tested merged base 07fbce896099b87903bb994e3b6a939f232669fd. 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 b99489b3c while 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.

  6. removed their assignment
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions