fix(server,test): W6-A stabilize CI — sync lost update, atomic recovery summary, serial PG tests

- downloads.ts observe: re-read download_task FOR UPDATE inside the tx and merge
  from the locked row; qB sync could overwrite imported back to importing when
  verifyAndImport committed between the sync read and write (E8 flake).
- agent finalize: accept summaryPrefix so the recovery verdict is written with
  the terminal status in one update (E6 read a budget_exceeded run before the
  "未恢复:…" annotation landed); recover-summary step kept, now idempotent no-op.
- organize.ts: drop local slotComplete and the once-subscription completion
  write; completion/history are decided only by applySlotEvent(verify_passed)
  (W5-C follow-up, removes double write). Manual slot organize uses the shared
  subscriptions.slotComplete.
- vitest: server split into unit (parallel) and pg (file-serial, groupOrder 1)
  projects; packages/tasks file-serial; explicit worker concurrency in e2e.
- docs: W6 stabilization record in 04-v0.1-acceptance.md.

Test expectations unchanged. Full `deno task ci` x3 green: 369s / 341s / 337s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 00:32:57 +08:00
1 parent 36aa99b8aa
commit 887843f777
10 files changed
+198 -143

No files matched your search

+8 -1
View File
@@ -34,7 +34,14 @@ const worker = await startWorker({
logger,
heartbeatMs: 60_000,
bus,
runtime: { ctx: booted.ctx, modules, setRelay: booted.outbox.setRelay, outboxIntervalMs: 100, concurrency: 4 },
runtime: {
ctx: booted.ctx,
modules,
setRelay: booted.outbox.setRelay,
outboxIntervalMs: 100,
concurrency: 4,
agentConcurrency: 2,
},
});
console.log(`worker ready pid=${Deno.pid}`);
Deno.addSignalListener("SIGTERM", async () => {
+2
View File
@@ -189,7 +189,9 @@ export async function createE2E(name: string, opts: E2EOptions = {}): Promise<E2
modules,
setRelay: booted.outbox.setRelay,
outboxIntervalMs: 100,
// 并发显式固定,不随 WORKER_CONCURRENCY 等环境变量漂移
concurrency: 4,
agentConcurrency: 2,
},
});
e.worker = worker;