feat(FN-3292): document research boundary contract
Documents the research boundary contract in the architecture docs and research hardening preflight guide, updating architecture documentation and adding a new boundary definition file. Fusion-Task-Id: FN-3292
This commit is contained in:
@@ -64,6 +64,7 @@ export interface ResearchStepRunnerApi {
|
||||
): Promise<ResearchStepResult<ResearchSource[]>>;
|
||||
runContentFetch(
|
||||
url: string,
|
||||
providerType?: string,
|
||||
config?: ResearchProviderConfig,
|
||||
signal?: AbortSignal,
|
||||
): Promise<ResearchStepResult<{ content: string; metadata: Record<string, unknown> }>>;
|
||||
@@ -118,10 +119,11 @@ export class ResearchStepRunner implements ResearchStepRunnerApi {
|
||||
|
||||
async runContentFetch(
|
||||
url: string,
|
||||
providerType?: string,
|
||||
config: ResearchProviderConfig = {},
|
||||
signal?: AbortSignal,
|
||||
): Promise<ResearchStepResult<{ content: string; metadata: Record<string, unknown> }>> {
|
||||
const provider = this.findFirstConfiguredProvider();
|
||||
const provider = this.resolveContentProvider(providerType);
|
||||
if (!provider) {
|
||||
return this.unconfigured("no configured provider available for content fetch");
|
||||
}
|
||||
@@ -169,6 +171,14 @@ export class ResearchStepRunner implements ResearchStepRunnerApi {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private resolveContentProvider(providerType?: string): ResearchProvider | undefined {
|
||||
if (providerType) {
|
||||
const selected = this.providers.get(providerType);
|
||||
if (selected?.isConfigured()) return selected;
|
||||
}
|
||||
return this.findFirstConfiguredProvider();
|
||||
}
|
||||
|
||||
private classifyError<T>(step: string, error: unknown): ResearchStepResult<T> {
|
||||
if (error instanceof ResearchStepTimeoutError) {
|
||||
return { ok: false, error: { code: "timeout", message: error.message, retryable: true } };
|
||||
|
||||
Reference in New Issue
Block a user