mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-26 01:43:56 +01:00
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>
This commit is contained in:
1 parent
31befac653
commit
b690383da5
3 files changed
+15
-15
No files matched your search
@@ -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'),
|
||||
|
||||
@@ -18,7 +18,7 @@ const usage = (over: Partial<CellUsage> = {}): 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);
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ function consulted(result: Awaited<ReturnType<typeof runSkillTest>>): boolean {
|
||||
|
||||
async function runCell(task: PanelTask, arm: PanelArm, trial: number): Promise<PanelRow | null> {
|
||||
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<P
|
||||
maxTurns: PANEL_MAX_TURNS,
|
||||
allowedTools: PANEL_ALLOWED_TOOLS,
|
||||
timeout: PANEL_TIMEOUT_MS,
|
||||
testName: task.key + '-' + arm.id + '-t' + trial,
|
||||
testName: task.id + '-' + arm.id + '-t' + trial,
|
||||
runId,
|
||||
model: arm.model,
|
||||
env: armEnv(arm),
|
||||
@@ -73,13 +73,13 @@ async function runCell(task: PanelTask, arm: PanelArm, trial: number): Promise<P
|
||||
const cls = classifyCell(arm, result.exitReason, usage);
|
||||
const scored = cls.verdict === 'scored' ? runCheck(task, dirs.dir) : null;
|
||||
const row: PanelRow = {
|
||||
task: task.key, arm: arm.id, model: arm.model, route: arm.route, trial,
|
||||
task: task.id, arm: arm.id, model: arm.model, route: arm.route, trial,
|
||||
verdict: scored ? (scored.pass ? 'pass' : 'fail') : 'infra',
|
||||
reason: scored ? scored.detail : (cls as { reason: string }).reason,
|
||||
exitReason: result.exitReason, costUsd, usage, durationMs: Date.now() - started, consulted: consulted(result),
|
||||
};
|
||||
fs.appendFileSync(ROWS, JSON.stringify({ runId, ...row }) + '\n');
|
||||
console.log('[model-panel] ' + task.key + ' ' + arm.id + ' t' + trial + ' ' + row.verdict + ' $' + (costUsd ?? 0).toFixed(4) + ' turns=' + (usage?.turns ?? 0) + ' ' + row.reason);
|
||||
console.log('[model-panel] ' + task.id + ' ' + arm.id + ' t' + trial + ' ' + row.verdict + ' $' + (costUsd ?? 0).toFixed(4) + ' turns=' + (usage?.turns ?? 0) + ' ' + row.reason);
|
||||
return row;
|
||||
} finally {
|
||||
if (!settled) settle(SPEND, attempt, 'unknown');
|
||||
@@ -102,9 +102,9 @@ async function pool<T>(jobs: Array<() => Promise<T>>, limit: number): Promise<T[
|
||||
const describePaid = describeE2ETier('periodic');
|
||||
|
||||
for (const task of PANEL_TASKS) {
|
||||
const selected = selectedTests === null || selectedTests.includes(task.key);
|
||||
(selected ? describePaid : describe.skip)('Model panel: ' + task.key, () => {
|
||||
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)));
|
||||
|
||||
Reference in new issue
Block a user