feat(research): cut over canonical runtime and enforce agent budgets
This commit is contained in:
parent
ab08db82fd
commit
bbf0dd4453
103 changed files with 6138 additions and 3112 deletions
|
|
@ -20,8 +20,25 @@ import type {
|
|||
} from '@stock-bot/stock-config/experiments';
|
||||
import { builtinCatalogDescriptors } from '@stock-bot/stock-config/strategy';
|
||||
import type { Backtest } from '../../apps/stock/web-app/src/features/backtest/services/backtestApiV2';
|
||||
import { parseValidationDetail } from '../../apps/stock/web-app/src/features/experiments/services/chronologicalValidationDurableApi';
|
||||
import { nativeReplayFixture } from '../fixtures/native-replay';
|
||||
|
||||
test('saved validation decodes explicit research agent actors without accepting malformed identities', () => {
|
||||
const value = document('reported');
|
||||
if (!value.selection || !value.report) {
|
||||
throw new Error('Reported fixture needs immutable selection and report');
|
||||
}
|
||||
const actor = 'agent:aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa';
|
||||
value.selection.principal = actor;
|
||||
value.report.principal = actor;
|
||||
const parsed = parseValidationDetail(value);
|
||||
expect(parsed.selection?.principal).toBe(actor);
|
||||
expect(parsed.report?.principal).toBe(actor);
|
||||
expect(() =>
|
||||
parseValidationDetail({ ...value, report: { ...value.report, principal: 'agent:operator' } })
|
||||
).toThrow();
|
||||
});
|
||||
|
||||
const browser = new GlobalWindow({ url: 'http://localhost:5173' });
|
||||
const keys = ['window', 'document', 'Event', 'ResizeObserver', 'IS_REACT_ACT_ENVIRONMENT'] as const;
|
||||
const originals = new Map(keys.map(key => [key, Object.getOwnPropertyDescriptor(globalThis, key)]));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue