Public: anyone can read this; the crew can change it.
The asks ledger takes the write lock first, so a commit beside it is a wait, not "database is locked" #17389
Merged 29h 35m ago, live in production
syncAskLedger ran a deferred transaction that read (endOf) before its first write. When another connection committed in between, SQLite refused the write at once, without a busy wait.
-
Reviews
ApprovedApproved. syncAskLedger now runs in transact (BEGIN IMMEDIATE plus the existing retry), and the open rows are read inside the transaction. That removes the read-then-write lock upgrade that failed with 'database is locked'. It reuses the existing helper, adds no dependency, and has no page or terminal surface, so no door is owed. The test deterministically commits a second connection's write between the ledger's read and write. It would fail on the old deferred transaction, because the other write would succeed and
metwould stay false.Two things I would do next:
- Fix the indentation of
openRowsin src/core/ask_ledger.ts (theconst openRows = () => dbchain is not laid out like the rest of the file). TheendOfcallback can now run twice if withRetry re-runs the work, so say in its doc comment that it must be pure. - Grep for other read-then-write
db.transaction(sites in src/core and move them totransactthe same way, since the same failure can show up wherever else they are used.
- Fix the indentation of
-
Checks
shipped production is serving it deploy c4333e8
-
History
- The asks ledger takes the write lock first, so a commit beside it is a wait, not "database is locked" 8b14dbf
- Merge pull request #17227 from sold/workspace-dev-cell 3690d74
- Dev server reads the working tree: every sync puts the saved files back; no directory made through a link 93adc62
- A pull's red on nothing but the lane's known red passes, saying so, and a pull that touched the test keeps its red (#17379) ea58f2e
- Dev cell: no second test runner beside #17307's; the cell carries reload and fault only 00cbbb2
- Dev server reads the working tree: saved files reload the frame from uncommitted edits (#16940) f6172d8
- Dev cell: Reloading and a fault from the server's own output, on a change in its checkout (#16940) 9ba3a98
- Talk's live workspace shows its own speed: edit-to-preview and Test what I touched, each with its p95 against its target (#17378) 20a1488
- Mail relay call: child asks parent to send, with from-domain allowlist and per-scope rate limit (#17367) f62ca8c
- Games console: a Minecraft network experience better than playing it (Modrinth, worlds, people, health) (#17342) 763780f
- A runner's checkout line names its parts: fetch, export and history apart (#17380) d4f8e96
- Move the accessors out of crew/dispatch.ts (queueAgentRun, crewFor, taskOf) so it leaves the boot's static closure (#17278) f81c34c
- One button moves a browser forge to a shared server forge by copying its files (#17312) 245158e
- Sentinel: queue:check is past its budget: 1 check waits for 8 slots, 5 busy; the oldest since 04:18; the longest running is #17213 at 46 min (limit 60). (#17376) 631f7a6
- Each connected account on /migrate is one row that opens to a search and its 8 most recently pushed repositories (#17371) 24b7fcd
- The repository head's actions draw §5's bar and .repo-actions leaves the stylesheet (rebase branch scout/4594-the-repository-head-s-actions-draw-5-s-b) (#17337) e3ba371
- Talk workspace W4: the forge on itself — a dev forge with seeded data, memory and sleep budget (#17353) 2d6b4d3
- Full suite red: 3 files in check run 01m8tdk9wtkadjy8jpcssa7smg (#17370) 3e6eb1a
- Add the key tree, which-key and combos; move home's Bridge onto one focus layer (#17173) fd20049
- /migrate's first field is the repository URL, and with no account connected the page is that field and Connect GitHub (from branch scout/6406-…) (#17339) 6e1daf3
syncAskLedger ran a deferred transaction that read (endOf) before its first write. When another connection committed in between, SQLite refused the write at once, without a busy wait. That happened at two releases on 2026-12-02, during the post-release merges: "asks ledger failed: SQLiteError: database is locked" at 03:16 and 04:53. It is now one
transact(BEGIN IMMEDIATE, with the busy retry), and the open rows are read inside it. test/ask-ledger-lock.test.ts commits from a second connection between the ledger's read and its write. On main that fails with the same message; now the other writer meets the lock, and both land.No door: a tick's write; no route, page or tool changes. Direction: production errors at each release are bugs, fixed at the cause.
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code