01. Execution Pipeline Spec
1. Purpose
Define the execution contract and phase boundaries for Structure -> Generation -> Polish.
2. Scope
IThoughtProcessIExecutionOutputIOutputPolisherIModelVectorRouterIAttentionGuardIPolisherValidatorIPipelineOrchestratorExecutionResultIQueryAugmentorIQueryDecomposerIQueryRouterQueryPart
3. Normative Requirements
EPS-001IThoughtProcessMUST output structured artifacts only.EPS-002IExecutionOutputMUST NOT introduce new reasoning.EPS-003IOutputPolisherMUST NOT alter facts or conclusions.EPS-004Phase order is fixed and reverse flow is prohibited (MUST).EPS-005Inter-phase payload integrity MUST be verified by hash.EPS-006State Immutability: Once committed, phase outputs MUST NOT be overwritten by downstream phases. Required changes MUST be performed via branch-based re-execution from Replay Dump.EPS-007Buffer Mapping:EPS-008Deterministic Scheduling: Before each phase,IModelVectorRouterMUST re-evaluate the phase model and record routing rationale inExecutionResultmetadata.EPS-009Phase 1 Query Processing: Query augmentation and decomposition MUST complete before ROM/CacheDB materialization and before Structure output is committed.EPS-010RAG Boundary: RAG MUST remain a provider or pipeline strategy for material supply. Core query abstractions MUST NOT implement knowledge retrieval.
Structure extracts Thought from Orchestration and Material; Generation produces Expression from Thought; Polish refines Expression and finalizes IExecutionOutput (MUST).
4. Fail-Closed
EPS-F001Abort when Structure schema validation fails.EPS-F002Abort on inter-phase hash mismatch.EPS-F003Abort on missing mandatory fields.EPS-F004Information Leakage Detection: IfIAttentionGuarddetects leakage from isolated context in Polish, execution MUST abort immediately.EPS-F005Logic Divergence Check: If Generation diverges from the Structure execution plan, Polish MUST be stopped and the pipeline MUST fail.EPS-F006Query Processing Failure: If query augmentation, decomposition, embedding conversion, or query routing cannot complete consistently, Phase 1 MUST abort without committing partial QueryPart state.
5. Acceptance Criteria
- AC1: Generation does not start on invalid Structure schema.
- AC2: Hash tampering returns
Deny/Abort. - AC3: Normal runs preserve phase metadata in
ExecutionResult. - AC4: Routing rationale is reproducible for identical inputs.
- AC5: Semantic changes attempted in Polish are blocked by
IPolisherValidator. - AC6: QueryPart generation is deterministic for identical input and KernelContext.
- AC7: Provider routing records capability-based rationale without treating RAG as a Core retrieval implementation.
6. Phase Interface Details (ROM Representation)
Phase boundaries are represented as ROM entities and chained by hashes.
---\nid: "pipeline.exec.001"\ntype: "execution.contract"\nphases:\n - id: "structure"\n provider_id: [[provider.reasoning_model]]\n output_hash: "sha256:..."\n - id: "generation"\n provider_id: [[provider.creative_model]]\n output_hash: "sha256:..."\n - id: "polish"\n provider_id: [[provider.fast_model]]\n output_hash: "sha256:..."\n---\n# Execution Policy\n* [isolation_level]: [[policy.strict]]\n* [retry_strategy]: [[policy.abort_on_fail]]
7. Pipeline Sequence
IPipelineOrchestrator guarantees atomic execution in the following order.
- Phase Initialization
- Phase 1 Query Processing
- Material Context Build
- Structure Phase
- Handoff Validation
- Generation Phase
- Polish Phase
- Final Commitment
Validate pre-execution context hashes and confirm ISignatureTrustStore verification passed.
Run IQueryAugmentor to normalize and enrich query intent, run IQueryDecomposer to produce ordered QueryPart units, optionally use IEmbeddingProvider for semantic-space conversion, then run IQueryRouter against declared provider capabilities.
Resolve ROM and CacheDB material through provider or pipeline strategies, quarantine material, and keep provenance separate from Orchestration and Expression.
Use a reasoning model to decompose tasks into ContextFragment units and produce a thought blueprint.
Record Structure output hash as parent hash for Generation.
Generate content from blueprint; Structure mutation is prohibited.
Refine format/tone; semantic mutations are blocked by IPolisherValidator.
Build ExecutionResult with full phase hash chain and commit to ConversationStore (Git).
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
- v0.0.1 (2026-05-09): Added Phase 1 Query Processing abstractions and RAG boundary
specs/01.EXECUTION_PIPELINE_SPEC.md