Skip to content

ci: add advisory Astra and Opus PR threat reviews - #1222

Merged
Gajesh2007 merged 46 commits into
masterfrom
codex/advisory-threat-review
Sep 29, 2026
Merged

Gajesh2007 merged 46 commits into
masterfrom
codex/advisory-threat-review

Conversation

@antojoseph

@antojoseph antojoseph commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Restore nonblocking PR threat-model feedback through independent Opus 5.5 and GPT-6 Astra scans using the existing OpenRouter key. Every changed file's complete before/after source is reviewed against the full canonical base threat model, followed by cross-file integration. Findings appear in one updatable public PR comment with model attribution; clean first scans stay quiet and incomplete scans are explicit.

  • Execute only trusted-base workflow/code. Read immutable Git blobs as data, including renamed/deleted files and mode changes; never execute PR source or follow symlinks.
  • Consolidate legacy/versioned bot reports into one active canonical report, superseding duplicates with links. Recover a one-shot deadline during initial GitHub lookups or final verification/publication by refreshing comment identity and retrying once with an incomplete status.
  • Preserve earlier findings when a retry is incomplete only if the full head and verified diff merge base match; supersede findings from changed or unverified comparisons, alongside new partial findings; identical retry reports do not accumulate. At the comment capacity limit, retain the PR comment and put the retry report in the Actions summary.
  • Preserve validated findings when a reviewer reaches the 32-finding cap, marking that reviewer incomplete. Oversized first/new-diff reports keep a fitting PR subset and the full Actions-summary report; invalid model configuration also posts incomplete feedback.
  • Preserve differing advice and completed findings when the other reviewer fails. Both reviewers must complete for a complete result; findings never request changes or become a required merge gate.
  • Accept every defined canonical ID family and reject undefined/prose-only references. Allow citations to actual complete-source context and explicit metadata citations for existing empty-file sides; absent or unread evidence remains invalid.
  • Trigger scans for base-branch edits into master/main while filtering title/body edits before job-level cancellation. Keep valid same-head reviews when the target tip advances. A changed head, closed PR or different target branch suppresses stale output; a changed or unverifiable merge base yields explicit incomplete coverage. Validate the live diff before and after file enumeration; discard new findings if the comparison changes or becomes unverifiable during scanning.
  • Continue cross-file integration when separate summaries shrink enough for a later combined pass; unchanged summary count alone is not failure. Equal-sized or growing same-count output remains explicitly incomplete.
  • Bound total source collection to 8 MB across before/after reads, counting cached reuse again, plus separate 8 MB JSON budgets for cached trees and the file inventory including fallback patches. Exceeding any stops collection and posts explicit incomplete coverage before model calls.
  • Keep explicit source, output and shared-deadline limits. Missing/binary/Git LFS/submodule coverage and capacity failures produce an incomplete result, not a clean verdict. Suppress stale-head output and avoid logging raw model responses or credentials.
  • Stabilize two inherited CI tests: deterministic routing-evidence ages, and an enforced uninstrumented 250 ms numeric-parser gate before the full race/atomic-coverage suite. Production parsing and serving policy are unchanged.

Head 2ccbc75bf includes master d2a7b6431 (provider work measurements, measured warm placement, and the SSD write-budget update). The latest master sync preserved both changelog entries; subsequent advisory fixes validate the live diff snapshot before model calls and publication. The routing-test merge preserves deterministic fresh-evidence fixtures, upstream transport-age normalization, and unknown-age sentinels; both developer-documentation links and upstream measurement guidance are retained. Set THREAT_REVIEW_MODELS=anthropic/claude-opus-5.5,openai/gpt-6-astra; repository secret OPENROUTER_API_KEY is already configured. The workflow activates after this PR lands. Merge #891 first so initial scans use its refreshed hybrid trust model.

Before

flowchart LR
  P["PR opened or updated"] --> C["Regular CI checks"]
  P --> M["Manual threat-model review only"]
  classDef input fill:#dbeafe,stroke:#2563eb,color:#172554
  classDef manual fill:#ffedd5,stroke:#ea580c,color:#431407
  class P,C input
  class M manual
Loading

After

flowchart TD
  S["ensemble.py: full PR"] --> O["Opus: full scan + integration"]
  S --> A["Astra: full scan + integration"]
  O --> F["GitHub.publish: attributed union"]
  A --> F
  classDef input fill:#dbeafe,stroke:#2563eb,color:#172554
  classDef review fill:#dcfce7,stroke:#16a34a,color:#14532d
  classDef feedback fill:#ffedd5,stroke:#ea580c,color:#431407
  class S input
  class O,A review
  class F feedback
