A push to omni-queue/** has no github.event.pull_request, so the gates that
are base-relative (or advisory) on a pull request ran a candidate in their
absolute / strict mode. A base that drifted mid-cycle would red every
candidate and the queue would blame innocent pull requests. Measured on the
release tip: the strict i18n drift check exits 1 (33 sources, 66 mirrors).
On a candidate these now compare with needs.changes.outputs.candidateBase:
- ci.yml lint: boundary ratchet (--base-ref).
- quality.yml fast-gates: file-size, complexity-ratchets, dead-code, boundary
and the TS7 diagnostics ratchet (which was skipped without a base).
- ci.yml docs-sync-strict: the i18n docs drift takes the pull-request path
(base checkout of the candidate base + advisory comparison); the strict
step no longer runs on a candidate.
Pushes to main, merge_group and workflow_dispatch evaluate to the same
values as before; pull requests keep github.event.pull_request.base.sha.
newCodeMode.resolveMergeBase: on a merge-commit HEAD it compares with HEAD^1
(the live base tip of refs/pull/N/merge). A batch candidate is the base plus
one merge commit per pull request, so that rule judged only the last pull
request of the batch. The two new-code gates now pass the pushed ref, and a
refs/heads/omni-queue/** ref compares with the given base. Every other ref
keeps the first-parent rule. GITHUB_REF joins the runner-owned variables of
check-env-doc-sync (the gates read it; it is not OmniRoute configuration).
Existing assertions changed on purpose (same strictness, new expression):
- tests/unit/build/check-boundary-ratchet.test.ts: the two exact matches of
the PR_BASE_SHA binding (ci.yml lint, quality.yml fast-gates) now expect
"github.event.pull_request.base.sha || needs.changes.outputs.candidateBase".
- tests/unit/quality-rail-gate-membership.test.ts: the PR_BASE_SHA regex of
the TS7 ratchet expects the same expression.
Onda 3 (woodsonl) validada num único board em `.claude/worktrees/batch-w3` sobre `origin/release/v3.8.52` (`4f4c983347b9`), 27 PRs, superfícies protegidas 0.
Evidência: `typecheck:core` limpo. i18n drift limpo no board. changelog-integrity ok. file-size ok (170 congelados). complexity 2975/3218 e cognitive-complexity 1357/1437 dentro do baseline. node:test focado: 1868 passaram, 0 falharam. Vitest da UI: 150 passaram em 12 arquivos. Os 38 do RTK caem no `useCallback` nulo de `node_modules/node_modules/react` via zustand, o mesmo React duplicado desta worktree. Onde dois PRs mexiam no mesmo save, o board ficou com os dois comportamentos: escrita parcial de engine por id e a fila/resync do PR que entrou depois.
O hash de `.i18n-state.json` do guia de quality-gates entra no follow-up, fora do squash.
⚠️ base-red inherited: #15306 (timeouts de suíte no tip, não neste diff).
Obrigado, @woodsonl.
Validated in the 2026-09-28 merge-batch: all 38 PRs of this wave boarded together on release/v3.8.51 (a58000c) — typecheck:core and open-sse typecheck clean, focused tests of the whole board 429/434 (the remaining reds belong to PRs held for rework or already fail on the tip), static gates green apart from file-size/docs-count reconciliation landed in the wave follow-up. Thank you @HouMinXi!
Refresh the existing MIT-licensed miuuyy/codex-chatgpt-web vendor snapshot and its OmniRoute integration as one reviewable change.
Co-authored-by: backryun <backryun@daonlab.local>
A global ratchet ("total ≤ baseline") reds an innocent PR whenever the base
drifted, and lets a PR that adds 10 violations pass as long as someone else
removed 11 — both happened this week. On pull_request events quality.yml now
passes --base-ref <PR base SHA> to check:complexity-ratchets and check:dead-code
(file-size already had it); in that mode the gate compares HEAD with the
merge-base RESTRICTED to the files the PR touched:
- blocking: violations / dead exports the PR added in files it changed
(complexityNewCode=, cognitiveComplexityNewCode=, deadExportsNewCode=)
- advisory: the global total vs the frozen baseline (re-frozen at release,
watched by the nightly headroom job)
scripts/check/newCodeMode.mjs holds the git side (merge-base, changed files,
throwaway `git worktree` of the base with node_modules linked — no stash, no
checkout) and the pure comparison helpers (13 unit tests). ESLint runs only on
the changed files in both trees (~20 s); knip runs twice (~70 s).
Exercised locally against the last 8 merges: complexity flagged
src/lib/credentialHealth/scheduler.ts (2→3, cognitive 1→2) and dead-code flagged
src/lib/resilience/settings.ts:CredentialHealthCheckSettings — findings the
global totals were hiding under the relaxed baselines.
workflow_dispatch, the release-green sweep and the headroom job have no PR base
and keep the absolute comparison. Docs: QUALITY_GATES.md → "New-code mode".