inline-defect-executable-task-delivery-result-return
Goal
Make the recurrent client handoff a complete executable protocol boundary. An active ContinueRuntimeView must carry the exact engine-authored bounded task and its authorized typed return path, not merely identify the workflow node that wants an LLM.
Observed pilot defect
Two exact Codex goal callbacks for plans/bytecode-vm returned the same sealed digest and the same generic {action, state, workflow_id, tools, result_contract, return_target} mapping. The view contained no work-item text, owned criteria, task token, result schema, or submission operation. The client therefore could only stall or invent a prompt by inspecting plan/engine source, violating the workflow-engine mission and section 1.6 of spec/workflow-state-machines.md.
Invariants
current_taskremains byte-for-byte the script-producedContextAssembly.guidance.now; adapters and goals do not enrich, paraphrase, or reconstruct it.- The engine’s common
dispatch_llm_taskassembly owner supplies the bounded target/instructions, sanctioned domain projection, fullTaskDispatchidentity/token,ResultContract, mandatory reminder instances, and an executable typed submission directive before sealing the assembly. next_upcoming_taskremains a non-authoritative preview and cannot be submitted or executed.- A valid submission is admitted through
WorkflowGateway, consumes the unique task token once, and resumes the correct authoritative continuation; stale, duplicate, foreign-closure/frame, digest-mismatched, widened, or client-authored control data fails closed without domain mutation. - An outstanding unconsumed admission may replay identically across fresh-process re-entry. Once its valid result is accepted, the next exact callback must advance to a different admitted task, a typed wait/block, or the matching sealed terminal report; it must not replay the consumed dispatch.
- The cure is systemic across ordinary work items, ledger-grind work, failure classification, and human-decision LLM dispatches, and across Claude Code, Codex, and OpenCode adapters.
Implementation surface
Use scripts/workflow_engine/work_dispatch.py as the common admission/dispatch owner, context.py for sanctioned domain projections, guidance.py plus context_assembly.py for the sealed current-task envelope, current_dispatch.py plus continue_runtime.py/client_transport.py for durable recovery and unchanged relay, and the canonical gateway/result-ingestion plus drive-continuation path for accepted results. Do not add a client-specific prompt builder or a parallel plan writer.
TDD matrix
Pin same-process serve, fresh-process re-entry, and repeated outstanding re-entry; ordinary work-item, ledger, classifier, and human-decision dispatch families; accepted, stale, duplicate, foreign-identity, contract-invalid, and ambient-context-widening submissions; and adapter parity for Claude Code, Codex, and OpenCode. The semantic pin asserts that current_task contains executable task text, token, exact result contract, reminders, and submission data, then submits a conforming result and proves the next one-read callback cannot return the consumed dispatch.
Work Items
- Replace metadata-only dispatch_llm_task delivery with one shared engine-owned executable-task envelope for every admitted LLM dispatch: seal and relay the exact bounded task target and instructions, authorized domain projection, task token, ResultContract, mandatory reminders, and typed result-submission directive in ContinueRuntimeView.current_task; keep next_upcoming_task preview-only; accept, identity-check, and consume one ResultSubmission through the canonical gateway; advance the authoritative work-item, ledger, classifier, or human-decision continuation exactly once; reject stale, duplicate, foreign, widened, or client-authored submissions; and prove a Codex goal callback can execute and return the task without reading plan/source state or replaying the same admitted dispatch after acceptance.
- Make durable current-task recovery upgrade or supersede every unconsumed pre-envelope dispatch before ContinueRuntimeAPI.read returns active: detect an admitted ContextAssembly whose guidance.now lacks the engine-minted executable task payload, derive the exact bounded task from the authoritative domain projection plus the root-pinned workflow/action contract, atomically preserve or fence its dispatch identity, reminders, consume-once result contract, and frame authority, and return a fully executable current_task without client-authored enrichment, direct plan reads, duplicate work, stale-token acceptance, or metadata-only replay; prove both a synthetic pre-upgrade admission and the live Codex bytecode-vm reentry class converge to an executable task on the next exact read.
Intel dossier — pointer and tier disposition
Dossier: inline-defect-executable-task-delivery-result-return--s-de17fb12.intel.md (this section’s content/intel/ sidecar)
Read that dossier from line 1 through EOF before acting on this section. This block is a pointer and an audit record, never a substitute: not the BLUF, not a summary, not selected tiers.
| Dossier tier | Title | Lines | Disposition | Where / why |
|---|---|---|---|---|
| 0 | 0. Bottom line up front | 28 | pending | |
| 1 | 1. The section, verbatim | 23 | pending | |
| 2 | 2. Terrain — symbols in the objective area (with files) | 71 | pending | |
| 3 | 3. Code-graph recon | 148 | pending | |
| 3D | 3D. Diagnostic / observability surface | 26 | pending | |
| 3H | 3H. Hygiene constraints the downstream design inherits | 28 | pending | |
| 4 | 4. Section family — the three inline-defect siblings and the cutover | 36 | pending | |
| 5 | 5. Conformance audit — duplication and shape drift | 40 | pending | |
| 6 | 6. Plan ownership — who owns this code now | 24 | pending | |
| 7 | 7. Prior art — cross-repo | 15 | pending | |
| 8 | 8. Sentiment — N/A | 5 | pending | |
| 9 | 9. Declared coverage gaps | 23 | pending | |
| 10 | 10. Recommended recon entry points (ordered) | 29 | pending |