Repository navigation
Preserve Guardian extra policy when reviewer templates omit its slot - #1
Merged
Merged
Conversation
uncfreak1255-code
marked this pull request as ready for review
November 2, 2026 11:40
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.
Summary
A nonblank
auto_review.extra_policyis currently omitted when the selected reviewer catalog template lacks{{ extra_policy }}. Keep the selected template and resolved tenant policy, and append the additional policy before the output contract only when its insertion slot is absent.Refs openai#50309.
Safety contract
Written before implementation from the issue's expected behavior and the existing renderer: retain the complete selected vendor template and resolved tenant policy; preserve working-slot and blank-addition behavior; keep inserted policy text literal; keep the output contract last. Check the original template for the slot so placeholder-like text inside policy values cannot suppress the fallback.
The regressions must reject both the original omission and a wrong variant that forces the bundled fallback template, which would discard future catalog-specific instructions.
Evidence
cargo test -p codex-prompts --lib guardian_instructions::testsfails 3 tests (3 pass).reviewer_extra_policy_reaches_catalog_selected_reviewers(0 pass, 1 fail).cargo test -p codex-prompts --libpasses all 55 tests. Coverage includes both bundled reviewer entries throughResolvedModelMessages, catalog-specific future guidance, permissive/restrictive additions, both transcript formats, blank input and literal placeholders.cargo clippy -p codex-prompts --testspasses.cargo fmt -- --config imports_granularity=Item --checkpasses. Stable rustfmt emits its existing warning that the nightly-only import setting is ignored.Merge Danger
Door: two-way; this is a source-only change.
Blast Radius: reviewer prompt composition. Configured local or managed additions that were previously omitted will now reach the reviewer and may affect decisions as intended. Tenant-policy selection, approvals configuration and sandbox boundaries are unchanged. This PR does not establish model enforcement or installed desktop behavior.
Review ledger
Prepared for openai#50309. Upstream's current policy does not accept external code PRs, and upstream creation was refused through the integration and authenticated GitHub CLI. This fork draft preserves the proposed patch and verification; no upstream PR was created.