[codex] prevent unsafe readiness-policy contradictions#910
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
PR Risk Assessment — Low
Decision: Approved (no reviewer assignment required)
Evidence (from diff only)
| Area | Finding |
|---|---|
| Files changed | 3 (app/readiness/analyzer.py, 2 test files) |
| Production logic | +24 / −2 lines in readiness analyzer |
| Blast radius | Readiness verdict only — aligns banner with compiled IR policy |
| Infra / auth / schema | None |
| Tests | Unit + API regression coverage added |
| CI | All checks green (Smoke, PR Tests, CodeQL, Snyk, Vercel) |
What changed
Adds _policy_review() so the readiness analyzer respects policy.risk_level=high and execution_mode=human_approval_required from the compiled IR. Prevents the readiness banner from showing "Ready to compile" when the compiler policy already requires review.
Why Low (not Medium)
- Single-module, narrowly scoped behavioral fix
- Low blast radius; improves safety by removing a policy/readiness contradiction
- Straightforward logic with focused regression tests
- No shared infrastructure, auth, migrations, or prompt changes
Reviewers
None assigned — risk is below Medium threshold. No CODEOWNERS file in repo; 0 reviewers currently requested.
Slack
Slack notification tool not available in this automation run; summary posted here instead.
Automated risk assessment — conclusions derived from diff evidence only.
Sent by Cursor Automation: Assign PR reviewers
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
highrisk or otherwise-readyhuman_approval_requiredrequests from being shown asReady to compileClarifybehavior for unresolved references and vague requestsRoot cause
The readiness analyzer accepted the compiled IR but ignored it. It independently inspected only a narrow set of text risk keywords, so a destructive request could have
policy.risk_level=highandexecution_mode=human_approval_requiredwhile readiness still returnedready.User impact
The offline page now displays the readiness banner. This fix prevents that banner from presenting a green, safe-to-run message when the compiler's own policy requires review.
Scope
Changed:
app/readiness/analyzer.pytests/test_readiness_analyzer.pytests/test_readiness_api.pyNot touched: environment files, secrets, auth, schemas, migrations, deploy/provider settings, LLM prompts, model parameters, response formats, or dependencies.
Validation
100 passed1642 passed, 5 skippedpre-commit run --all-files: passeduv pip check: passedreadiness=riskywhile existingclarifybehavior remains intact