ci: add exact-head Codex review gate - #97
Conversation
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
…te-clean # Conflicts: # docs/DECISIONS.md # docs/INDEX.md # docs/TOOLCHAIN.md # docs/decisions/0006-gate-codex-review-exact-head.md # scripts/codex-review-gate.mjs # test/codex-review-gate.test.mjs
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9af5ca5e46
ℹ️ 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".
| : !requiresReviewedCommit || exactEyesAt > 0) && | ||
| timestamp(requestedAt) > 0 && | ||
| timestamp(comment.created_at) >= timestamp(requestedAt) && | ||
| now - timestamp(requestedAt) >= 30_000 && | ||
| timestamp(comment.created_at) >= latestEyesAt && | ||
| timestamp(comment.created_at) >= | ||
| (commit ? timestamp(requestedAt) : requiresReviewedCommit ? exactEyesAt : latestEyesAt) && |
There was a problem hiding this comment.
Non associare gli errori solo tramite l'orario
Se due invocazioni @codex review si sovrappongono sullo stesso SHA, un errore generico e senza Reviewed commit della prima può essere pubblicato dopo la reazione eyes sulla seconda: questa condizione lo attribuisce al tentativo più recente e imposta erroneamente codex-review a failure. Il timestamp prova soltanto l'ordine di pubblicazione, non l'appartenenza all'invocazione; accetta questi errori solo quando esiste un legame non ambiguo con la richiesta corrente.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69f7769985
ℹ️ 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".
| (commit | ||
| ? headSha.startsWith(commit) | ||
| : !requiresReviewedCommit && timestamp(requestedAt) > 0) && | ||
| : !requiresReviewedCommit || (unambiguousInvocation && exactEyesAt > 0)) && |
There was a problem hiding this comment.
Disambigua anche i tentativi iniziali sovrapposti
Nel percorso opened/ready_for_review, main passa requiresReviewedCommit: false, quindi questo ramo accetta l'errore senza consultare unambiguousInvocation: se due @codex review si sovrappongono, un errore generico della prima pubblicato dopo la reazione eyes della seconda imposta ancora codex-review a failure. Nuova evidenza rispetto al commento precedente: il conteggio introdotto dal commit protegge solo i percorsi con requiresReviewedCommit: true; applica la stessa disambiguazione anche alle review iniziali.
AGENTS.md reference: AGENTS.md:L26-L26
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46510ce0f2
ℹ️ 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".
| if (result.state !== "pending") { | ||
| await setStatus(repository, headSha, result.state, result.description); |
There was a problem hiding this comment.
Non chiudere il polling al primo esito pulito
Quando due review Codex si sovrappongono sullo stesso HEAD, la seconda può produrre un esito pulito mentre la prima sta ancora generando commenti: questo ramo pubblica subito success e termina il polling. Poiché .github/workflows/codex-review-gate.yml non si attiva su pull_request_review o pull_request_review_comment, un finding P0-P3 pubblicato successivamente dalla prima review non viene più rilevato e lo status resta verde, nonostante i finding correnti debbano prevalere; attendi la conclusione di tutti i tentativi correnti, oppure riattiva il gate sui nuovi segnali Codex, prima di finalizzare il successo.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8273fbb2e3
ℹ️ 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".
|
|
||
| concurrency: | ||
| group: codex-review-${{ github.event.pull_request.number || inputs.pull_request }} | ||
| group: codex-review-${{ github.event.pull_request.number || inputs.pull_request }}-${{ startsWith(github.event_name, 'pull_request_review') && github.run_id || 'poll' }} |
There was a problem hiding this comment.
Impedisci al polling di sovrascrivere un finding tardivo
Quando un finding arriva tra l'ultima reviewSignals() del polling e il successivo setStatus(success), il suffisso github.run_id fa eseguire il job pull_request_review* in parallelo al polling: il job evento può scrivere failure per primo, ma il polling usa lo snapshot ormai obsoleto e scrive subito dopo success, che diventa lo stato corrente dello stesso context. La nuova evidenza rispetto al commento precedente è che i nuovi trigger non chiudono questa finestra, perché questa riga li separa esplicitamente dal gruppo di concurrency del polling; occorre serializzare gli aggiornamenti o ricontrollare i finding prima di pubblicare il successo.
AGENTS.md reference: AGENTS.md:L26-L26
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa0d2349b
ℹ️ 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".
| await setStatus( | ||
| repository, | ||
| headSha, | ||
| finding ? "failure" : "success", |
There was a problem hiding this comment.
Impedisci a un tentativo precedente di ripristinare success
Con due invocazioni @codex review sovrapposte sullo stesso HEAD, se il tentativo più recente pubblica un finding e quello precedente termina pulito dopo, questo ramo imposta success perché finding esamina soltanto la singola review ricevuta. Non consulta codexInvocations, le reazioni o lo status failure appena scritto, quindi può ribaltare un finding corrente; la nuova evidenza rispetto ai thread precedenti è il fast path pull_request_review* introdotto qui, che bypassa completamente la disambiguazione usata dal polling. Associa anche questi eventi al tentativo oppure impedisci a un esito pulito ambiguo di sovrascrivere un failure.
AGENTS.md reference: AGENTS.md:L24-L26
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c81299d37
ℹ️ 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".
| pull_request_review: | ||
| types: [submitted] | ||
| pull_request_review_comment: | ||
| types: [created] |
There was a problem hiding this comment.
Mantieni un token scrivibile sugli eventi di review
Sulle PR provenienti da fork, i workflow pull_request_review e pull_request_review_comment ricevono normalmente un GITHUB_TOKEN in sola lettura anche se qui viene richiesto statuses: write. Quando Codex pubblica una review, il nuovo run cancella il polling pull_request_target tramite il gruppo condiviso, ma setStatus() fallisce con 403 e anche il fallback non può pubblicare error, lasciando codex-review fermo a pending; mantieni gli aggiornamenti dello status nel contesto fidato pull_request_target oppure evita che questi eventi cancellino quel polling.
Useful? React with 👍 / 👎.
|
|
||
| concurrency: | ||
| group: codex-review-${{ github.event.pull_request.number || inputs.pull_request }} | ||
| group: codex-review-${{ github.event.pull_request.number || inputs.pull_request }}-${{ startsWith(github.event_name, 'pull_request_review') && (github.event.review.user.login || github.event.comment.user.login) != 'chatgpt-codex-connector[bot]' && github.run_id || 'gate' }} |
There was a problem hiding this comment.
Evita che segnali obsoleti cancellino il gate dell'HEAD corrente
Quando una review o un commento Codex relativo al vecchio SHA arriva dopo un evento synchronize, questo gruppo condiviso cancella il polling già avviato per il nuovo HEAD. Il run del segnale obsoleto poi termina senza riavviare il polling perché il commit della review non coincide con l'HEAD del payload, oppure opera soltanto sul vecchio SHA, quindi lo status del commit corrente resta indefinitamente pending; separa i segnali obsoleti per SHA oppure rileggi l'HEAD corrente e preserva il relativo polling.
AGENTS.md reference: AGENTS.md:L24-L26
Useful? React with 👍 / 👎.
| } | ||
| const statuses = await all(`/repos/${repository}/commits/${headSha}/statuses`); | ||
| const currentStatus = statuses.find((status) => status.context === "codex-review"); | ||
| if (currentStatus && currentStatus.state !== "pending") return; |
There was a problem hiding this comment.
Consenti a un retry più recente di recuperare lo stesso SHA
Se un tentativo sullo stesso HEAD ha già prodotto failure o error — per esempio per un limite d'uso o per il timeout di cinque ore — una review pulita del retry entra qui con uno status diverso da pending e termina senza aggiornarlo. Poiché una nuova invocazione @codex review o le relative reazioni non attivano questo workflow, il gate non può più tornare verde sullo stesso SHA senza un dispatch manuale o un nuovo commit; accetta l'esito pulito quando può essere associato senza ambiguità a un tentativo successivo.
AGENTS.md reference: AGENTS.md:L24-L26
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
Cosa cambia
codex-reviewexact-HEAD allineato a SyncBay e corretto sui casi limite emersi in reviewmaintramitepull_request_targete checkout fissatoCodex feedback inbox: workflow, script, helper, test e documentazioneVerifiche
npx vitest run test/codex-review-gate.test.mjs test/workflow.test.ts test/security.test.tsnpm test(83 test)npx tsc -p tsconfig.json --noEmitnpm run buildBootstrap
Questa PR introduce il workflow
pull_request_target: GitHub esegue la versione presente sul branch predefinito, quindi il nuovo gate non è attivo su questa stessa PR. Il bootstrap usa i check esistenti e una review Codex esplicita; dopo il merge il workflow verrà verificato via dispatch sullo SHA esatto.Isolamento
Sostituisce il solo scope gate della PR #96, la cui branch ha ricevuto commit concorrenti estranei. Questa PR parte dall’ultimo SHA gate-only e non include quei file.