Skip to content

ci: unify the risk gate on the canonical implementation - #46

Merged
Pigbibi merged 3 commits into
mainfrom
governance/unify-risk-gate-canonical
Nov 5, 2026
Merged

Pigbibi merged 3 commits into
mainfrom
governance/unify-risk-gate-canonical

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI assistance

Qoder agent (DeepSeek) analysed the failure, wrote the change and ran the local checks. Codex reviews through the repository integration.

What changed

risk-gate.yml is the canonical gate the other QuantStrategyLab repositories run, with two hardening fixes Codex found on this head:

  • Receipt selection: trusted comments carrying codex-review-state:v1 are ordered by updated_at and then by descending comment id, and only the newest is read. A malformed, duplicated or blocking newer receipt can no longer fall back to an older clean one.
  • Classifier: .github/governance/ is a protected prefix, ai_service, aiservice, kelly, stop_loss, release, service_account, serviceaccount, permission, role_binding, k8s and kubernetes are segmented path terms, and .pem, .key, .p12 and .pfx files are matched by extension.

The rest keeps the canonical behaviour: pull_request_target, issue_comment, push, schedule and workflow_dispatch triggers, the record_label job that binds a label addition to its head and event, the per-PR writer, and the risk-gate, pr-template and ai-review contexts.

Also in this change:

  • .github/scripts/test-risk-gate.cjs removed: it asserted the discovery matrix, the policy file and the per-PR job shape of the removed design.
  • .github/workflows/governance-shadow-tests.yml runs scripts/test-governance-shadow.cjs only; the SHADOW observer is unchanged.
  • AGENTS.md: the AI-only development clause is the canonical wording the other repositories use.
  • PROPOSAL.md: marked superseded, with the reason.
  • .github/governance/policy.json stays because governance-acceptance.yml reads it.

Final file sha256: 701918c57d6194e10f110ac987f8a4b937ddc17989fb271cced03907392ce322.

How verified

Why

The reconciled verifier added check_run, check_suite, status and workflow_run triggers and then reread check evidence, refusing to publish when the reread differed. Each run creates its own check runs, so the evidence changes while the run reads it: every evaluation ends in error, and because the three contexts are required, the repository is closed to merges. Returning to the canonical gate removes the self-triggered loop; the other repositories move to this same file in one follow-up batch, so the organisation ends with one gate implementation.

Risk

High: the change touches .github/workflows/ and governance documentation. Behaviour changes are deliberate: no check/status/workflow-run triggers, review provenance by the reserved chatgpt-codex-connector[bot] login rather than an App ID list, no live required-check discovery (branch protection still enforces those contexts), dependency updates exempt from review and template, and a wider high-risk classifier. No secret, token, label write, merge or deploy is added; the gate keeps read-only permissions plus the base-push dispatch.

The reconciled verifier merged here fed its own check and workflow-run events
back into the evidence it rereads, so every evaluation ended in error and both
governance repositories were closed to merges. Restore the canonical gate the
other 23 repositories run, keep the shadow tests that cover the reusable
observer, and drop the gate tests that asserted the removed discovery matrix.
@Pigbibi

Pigbibi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-05T18:58:51.240382Z a678467 Draft marked ready
ℹ️ 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: 30e2709bf7

ℹ️ 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/workflows/risk-gate.yml Resolved
The newest marker-bearing comment is selected before its payload is read, so a
malformed newer receipt cannot fall back to an older clean one, and comments
updated in the same second are ordered by id. Governance and AI-service paths
stay high risk in the shared classifier.
@Pigbibi

Pigbibi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 11702474dc

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

Release, deployment, service-account, permission and Kubernetes paths, plus
pem/key/p12/pfx files, must keep the clearing-label requirement when the
classifier is unified.
@Pigbibi

Pigbibi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: a678467411

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

@Pigbibi
Pigbibi marked this pull request as ready for review November 5, 2026 18:56
@Pigbibi
Pigbibi merged commit 260d39b into main Nov 5, 2026
13 of 19 checks passed
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