2.2 KiB
TODO
Dump anything here.
Self-Feedback Inbox
[prompt-modularization] Phase 3 — migrate remaining builders to composeUnitContext v2
Context: Phase 1 (fragment infrastructure, 17-prompt Working Directory deduplication) and
Phase 2 (5 stub manifests for deploy/smoke-production/release/rollback/challenge) shipped in
commit ca5d869e3. 9 of 26 unit types are now fully manifest-driven via composeInlinedContext.
What's blocked and why:
Migrating the remaining 17 builders to composeInlinedContext (v1) is the wrong path because:
inlineKnowledgeScopedandinlineGraphSubgraphare NOT inARTIFACT_KEYS— these artifacts would remain imperative and undeclared in every manifest, making manifests structurally unreliable descriptions of actual builder behavior.- Injecting knowledge/graph at the right position in the composed string requires fragile
sentinel-string searches (e.g.,
body.lastIndexOf("### Task Summary:")). This pattern is already untested in the 2 migrated complex builders (research-milestone,complete-slice). composeUnitContext(v2) inunit-context-composer.jsalready hascomputed,prepend, andexcerptsupport — knowledge and graph inlining maps cleanly tocomputedentries. Migrating to v1 now creates a half-migration state that must be undone when v2 lands.
Recommended next slice:
- Add
"knowledge"and"graph"toARTIFACT_KEYSinunit-context-manifest.js. - Register them as
computedentries in relevantUNIT_MANIFESTSentries. - Wire one builder (e.g.,
buildResearchSlicePrompt) throughcomposeUnitContextv2 as pilot. - Add position-assertion tests to already-migrated complex builders (
research-milestone,complete-slice) to guard against silent ordering degradation. - Then migrate remaining builders in batches: slice builders → milestone builders → execute-task.
Note on prompt-cache-optimizer.js: Entirely dead code — optimizeForCaching(),
estimateCacheSavings(), computeCacheHitRate() have zero importers. reorderForCaching()
is wired at phases-unit.js:519 but no cache_control markers are written to outgoing
requests. Remove the file or wire it in the same slice that adds cache_control breakpoints.