feat(research): add retained-input parameter sweep workbench
This commit is contained in:
parent
30accfcf43
commit
6f64ef62ba
41 changed files with 4469 additions and 34 deletions
24
test/integration/experiments-contracts.test.ts
Normal file
24
test/integration/experiments-contracts.test.ts
Normal 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({});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue