From a9cc61349ef63f6f4936228c9fc42569894d1595 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 7 Apr 2026 03:47:22 +0000 Subject: [PATCH] next --- packages/core/src/context/ir/graphUtils.ts | 4 ++-- .../src/context/sidecar/orchestrator.test.ts | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/core/src/context/ir/graphUtils.ts b/packages/core/src/context/ir/graphUtils.ts index 87423ddfa7..45234c9345 100644 --- a/packages/core/src/context/ir/graphUtils.ts +++ b/packages/core/src/context/ir/graphUtils.ts @@ -53,7 +53,7 @@ export function generateWorkingBufferView( ep.trigger?.type === 'USER_PROMPT' ? [...(ep.trigger.semanticParts || []).map((sp) => ({ ...sp }))] : undefined, - } as any, + } as unknown as typeof ep.trigger, steps: ep.steps.map( (step) => ({ @@ -62,7 +62,7 @@ export function generateWorkingBufferView( ...step.metadata, transformations: [...(step.metadata?.transformations || [])], }, - }) as any, + }) as unknown as typeof step, ), yield: ep.yield ? { diff --git a/packages/core/src/context/sidecar/orchestrator.test.ts b/packages/core/src/context/sidecar/orchestrator.test.ts index 8e4d6710cd..38d3a1ffb6 100644 --- a/packages/core/src/context/sidecar/orchestrator.test.ts +++ b/packages/core/src/context/sidecar/orchestrator.test.ts @@ -9,18 +9,22 @@ import { PipelineOrchestrator } from './orchestrator.js'; import { ProcessorRegistry } from './registry.js'; import { createMockEnvironment, createDummyState, createDummyEpisode } from '../testing/contextTestUtils.js'; import type { ContextEnvironment } from './environment.js'; -import type { ContextProcessor } from '../pipeline.js'; +import type { ContextAccountingState, ContextProcessor } from '../pipeline.js'; import type { SidecarConfig } from './types.js'; import type { ContextEventBus } from '../eventBus.js'; +import type { EpisodeEditor } from '../ir/episodeEditor.js'; + // Create a Dummy Processor for testing Orchestration routing class DummySyncProcessor implements ContextProcessor { static create() { return new DummySyncProcessor(); } constructor() {} readonly name = 'DummySync'; - async process(editor: any, _state: any) { - editor.editEpisode(editor.episodes[0].id, 'DUMMY_EDIT', (draft: any) => { - draft.dummyModified = true; + readonly id = 'DummySync'; + readonly options = {}; + async process(editor: EpisodeEditor, _state: ContextAccountingState) { + editor.editEpisode(editor.episodes[0].id, 'DUMMY_EDIT', (draft: unknown) => { + (draft as Record)['dummyModified'] = true; }); } } @@ -29,9 +33,11 @@ class DummyAsyncProcessor implements ContextProcessor { static create() { return new DummyAsyncProcessor(); } constructor() {} readonly name = 'DummyAsync'; - async process(editor: any, _state: any) { - editor.editEpisode(editor.episodes[0].id, 'DUMMY_EDIT', (draft: any) => { - draft.dummyAsyncModified = true; + readonly id = 'DummyAsync'; + readonly options = {}; + async process(editor: EpisodeEditor, _state: ContextAccountingState) { + editor.editEpisode(editor.episodes[0].id, 'DUMMY_EDIT', (draft: unknown) => { + (draft as Record)['dummyAsyncModified'] = true; }); } } @@ -40,7 +46,9 @@ class ThrowingProcessor implements ContextProcessor { static create() { return new ThrowingProcessor(); } constructor() {} readonly name = 'Throwing'; - async process(editor: any, state: any): Promise { + readonly id = 'Throwing'; + readonly options = {}; + async process(_editor: EpisodeEditor, _state: ContextAccountingState): Promise { throw new Error('Processor failed intentionally'); } }