From b690383da5b641615d7dfa2cd6ea1c30679e9f63 Mon Sep 17 00:00:00 2001 From: garrytan Date: Fri, 30 Oct 2026 01:23:11 +0000 Subject: [PATCH] test(model-panel): name the task field id (credential scanner false positive on key) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/helpers/model-panel-harness.ts | 12 ++++++------ test/model-panel-selftest.test.ts | 4 ++-- test/skill-e2e-model-panel.test.ts | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/helpers/model-panel-harness.ts b/test/helpers/model-panel-harness.ts index 390f7cec03..da2b340ea9 100644 --- a/test/helpers/model-panel-harness.ts +++ b/test/helpers/model-panel-harness.ts @@ -51,7 +51,7 @@ export const PANEL_ARMS: PanelArm[] = [ export interface PanelTask { /** E2E_TOUCHFILES / E2E_TIERS key. */ - key: string; + id: string; fixture: string; check: string; reference: string; @@ -65,35 +65,35 @@ const LEAVE = '\n\nLeave your changes uncommitted in the working tree.'; export const PANEL_TASKS: PanelTask[] = [ { - key: 'model-panel-bugfix', + id: 'model-panel-bugfix', fixture: path.join(ARM_FIXTURES, 'bugfix-decoys'), check: check('bugfix-decoys'), reference: reference('bugfix-decoys'), ticket: 'Bug report: receipts print $10.5 for a $10.05 item.\n\nYou are in a small git repo. `node run-tests.js` currently fails on formatPrice(1005).\nFix the bug so all tests pass. Verify with: node run-tests.js' + LEAVE, }, { - key: 'model-panel-crud', + id: 'model-panel-crud', fixture: path.join(ARM_FIXTURES, 'crud-endpoint'), check: check('crud-endpoint'), reference: reference('crud-endpoint'), ticket: 'Ticket: users need to delete notes.\n\nYou are in a small git repo containing an in-memory notes API (app.js, wired to HTTP in server.js).\nAdd DELETE /notes/:id: respond 204 on success and 404 for an unknown id, and cover the new endpoint in run-tests.js. Verify with: node run-tests.js' + LEAVE, }, { - key: 'model-panel-review', + id: 'model-panel-review', fixture: fixture('review-seeded-bug'), check: check('review-seeded-bug'), reference: reference('review-seeded-bug'), ticket: 'Pre-landing review: PR.md describes a teammate\'s change, which added src/users.js.\n\nReview src/users.js the way a careful reviewer would before it ships: find the bugs that pass a quick read but break in production. Do not edit any source file. Write REVIEW.md with one numbered finding per bug, each naming file:line, what goes wrong, and the fix.' + LEAVE, }, { - key: 'model-panel-changelog', + id: 'model-panel-changelog', fixture: fixture('changelog'), check: check('changelog'), reference: reference('changelog'), ticket: 'Release 1.4.0: write its CHANGELOG.md entry from COMMITS.md.\n\nRules: the new section goes above 1.3.0 and matches its format; list only changes a user of the app would notice, in everyday words; leave out build, test and tooling changes; do not edit older sections.' + LEAVE, }, { - key: 'model-panel-investigate', + id: 'model-panel-investigate', fixture: fixture('investigate'), check: check('investigate'), reference: reference('investigate'), diff --git a/test/model-panel-selftest.test.ts b/test/model-panel-selftest.test.ts index 1464448c5f..f67d626f8f 100644 --- a/test/model-panel-selftest.test.ts +++ b/test/model-panel-selftest.test.ts @@ -18,7 +18,7 @@ const usage = (over: Partial = {}): CellUsage => ({ input: 1000, cach describe('model panel selftest (free, no API)', () => { for (const task of PANEL_TASKS) { - test(task.key + ': the hidden check fails on the seed and passes on the reference', () => { + test(task.id + ': the hidden check fails on the seed and passes on the reference', () => { expect(fs.existsSync(task.check)).toBe(true); const seed = setupCell(task, 'selftest-seed'); const ref = setupCell(task, 'selftest-ref'); @@ -36,7 +36,7 @@ describe('model panel selftest (free, no API)', () => { } test('the panel is the preregistered shape: 5 tasks, 4 arms, 3 trials', () => { - expect(PANEL_TASKS.map((t) => t.key)).toEqual(['model-panel-bugfix', 'model-panel-crud', 'model-panel-review', 'model-panel-changelog', 'model-panel-investigate']); + expect(PANEL_TASKS.map((t) => t.id)).toEqual(['model-panel-bugfix', 'model-panel-crud', 'model-panel-review', 'model-panel-changelog', 'model-panel-investigate']); expect(PANEL_ARMS.map((a) => a.model)).toEqual(['claude-opus-5-5', 'claude-sonnet-5-5', 'particle-ai/particle-1', 'deepseek/deepseek-v4.1-flash-1017']); expect(PANEL_TRIALS).toBe(3); }); diff --git a/test/skill-e2e-model-panel.test.ts b/test/skill-e2e-model-panel.test.ts index 560f607e19..ff7e76cdc3 100644 --- a/test/skill-e2e-model-panel.test.ts +++ b/test/skill-e2e-model-panel.test.ts @@ -42,7 +42,7 @@ function consulted(result: Awaited>): boolean { async function runCell(task: PanelTask, arm: PanelArm, trial: number): Promise { if (stopped) return null; - const attempt = task.key + ':' + arm.id + ':' + trial + ':' + runId; + const attempt = task.id + ':' + arm.id + ':' + trial + ':' + runId; try { reserve(SPEND, attempt, arm.reserveUsd, { cap: PANEL_SPEND_CAP_USD, label: arm.model }); } catch (err) { @@ -61,7 +61,7 @@ async function runCell(task: PanelTask, arm: PanelArm, trial: number): Promise

(jobs: Array<() => Promise>, limit: number): Promise { - test(task.key, async () => { + const selected = selectedTests === null || selectedTests.includes(task.id); + (selected ? describePaid : describe.skip)('Model panel: ' + task.id, () => { + test(task.id, async () => { fs.mkdirSync(OUT, { recursive: true }); if (readLedger(SPEND).cap_usd === null) setCap(SPEND, PANEL_SPEND_CAP_USD); const jobs = PANEL_ARMS.flatMap((arm) => Array.from({ length: PANEL_TRIALS }, (_, i) => () => runCell(task, arm, i + 1)));