From 19c39885e7cb270ee09cf14d4f4fbd250f2d7efc Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 7 Apr 2026 23:23:50 +0000 Subject: [PATCH] docs: add migration checklist for pure functional IR --- packages/core/src/context/migration-plan.md | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 packages/core/src/context/migration-plan.md diff --git a/packages/core/src/context/migration-plan.md b/packages/core/src/context/migration-plan.md new file mode 100644 index 0000000000..9b9ddb2c0b --- /dev/null +++ b/packages/core/src/context/migration-plan.md @@ -0,0 +1,37 @@ +# The Ship of Theseus Migration Checklist + +- [ ] **Phase 1: Core Types (`ir/types.ts`)** + - [ ] Add `ConcreteNode` and `LogicalNode` types. + - [ ] Add `episodeId` (or generic `parentId`) to all `ConcreteNode` + interfaces. + - [ ] Add `replacesId` and `abstractsIds` pointers. + - [ ] Remove `variants` dictionary from `IrNode`. + +- [ ] **Phase 2: Processor Pipeline (`pipeline.ts`)** + - [ ] Delete `EpisodeEditor`. + - [ ] Define `ContextPatch`. + - [ ] Update `ContextProcessor` signature to accept `ProcessArgs` and return + `Promise`. + +- [ ] **Phase 3: The Reducer (`sidecar/orchestrator.ts`)** + - [ ] Update `executePipeline` and `executeTriggerSync` to act as a reducer. + - [ ] Map `ContextPatch` results onto the flat Ship array. + +- [ ] **Phase 4: Pristine Graph & Mapping (`contextManager.ts` & `ir/toIr.ts`)** + - [ ] Update `toIr` to produce a flat list of `ConcreteNode`s and a tree of + `LogicalNode`s. + - [ ] Make `ContextManager` track the Pristine Graph and instantiate the flat + Ship. + - [ ] Commit patches to the Pristine Graph history. + +- [ ] **Phase 5: The Walker (`ir/projector.ts`)** + - [ ] Update projection to simply walk the flat `ReadonlyArray`. + - [ ] Skip nodes whose IDs are in a "skipped" set (based on `abstractsIds`). + +- [ ] **Phase 6: Refactoring Processors** + - [ ] `ToolMaskingProcessor` + - [ ] `SemanticCompressionProcessor` + - [ ] `BlobDegradationProcessor` + - [ ] `EmergencyTruncationProcessor` + - [ ] `HistorySquashingProcessor` + - [ ] `StateSnapshotProcessor`