Loading

Blue shows immutable source collection, green shows source and integration review, orange shows public author feedback. Complete clean first scans only write an Actions summary; later complete clean scans update old finding comments. Current and legacy bot markers are recognized, spoofed markers ignored, and stale revisions suppressed before publication.

Validation

  • All 87 advisory regression tests pass: 55 input/validation/transport/comment tests, 23 complete-source/integration/citation tests, and 9 ensemble tests. Run the three .github/scripts/test-threat-*.py suites; Release Integrity runs them in CI.
  • make docs-check: 323 pages. make docs-impact-check BASE=origin/master, workflow actionlint and whitespace checks pass.
  • On current master integration, the first-byte, adversarial-number and routing-plan tests each pass ten repetitions with race detection and atomic coverage. Earlier targeted verification includes 500 routing-plan repetitions and 20 repetitions in both numeric-parser modes; controlled timing/bignum regressions fail the enforced guards.
  • Prior live end-to-end scan at 6d5a21624: both models completed all 19 changed files (14 source batches plus integration per model), with zero incomplete sources and no actionable findings. This proves the API/full-scan path on that revision, not absence of vulnerabilities; later citation-validation and retry-lifecycle fixes have the regression coverage above.
  • All 46 PR commits are GitHub Verified. Previous head 09fc86bda completed review with no unresolved findings and all 17 runnable checks passing. Current head 2ccbc75bf passes all 87 advisory tests, 100 repetitions of the routing-plan tests with race detection and atomic coverage, protocol tests with race detection, and documentation checks. GitHub confirms it is mergeable. The target-tip, diff-snapshot, retarget-trigger, integration-summary, aggregate source-memory, publication-lifecycle, LFS coverage and diff-scoped retention review findings are fixed with regressions, including negative controls that reproduce the original failures. Fresh CI and automated review are running on 2ccbc75bf. Protected E2E Benchmarks requires environment approval and is not a required merge check; repository rules require an approving review covering the latest push.

Complete changed files are scanned; unchanged callers elsewhere are not automatically fetched. Public findings require human validation. Each reviewer makes multiple paid requests, and every PR update can trigger a new scan. See configuration and limits.

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 29, 2026 3:34am UTC
d-inference-console-ui-dev Ready Ready Preview Sep 29, 2026 3:34am UTC
d-inference-landing Ready Ready Preview Sep 29, 2026 3:34am UTC
eigen-homepages-darkbloom Ready Ready Preview Sep 29, 2026 3:34am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-09-29T03:38:38.840538Z 2ccbc75 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.

@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: 250b2a28f3

ℹ️ 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 thread .github/scripts/threat_review/report.py Resolved
Comment thread .github/scripts/threat_review/report.py Resolved
@antojoseph antojoseph changed the title ci: restore advisory threat-model reviews through OpenRouter ci: restore private advisory threat reviews through OpenRouter Sep 28, 2026
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: e5fe1b0a1c

ℹ️ 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 thread .github/scripts/threat_review/runner.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: 6a4f9fd484

ℹ️ 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 thread .github/scripts/threat_review/client.py Resolved
Comment thread .github/scripts/threat_review/runner.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: a3e600f664

ℹ️ 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 thread .github/scripts/threat_review/source.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: 268cc18566

ℹ️ 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 thread .github/scripts/threat_review/report.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: a87b6437be

ℹ️ 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 thread .github/scripts/threat_review/runner.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: 6a4b2c3a7a

ℹ️ 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 thread .github/scripts/threat_review/review.py Resolved
Comment thread .github/scripts/threat_review/runner.py Resolved
Comment thread .github/scripts/threat_review/runner.py Resolved
@antojoseph

Copy link
Copy Markdown
Member Author

@codex review

@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: 2ccbc75bfd

ℹ️ 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 thread .github/scripts/threat_review/report.py Resolved

This branch was successfully deployed

4 active deployments
Preview – d-inference-console-ui-dev — 2ccbc75b Deployed Sep 29, 2026 by vercel[bot]
Preview – d-inference — 2ccbc75b Deployed Sep 29, 2026 by vercel[bot]
Preview – d-inference-landing — 2ccbc75b Deployed Sep 29, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 2ccbc75b Deployed Sep 29, 2026 by vercel[bot]
benchmarks — 2ccbc75b Deployed Sep 29, 2026 by antojoseph via E2E Benchmarks #1835
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.

2 participants