fix: preflight strict runtime proposals#559
Conversation
There was a problem hiding this comment.
💡 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".
| "task_instructions": _role_task_instructions( | ||
| role_id, | ||
| output, | ||
| invocation_id, | ||
| ), |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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), |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
briefloop contract validatefor standalone strict-schema checksbriefloop runtime invocation-validatethat checks exact scratch members, strict proposal shape, and current invocationrun_idbinding without Store writesinvocation-accept, and exact-actionruntime applyconsume the same proposal-validation pathruntime applyresolveinvocation_accept_or_fail: valid proposals are accepted; invalid proposals fail with zero Store writesRegression
Reproduces all three observed A2 scout failures:
claims/candidate_claimswrappers;run_id;invocation_accept_or_failand failing withruntime_action_not_implemented.Validation
python -ONo A2 workspace or Store mutation is included in this PR.