Skip to content

Preserve Guardian extra policy when reviewer templates omit its slot - #1

Merged
uncfreak1255-code merged 1 commit into
mainfrom
codex/fix-guardian-extra-policy-fallback
Nov 7, 2026
Merged

uncfreak1255-code merged 1 commit into
mainfrom
codex/fix-guardian-extra-policy-fallback

Conversation

@uncfreak1255-code

Copy link
Copy Markdown
Owner

Summary

A nonblank auto_review.extra_policy is 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.

slot present      -> existing substitution
slot absent       -> rendered vendor template + nonblank additional policy + output contract
blank addition    -> existing output

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

  • Before: with the new regressions and the original renderer, cargo test -p codex-prompts --lib guardian_instructions::tests fails 3 tests (3 pass).
  • Wrong-template control: forcing the bundled fallback instead of the selected catalog template fails reviewer_extra_policy_reaches_catalog_selected_reviewers (0 pass, 1 fail).
  • After: cargo test -p codex-prompts --lib passes all 55 tests. Coverage includes both bundled reviewer entries through ResolvedModelMessages, catalog-specific future guidance, permissive/restrictive additions, both transcript formats, blank input and literal placeholders.
  • cargo clippy -p codex-prompts --tests passes.
  • cargo fmt -- --config imports_granularity=Item --check passes. Stable rustfmt emits its existing warning that the nightly-only import setting is ignored.
  • Independent Boundary, Bypass and Silent-pass checks found no remaining reproduced defect after F1 was repaired. These checks exercise composition, not model enforcement.

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

  • F1 (P2), fixed in pre-publication round 1: the initial catalog regression could pass if a wrong variant forced the bundled template. Add catalog-specific guidance before message resolution and require it in the rendered output; observe the forced-bundled variant fail.

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.

@uncfreak1255-code

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T11:36:47.469626Z adc09dc Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@uncfreak1255-code

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: adc09dce42

ℹ️ 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".

@uncfreak1255-code
uncfreak1255-code merged commit 0eea2a4 into main Nov 7, 2026
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