Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
4c62031
test(codeql): reproduce rerun dead-end after pre-runner cancellation
seonghobae Sep 5, 2026
fabc998
fix(codeql): recover reruns with no dispatch verdict
seonghobae Sep 5, 2026
e47de34
docs(codeql): trace pre-runner rerun recovery evidence
seonghobae Sep 5, 2026
db15e4c
chore(codeql): restack rerun recovery on protected main
seonghobae Sep 5, 2026
9691960
chore(codeql): adopt latest verification guidance without force restack
seonghobae Sep 5, 2026
67a6bc9
docs(codeql): align ADR with evidence-driven rerun recovery
seonghobae Sep 5, 2026
510e337
merge(main): adopt concurrent CI governance deltas
seonghobae Sep 5, 2026
0599331
chore(codeql): adopt latest protected main
seonghobae Sep 5, 2026
2d4624a
chore(codeql): adopt protected main into rerun recovery
seonghobae Sep 5, 2026
e72ae30
chore(codeql): adopt current protected main
seonghobae Sep 6, 2026
acfa17e
test(codeql): require complete status pagination before redispatch
seonghobae Sep 6, 2026
7628274
fix(codeql): inspect complete status history before redispatch
seonghobae Sep 6, 2026
622ea74
docs(codeql): record complete status-history recovery guard
seonghobae Sep 6, 2026
bf732f9
test(codeql): exercise paginated empty-verdict recovery
seonghobae Sep 6, 2026
eb9d4d2
chore(codeql): merge current main into PR 1902
seonghobae Sep 6, 2026
4bf80b9
test(codeql): align verdict fixtures with paginated status reads
seonghobae Sep 6, 2026
951d0ec
fix(scheduler): require explicit open live PR identity
seonghobae Sep 6, 2026
9bfe575
fix(scheduler): bind Strix reruns to verified job identity
seonghobae Sep 6, 2026
fe64f24
test(ci): cover remaining Strix rerun identity rejections
seonghobae Sep 6, 2026
3549de5
chore(codeql): isolate rerun recovery on current protected main
seonghobae Sep 6, 2026
b966f82
fix(codeql): require preserved SARIF before terminal publication
seonghobae Sep 7, 2026
8c11d86
fix(codeql): verify live base before consuming terminal verdicts
seonghobae Sep 7, 2026
3d8a8b6
test(codeql): bind rerun recovery fixture to live base
seonghobae Sep 7, 2026
82ca0b8
fix(codeql): require preserved SARIF before status
seonghobae Sep 7, 2026
8c4fd55
merge(codeql): integrate canonical SARIF publication guard
seonghobae Sep 7, 2026
1a5957b
fix(codeql): bind terminal verdict receipt to base
seonghobae Sep 7, 2026
4b025af
test(codeql): prove old-base receipt redispatch
seonghobae Sep 7, 2026
51c9df5
fix(codeql): settle exact multi-language reruns
seonghobae Sep 8, 2026
b9b98cf
fix(codeql): bind self-status to exact handler evidence
seonghobae Sep 8, 2026
3349848
fix(codeql): harden self-repository fallback provenance
seonghobae Sep 8, 2026
23cc2df
test(codeql): reject HTTP-successful untrusted status creator
seonghobae Sep 8, 2026
af8334e
fix(codeql): authenticate published status creator
seonghobae Sep 8, 2026
c1351dc
test(codeql): return authenticated status creators in fixtures
seonghobae Sep 8, 2026
61b88b8
merge(main): replace unauthenticated CodeQL fallback with provenance …
seonghobae Sep 8, 2026
1a3133f
fix(codeql): bind exact dispatch settlement evidence
seonghobae Sep 8, 2026
e25800f
test(codeql): reproduce mixed-verdict settlement gap
seonghobae Sep 8, 2026
ef5ef47
fix(codeql): retain complete mixed-verdict settlement identity
seonghobae Sep 8, 2026
86898d3
test(codeql): require complete direct-evidence pagination
seonghobae Sep 8, 2026
df35cfe
fix(codeql): paginate direct settlement evidence
seonghobae Sep 8, 2026
211b763
fix(test): repair CodeQL pagination shim syntax
seonghobae Sep 8, 2026
0764ac2
fix(test): repair CodeQL settlement shim syntax
seonghobae Sep 8, 2026
4da013b
fix(codeql): integrate complete producer evidence
seonghobae Sep 8, 2026
49fd5fe
fix(codeql): preserve producer source across handler advances
seonghobae Sep 8, 2026
ccd4dd3
fix(codeql): select the unique evidence-complete handler
seonghobae Sep 8, 2026
e9589ed
test(codeql): prove App receipts require producer evidence
seonghobae Sep 8, 2026
e9c69e1
fix(codeql): authenticate App receipts with dispatch evidence
seonghobae Sep 8, 2026
3ca05c3
test(codeql): bind App receipts to exact evidence
seonghobae Sep 8, 2026
e07e8fd
fix(codeql): recover live base and reject receipt ambiguity
seonghobae Sep 8, 2026
723d1c3
test(codeql): complete successor evidence fixtures
seonghobae Sep 8, 2026
48baf18
test(codeql): reproduce stale-base and receipt ambiguity cycles
seonghobae Sep 8, 2026
2b60f0e
fix(codeql): converge mixed handler settlement
seonghobae Sep 8, 2026
855f017
fix(codeql): integrate live-base and receipt ambiguity repair
seonghobae Sep 8, 2026
87228f9
fix(codeql): reconcile attempt-wide base settlement
seonghobae Sep 8, 2026
7ca416e
fix(codeql): require predecessor language-gate evidence
seonghobae Sep 8, 2026
ebf054e
fix(codeql): recover attempt after base advance
seonghobae Sep 8, 2026
acea6d9
test(codeql): require dispatch validation for App receipts
seonghobae Sep 8, 2026
27fdc97
fix(codeql): authenticate App dispatch validation
seonghobae Sep 8, 2026
fe8b73e
docs(codeql): bind validation RED to published commit
seonghobae Sep 8, 2026
b924580
test(codeql): reproduce late base-advance deadlock
seonghobae Sep 8, 2026
3c8da48
fix(codeql): recover forward base advance during handler scan
seonghobae Sep 8, 2026
4566b15
fix(codeql): bound terminal recovery
seonghobae Sep 8, 2026
e092426
fix(codeql): report ambiguous evidence
seonghobae Sep 8, 2026
310e9e6
test(codeql): expose dispatch payload limit
seonghobae Sep 8, 2026
e28d7c6
fix(codeql): accept bounded rerun request payload
seonghobae Sep 8, 2026
80c139c
fix(codeql): bound repository dispatch payload
seonghobae Sep 8, 2026
2117695
test(codeql): bind nested rerun request
seonghobae Sep 8, 2026
da98bdc
test(codeql): require nested rerun payload parsing
seonghobae Sep 8, 2026
f0562e8
docs(codeql): record dispatch payload RCA
seonghobae Sep 8, 2026
9307973
docs(codeql): bind payload limit evidence
seonghobae Sep 8, 2026
aed803d
test(codeql): close receipt review gaps
seonghobae Sep 8, 2026
1ed0ca8
test(codeql): expose cross-channel producer ambiguity
seonghobae Sep 8, 2026
9b84832
fix(codeql): unify authenticated verdict evidence
seonghobae Sep 8, 2026
da1cbe5
test(codeql): expose wake credential shadowing
seonghobae Sep 8, 2026
8cb0a28
fix(codeql): preserve wake credential fallback
seonghobae Sep 8, 2026
2f3ff51
docs(codeql): bind verdict and wake evidence
seonghobae Sep 8, 2026
060597a
test(codeql): restore exact tree and expose cross-channel ambiguity
seonghobae Sep 8, 2026
631ccfc
fix(codeql): unify authenticated verdict evidence
seonghobae Sep 8, 2026
be87023
test(codeql): expose wake credential shadowing
seonghobae Sep 8, 2026
3762301
fix(codeql): preserve wake credential fallback
seonghobae Sep 8, 2026
9f06558
docs(codeql): bind verdict and wake evidence
seonghobae Sep 8, 2026
940242d
test(codeql): require full failed-job rerun matrix
seonghobae Sep 8, 2026
c8d7caa
fix(codeql): bind rerun matrix to failed job set
seonghobae Sep 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
584 changes: 496 additions & 88 deletions .github/workflows/codeql-pr.yml

