Skip to content

Stage phase submission instructions in a frozen guide - #1203

Draft
taras wants to merge 4 commits into
mainfrom
codex/staged-submission-guide
Draft

taras wants to merge 4 commits into
mainfrom
codex/staged-submission-guide

Conversation

@taras

@taras taras commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Why

A phase call receives all reporting instructions and its JSON schema before it starts work. Supply that material through a frozen file that the same call reads when it needs to return a result. First staged-loading slice from #1199, based on merged #1198.

What changes

Before: initialization, work instructions, selected evidence, assignment, submission prose and the response schema all enter the initial prompt.

After: the initial prompt retains the work and evidence obligations, then names an absolute submission-guide path. The guide contains the complete existing submission prose and the exact role- and phase-specific contract. The agent must read it before any completion, early blocker, source conflict or unanswered decision.

Codex authors prose committed to workflow documents. Claude roles can still author internal runtime handoffs, hold prompts and summaries.

How it works

Phase.Run reserves the attempt and writes the guide plus its hash receipt. Phase.Request verifies the retained text before dispatch. After each native reply, the runner saves the raw text and validates the guide again before accepting the result or starting a correction. Initial delivery receipts remain recorded even when guide validation holds the attempt.

The existing submission section and schema construction move verbatim. Response validation, canonicalization, internal handoff routing, provider/session identity and correction allowances keep their existing owners. Response-only corrections retain their inline packet; staging adds no model call.

How to verify it

  • Submission journeys cover every role/phase contract, deferred initial prompts, preserved impact-assessment semantics, early blockers in one call, occupied guide paths, predispatch failures, altered/missing/unreadable guides after dispatch, invalid replies, and guide mutation during a response correction. Failed guide checks preserve raw and delivery records and produce no canonical result.
  • Existing production API-conflict and correction cases retain their canonical outcomes, original owner and correction allowance.
  • Friction journeys cover canonical metadata, evidence and zero/bounded correction behavior.
  • Scoped TypeScript checks and lint pass.

Commands and results:

  • deno task test packages/cli/tests/adversarial-production-role.test.ts packages/cli/tests/adversarial-submission.test.ts — PASS, 2 tests / 3 steps.
  • ./node_modules/.bin/tsx --tsconfig tsconfig.node.json --test --test-concurrency=1 packages/cli/tests/adversarial-production-role.test.ts packages/cli/tests/adversarial-submission.test.ts — PASS, 3 tests. ProductionRole completes in about 96s and Submission in 52s; each keeps its existing 120s outer limit.
  • Friction and the affected Preparation, Delivery, Workflow, DecisionResolution and SessionContinuity suites passed on the implementation feedback commit. The later commits change only one authoring sentence, the grouping of byte-identical tests and the expected suite inventory.
  • scripts/tests/runtime-exclusions.test.ts — PASS under Deno, Node and Bun, including the explicit cross-runtime suite inventory.
  • Scoped Deno typechecks, oxlint, oxfmt and git diff --check pass. A production render verifies that the authoring-dependency hold applies to Claude while Codex can write assigned workflow prose.

Latest normally signed head: 606845dc597101b804168c3006fb13a1e07eb5d1. Independent Codex Astra review: PASS on the latest exact SHA; the prior implementation reviews remain applicable.

The initial CI exposed a 120s outer deadline around the expanded ProductionRole suite. Its three new submission tests now run in their own discovered suite, preserving every assertion, case and inner/outer deadline. The separate unchanged Delivery fallback count failure is tracked by flake #1176, with the first complete log preserved and its unchanged-head Node retry passing all 44 files, recorded there. The new Submission wrapper is also included in the regression test’s explicit suite inventory. No fallback behavior is changed or claimed repaired. The existing Implementation timing issue is recorded in flake #1143; the latest Bun job passes it in 100 seconds with the original deadline.

Required CI 2570 is green on 606845dc597101b804168c3006fb13a1e07eb5d1, attempt 1: 61 successful jobs and the expected composability skip, including the green aggregate. All Deno, Node and Bun shards pass. PR Review also succeeds. The final Node integration job completed before a diagnostic cancellation request arrived; GitHub rejected that request because the run had already finished. No cancellation or retry changed this successful run.

Scope

This slice stages phase submission guidance. AGENTS restructuring, other reading stages and the earlier proposed report adapter remain outside it. No dependency or lockfile changes.

New abstractions

Phase.SubmissionGuide owns the attempt's bounded frozen guide and receipt, reusing existing protected text storage, descriptors and hashing. Run, Request and Correct consume the same check; it adds no general stage engine. Its exported props schema is consumed by the function-component loader (packages/core/src/execute.ts), as required by the function-component contract; it is not a dead local declaration.

Risks and limitations

The runner verifies file availability and integrity; the model follows the instruction about when to read it. The deterministic fixture simulates file consumption at the native-prompt boundary and does not prove that a paid model follows the instruction. This change makes no token or billing claim.

Scope confirmation

  • Every changed file supports this slice.
  • Unrelated cleanup and formatting are excluded.
  • Fixture marker changes are mechanical; direct request fixtures now prepare their guide explicitly.
  • The description matches the behavior and focused results.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

PR #1203: Stage phase submission instructions in a frozen guide

23 files, +332 / -52

Scope

🟡 23 files changed. Are all changes related?

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

FILE: packages/cli/src/Phase/SubmissionGuide.ts
PATTERN: Dead constructs
CONCERN: The props object is declared but not referenced in the diff.
QUESTION: Is the props object intended to be used elsewhere, or is it redundant?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant