feat(research): add retained-input parameter sweep workbench

This commit is contained in:
Boki 2026-10-24 10:33:05 -04:00
parent 30accfcf43
commit 6f64ef62ba
41 changed files with 4469 additions and 34 deletions

View file

@ -0,0 +1,24 @@
import { expect, test } from 'bun:test';
import {
experimentInputSchema,
experimentSubmissionSchema,
} from '@stock-bot/stock-config/experiments';
test('reserved raw grid keys cannot silently become a baseline experiment', () => {
for (const key of ['__proto__', 'constructor', 'prototype']) {
const input = JSON.parse(
`{"backtestId":"00000000-0000-4000-8000-000000000001","name":"Sweep","grid":{"${key}":[1]}}`
);
expect(experimentInputSchema.safeParse(input).success).toBe(false);
expect(
experimentSubmissionSchema.safeParse({ ...input, previewHash: 'a'.repeat(64) }).success
).toBe(false);
}
expect(
experimentInputSchema.parse({
backtestId: '00000000-0000-4000-8000-000000000001',
name: 'Baseline',
grid: {},
}).grid
).toEqual({});
});