Large diffs are not rendered by default.

469 changes: 425 additions & 44 deletions .github/workflows/codeql-scan-dispatch.yml

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,115 @@
### CodeQL verdicts unify authenticated status and direct evidence

- Shard and coordinator settlement now enumerate both authenticated status
receipts and status-less direct run/SARIF evidence before deciding. The two
channels are normalized by exact producer run ID and state: zero candidates
remains pending, one candidate supplies the verdict, and multiple or
conflicting candidates fail closed with redaction-safe telemetry before a
token request or another dispatch. A valid status from producer A can no
longer hide a distinct complete direct producer B.

### CodeQL wake credentials retain bounded fallback

- The single run-wide settlement now tries the two configured Actions-write
credentials in order and uses the native token only for a self-repository
target. A present but repository-denied primary credential can no longer
shadow a working fallback. Every identity read and the final exact-run wake
share the same bounded chain; exhaustion remains fail-closed, and the scan
job's repository-scoped App token is never transferred to the separate wake
job.

### CodeQL dispatch payload respects GitHub cardinality

- The current-head coordinator had grown to eleven top-level `client_payload`
properties, so GitHub rejected the real repository dispatch with HTTP 422
before the central scan could start. The sender now groups rerun mode and
exact failed-job identities under one `rerun_request` object, keeping the
payload at GitHub's ten-property limit. The protected receiver reads the
nested contract first and retains legacy-field compatibility for already
queued dispatches. RED run `34217639402` reproduced `11 <= 10` on PR #1902.

