Skip to content

fix: preflight strict runtime proposals#559

Merged
Stahl-G merged 4 commits into
mainfrom
codex/runtime-proposal-contract-preflight
Jul 21, 2026
Merged

fix: preflight strict runtime proposals#559
Stahl-G merged 4 commits into
mainfrom
codex/runtime-proposal-contract-preflight

Conversation

@Stahl-G

@Stahl-G Stahl-G commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add read-only briefloop contract validate for standalone strict-schema checks
  • add envelope-aware briefloop runtime invocation-validate that checks exact scratch members, strict proposal shape, and current invocation run_id binding without Store writes
  • make preflight, explicit invocation-accept, and exact-action runtime apply consume the same proposal-validation path
  • make runtime apply resolve invocation_accept_or_fail: valid proposals are accepted; invalid proposals fail with zero Store writes
  • update role envelopes, Codex kit, canonical Skill, Hermes projection, and support matrix

Regression

Reproduces all three observed A2 scout failures:

  1. guessed claims / candidate_claims wrappers;
  2. a schema-valid proposal with a one-character-wrong run_id;
  3. the generic host loop receiving invocation_accept_or_fail and failing with runtime_action_not_implemented.

Validation

  • 57 focused tests normal
  • 57 focused tests under python -O
  • Codex generated asset check
  • Ruff
  • public safety / terminology / Skill freshness / Skill contract / product baseline

No A2 workspace or Store mutation is included in this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6b70fa153

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +457 to 461
"task_instructions": _role_task_instructions(
role_id,
output,
invocation_id,
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Revalidate task instructions before accepting envelopes

When role_task_envelope.json is edited or an active invocation carries an older envelope, runtime invocation-accept/invocation-fail reloads that file and _validate_envelope checks the other binding fields but never recomputes task_instructions. That lets the invocation proceed with the new preflight text removed while still accepting a valid proposal, so the newly added contract-show/validate requirement is not fail-closed at the host boundary; include _role_task_instructions(role_id, spec, invocation_id) in envelope validation so this host-written control field cannot be silently changed.

AGENTS.md reference: AGENTS.md:L99-L103

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc75850de5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"proposal_schema_id": envelope.proposal_schema_id,
"status": "invalid" if reason_code is not None else "valid",
"reason_code": reason_code,
"checked_filenames": sorted(spec.filenames),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate source bytes before marking preflight valid

For a source-provider invocation, this reports all allowed files as checked after _strict_proposal_violations has only parsed source_proposal.json. If the proposal is schema-valid but its declared content_sha256 or raw_payload_sha256 does not match source_content.bin or source_raw.json, runtime invocation-validate still returns status=valid; the subsequent accept/apply then reaches submit_source, which records a rejection in the Store instead of letting the role fix the bytes under the read-only preflight. Please compare the declared source hashes against the sibling scratch files before returning valid, or do not list those files as checked.

AGENTS.md reference: AGENTS.md:L103-L103

Useful? React with 👍 / 👎.

@Stahl-G
Stahl-G merged commit cc16576 into main Jul 21, 2026
10 checks passed
@Stahl-G
Stahl-G deleted the codex/runtime-proposal-contract-preflight branch July 21, 2026 22:47
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