refactor(api): compose research services with narrow collaborators (CL28)
This commit is contained in:
parent
3a63b2039e
commit
24487d35da
28 changed files with 281 additions and 94 deletions
|
|
@ -17,13 +17,11 @@ import { createRoutes } from '../../apps/stock/web-api/src/routes/create-routes'
|
|||
import { createExperimentRoutes } from '../../apps/stock/web-api/src/routes/experiments.routes';
|
||||
import { BacktestServiceV2 } from '../../apps/stock/web-api/src/services/backtest-v2.service';
|
||||
import { BacktestDispatcher } from '../../apps/stock/web-api/src/services/BacktestDispatcher';
|
||||
import { ChronologicalValidationService } from '../../apps/stock/web-api/src/services/chronological-validation.service';
|
||||
import { ExperimentsService } from '../../apps/stock/web-api/src/services/experiments.service';
|
||||
import { researchGrantPolicy } from '../../apps/stock/web-api/src/services/research-agent-budget';
|
||||
import { ResearchAgentsService } from '../../apps/stock/web-api/src/services/research-agents.service';
|
||||
import { ResearchService } from '../../apps/stock/web-api/src/services/research.service';
|
||||
import { createResearchServices } from '../../apps/stock/web-api/src/services/research-services';
|
||||
import { StrategyCatalogService } from '../../apps/stock/web-api/src/services/strategy-catalog.service';
|
||||
import { WalkForwardService } from '../../apps/stock/web-api/src/services/walk-forward.service';
|
||||
import { retainResearchDataset } from '../../scripts/import-research-dataset';
|
||||
import { packageBuiltinStrategies } from '../../scripts/package-builtin-strategies';
|
||||
import { canonicalSettings } from '../fixtures/canonical-research';
|
||||
|
|
@ -142,7 +140,7 @@ async function fixture(poolMax = 4, withAgents = true, dataset = canonicalSmaFix
|
|||
postgres,
|
||||
container,
|
||||
agents: new ResearchAgentsService(container),
|
||||
research: new ResearchService(container),
|
||||
research: createResearchServices(container).research,
|
||||
schema,
|
||||
api,
|
||||
experiments,
|
||||
|
|
@ -687,8 +685,7 @@ describe.skipIf(!url)('authoritative research principals and budgets', () => {
|
|||
);
|
||||
expect(cost.trials).toHaveLength(2);
|
||||
await f.experiments.cancel(cost.id);
|
||||
const validation = new ChronologicalValidationService(f.container),
|
||||
walk = new WalkForwardService(f.container);
|
||||
const { validations: validation, walkForwards: walk } = createResearchServices(f.container);
|
||||
const input = {
|
||||
backtestId: f.draft.id,
|
||||
name: 'Validation',
|
||||
|
|
@ -909,7 +906,7 @@ describe.skipIf(!url)('authoritative research principals and budgets', () => {
|
|||
[randomUUID(), runId, b.agent.id, randomUUID(), 'a'.repeat(64)]
|
||||
)
|
||||
).rejects.toThrow(/owning.*principal/);
|
||||
const validation = new ChronologicalValidationService(f.container),
|
||||
const validation = createResearchServices(f.container).validations,
|
||||
input = {
|
||||
backtestId: f.draft.id,
|
||||
name: 'Owned phases',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue