Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeszack

Relationships

#4628 Test broken on main: SqliteReadModel.recover full_recovery_required case merges into a directory that does not exist (found by #4612)

Opened by zack · 11/11/2026· Shipped 11/11/2026

What fails

On a clean checkout of main at 1fb5c4c1e, this test fails every run on Linux:

src/infrastructure/datastore_v3/sqlite_read_model_test.ts SqliteReadModel.recover: a recovery asked to be targeted runs in full and says why: full_recovery_required (5, swamp-club#4581)

error: TypeError: the source path is neither a regular file nor a symlink to a regular file: copy '/repo/moved/data' -> '/repo/elsewhere/data'

It also fails verify-build's run-tests step for any branch rebased onto current main (found while verifying swamp-club#4612).

Why

The full_recovery_required case's arrange writes moved/data/x, then calls mergeDirInto(moved, join(repoDir, "elsewhere")) without creating elsewhere. In mergeDirInto (src/infrastructure/persistence/directory_merge.ts), the destination entry does not exist, so it tries Deno.rename into the missing parent, which fails, and then falls back to Deno.copyFile on the data directory, which throws.

Likely fix

Create the destination before merging in the test's arrange (Deno.mkdir with recursive true on the elsewhere path), or have the arrange use a destination that exists. mergeDirInto itself has always required an existing destination; whether it should create one is a separate question.

Reproduce

deno run test src/infrastructure/datastore_v3/sqlite_read_model_test.ts (107 passed, 1 failed)

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 6 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/11/2026, 12:14:52 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack11/11/2026, 12:00:54 AM

Sign in to post a ripple.