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
|
|
@ -11,14 +11,14 @@ import type {
|
|||
WalkForwardSummary,
|
||||
} from '@stock-bot/stock-config/walk-forward';
|
||||
import { readCanonicalDataset } from './canonical-research.service';
|
||||
import { ChronologicalValidationService } from './chronological-validation.service';
|
||||
import type { ChronologicalValidationService } from './chronological-validation.service';
|
||||
import {
|
||||
ExperimentError,
|
||||
experimentHash,
|
||||
experimentId,
|
||||
experimentReceipt,
|
||||
} from './experiment-input';
|
||||
import { ExperimentsService } from './experiments.service';
|
||||
import type { ExperimentsService } from './experiments.service';
|
||||
import { lockResearchAgent } from './research-agent-budget';
|
||||
import { validationEqual } from './validation-evidence';
|
||||
import {
|
||||
|
|
@ -73,10 +73,19 @@ export class WalkForwardService {
|
|||
private readonly database;
|
||||
private readonly experiments;
|
||||
private readonly validations;
|
||||
constructor(container: IServiceContainer) {
|
||||
constructor(
|
||||
container: IServiceContainer,
|
||||
collaborators: {
|
||||
experiments: Pick<ExperimentsService, 'lockedPreview'>;
|
||||
validations: Pick<
|
||||
ChronologicalValidationService,
|
||||
'admitPrepared' | 'verifiedSealedReport' | 'readDetail'
|
||||
>;
|
||||
}
|
||||
) {
|
||||
this.database = requireServices(container, 'postgres').postgres;
|
||||
this.experiments = new ExperimentsService(container);
|
||||
this.validations = new ChronologicalValidationService(container);
|
||||
this.experiments = collaborators.experiments;
|
||||
this.validations = collaborators.validations;
|
||||
}
|
||||
async preview(raw: unknown, principal = 'operator') {
|
||||
const input = parseWalkForwardInput(raw);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue