test(orchestration): give the stopping-worker task guard a Run

#19542 tightened createTask so a Task without a Run throws instead of
falling back to the legacy Run, and migrated every existing test to pass
`runId: 'run_legacy_local'` (254 such lines) with writer-run-required.test.ts
pinning the throw. #19551 added this file 16 seconds later, validated
against a main that predated #19542, with two bare createTask calls. Each
PR was green alone; together shard 3/8 fails all 7 cases here with
"Run is required".

The stale side is this test, not createTask: re-loosening the writer would
undo a deliberate, pinned invariant to make a newer test pass. Pass the
legacy Run at both sites, matching the shape #19542 established.

Swept the rest: with this change, every test under src/main/runtime/
orchestration and src/main/runtime/rpc/methods/orchestration passes
(194 files, 1611 tests); the remaining bare createTask calls are either
the intentional pin in writer-run-required.test.ts or RPC-harness tests
whose db is bound to a run by the harness.
This commit is contained in:
Neil
2026-09-08 01:41:16 -07:00
parent d346d6f447
commit e958ae5d85
@@ -12,7 +12,7 @@ describe('a Task whose supervised worker is stopping', () => {
afterEach(() => db.close())
function localWorker() {
const task = db.createTask({ spec: 'local work' })
const task = db.createTask({ runId: 'run_legacy_local', spec: 'local work' })
const { dispatch } = db.createStartingWorkerDispatch({
taskId: task.id,
startOptions: {},
@@ -59,7 +59,7 @@ describe('a Task whose supervised worker is stopping', () => {
})
it('control: still accepts dispatched for an active Dispatch with no supervised worker', () => {
const task = db.createTask({ spec: 'unsupervised work' })
const task = db.createTask({ runId: 'run_legacy_local', spec: 'unsupervised work' })
createRootDispatch(db, task.id, 'term_worker')
expect(db.updateTaskStatus(task.id, 'dispatched')?.status).toBe('dispatched')