### CodeQL attempts share one live base and settle predecessor receipts

- `detect-languages` now captures one validated live base SHA before matrix
expansion. Every shard and the coordinator consume that immutable attempt
output. A later protected-base advance makes each shard fail closed, while
the coordinator binds a new dispatch to the refreshed base and asks the
trusted handler to restart the whole required workflow attempt. The
successful capture job and every matrix shard therefore rerun together;
failed-job-only recovery remains the default when the base is unchanged.
- The handler repeats the same live head and base-ref check immediately before
settlement. If the protected base advances after dispatch validation while
the scan is running, settlement proves the old base is the merge-base
ancestor of the new base and promotes that exact run to a whole-attempt rerun
instead of leaving the unchanged pull request permanently red.
- Run-wide settlement now re-authenticates exact predecessor-handler receipts
through run metadata, immutable source ancestry, exactly one successful
`validate-dispatch` job, language result, SARIF preservation, exactly one
Medium+ gate whose conclusion matches the published state, and the
unexpired exact-attempt artifact. Shard,
coordinator, and settlement consumers apply the same gate-state contract.
A mixed matrix may therefore reuse a completed language while the current
handler scans only pending languages; ambiguous, contradictory, or
incomplete receipts remain fail-closed. Multiple evidence-complete receipt
or direct-run candidates are a terminal ambiguity for that coordinator
attempt; it logs the exact run IDs and states and does not request a token or
dispatch another producer into the ambiguous set.
- The trusted handler now revalidates the target base immediately before it
wakes the required workflow. A same-repository, same-ref, strict forward
advance is proven through GitHub compare evidence and restarts the exact
required run in whole-run mode without consuming old-base receipts. A
retarget, rewrite, divergence, stale head, or malformed comparison remains
fail-closed.

### CodeQL queued runs rebind to live base and reject receipt ambiguity

- Before matrix expansion, a required CodeQL attempt validates the live
repository, base ref, head, and current base SHA. Status lookup, dispatch
payload, handler title, and receipt all use that one captured base. This
avoids the stale-event deadlock without allowing sibling shards to adopt
different base revisions.
- Shard and coordinator receipt consumers authenticate every matching App or
narrow self-repository candidate before deciding. Exactly one unique
evidence-complete run/state is required; conflicting complete receipts fail
closed instead of letting status order choose the verdict. Repeated rows for
the same run/state normalize to one candidate.

### CodeQL App receipts require exact dispatch evidence

- App-created statuses now pass through the same immutable producer run, source
ancestry, exact title and actors, unique successful dispatch validation,
language gate, SARIF preservation, and unexpired run-attempt artifact proof
as the narrow self-repository fallback. Creator identity alone is not a
terminal verdict.

### CodeQL producer sources survive compatible handler advances

- A required CodeQL run now keeps its immutable producer source `S` when the
`repository_dispatch` receiver runs from a newer default-branch handler `T`.
Receiver admission, shard and coordinator evidence reads, and run-wide
settlement require either `S == T` or GitHub compare evidence that `S` is the
exact merge base of `T`, with `T` ahead and not behind. Divergent, missing,
malformed, or unverifiable sources remain fail-closed; the target PR base is
still an independent identity. Executable RED fixtures cover the pre-fix
`S != T` deadlock and the negative divergent-source boundary.

### CodeQL duplicate handlers are filtered by complete evidence

- Shard and coordinator consumers no longer reject every direct verdict merely
because an incomplete predecessor and its retry share the same authenticated
dispatch title. They validate each candidate's immutable run metadata,
source ancestry, exact language gate, successful SARIF preservation, and
unexpired exact-run artifact first, then accept exactly one evidence-complete
candidate. Zero or multiple complete candidates remain fail-closed.

### CodeQL direct evidence reads every producer job and artifact page

- Shard, coordinator, and run-wide settlement consumers now stream every producer job and artifact page with GitHub CLI native pagination before rebuilding the response object consumed by the existing exact-identity filters. RED commit `86898d3ecccdf8306d8dc42c8f9e7d5ee8dfbc3a` enumerates all five collection pairs so a future first-page regression fails closed.

### Mixed CodeQL verdicts retain complete run-wide settlement identity

- The CodeQL coordinator still uses authenticated terminal receipts to decide whether any new scan is needed, but when one language remains pending it dispatches the complete exact failed-job language matrix. GitHub's `rerun-failed-jobs` endpoint wakes the whole failed set, so the handler requires a one-to-one matrix/job map; a pending-only matrix could never prove the newer attempt for an omitted failed sibling. RED commits `e25800f01c18ec8b28bd31b720478fc810cc4e92` and `1c84729` reproduce the settlement deadlock and the incomplete wake envelope; PR #1902 remains Proposed until its current head receives independent review and exact-head Checks.

### Failed-check finding names the Strix sandbox instead of the gateway

- `opencode-review-dispatch.yml`'s `emit_strix_provider_failure_finding` rendered one fixed finding for every `STRIX_PROVIDER_UNAVAILABLE` line, whose Root cause read "The contextual-orchestrator gateway or its discovered provider pool was unavailable for this run". `#1953` had just given the Strix sandbox bootstrap failure its own second verdict token (`STRIX_SANDBOX_UNAVAILABLE`) precisely because that attribution is wrong for it -- the sandbox container never reaches its Caido proxy, so the run dies before the gateway serves anything -- and this consumer re-applied the wrong attribution one step downstream, into the review findings and the failure census. The emitter now branches on the second token: a sandbox verdict gets a finding that names Strix's sandbox, says the verdict does not name the gateway, and tells the reader not to change gateway or provider configuration on its strength. A `STRIX_PROVIDER_UNAVAILABLE` line without the token keeps its existing text verbatim, so the gateway class has no regression surface. No test covered this finding text at all before (`gateway or its discovered provider pool` matched nothing under `tests/`); `tests/test_opencode_dispatch_strix_sandbox_finding.py` now runs the production emitter from the published run block and pins both directions plus the no-signal case. Refs #1953, #1935.
Expand Down Expand Up @@ -68,6 +180,38 @@
- Raised `hourly-review-repair.yml`'s discovery ceiling from 50 to 200 while rotating deterministic 50-PR deep-inspection windows by hourly run number. The scheduler hydrates only the selected window and stops immediately after its single dispatch, preserving access to newer PRs without quadrupling expensive review/check/comment work. See `docs/doctoring/hourly-review-repair-single-file-consolidation.md`'s 2026-09-03 follow-up.

## [Unreleased]
- Bind every CodeQL dispatch and receipt to the exact base SHA and required-run
ID, and move run-wide settlement out of the language matrix into one
non-matrix job. Scan shards now keep `actions: read`; only the settlement
job receives `actions: write`. When target status publication is forbidden,
consumers may settle from the uniquely matched central run only after
revalidating its workflow, actors, title, live PR identity, successful
validation and SARIF upload, terminal language gate, and exact unexpired
run/attempt artifact across complete paginated run, job, and artifact
responses. A status receipt or this direct evidence must exist;
neither URL shape nor a bare HTTP 403 is sufficient.
- Authenticate the CodeQL handler's `.github` self-repository status fallback.
If the target-scoped App status POST returns 403 and the handler's own token
publishes as `github-actions[bot]`, consumers now require the exact protected
repository-dispatch run, target/PR/head run title, language job conclusion,
and unexpired run/attempt SARIF artifact. Other repositories still require
the OpenCode App creator; a bot creator or central-looking URL alone cannot
satisfy the gate.
- Settle multi-language CodeQL callbacks at the exact required-run boundary.
The native handler now waits for every base/head/workflow-bound language
receipt, keeps the pending scan matrix separate from the complete failed
compatibility-job settlement map, rejects unrelated failed jobs,
and calls `rerun-failed-jobs` once. A concurrent wake is accepted only when
newer attempts for every mapped language are proven. Required-workflow
reruns may also redispatch when complete receipt history proves the earlier
attempt never reached the coordinator; `run_attempt` is no longer treated
as a dispatch receipt.
- Bind CodeQL admission to the immutable central workflow source SHA.
Required workflows now carry `github.workflow_sha` through dispatch payload,
handler title, terminal receipt, and exact-run validation. This source SHA is
independent from the target pull request base SHA: target-base movement does
not rewrite it, while a missing, substituted, or conflicting source fails
closed.
- Include merge-scheduler entrypoint, core, and regression-test changes in
the existing runtime-quality workflow's trigger and suite selector. Scheduler
workflow edits retain queue checks and also select the full review-repair
Expand Down
Loading
Loading