Skip to content

Commit 8fd56ea

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-26071-lint-schedule-skip
Claude-Session: https://claude.ai/code/session_01QSeKYmhU5KEj1nukYhp1Tg Co-authored-by: Claude <noreply@anthropic.com>
2 parents 9022ad4 + 5cba8fc commit 8fd56ea

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

‎packages/qa/dogfood/test/packaged-action-disabled-dispatch-live.dogfood.test.ts‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
//
3737
// The file owns its boot (and its database file): it writes ledger rows, so it
3838
// may not share a showcase with any other file.
39+
//
40+
// The task the Mark Done cases act on is picked as a not-done one in a stable
41+
// order, and its `done === false` is asserted in `beforeAll`: the seed carries
42+
// done tasks too, and an unordered first row could be one of them, which
43+
// acceptance[0]'s "nothing written" check cannot tell from a refusal.
3944

4045
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
4146
import { mkdtempSync, rmSync } from 'node:fs';
@@ -65,7 +70,6 @@ describe('[#26572] a disabled packaged action is refused at both doors, over HTT
6570
let dir: string;
6671
let dbFile: string;
6772
let taskId: string;
68-
let markDoneRowId: unknown;
6973

7074
const boot = (file: string) => bootShowcase({ databaseFile: file, extraPlugins: [new MCPServerPlugin()] });
7175

@@ -115,9 +119,13 @@ describe('[#26572] a disabled packaged action is refused at both doors, over HTT
115119
dbFile = join(dir, 'showcase.db');
116120
stack = await boot(dbFile);
117121
admin = await stack.signIn();
118-
const list = await call(admin, 'GET', '/data/showcase_task?$top=1');
119-
taskId = list.json.records[0].id;
120-
expect(taskId).toBeTruthy();
122+
const notDone = encodeURIComponent(JSON.stringify({ done: false }));
123+
const list = await call(admin, 'GET', `/data/showcase_task?$filter=${notDone}&$orderby=id&$top=1`);
124+
expect(list.status, list.text).toBe(200);
125+
taskId = list.json.records[0]?.id;
126+
expect(taskId, 'setup: the showcase seed has no task with done = false').toBeTruthy();
127+
// The precondition acceptance[0] rests on, asserted before any switch flips.
128+
expect((await readTask(taskId)).done, `setup: task ${taskId} was picked as not done`).toBe(false);
121129
}, 240_000);
122130

123131
afterAll(async () => {
@@ -152,9 +160,7 @@ describe('[#26572] a disabled packaged action is refused at both doors, over HTT
152160
.toEqual({ done: before.done, progress: before.progress, updated_at: before.updated_at });
153161
expect(after.done).toBe(false);
154162

155-
const rows = await actionRows('showcase_mark_done');
156-
expect(rows).toHaveLength(1);
157-
markDoneRowId = rows[0].id;
163+
expect(await actionRows('showcase_mark_done')).toHaveLength(1);
158164
});
159165

160166
it('acceptance[1]: the consult precedes the param contract — 409 disabled, 400 enabled, for the identical request', async () => {
@@ -233,6 +239,12 @@ describe('[#26572] a disabled packaged action is refused at both doors, over HTT
233239
});
234240

235241
it('acceptance[5] / [2]: after a cold boot the switch holds; re-enabling updates the same row and re-arms dispatch', async () => {
242+
// The row acceptance[0]'s switch wrote, read here before the reboot.
243+
const rowsBeforeBoot = await actionRows('showcase_mark_done');
244+
expect(rowsBeforeBoot, 'acceptance[0] disables showcase_mark_done; this clause re-reads the ledger row it wrote')
245+
.toHaveLength(1);
246+
const markDoneRowId = rowsBeforeBoot[0].id;
247+
236248
await stack.stop();
237249
stack = await boot(dbFile);
238250
admin = await stack.signIn();

0 commit comments

Comments
 (0)