Repository navigation
Conversation
PR #1203: Stage phase submission instructions in a frozen guide23 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. CorrectnessFILE: packages/cli/src/Phase/SubmissionGuide.ts |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Runreserves the attempt and writes the guide plus its hash receipt.Phase.Requestverifies 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
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.scripts/tests/runtime-exclusions.test.ts— PASS under Deno, Node and Bun, including the explicit cross-runtime suite inventory.git diff --checkpass. 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 thegreenaggregate. 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.SubmissionGuideowns 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 exportedpropsschema 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