Compare commits

..

127 Commits

Author SHA1 Message Date
diegosouzapw
97bdeecde1 fix(security): confine local plugin installs to the plugin sources directory
POST /api/plugins and the MCP plugin_install tool now install only from the
plugin-sources directory next to the plugin root. The source is canonicalized
with realpath, must stay strictly inside that directory, and a source tree with
a symlink that escapes it is refused; every check fails closed. The previous
schema regex accepted any absolute path.

POST /api/plugins also requires the management credential when login is
disabled.
2026-11-18 00:47:14 -03:00
Diego Rodrigues de Sa e Souza
bc4b0c5f51 chore(ci): prune the 15159 and 7746 test-masking waivers now that v3.8.54 is on main (#20447)
Both waivers covered assertions that changed between main and the
release cycle: routing-strategy-docs-sync-15159 (#20162, phase 2 of the
derived-numbers plan) and compression/ccr-non-mcp-full-prompt-loss-7746
(#18870). v3.8.54 reached main (1c880c5c), both test files are now
identical on main and release/v3.8.55, and check:test-masking against
main passes without them.

Closes #20405
2026-11-17 23:15:02 -03:00
Diego Rodrigues de Sa e Souza
5340875be2 Merge pull request #20397 from cheaper-inference/feat/omni-queue-cutover-2b
feat(ci): omni-queue cut-over part 2b (re-runs, PR gates, lanes, health, watchdog, candidate profile)
2026-11-17 19:15:03 -03:00
diegosouzapw
5716ac0e4f Merge release/v3.8.55 into feat/omni-queue-cutover-2b 2026-11-17 15:43:39 -03:00
dependabot[bot]
4a8b1292ba deps: bump next from 16.4.2 to 16.4.6 (#20392)
Bumps [next](https://github.com/vercel/next.js) from 16.4.2 to 16.4.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.4.2...v16.4.6)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 16.4.6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
2026-11-17 15:43:01 -03:00
diegosouzapw
21c01f89dc Merge release/v3.8.55 into feat/omni-queue-cutover-2b
Brings the v3.8.54 sync-back (16c9247c). Two conflicts:

- .github/workflows/ci.yml: both sides kept. This branch's advisory
  flag on audit:deps for omni-queue candidates sits next to the release's
  comment on the ESLint cache steps; the scanner pins, changed identically
  on both sides, appear once.
- tests/unit/merge-queue/workflows.test.mjs: this branch's file. The
  release side only added a copy of the scanner pin test with a local
  `words` helper; the test and the shared helper are already here.
2026-11-17 13:57:53 -03:00
Diego Rodrigues de Sa e Souza
16c9247c23 Merge pull request #20429 from cheaper-inference/chore/sync-back-v3.8.54-into-v3.8.55
chore(release): sync main (v3.8.54 close) into release/v3.8.55
2026-11-17 13:51:50 -03:00
diegosouzapw
75d9e01559 chore(release): sync main (v3.8.54 close) into release/v3.8.55 — parallel-cycle sync-back 2026-11-17 13:08:43 -03:00
Diego Rodrigues de Sa e Souza
1c880c5c95 Release v3.8.54
Release v3.8.54 — 1,024 documented changes from 920 cycle commits and 110 contributor rows; full changelog in CHANGELOG.md → [3.8.54].

Merged by explicit owner decision at STOP #1, after the CodeRabbit review was triaged and all 30 findings (plus 5 follow-ups) were fixed with tests, on head 73b23ce0. Gate / CI and Gate / Quality passed on this head (8 unit shards, integration, E2E, vitest, build, package, coverage). Security: 0 CodeQL alerts, 0 secret-scanning alerts, 0 Dependabot high/critical.
2026-11-17 10:18:08 -03:00
Diego Rodrigues de Sa e Souza
4b9fc08ad6 fix(ci): run the Release-Green hosted suites in pr gate mode (#20338)
* fix(ci): run the Release-Green hosted suites in pr gate mode

validate-release-green gives its own HARD gates OMNIROUTE_GATE_MODE=pr
(plan "derived numbers and texts resolved only at release"), but the
unit/integration/vitest results it reads through --suites-from come from
the hosted `suites` and `main-suites` jobs, which set no mode. A scheduled
run resolves to release mode there, so the locale-parity tests fail on
every key a feature PR adds to en.json: on 2026-11-16 unit-1/unit-4
failed "should contain every key present in en.json" after #19538, and
base-red #19329 stayed open.

Set the same pr mode on both suite jobs. Release-mode assertions stay with
the release cut.

* test(ci): describe the locale-parity tests without naming their helper path

tests/unit/locale-parity-mode.test.ts counts every test file whose text
mentions the helper path as a user of the mode-conditional skip helper.
The new hosted-suites test only named it in a comment and was flagged as
an unlisted user (Unit Tests 7/8). It does not use the helper, so the
comment is reworded instead of widening the allowlist.
2026-11-17 08:21:23 -03:00
diegosouzapw
68cdb82a9a Merge release/v3.8.55 into feat/omni-queue-cutover-2b 2026-11-17 02:32:01 -03:00
Diego Rodrigues de Sa e Souza
e23b439525 fix(i18n): v3.8.55 base-red — translate the refresh's __MISSING__ markers; decouple the refresh real-plan tests (#20395)
* test(release): refresh real-plan fixture drops lines that repeat the migration count by coincidence

The two 'real gate plan' tests copy the live README and the fa/pt-BR mirrors. After the v3.8.54 refresh the count (240) also appears in the PR census ('240 by Dependabot'), and fa writes the migrations count in Persian digits, so the mirror carry is ambiguous and the refresh correctly asks for a manual edit; both tests failed on release/v3.8.55 6bb0d350 in pr and release mode.

The fixture keeps the real files and drops only the lines, other than the database row (better-sqlite3 + LowDB), that show the current count in ASCII, Persian or Arabic-Indic digits. The mirror check now asserts the mirror changed against that input AND carries the new count. Nothing else changes.

* chore(i18n): translate the UI keys the v3.8.55 refresh left as __MISSING__ markers

The v3.8.55 cut (6bb0d350) ran release:refresh-derived without a translation backend, so syncUiKeys left the cycle's new and rewritten UI keys as __MISSING__:<en> in 65 locales (1,782 values). The UI fell back to English, but i18n-vi-completeness and the release-mode ratio gate failed on the base.

Translated with scripts/i18n/translate-new-keys.sh (route codex/gpt-5.6-sol-low, 2 workers). Also: 496 falNative values that were a bare "__MISSING__" (no English, shown literally because the runtime only recognises the __MISSING__: prefix) became markers and were translated; the zh-CN/zh-TW glossary normaliser fixed breadcrumbs.mediaProviders; Filipino leaves still identical to English were retranslated (ratio 4.0% -> 3.0%, baseline 3.3%). Audit: 2,402 changed values, none with model chatter, a placeholder or tag mismatch, or a leftover marker.

* docs(changelog): fragment for the v3.8.55 base-red fix

* docs(changelog): number the base-red fragment after PR #20395

* test(check): strategy-count real-tree test takes the version from the facts snapshot too

After the v3.8.55 bump llm.txt states v3.8.55 while the test fixture says 3.8.54, so planDerivedRewrites also planned a version rewrite of llm.txt and 'llm.txt must not be rewritten' failed for a reason unrelated to strategy counts (Unit Tests 2/8 of #20395, run 43996522143). The test already reads the strategy count from docs/reference/derived-facts.json; it now reads the version from there as well.
2026-11-17 02:30:42 -03:00
diegosouzapw
3fe023d770 docs(ci): say what a blocked pull_request_target run of omni-queue looks like
The runbook quoted an error text for a blocked run that nothing in this
project ever showed. During GitHub's brownout of 2026-11-16 (16:00-18:00
UTC) the deployed workflow had 29 such runs: status Startup failure, no
jobs, no check run on the pull request, and an annotation that names the
pull_request_target protection. "Labels with no effect" and the Actions
event policy section now describe that.
2026-11-17 00:16:31 -03:00
diegosouzapw
24b9ef0dd9 Merge release/v3.8.55 into feat/omni-queue-cutover-2b 2026-11-16 21:17:16 -03:00
diegosouzapw
d14be7176d docs(ci): omni-queue runbook for the bounded repair lane, new stall causes and the follow-up fixes
docs/ops/OMNI_QUEUE.md:
- H1: the base-repair lane and its incident entry give the bound (infraRetries + 1 candidates of
  the same head on the same base tip), the PR comment and the dashboard line, and what the
  operator does; repairInfraDrops in the state table and the rollback table.
- H2: Health and "Who is told, and when" say that a new kind of cause opens a new episode, and
  what still tells nobody follows.
- H3: a repair found landed at the start of a tick does not lift a base-red pause while the
  overflow holds entries.
- H4: a squash-api rate limit is retried only when nothing was merged; after a partial merge the
  merge-failed pause names the merged PRs, without the token hint.
- H5: when API Route Typecheck stays missing on a head (a base changed from outside main and
  release/**, a fork run awaiting approval, a head with merge conflicts) and what to do; the
  rollback's step 6 says the rolled-back config is shadow, where only a bless writes the land
  status; the compare-and-swap message is one run redoing its tick three times.

.github/workflows/omni-queue-watchdog.yml: the header comment lists the watchdog's signals as
they are now (comment only; nothing else in the workflow changes).
2026-11-16 21:07:18 -03:00
diegosouzapw
f639e7cda1 fix(ci): omni-queue bounds a repair that keeps failing for infrastructure and tells a new stall cause
- H1: a base repair dropped for infrastructure under a base-red pause is counted per PR in a new
  optional state field, repairInfraDrops ("<n>" → {head, baseSha, drops}; counted from 1 again for
  a new head or another base tip). At repairInfraLimit(config) = infraRetries + 1 drops of the
  same head on the base tip the pause names, the lane stops composing it (stoppedRepair, applied
  to the candidates of startBatch) until the head or the base moves; the base-red pause stays.
  The PR is told once (commentOnce key `repair-infra:<head12>:<base12>`; never in shadow mode, like
  every PR comment) and the dashboard shows a line per stopped repair. Entries go when the PR is
  closed, retargeted or its head changes (pruneRepairInfraDrops); labels are not read, so
  removing and re-adding the base-repair label does not retry it. Validated when present; the
  code at 8c60cc2d ignores it. The error event of a dropped base check names its parked repair.
- H2: dashboard.assessHealthDetail gives each stall its kind (the rule that fired:
  paused:<reason>, in-flight, waiting, failed-ticks, withdrawal, landings) and its own since;
  assessHealth returns the same verdict without them. An episode stores its kinds (stalled.kinds,
  validated when present). trackStall opens a new episode (its own queue-stalled event and
  comment, keyed by the new cause's start) when the verdict has a kind the open episode does not
  carry whose own since is later than the episode's opening; an unchanged or reworded cause opens
  nothing.
- H3: the overflow check of afterLanded is reached (recordEarlierLanding runs before
  replaceBaseRedForOverflow): its comment says so, and a test pins the sequence. The twin check in
  maybeAutoResume is removed: its only caller runs it right after replaceBaseRedForOverflow, which
  leaves no base-red pause with overflow entries, and nothing between adds one.
- H4: a squash-api rate limit is retried as an error without a verdict only when nothing was
  merged; after a partial merge the merge-failed pause names the merged PRs, without the
  land-token hint (the result carries the rate-limit mark).
- H6: the retry log lines give the attempts as a lower bound ("at least N … since <since>").

New tests: tick-followup.test.mjs (B6 live and shadow; a new head and a base move start again;
the label removed and re-added does not retry; the field's validation; B4; a withdrawal inside a
pause episode; reworded and earlier causes open nothing; rr-m29; rr-squash; an allowed resume
ends landingsWithoutVerdict; the log wording). Ten of them failed against 359ecf8; the H3 and H6
ones pin behaviour 359ecf8 has and fail under their mutations (scratch copies).

Re-aimed: tick.test.mjs "a pause older than 2 h: one queue-stalled event and one comment, not
repeated" (live, shadow; two deepEqual of state.stalled now include kinds: ["paused:manual"]) and
"three ticks that throw before the end of run(): one queue-stalled event and one comment"
(state.stalled includes kinds: ["failed-ticks"]); tick-pauses.test.mjs "G6 (M2, final review
P4) …" (with infraRetries 0 the first drop reaches the bound, so nothing is recomposed; with 1 the
repair is recomposed as before; both now check repairInfraDrops). No assertion removed.
2026-11-16 21:03:22 -03:00
diegosouzapw
359ecf8856 docs(ci): omni-queue runbook for the final fix wave, the rollback's last step and who is told
docs/ops/OMNI_QUEUE.md says what the code does after this wave:

- Rolling the code back: a step 6 for the bless path (the release rulesets stay and, with
  OMNI_QUEUE_ENABLED false, nothing can write the land status: delete the rulesets right after the
  merge, or set the variable back to true so the rolled-back queue runs); Rollback's first bullet
  points at it. The rollback table gains landingsWithoutVerdict, stalled.quietTicks and the
  change in what counts as work; its landWithdrawalsOverflow row agrees with step 1.
- Stored withdrawals (G1): queue work found through the open dashboard issue (do not close it),
  retried on every visit, a stall after an hour, the day alert, the count saved only with another
  change or the heartbeat, the kept candidate ref; the incident entry follows (no "dispatch once
  per retry" any more), and the known limit that said they were not visited is gone.
- Who is told, and when (M8): the new watchdog signals (labelled PRs with no state file, an
  invalid config), the dashboard rules, and what still tells nobody; the invalid-configuration
  incident; the deadline's stop between a comment and its update.
- Health: the at-once pauses (error, tree-divergence), the withdrawal and landings-without-a-verdict
  rules, the episode that failed ticks opened held for two completed ticks; The queue stalled lists
  the new reason lines.
- The candidate verdict (G4): only the jobs of the candidate's push runs count; a check run that is
  no job is ignored and noted; a later same-named run of another suite supersedes nothing.
- PR gates (G3 was in its own commit), `queue why` reading gates and lane, the pause reason (one
  line, 200 characters, `Kept-nowhere`), who may pause and resume (M9), the base-repair lane's infra
  failure under base-red, the deferred bisection segment under a pause, a base-red pause with
  overflow entries, the rate-limited squash-api merge (no longer a known limit), the
  workflow_dispatch sentence, the scheduled-run timing, and an entry for the messages that had none.

English only; nothing under docs/i18n. runbook.test.mjs, prettier, check:doc-links,
check:fabricated-docs and check:docs-all (PR mode) pass; no broken in-page anchor.
2026-11-16 20:15:01 -03:00
diegosouzapw
9929d2c60e test(ci): omni-queue candidate parity tests judge only what really runs and blocks
tests/unit/merge-queue/workflows.test.mjs (the candidate parity checks of ci.yml / quality.yml):

- T13-a: invokes() anchors the gate at the start of the command line (commandWords drops the
  `exec`, `time` and `VAR=value` prefixes) and refuses a line with a `#` after its start, so
  `echo "npm run …"`, `exit 0 # npm run …` and `: npm run …` no longer count as running a gate.
- T13-b: counted sites are judged with every repository variable on AND off (a site blocks only
  where it blocks under both); a counted step whose `if:` or `continue-on-error` (its own or its
  job's) reads `env.*`, `matrix.*` or `head_commit`, or that runs in a shell other than none or
  bash, is not accepted (unjudgeable); the evaluator compares context and property names
  case-insensitively, as GitHub does.
- T13-c: the exception check fails only the gate's own script (FAKE_NPM_FAIL), not every npm
  call.
- T13-d: the any-context rule applies to a job-level continue-on-error too (the jobs advisory on
  every event before this task are named: docs-lint, i18n, test-protocols-e2e).
- T13-e: the trigger test pins that on.push filters by branches only, carries the "add a
  context" advice in each assertion message, and calls branchFilterMatches with a filter object
  (it was handed the branch string, so every push branch matched).
- T13-f: the test-masking probe's git calls run with `-c core.hooksPath=/dev/null -c
  commit.gpgsign=false`, and PROBE_GIT_ENV also drops GIT_CONFIG_COUNT / KEY_n / VALUE_n,
  GIT_CONFIG_PARAMETERS and GIT_TEMPLATE_DIR.

New cases: 10 mutations in "a hard gate counts only where it can make the candidate red" and 2 in
"a step advisory on a candidate is advisory on no other event", each a survivor before this
change (run recorded in the wave report); "T13-f: the test-masking probe ignores git configuration
and templates passed down through the environment". No workflow file changed; no assertion
removed.
2026-11-16 20:08:06 -03:00
diegosouzapw
5a3692e030 fix(ci): omni-queue retries a rate-limited squash merge and reports landings that never answer
- T13b-a: land.landSquashApi keeps the client's rate-limit mark on its merge-failed result
  (`rateLimited: true`, LandResult). The tick then retries it as an error without a verdict: the
  blessing is withdrawn (revokeOrNote), the tick fails with "landing <batch> hit a rate limit
  (...)", and the attempt stays counted; no merge-failed pause and no land-token hint.
- T13b-f: a new optional state field, landingsWithoutVerdict {count, since}: counted in the
  save before each blessing (markLanding), deleted when a landing answers (any verdict), when a
  batch lands (afterLanded, also for a landing recordEarlierLanding finds) and by an operator's
  pause or resume. Health rule 6 (dashboard.assessHealth, STALL_LANDINGS_WITHOUT_VERDICT = 3, the
  value of tick.LANDING_ATTEMPTS_LIMIT): stalled from that count on, since its `since`, with the
  line "<n> landings in a row ended without a verdict, the first at <time>, none landed since:
  the landing keeps failing". It catches a base that keeps moving, where every new candidate
  starts its own attempts count. validateState checks the field when present; the code before
  it carries it along unread (rollback: remove it before rolling forward again).
- M1: an episode opened by failed ticks (its reasons name dashboard.FAILED_TICKS_REASON) stays
  open until STALL_CLEAR_COMPLETED_TICKS (2) completed ticks in a row found no stall
  (stalled.quietTicks counts them; a failed tick or a new stalled verdict drops the count), so
  three failures, one completed tick, three failures is one episode and one mention. Other
  episodes end at the first completed tick that finds no stall, as before. stalled.quietTicks is
  validated when present.

New tests: tick-landing-health.test.mjs (R-3 on the real landSquashApi; the tick's retry
without a pause or hint; P-8 as a test with one alert; the run ended by a landing, by a landing
the next tick finds, by another verdict and by a pause; rule 6; P3 as a test and the row broken
by a failed tick; an episode not from failed ticks still ends at once; the validation of both
fields). Each code change fails its test under a mutation in a scratch copy (wave report).

Re-aimed (tick.test.mjs), for M1: "three ticks that throw before the end of run(): one
queue-stalled event and one comment", "fail, complete, fail, fail: no alert; three failed ticks
in a row: the alert" and "an episode on a base that lost its work ends: visited once, cleared,
then dropped" (now "...: visited twice, cleared, then dropped"): the first completed tick after
the failures holds the episode (quietTicks 1, the failed-tick count cleared), the second clears
it; every earlier assertion stays.
2026-11-16 20:07:17 -03:00
diegosouzapw
1319e3ad0f fix(ci): omni-queue keeps a base-red pause through a repair's infra failure and reports error pauses at once
- M2 (infraPath): a base-repair candidate (lane base-repair, a base check of one included) whose
  CI fails for infrastructure after its retries, under a base-red pause, is dropped and the
  base-red pause stays as it is (it used to become an `infra` pause while the base-red issue said
  the queue resumes by itself). One `error` event says so; the repair PR keeps its labels and its
  lane composes it again (a new candidate). No new event type.
- M4 (dashboard.assessHealth rule 1): a pause with reason `error` or `tree-divergence`
  (STALL_AT_ONCE_PAUSE_REASONS) is a stall from the first tick, the pause's reason in the line
  ("paused (reason `error`) since <time>: a pause for this reason does not lift by itself");
  the other reasons keep STALL_PAUSED_MINUTES.
- M6: a batch found landed by recordEarlierLanding (it runs before the action) no longer composes
  the next segment of its bisection there: afterSegmentGreen defers it, and
  composeDeferredSegments composes it once the action is applied, never under a pause (then the
  bisection ends; its PRs keep their labels and come back through the FIFO).
- T13b-c, T13b-d: an operator's pause reason goes through operatorReason: one line, the words
  `Kept nowhere` escaped ("Kept-nowhere", any case) so it can neither plant nor re-label a commit
  kept nowhere, cut at OPERATOR_REASON_CHARS (200).
- T14-a: `queue why` reads the PR gates (config.prChecksRequired, read as Tick.snapshotPull and
  Tick.gateSuites read them) and the lane (eligibility.laneOf, which exempts a base repair from
  the gates), and prints both.
- T14-c: the header of tick.mjs lists the App token's permissions as the tick job mints them.
  `pull-requests: write` stays in the workflow (a sandbox check first).

New tests: tick-pauses.test.mjs (P4 as a test with infraRetries 0 and 1, an ordinary batch still
pauses infra; an error pause opens its episode and one comment in the same tick; P8 as a test
and its no-pause counterpart; T13b-c; T13b-d); dashboard.test.mjs "G6 (M4)…"; cli.test.mjs
"G6 (T14-a)…". Each fails under its mutation (scratch copies; see the wave report).

Re-aimed (tick.test.mjs): a tick that pauses with reason `error` now ends with the
`queue-stalled` event of its episode, so the assertions on its last event read the event before
it through lastBeforeStall (which also asserts that the last one is `queue-stalled`) in: "live:
a base branch that does not exist → paused error, nothing blessed, nothing landed"; "a landing
failure other than base-moved/divergence pauses with reason error"; "live with actor owner and no
OMNI_QUEUE_LAND_TOKEN: paused (error) naming the land token"; "a landing that throws every tick
pauses after 3 attempts" (merge-ff, squash-api); the nine "… a stored batch that
names … is not blessed, not landed, and pauses" tests (live merge-ff, live squash-api, shadow
merge-ff); "live merge-ff/squash-api: queue refs without an update rule → paused
error naming it…"; "M4: twenty stored withdrawals and a twenty-first refusal…". "an error event
appended by a tick that completed (a landing pause) is not a failed tick": the last four events
are error, queue-stalled, error, error, and its last assertion (no episode) now checks that the
episode is the error pause's, not a streak of failed ticks.
2026-11-16 19:49:41 -03:00
diegosouzapw
6024f79b7a test(ci): omni-queue pins the invariants the review's mutations left untested
New file tests/unit/merge-queue/tick-invariants.test.mjs, one test per invariant; each fails
under the mutation named in its title (run in a scratch copy, never in the worktree; the log is in
the wave's report):

- M10a, M10b: waitForRerun takes a batch at the landing stage back to testing while it waits for
  the re-run (attempt in flight; attempt not shown yet): its land status is withdrawn.
- M10c: rerunFailed adopting a re-run a person started does the same.
- M17a, M17b, M17c: a lane batch keeps its lane when it is recomposed because the base moved,
  because a PR left it before landing (a stored lane batch of two, the only way to reach that
  recomposition with PRs left) and because its candidate is gone from origin.
- M27: under a base-red pause a hotfix PR is not composed; a base-repair PR is.
- M46: the FIFO never takes a base-repair PR, even one its lane does not compose (a tried head).
- M47: a repair that fails like the base leaves the base-red pause exactly as it was (same since,
  no second base-red-paused event).
- M22: the landing-stage save (markLanding) drops a stored withdrawal of the commit it blesses.
- T13b-e: entries of landWithdrawals alone do not block the automatic lift of a base-red pause.

No production code changed; no test re-aimed or deleted.
2026-11-16 19:35:39 -03:00
diegosouzapw
be322d1bf3 fix(ci): omni-queue counts only the jobs of the candidate's own push runs in its verdict
Any workflow token with checks: write can create a check run on the candidate's SHA; GitHub files
it in one of the commit's Actions suites, which are the candidate's own push runs. The tick read
every check run of those suites, so a planted `success` named like a red job (a later id in the
same suite) superseded it: checks-green, land-blessed, landed (final review P1).

- github.mjs: new read listWorkflowRunJobs(runId) (GET /actions/runs/{run_id}/jobs?filter=all,
  every page; normalizeWorkflowJob reads each job's check run id from its check_run_url). It is a
  read: not in GH_WRITE_METHODS, allowed in a dry-run.
- tick.mjs pushCheckRuns: inside the suites of the listed push runs of the candidate ref, only the
  check runs that are the check run of a JOB of those runs count. Any other one is ignored for the
  verdict (absent: neither green nor red) and noted once per batch (per SHA when the batch is
  unknown) as an `error` event, one line, naming each check and its app
  (FOREIGN_CHECKS_DETAIL, noteForeignChecks). A job listing that fails fails the tick, as the other
  reads there do. readChecks / evaluate / failuresOf carry the batchId for that note. Shadow and
  live read the same.
- checks.mjs supersedes: a run never supersedes one of another check suite when both suite ids
  are known and differ (final review p7: a failed job in one suite and a later same-named success
  in another read green).
- The re-run path is unchanged: a re-run of failed jobs is the run's next attempt in the SAME
  suite (task-9 report); filter=all lists the jobs of every attempt, so the attempt-2 check runs
  are jobs and still count, and supersede attempt 1 within the suite.
- Extra API calls: one job listing per push run of the candidate ref per evaluation (one page per
  100 jobs); ci.yml and quality.yml push on omni-queue/**: two listings per tick with a candidate
  in flight (plus two for a parked batch's re-read after a base check).

Test fakes: tick-fakes.mjs lists the jobs of a run (every check run of its suite except
gh.nonJobs, check runs created through the API); fake-github.mjs serves GET
/actions/runs/:id/jobs (every check run of the run's suite, except one added with
addCheckRun `job: false`) and records fake.jobListings.

New tests: tick-candidate-jobs.test.mjs (P1 for flakyReruns 0 and 1: the candidate stays red,
nothing blessed or landed, one `error` event per batch; planted successes for every required check
leave it pending; a re-run's attempt-2 jobs still count and the batch lands; a job listing that
throws fails the tick with nothing blessed; one listing per push run of the ref, none for other
refs or events); checks.test.mjs the p7 case (another suite never supersedes; the same suite
does; a suite known on one side keeps the old rule); github.test.mjs listWorkflowRunJobs (filter
all, every page, check run ids, the planted run not listed, refusals) and normalizeWorkflowJob.

No test re-aimed or deleted. No new state field or event type.
2026-11-16 19:28:52 -03:00
diegosouzapw
8de5fe4f21 fix(ci): omni-queue requires API Route Typecheck green on a PR head, as a merge does today
config/merge-queue/config.json: prChecksRequired gains "API Route Typecheck" (the job and check of
.github/workflows/api-route-typecheck.yml, which runs on every pull request to main and
release/** with no path filter, on opened, synchronize, reopened and ready_for_review). Nothing
else in the file changes; "mode" stays "shadow". config.mjs needs no change (the key is optional
with default [], and the Zod mirror of config.test.mjs lists the same default).

A head on which that check never ran (a draft, a head pushed before the workflow existed) has no
check run of that name: eligibility.prCheckState returns null, prGatesReason reads it as
"API Route Typecheck missing", and the PR is pr-checks-not-green with no action (label kept, no
comment), as for the other two gates.

Runbook: the Eligibility row, the "PR's own gates" section (what the third gate is and what a
head without it reads) and the Configuration-keys row of prChecksRequired.

New tests: eligibility.test.mjs "G3: with the shipped gates, a PR whose API Route Typecheck is
red, pending or missing (never ran on the head) is pr-checks-not-green"; tick.test.mjs "G3: a head
on which API Route Typecheck never ran, or ran red, is not composed: pr-checks-not-green, no
action" (live and shadow).

Re-aimed (aligned to the shipped config; no assertion removed):
- config.test.mjs "prChecksRequired: both PR gates shipped; default []; distinct non-empty names"
  is now "...: the three PR gates shipped; ..." and also checks the shipped config validates and
  is in shadow mode.
- eligibility.test.mjs "the shipped config requires both PR gates" is now "the shipped config
  requires the three PR gates".
- tick.test.mjs "shadow: a PR with a red gate is not in would-land": the per-gate settings of #2,
  #3 and #4 name the third gate green, so each PR's reason stays the one the test is about.
- tick.test.mjs "with every PR gate red nothing is selected and no PR is dequeued: labels kept, no
  comment": the expected detail names the third gate too.
- integration/tick-e2e.test.mjs "scenario 8c": the asserted prChecksRequired lists the third gate
  (reportPrGates reports it green).
2026-11-16 19:18:51 -03:00
diegosouzapw
9bc742c35b fix(ci): omni-queue watchdog reports labelled bases with no state file and an invalid config
- The watchdog always lists the open PRs carrying the queue label (it used to list them only when a
  state file existed). A managed base that labelled PRs target and that has no state file on the
  state branch fires a signal of its own, "Labelled pull requests, no state file", once the
  newest `updatedAt` of those PRs is more than WATCHDOG_LIMIT_MINUTES old (new pure
  assessNoStateFile; the run result carries `noState`). A base whose file is listed but could not
  be fetched or was past the read budget is not judged by it.
- A config that cannot be loaded or does not validate is the run's config signal: main() catches
  the load, hands runWatchdog `configError` (one line, clipped) and the raw JSON's approvers
  (rawApprovers: the valid logins of an `approvers` array; none otherwise). Such a run reads no
  state file and no PR (every other judgement needs `bases` or the label), opens, reopens or
  updates the issue with the reason in an inert code span, never closes it, prints one error line
  and exits 1.
- T12-b: once main()'s deadline has stopped the run, a reopen or a close that has posted its
  comment does not update the issue (mayWrite(verb, midway)); main()'s JSDoc says the run is still
  pending after a deadline and what it then does.
- T12-c: the CLI entry ends with `.catch(() => process.exit(1))`; no comment line over 100
  characters.
- The closing comment also says every managed base with labelled pull requests has a state file.

Tests (watchdog.test.mjs): P2 as a test (signal at 95 minutes, not at 90, ended by a state file);
the signal with no other state file and never for an unmanaged base; a config that is not JSON
(issue opened, one-line reason, no mention, nothing else read, exit 1); a config that fails
validation (open issue kept and updated, never closed; mention of the raw JSON's valid logins
only; none without an approvers array); T12-a's two missing tests (the update path past the write
cut-off; the deadline fires, then the run reaches its write); T12-b for the close and the reopen;
T12-c.

Re-aimed: watchdog.test.mjs "a labeled PR to a base the queue does not manage reports nothing",
the assertion "A labeled PR to a managed base with no state file is not judged either"
(`stale` empty) now also checks that the base is reported by the new signal (`noState`).
2026-11-16 19:13:08 -03:00
diegosouzapw
0b9bac9c60 fix(ci): omni-queue keeps visiting a base with stored withdrawals and reports one refused for an hour
A stored land-status withdrawal (landWithdrawals or landWithdrawalsOverflow) is now queue work
(contracts.hasQueueWork, new storedWithdrawalCount): discoverBases keeps visiting its base when no
labelled PR targets it, the watchdog judges that base, and the CLI's STALE line counts it.

- The failure path of main() (recordTickFailure) creates the dashboard issue of a base whose state
  stores withdrawals when none is open (dashboardIssueOf, shared with deliverStalledAlert), so the
  next scheduled tick finds the base through it. Every completed tick already upserts it.
- Health rule 5 (dashboard.assessHealth, STALL_WITHDRAWAL_MINUTES = 60): an entry of either list
  first refused more than 60 minutes ago is a stall; since = the oldest such entry's `since`; the
  reason names the count of each list and the oldest commit and its batch. The episode logic
  (one queue-stalled event, one comment, retried delivery) is unchanged.
- A tick whose only change is the `attempts` count of an entry does not save (withoutStamp leaves
  the count out); the heartbeat or any other change writes it. The alert that used to fire at 288
  attempts now fires when an entry has been refused for a day (WITHDRAWAL_ALERT_MINUTES = 1440,
  measured from `since`), once per entry (the history holds it); WITHDRAWAL_ALERT_ATTEMPTS is gone.
- A base-red pause loaded together with overflow entries (a hand-edited state) becomes the
  full-list pause at the start of the tick (replaceBaseRedForOverflow, through
  recordFullWithdrawals and tellBaseRedReplaced). The base-red banner now reads "Resumes
  automatically when the base tip moves."
- cleanupRefs and deleteSuperseded keep the candidate ref of every commit a stored withdrawal
  names (withdrawalRefs); a retired entry's ref is a stray for the next cleanup.

No new state field, no new event type.

New tests: tests/unit/merge-queue/tick-withdrawal-work.test.mjs (probe3 as a test, P7 as a test,
no save for a count-only tick, discoverBases with only an entry or only a stalled episode, the
failure path's dashboard, base-red plus overflow with its issue comment and banner, the kept
ref); dashboard.test.mjs rule 5 (60/61 minutes, the oldest of both lists named, the p6 case);
watchdog.test.mjs "a base whose only work is a stored land-status withdrawal is judged, in either
list".

Re-aimed tests (tick.test.mjs unless named):
- "a later status by another user does not hide the App's success: a stored withdrawal writes
  failure, kept until it succeeds": the first tick's stored entry is the seeded one (a refusal
  alone saves nothing); the second half (written once GitHub accepts) is unchanged.
- "a stored withdrawal whose land status cannot be read stays stored, one attempt per tick,
  nothing written" is now "...; its count alone saves nothing until the heartbeat": three ticks
  save nothing, the heartbeat tick saves the count of its own tick.
- "W4: one error event when a stored withdrawal reaches WITHDRAWAL_ALERT_ATTEMPTS, not on the
  ticks after" is now "W4: one error event when a stored withdrawal has been refused for a day
  (WITHDRAWAL_ALERT_MINUTES), not on the ticks after": no alert at 23 h 59 min, one at a day, none
  on three more ticks.
- "X3 (re-review P-6): a 403 the client marked as a rate limit stops the stored retries; a plain
  403 does not": counts the land-status reads of each entry instead of the stored counts.
- "X3: the alert at WITHDRAWAL_ALERT_ATTEMPTS comes from the in-tick store too" and "...from the
  failure path too, once" are now "X3: the day-old withdrawal alert comes from ...": the entry is
  seeded a day old instead of at 287 attempts.
- "Y2 (re-review Q-6)": a base-red pause with overflow entries now becomes the full-list pause
  (reason error, the replaced clause, no lift on a tip move nor after the overflow is written;
  an operator's resume lifts it), as the ruling T13b-b requires.
- "Y2: a repair that lands under a base-red pause while the overflow holds entries leaves the
  pause in place" is now "Y2: a repair in flight under a base-red pause loaded with overflow
  entries is not landed: the pause becomes the full-list pause".
- dashboard.test.mjs, the base-red banner line: "Resumes automatically when the base tip moves."
2026-11-16 19:05:26 -03:00
diegosouzapw
6bb0d35021 chore(release): bump to v3.8.55 — changelog, docs, version sync
Opens the v3.8.55 cycle at the v3.8.54 freeze (#20389), cut from the frozen
tip e9c9f1dd (parallel-cycle model, /generate-release 0a.0b):

- package.json, open-sse, electron and docs/openapi.yaml at 3.8.55; lockfiles
- CHANGELOG: new "## [3.8.55] — TBD" section, mirrored to the 66 locales
- README.md / llm.txt current-version claims and their 66 mirrors
- release:refresh-derived --profile=release: provider reference, derived
  facts, managed numbers and the 1,782 missing UI keys (marked __MISSING__
  for the release translation wave); --check exits 0
2026-11-16 18:57:51 -03:00
diegosouzapw
8378d7ca0e docs(ci): omni-queue runbook entries an operator can find, and the gaps it must name
Incidents entries become headings that open with what the operator sees,
quoted as the code writes it (the dashboard banner, the pause detail, the
comments, the watchdog issue, the CLI's messages). New entries for a refused
or day-old land-status withdrawal, an invalid config.json on the default
branch, a failed base discovery and a CLI command that did not apply.

The runbook now says that stored withdrawals are retried only on a base
that ticks visit, and that a base whose only work is a stored withdrawal is
not visited: where to see it and what to do. Rolling the code back is an
ordered list that works step by step, with the bless before the variable
goes false when the release rulesets stay. The Actions event policy is a
precondition of OMNI_QUEUE_ENABLED, shadow mode included. Smaller
corrections: a candidate dispatch, the live-only attempts limit, the
owner-only token hint, lanes ignore batch.minSize, why the queue-refs
ruleset matters in shadow mode, what Pull requests write is used for, and
the base-red banner's one wrong case.
2026-11-16 18:13:23 -03:00
diegosouzapw
af93a5c2ec docs(ci): omni-queue runbook for re-runs, PR gates, adaptive batches, lanes and health
New sections: re-running the failed jobs before blaming (flakyReruns), the
PR's own gates (prChecksRequired), batch selection with the adaptive window
and the two lanes, one check profile for candidates and Release-Green, and
health (heartbeat, the four stall rules, one alert per episode). Who lands
says who authors a squash commit. The App permission table says what each
permission is used for; the labels, the queue-refs ruleset in shadow mode and
the watchdog are preconditions of OMNI_QUEUE_ENABLED. The rollback list is a
table derived from contracts.mjs, and says that config.json and the watchdog
workflow go back with the code.

One read of the whole document against the code: about fifty sentences made
true (what a failed tick saves, what shadow mode and a bless write, what a
resume does after a landing pause, the base-red lift under the overflow, the
watchdog's clipping and waits, the squash-api rate limit).
2026-11-16 17:50:15 -03:00
diegosouzapw
9edc169759 fix(ci): omni-queue names commits kept nowhere only after the words and lifts base-red by the resume rule
Task 13b, fix round 4 (rulings Y1 to Y4 of task-13b-fix4.md).

Y1: a commit kept nowhere counts as already named only when a
"Kept nowhere (both lists full)" clause of the new detail names it
(keptNowhereCommits), never because its SHA appears somewhere in the
text. Applies to setPaused (an operator's pause whose reason quotes the
SHA kept the commit out of the state after a second pause) and to the
kept-pause path of recordFullWithdrawals. keptNowhereCommits is exported
for the tests.

Y2: the automatic lifts of a base-red pause (maybeAutoResume when the tip
moved, afterLanded when a repair lands) apply the resume rule
(contracts.resumeBlockers): while landWithdrawalsOverflow holds entries
the pause stays, with one decision line and no event. Defence in depth
for a hand-edited state.

Y3:
- isAuthFailure: an error the client marked rateLimited is never an
  authentication failure (a marked 403 without the words "rate limit" no
  longer pauses with the land-token hint).
- tellBaseRedReplaced is best effort: a refused comment is one decision
  line and the tick completes.
- A base-red pause replaced by the full-list pause keeps its issue number
  in the text: "; the base was also paused as base-red (issue #<n>): ...".
- The resumed event of an allowed resume names the commits kept nowhere
  it clears from the pause, as many as fit in 500 characters, then
  "and N more".

Y4 (docs/ops/OMNI_QUEUE.md): Known limits, the moving base (what the
stored history shows: checks-green, error, land-rejected, batch-started;
land-blessed is never stored on that path); CLI (from the CLI wait one
tick and resume again; the wait loop stops only on a refusal newer than
the dispatch; a resume refused from the Actions tab ends as a green run
and where to look; the automatic base-red lifts follow the resume rule);
Incidents, "Paused: landWithdrawals is full" (the pause detail and the
error event quoted as the code writes each; the issue number in the
detail; the comment only from a completed tick, best effort; the resumed
event names the cleared commits); the resumed row of the event table.

New tests (tick.test.mjs): "Y1 (re-review Q-1): ...", "Y1: a kept pause
whose text names a commit outside the words gets it appended after them",
"Y2 (re-review Q-6): ...", "Y2: a repair that lands under a base-red
pause while the overflow holds entries leaves the pause in place", "Y3: a
landing error the client marked as a rate limit is never an auth
failure, whatever its text", "Y3: a refused comment on the replaced
base-red issue does not fail the tick: ...", "Y3: a base-red pause
replaced by the full-list pause keeps its issue number in the detail",
"Y3: an allowed resume names, in its resumed event, the commits kept
nowhere it clears from the pause", "Y3: a resume clearing more commits
kept nowhere than an event detail holds names what fits, then how many
more", "Y3: a resume of a pause that names no commit kept nowhere keeps
the plain resumed detail" (pin). cli.test.mjs: "Y3 (re-review Q-CLI): a
refusal event older than the dispatch does not stop the resume wait
loop" (pin; fails with the watermark mutated to -Infinity).

Renamed (no assertion changed): "X2: a dry-run resume while the overflow
holds entries writes nothing" -> "X2: a dry-run tick on a base paused
with overflow entries makes no GitHub write".

config/merge-queue/config.json keeps "mode": "shadow". No new state
field, no new event type, no validator bound raised, no new GitHub write
method.
2026-11-16 17:13:20 -03:00
diegosouzapw
91f2cbb0a1 fix(ci): omni-queue refuses a resume while the overflow holds entries and keeps commits kept nowhere
Task 13b, fix round 3, rulings X1, X2 and X3.

X1: every pause the tick sets goes through setPaused, which carries each
commit named after "Kept nowhere (both lists full)" in the current pause's
detail into the new detail, once each (keptNowhereCommits). Of the places
that set a pause, only the operator's `pause` can replace a pause carrying
such words (the others run while the base is not paused, or under a
base-red pause, which a full list replaces); all carry them anyway. A
resume or the base-red auto-resume clears the pause instead.

X2: a `resume` is refused while landWithdrawalsOverflow holds entries
(entries of landWithdrawals alone do not block it). One rule in
contracts.mjs (resumeBlockers, resumeRefusal, RESUME_REFUSED_PREFIX) used
by the tick, the CLI and the dashboard. The tick decides it in applyResume,
after this tick's retry pass (handleAction keeps the pause action only), so
a resume sent once GitHub accepts the App's writes again succeeds when that
same tick drains the overflow; a refused one leaves the pause exactly as it
was and records one `error` event (detail: resumeRefusal). `queue resume`
refuses early without dispatching and exits 1; its wait loop stops on a
new refusal event and exits 1 with it. The dashboard's pause banner says
to wait, with the overflow count, instead of how to resume. No new event
type, no new field.

X3: the attempts-limit pause says "ended without a verdict N times since
its candidate was composed or the queue was last paused or resumed by
hand" (no longer "in a row"). The tick's isRateLimitError reads the
client's `rateLimited` mark (previous commit), keeping 429 and the words
"rate limit" for errors without it. A base-red pause replaced by the
full-list pause gets one comment on its issue (commentOnce, key
base-red-replaced:<since>) saying the base will not resume by itself; the
full-list detail says its counts are those at the time of the pause.
Runbook: Who lands (the attempts sentence), CLI (the resume rule),
Before a mode change (steps 2 and 3; the history cut at 200 characters,
history[] in the state file), Incidents (attempts pause, full-list pause:
the resume refusal, carried names, the base-red comment), Known limits (a
landing that always fails on a base that keeps moving).

New tests, failed on 44a2214 unless marked:
- tick.test.mjs "X1 (re-review P-1): an operator's pause keeps the commits
  kept nowhere of the pause it replaces"
- "X2 (RR-13): a resume while the overflow holds entries is refused: the
  pause stays, one error event, nothing blessed"
- "X2: a resume in the tick whose own retry pass empties the overflow
  succeeds" (passed at once: the old code resumed regardless; it pins the
  order)
- "X2: entries of the main list alone do not block a resume" (passed at
  once, pin)
- "X2: a dry-run resume while the overflow holds entries writes nothing"
  (passed at once, pin)
- "X3: the attempts-limit pause says what it counts (not \"in a row\")"
- "X3 (re-review P-6): a 403 the client marked as a rate limit stops the
  stored retries; a plain 403 does not"
- "X3: an infra retry keeps the candidate's landing count" (passed at
  once, pin)
- "X3: a commit already named in a kept pause's detail is not appended
  again" (passed at once, pin)
- "X3: the alert at WITHDRAWAL_ALERT_ATTEMPTS comes from the in-tick store
  too"
- "X3: the alert at WITHDRAWAL_ALERT_ATTEMPTS comes from the failure path
  too, once" (passed at once, pin)
- "X3: a replaced base-red pause gets one comment on its issue: the base
  will not resume by itself"
- cli.test.mjs "resume is refused at once while the overflow holds
  entries: nothing dispatched", "the resume wait loop stops on the tick's
  refusal event, with its reason"
- dashboard.test.mjs "the resume line says to wait while the overflow
  holds entries (the shared resume rule)"

Re-aimed to the new limit text (the regex or the exact detail, nothing
else): "a landing that throws every tick pauses after 3 attempts
(merge-ff, squash-api)", "a manual pause and resume resets the counter",
"a state without landAttempts loads and counts from 1", "the tick that
hits LANDING_ATTEMPTS_LIMIT withdraws a blessing still standing", "V1
(review probe 1): landings that throw, alternating with ticks that throw
before landing, pause at the third landing without a verdict; three
blessings", "W3 (re-review RR-2): landings that throw, alternating with
checks back to pending, pause at the third landing without a verdict".
2026-11-16 16:47:13 -03:00
diegosouzapw
7af938b30c fix(ci): the omni-queue GitHub client marks the errors it classified as rate limits
Task 13b, fix round 3, ruling X3 (the client half).

The client already classifies an answer as a rate limit (isRateLimited: a
429, or a 403 with a Retry-After header, x-ratelimit-remaining: 0 or the
words "rate limit") to decide its own retries. The error it then throws,
when it gives up at once (a wait over its cap) or after its retries, now
carries `rateLimited: true` (markRateLimited); any other error is
unchanged (no property). Nothing else in github.mjs changes: the same
retries, waits, messages and statuses, so the watchdog and the tick
behave as before; the tick reads the mark in the next commit.

New test (github.test.mjs), failed on 44a2214: "the error of an answer
the client classified as a rate limit is marked rateLimited; others are
not" (a secondary limit whose text never says "rate limit" but carries a
Retry-After over the cap, a primary limit retried out; a plain 403, a 404
and a 502 not marked).
2026-11-16 16:45:00 -03:00
diegosouzapw
44a22145ab fix(ci): omni-queue landing count belongs to the candidate; full lists never hide a commit
Task 13b, fix round 2, rulings W1, W2, W3, W4 (code items) and W5.

W1: when both lists are full and the base is already paused for a kept
reason, "Kept nowhere (both lists full): <sha> (<batchId>)" is appended to
that pause's detail (reason and since untouched), so paused.detail names
every commit kept nowhere. validateState has no bound on paused.detail;
the error event's detail is cut at 500 characters, so it names the
commits that fit and "and N more, named in paused.detail" (namedWithin).

W2: only manual, error, infra and tree-divergence pauses are kept
(KEPT_PAUSE_REASONS: none lifts by itself, nothing is blessed under one).
A base-red pause is replaced by the full-list pause, whose detail says
the base was also paused as base-red (the repair lane blesses under it,
maybeAutoResume lifts it when the tip moves).

W3: inFlight.landAttempts belongs to the candidate. Checks back to
pending, a re-run, a release-freeze hold, a paused base leaving it as is,
an infra retry (same SHA), the failure path and the full-list pause keep
it (written out: a stored landing without the field counts as 1); only a
new candidate and an operator's pause or resume (handleAction) start it
again. The limit is checked in live mode only: a shadow tick never pauses
on a carried count. Contract comment, tick header and runbook updated.

W4: only a NEW entry of the overflow is the full-list condition
(isFullListRefusal; storeWithdrawalIn says whether the entry is new). A
read or a write of a stored withdrawal that fails with a rate limit
(isRateLimitError) stops the retries of the tick; the rest of both lists
waits. One error event when an entry's attempts reach
WITHDRAWAL_ALERT_ATTEMPTS (288), at the crossing only, from the retry,
the in-tick store and the failure path. recordEarlierLanding reads the
base tip twice before falling back.

W5 runbook: the withdrawal is written once, by the pass right after the
batch in flight; the attempts sentence; the full-list incident (a NEW
overflow entry; which pauses are kept; base-red replaced; the counts on
the dashboard and in status); where a commit kept nowhere is named and
how long each view is; step 2 of a mode change reads paused.detail and
the history with --limit 200; the last-resort hand edit says what
disabling the queue-refs ruleset does to other live bases and that the
kill switch avoids it; an unknown commit's statuses answer an empty list.

New tests (tick.test.mjs), failed on 021ff70 unless marked:
- "W1 (re-review RR-8): a base paused by hand, both lists full: the
  commit kept nowhere is named in that pause's detail, its reason and
  since untouched"
- "W1: more commits kept nowhere than an event detail holds: all in
  paused.detail, the event names what fits and how many more"
- "W2: a base-red pause with a repair in flight is replaced by the
  full-list pause: nothing is blessed under it and it does not lift when
  the tip moves"
- "W3 (re-review RR-2): landings that throw, alternating with checks back
  to pending, pause at the third landing without a verdict"
- "W3 (re-review RR-10): a shadow tick never pauses on a kept count"
- "W3: a recomposition starts the count again" (passed at once: pins it)
- "W3: an operator's pause, and an operator's resume, start the count
  again"
- "W4 (re-review RR-9a): a refusal of a SHA already in the overflow, with
  room in the main list, is not a full list"
- "W4: stored retries stop at a rate limit: the rest of both lists waits
  for the next tick"
- "W4: one error event when a stored withdrawal reaches
  WITHDRAWAL_ALERT_ATTEMPTS, not on the ticks after"
- "W4: the tip read of recordEarlierLanding is tried twice before falling
  back"

Re-aimed to W3 (each asserted that landAttempts was gone; each now
asserts the candidate's count is kept):
- "a red batch at the landing stage leaves it before its failed jobs are
  re-run"
- "a red batch at the landing stage loses its land status on the first red
  tick, while it waits"
- "a landing-stage batch whose checks went back to pending is withdrawn
  and re-blessed when green" (its landing marker is now "(attempt 2)")
- "live → shadow on a paused base: a batch left at the landing stage loses
  its status too"
- "a batch at the landing stage held by a release-freeze: its land status
  turns failure; blessed again when the freeze lifts and it lands" (1
  when blessed, none otherwise)
- "M1 probe: a landing-stage batch whose base moved and whose
  recomposition push throws six times: withdrawn by the first tick, not
  stored as landing after it" (count 1 kept)
- round 1's "V1: a freeze hold between two failing landings still resets
  the count" is now "W3 (was V1): a freeze hold between two failing
  landings keeps the count" (kept through the hold, then 2)
Re-aimed to W4: "V5: the failure path leaves a batch whose candidate is
the base tip at the landing stage, with no write; the next tick records
it" now makes both of recordEarlierLanding's reads fail (it read once).
2026-11-16 16:21:46 -03:00
diegosouzapw
ff07520472 fix(ci): omni-queue shows how many land-status withdrawals are stored
Task 13b, fix round 2, ruling W4 (the display items).

- The dashboard prints one line, between the pause banner and "In flight",
  when landWithdrawals or landWithdrawalsOverflow is not empty:
  "Stored land-status withdrawals (retried on every tick): N in
  `landWithdrawals`, M in `landWithdrawalsOverflow`." Counts only, nothing
  relative, so the body stays stable between ticks (renderDashboard).
- `npm run queue -- status` prints "stored withdrawals: N in
  landWithdrawals, M in landWithdrawalsOverflow" under the pause line, only
  when either list is not empty (cli.mjs).

New tests (both failed on 021ff70):
- dashboard.test.mjs "the stored land-status withdrawals are counted on
  the dashboard when there are any (counts only)": the line, its place,
  the body unchanged when only the attempts change, no line without
  entries.
- cli.test.mjs "status counts the stored land-status withdrawals of each
  list when there are any".

Renamed (W4), assertions unchanged: state.test.mjs "a top-level field the
validator does not know is ignored: how code before
landWithdrawalsOverflow loads a state that has it" is now "the current
validator ignores a top-level field it does not know (the rule older code
relies on to load landWithdrawalsOverflow)": it checks the current
validator, not the older code.
2026-11-16 16:19:17 -03:00
diegosouzapw
021ff7006e fix(ci): omni-queue keeps every refused withdrawal and leaves an operator's pause alone
Task 13b, fix round 1, rulings V2 and V3.

V2: a refused withdrawal that found landWithdrawals full was kept only
in the pause detail and one error event (review probe 3: after the drain
and the resume the commit kept the App's success for ever). It now goes
to the new optional state field landWithdrawalsOverflow (same entries,
at most LAND_WITHDRAWALS_LIMIT, one per SHA across both lists),
retried by the same code on every tick in every mode (retryList) and
dropped like the main list (dropWithdrawals, the failure path's
retired SHAs). storeWithdrawalIn says which list holds a refusal;
recordFullWithdrawals replaces pauseForUnrecordedWithdrawals: the
full-list pause stays for a base that is not paused, its detail
(starting WITHDRAWALS_FULL_DETAIL, "landWithdrawals is full") gives the
size of both lists, and only a refusal that fits in neither is named in
full, in the detail and as the error event's sha.

Contract: validateState checks landWithdrawalsOverflow when present
(withdrawalListErrors: the same entry rules, at most 20, no SHA of the
main list). A state without it loads; the validators of 05b9bd4 and of
origin/release/v3.8.54 return no error for a state that has it (checked
by importing them: they ignore unknown top-level fields, and the old
tick carries the field along without retrying it); the runbook's
rollback list says to empty it before such a rollback.

V3: a base already paused keeps its pause (reason, detail, since) when
the list fills: the condition is only an error event, the refusal goes
to the overflow; a full-list pause of its own gets the commits kept
nowhere appended. The "(was paused: ...)" quoting is gone.

Runbook: Who lands, State (the new field), Events (error row), shadow
mode's withdrawals, Before a mode change (both lists empty; the error
event of a commit kept nowhere), Kill switch, cut-over step 9, rollback
(first line and the new clean-up item), Incidents ("Paused:
landWithdrawals is full": what a resume does and what to check first;
the hand edit only for the last resort, with the entry format and the
order of steps).

Re-aimed tests (tick.test.mjs), each keeping its earlier checks:
- "M4: twenty stored withdrawals and a twenty-first refusal: the base
  pauses, nothing is dropped, the detail names the SHA" is now "... the
  refusal is kept in the overflow": the refusal is asserted in
  landWithdrawalsOverflow and as the event's sha; the detail gives the
  counts and no longer names a stored commit.
- "M4: while paused for a full list the stored withdrawals are still
  retried; a resume with room continues" is now "... both lists are
  still retried ...": also asserts the overflow drained and the
  twenty-first commit at failure.
- "M4: the failure path pauses too when a refused withdrawal finds the
  list full" now also asserts the refusal in the overflow.

New tests, failed on 6b20bd7 unless marked:
- "M4 (review probe 3): after the drain and the resume, the twenty-first
  commit is withdrawn too and both lists are empty"
- "M4: both lists full: the commit that fits nowhere is named in the
  pause detail and in the event's sha"
- "M4 (review probe 6): a base already paused by hand keeps its pause
  when the list is full; one resume lifts that pause"
- state.test.mjs: "load: landWithdrawalsOverflow is absent in older
  documents, and accepted up to LAND_WITHDRAWALS_LIMIT entries, one per
  SHA across both lists" (passed at once: an unknown field was already
  carried), "load: a malformed landWithdrawalsOverflow is refused, and
  never saved", "a top-level field the validator does not know is
  ignored: how code before landWithdrawalsOverflow loads a state that
  has it" (passed at once: pins the rule older code relies on).
2026-11-16 15:53:01 -03:00
diegosouzapw
8247c8ccfb fix(ci): omni-queue failed ticks keep the landing count and withdraw before the snapshot
Task 13b, fix round 1, rulings V1, V4 and V5.

V1 (a regression of 88422cc): main()'s failure path sent a batch back to
testing and dropped inFlight.landAttempts, so landings that throw,
alternating with ticks that throw before landing, were blessed without
end (review probe 1: 12 ticks, 6 blessings, never paused; 05b9bd4
paused after 3). The failure path now keeps landAttempts
(leaveLandingIn keepCount); markLanding and the limit check count from
the stored value whatever the stage (storedLandAttempts). Every other
exit from the landing stage still resets it, also for a batch at testing
that carries a kept count (leaveLandingStage: hold, pending checks,
re-run, pause; infra retry and recomposition as before). Contract
comment and runbook State reworded.

V4: withdrawAbandoned() also runs right after the in-flight block,
before the queue snapshot and any composition, which can hang until the
job's timeout; the end-of-tick call stays (once per batch).

V5: markLanding marks the tick's own attempt only after its save
succeeded (a save that throws left a stale stored blessing standing);
recordEarlierLanding catches an unreadable tip and goes on (unknown:
not landed, so a manual pause still pauses and withdraws);
settleFailure deletes an older record of the same error object first.
Runbook: Who lands (what a failed tick saves and keeps, the early
withdrawal, the third lost compare-and-swap), State, Before a mode
change (step 1, squash-api), Known limits (tip equality; squash-api),
rollback note on a landAttempts left at testing.

New tests (tick.test.mjs), failed on 6b20bd7 unless marked:
- "V1 (review probe 1): landings that throw, alternating with ticks that
  throw before landing, pause at the third landing without a verdict;
  three blessings"
- "V1: a freeze hold between two failing landings still resets the
  count"
- "V4: a batch loaded at the landing stage and recomposed has its status
  withdrawn before the queue snapshot"
- "V5: a markLanding save that fails (not a conflict) does not count as
  this tick's attempt: the stale blessing is withdrawn"
- "V5: a manual pause whose base tip cannot be read still pauses and
  withdraws the stored blessing"
- "V5: the same error object thrown by a later tick with nothing to
  record carries no stale record"
- "V5: the failure path's own withdrawal refused: stored by the failure
  path and written by the next tick" (passed at once: pins it)
- "V5: a live tick that throws after its end-of-tick pass: written once,
  the stored batch at testing" (passed at once: pins it)
- "V5: the failure path leaves a batch whose candidate is the base tip at
  the landing stage, with no write; the next tick records it"

Re-aimed: "M1 through main(), shadow mode (the shipped config): a tick
that throws after it left a stored landing withdraws the status and
saves the batch at testing with its error" asserted that landAttempts
was gone after the failure path; it now asserts the count is kept (V1).
No assertion removed otherwise.
2026-11-16 15:49:16 -03:00
diegosouzapw
6b20bd7582 test(ci): the omni-queue tests the reviews asked for before live mode
Task 13b, the test-only items.

- The tick fake's eligibility honours the mode as eligibility.mjs does
  (`shadow-processed` only in shadow mode). New: "a PR that produced a
  would-land in shadow is batched again once the mode is live" (failed
  with the old fake).
- The attempts bound and the withdrawal: "an authentication failure on
  the second landing attempt pauses with the status withdrawn" (passed at
  once: pins existing behaviour) and "the tick that hits
  LANDING_ATTEMPTS_LIMIT withdraws a blessing still standing" (seeded with
  the App's success still standing; on 05b9bd4 it failed only on the
  withdrawal's wording, the behaviour was already there).
- End to end on real git: scenario 2e, blessed, then the base moves
  between the landing's tip read and its push (queue-world's new
  beforeBasePush hook wraps the tick's git runners): the push is refused
  (stale info), the status withdrawn, the batch recomposed on the moved
  tip and landed. Scenario 2f: a planted candidate with the same parents,
  the same message and another tree is refused by the real
  verifyComposition through a tick: nothing blessed, paused. Both passed
  at once (existing behaviour); each fails with the code it pins removed
  (revokeLanding after a refused landing; `trees: true`), checked once.
- Re-aimed, scenario 14 of tick-e2e.test.mjs: the deepEqual compared
  baseChecks[0].startedAt with itself; it now compares it with the
  retry's start, read from the clock of the tick that pushed the retry.
- Re-aimed, github.test.mjs "a hung request times out and is retried as
  a network error": the stalled response is held 10 minutes instead of
  10 s and the bound is half of that instead of 5 s, so machine load
  cannot fail it; a client that waits for the stalled answer fails at the
  test's own 2-minute timeout. What it proves is unchanged (the answer
  comes from the retried request, after one 1 s timeout and one 1 s
  backoff).
2026-11-16 15:10:42 -03:00
diegosouzapw
88422cce7d fix(ci): close the omni-queue withdrawal gaps left for live mode
Task 13b: the paths where a land status (`omni-queue/land` success) could
be left standing on a batch that did not land, recorded as "before mode
live".

M1, a tick that throws late. run() now catches what runLoaded() throws:
Tick.settleFailure withdraws the land status of the batch the tick found
at the landing stage (forced withdrawAbandoned) unless the tick landed it,
its candidate is the base tip, or the tick made its own landing attempt
(that attempt withdrew its own blessing, and its landing stage with
landAttempts is the attempts bound's record). It never throws and never
replaces the error; it skips a dry-run and a lost compare-and-swap. What
the stored state must learn goes to main() keyed by the error
(failedTickRecord) and recordTickFailure applies it in the same save as
the `error` event (amendFailedTick): the withdrawn batch back to testing,
the refused withdrawals stored, the settled ones dropped. A shadow tick
keeps its landing record after leaveLandingInShadow, so a later throw
still resets the stored stage.

M4, a full withdrawal list. storeWithdrawal never drops an entry: a
refusal the list cannot keep pauses the base with reason `error`
(pauseForUnrecordedWithdrawals), the commit named in full in a detail
that starts "land-status withdrawals not recorded"; the stored entries
stay and are still retried while paused. The failure path does the same.

A paused base holds no blessed batch: a paused base that does not process
its batch sends it back to testing (a base-repair batch blessed under a
base-red pause whose lane no longer runs could stay at the landing stage).

A batch that did land: recordEarlierLanding, first step of every tick
(every mode, merge-ff), records a batch at the landing stage whose
candidate is the base tip as landed (afterLanded) before a pause or a
shadow tick can withdraw it; afterLanded drops stored withdrawals of the
landed commits.

Wording: the withdrawal reason is "left the landing stage" (true of a
held batch too); the repair-not-fixing comment says anyone who can label
the PR can remove the lane label.

Runbook (docs/ops/OMNI_QUEUE.md): Who lands (the two known gaps replaced
by the behaviour), State, Events (`error` row), Configuration keys
(`lanes.baseRepairLabel`), Before a mode change or a stop (steps 1 and
2), Incidents (Pause and resume; new "Paused: land-status withdrawals
not recorded").

Tests re-aimed to the new wording only ("batch abandoned" -> "left the
landing stage", assertions unchanged otherwise): "live: a batch stored at
the landing stage whose base moved is not blessed again; its success is
withdrawn", "a withdrawal refused twice in one tick is stored and retried
by the next tick", "a later status by another user does not hide the
App's success: a stored withdrawal writes failure, kept until it
succeeds", "a later status by another user does not hide the App's
success from an abandoned landing-stage batch", "a success of unknown
origin counts as the App's: an abandoned landing-stage batch writes
failure", "a stored withdrawal of a success of unknown origin writes
failure, kept until the write succeeds", "a newer status of unknown
origin never hides the App's success from a stored withdrawal", "a newer
status of unknown origin never hides the App's success from a paused
landing-stage batch", "stored withdrawals are retried in shadow mode too
(a queue switched from live), never in a dry-run", "live -> shadow: a
batch a live tick blessed and left at the landing stage loses its status
on the first shadow tick", "squash-api: a stored withdrawal of a head
this tick blesses never un-blesses it", the release-freeze test with a
blessed batch, the storedWithdrawal fixture and state.test.mjs's
withdrawalEntry fixture. "a repair taken on an unpaused broken base ..."
now checks the new comment text (and that it no longer says an approver
must remove the label).

Deleted, with what replaces them:
- "at most 20 stored withdrawals, one per SHA: when full the oldest is
  dropped with an error event" (the ruled behaviour changed): replaced by
  "M4: twenty stored withdrawals and a twenty-first refusal: the base
  pauses, nothing is dropped, the detail names the SHA", which keeps its
  checks of the 20 entries and their attempts and asserts the pause and
  the absence of the drop.
- "a state without landWithdrawals loads" (cannot fail: the fixture never
  had the field): the load is checked by state.test.mjs "load: a state
  without landWithdrawals loads (a document of the older code)", and "no
  field when nothing is refused" by the new M1 probe and the
  landed-batch tests.

New tests (all failed on 05b9bd4 except the two marked): the M1 probe
(six throwing ticks), a throw before any blessing writes nothing (passed
at once), a read failing before any decision, a dry-run that throws
(passed at once), a refused withdrawal of a throwing landing, the three
M4 tests, the main()-level M1 test in shadow mode, a landed batch met by
a manual pause and by a shadow tick, a stored withdrawal of a landed
candidate, the base-red pause whose repair lane no longer runs.
2026-11-16 15:09:35 -03:00
Diego Rodrigues de Sa e Souza
e9c9f1dd84 fix(ci): OpenCode plugin publish jobs detect plugin changes again (#20373)
The bump step runs inside the plugin folder, where git resolved the repo-root pathspec to a folder that does not exist, so every release logged 'no plugin changes'. Compare '-- .' instead, and bump @omniroute/opencode-plugin to 0.2.2 for the changes that predate v3.8.53. Merged by owner decision before the gates finished.
2026-11-16 14:27:25 -03:00
diegosouzapw
05b9bd4200 test(ci): the candidate parity checks see policy, unfailable lines, any-event advisory and hooks
Review round 2 of "one check profile for queue candidates and Release-Green". Test-only:
tests/unit/merge-queue/workflows.test.mjs. No workflow, profile or script changes.

- U1: the test-masking probe runs every git call and the spawned script in one environment
  without git's location variables (GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE,
  GIT_OBJECT_DIRECTORY, GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_COMMON_DIR, GIT_NAMESPACE,
  GIT_PREFIX, GIT_CEILING_DIRECTORIES, plus the ones compose.mjs clears), without user git
  config, and names its own repository explicitly (-C, GIT_DIR, GIT_WORK_TREE). Run from a git
  hook it committed into the caller's repository.
- U2: a job counts as able to red the candidate only when it is in admission-verdict's needs AND
  required in config/quality/admission-policy.json (the field and value
  scripts/quality/admission-verdict.mjs reads); no job name is hard-coded.
- U3: the shape rule refuses a background `&` (not `&&`, not a redirection) and a leading `!`.
  A script the line calls can still hide `|| true`: an accepted limit, said in a comment.
- U4: an expression-valued step continue-on-error that is true on any modelled context is a
  finding unless it is exactly the candidate expression around external-state gates only.
- U5: an exception entry must pass a behaviour check: its step, run on the candidate context
  with the fake npm, exits 0 with the gate green and non-zero with the gate red.
- U6: the modelled contexts are pinned to the workflows' real triggers.

New tests:
- "the test-masking probe ignores an inherited GIT_DIR / GIT_INDEX_FILE (suite run from a git
  hook)": failed first (the decoy, a temp repository, received a commit).
- "the contexts these tests model are the workflows' real triggers" (U6; a guard, green from
  the start).

Re-aimed tests:
- "a hard gate counts only where it can make the candidate red": four cases added, each a
  survivor before this change: in the background (P1b), negated (P2b), moved to a job the
  admission policy holds advisory (P25), the boundary exception made unfailable (P5). Each case
  now names the gate it must surface.
- "a step advisory on a candidate is advisory on no other event": case "a tree-only gate
  advisory on main only" (P23) added; it survived before.
- "every hard gate of the Release-Green profile runs on a candidate push": hardGateFindings
  takes the test context (the exception behaviour check runs steps); same assertions.
No assertion removed.
2026-11-16 14:01:03 -03:00
diegosouzapw
14638bfb31 fix(ci): pin the scanners ci.yml installs to quality.yml's versions
ci.yml (quality-extended, "Install advisory security scanners") downloaded the latest release
of gitleaks, osv-scanner and oasdiff, while quality.yml (fast-gates) pins them. A tool release
during a batch's CI could red check:secrets or check:openapi-breaking on an omni-queue
candidate (gates that judge the tree, so marking them advisory would be wrong), and the same
gate had two verdicts on one candidate.

ci.yml now sets GITLEAKS_VERSION=v8.30.1, OSV_SCANNER_VERSION=v2.3.8 and OASDIFF_VERSION=v1.19.1
(quality.yml's values) and passes each to its gh release download, in quality.yml's shape.
Only the install lines and their comments change; quality.yml verifies no checksum, so none is
added. The oasdiff repository keeps ci.yml's spelling (oasdiff/oasdiff; quality.yml says
Tufin/oasdiff, which GitHub redirects to the same repository and releases).

What "latest" served on 2026-11-16 (read with gh release view): gitleaks v8.30.1 (unchanged),
osv-scanner v2.7.1 (now v2.3.8, as quality.yml), oasdiff v1.38.0 (now v1.19.1, as quality.yml).

New test (failed first): "ci.yml and quality.yml install the same pinned gitleaks, osv-scanner
and oasdiff" in tests/unit/merge-queue/workflows.test.mjs.
2026-11-16 13:21:57 -03:00
diegosouzapw
b8495d4b09 fix(ci): a candidate gate counts only where it can red the candidate, and a candidate is a push
Review round 1 of "one check profile for queue candidates and Release-Green".

T4. Every candidate-only condition of the previous commit becomes
github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/'): the four
step-level continue-on-error expressions (ci.yml lint audit:deps, quality-gate CodeQL,
quality-extended OSV; quality.yml lint-guard CodeQL), the EXTERNAL_STATE_GATES value of the
quality bag and the if: of the lint test-masking step. A workflow_dispatch of an omni-queue/**
ref is not a candidate: there every external gate blocks and the step does not run.

T1, T3, T5 are test changes (tests/unit/merge-queue/workflows.test.mjs):
- candidateRuns counts a site only in a job listed in that workflow's admission-verdict needs,
  never a comment line, and accepts a site as blocking only when the step's whole run: is that
  one command or it is an entry of the executed quality bag. check:boundary:ratchet (lint,
  if/else script, both branches end in the gate under bash -e) is the one named exception;
  an exception is refused once its gate has an accepted blocking site.
- A step-level continue-on-error true on a candidate must be false on every other modelled
  event (pull request, main, merge group, dispatch, dispatch of an omni-queue ref) and wrap
  external-state gates only; the twelve steps advisory everywhere before this task are a named
  list, each with its reason, refused when stale or changed.
- The test-masking base check probes the script in a throwaway repository instead of matching
  its source with a multi-line regex.

New tests (each failed first):
- a hard gate counts only where it can make the candidate red (mutations: moved to
  ci-summary, behind a shell conditional, a comment line, pull-request only)
- a step advisory on a candidate is advisory on no other event (mutations: OSV ratchet also
  advisory on pull requests, a tree-only gate advisory everywhere, a tree-only gate advisory
  on a candidate)
- a workflow_dispatch of an omni-queue ref is not a candidate

Re-aimed tests, no check dropped without a stronger one:
- "ci.yml: check:test-masking runs on a candidate against the candidate base, not on main
  pushes": the source regex on check-test-masking.mjs is replaced by the behavioural probe
  (SHA wins over an unresolvable GITHUB_BASE_REF; no base, no diff checks).
- "external-state gates are advisory on a candidate, blocking on a pull request and on main":
  the site list moves to the shared EXTERNAL_SITES; the expected expression is the push one.
- "every hard gate of the Release-Green profile runs on a candidate push": the per-gate loop
  (found / advisory-everywhere / exception-not-found) moves into hardGateFindings with the
  admission-needs and shape rules; the stale-exception assertion becomes "refused once the
  gate has an accepted blocking site", exercised on an appended site; the test-masking control
  also pins that its site is accepted.
- "every externalState gate of the profile is advisory on the candidate": the converse that
  compared a candidate with main only now runs advisoryFindings over every modelled event; the
  count of exemptions (>= 4) becomes the exact list EXTERNAL_SITES; EXTERNAL_STATE_GATES is
  asserted empty on every non-candidate event, not only main.
2026-11-16 13:19:26 -03:00
diegosouzapw
ec4ff9e414 feat(ci): one check profile for queue candidates and Release-Green
Release-Green's static profile (config/quality/release-green-static-profile.json) is now the
one list both sides read:

- Every hard gate of the profile runs on an omni-queue candidate push. The one that did not,
  check:test-masking (it lived only in PR Test Policy, a pull-request job), gets a step in the
  lint job that runs on a candidate only, against needs.changes.outputs.candidateBase. The
  pull-request step is unchanged.
- The profile marks "externalState": true on the gates whose verdict reads state outside the
  tested commit: audit:deps (npm advisory database), check:vuln-ratchet (OSV database) and the
  excluded check:codeql-ratchet (the repository's open code-scanning alerts). check:deps,
  check:provider-asset-provenance and check:free-catalog-evidence read only the tree and the
  clone's history and stay unmarked.
- On a candidate push those gates are advisory: step-level
  continue-on-error: ${{ startsWith(github.ref, 'refs/heads/omni-queue/') }} in ci.yml (lint,
  quality-gate, quality-extended) and quality.yml (lint-guard). In the quality bag's
  non-fail-fast loop, an EXTERNAL_STATE_GATES list filled on a candidate only is filtered out
  of the failed gates before the closing verdict, with a warning; the loop lines are unchanged. Pull requests, main and every other event keep the blocking verdict;
  job names do not change. Release-Green itself is unchanged: its reader ignores the new field.

Tests (tests/unit/merge-queue/workflows.test.mjs), read the real profile and workflows:
- ci.yml: check:test-masking runs on a candidate against the candidate base, not on main pushes
- external-state gates are advisory on a candidate, blocking on a pull request and on main
- every hard gate of the Release-Green profile runs on a candidate push
- every externalState gate of the profile is advisory on the candidate
The fake npm of runStep gains FAKE_NPM_FAIL (fail one script only); no assert changed.
2026-11-16 12:53:26 -03:00
diegosouzapw
90eebf66df fix(ci): omni-queue watchdog always ends inside its job: short client, write cut-off, deadline
S1. main() builds the watchdog's client with its own limits, named next to
the other WATCHDOG_* constants: WATCHDOG_MAX_RETRIES = 2,
WATCHDOG_REQUEST_TIMEOUT_SECONDS = 15, WATCHDOG_MAX_WAIT_SECONDS = 15. One
request now takes at most 3 attempts of 15 s plus 2 waits of 15 s (75 s);
a Retry-After above 15 s is not waited for (the client throws at once: a
failed read, a partial run). The tick's client and the shared defaults are
untouched.

S2. WATCHDOG_READ_BUDGET_SECONDS goes from 180 to 150. No write sequence
(create, reopen, update, close) starts after WATCHDOG_WRITE_CUTOFF_SECONDS =
210: the run is partial, one error line says so, exit 1. main() races the
run against an unref()ed, injectable timer of WATCHDOG_DEADLINE_SECONDS =
240, cleared when the run finishes; when the timer wins it prints "deadline
of 240 s reached: the run was stopped (while <where it was>)" and returns 1.
main() never calls process.exit; the CLI entry does, with what main()
returned. A deadline during a write can leave what a killed job could (a
comment without its state change); the next run finds the issue by title
and marker.

S3. The workflow header, the runbook ("Who is told, and when") and the
comment at the budget constant say what bounds what: the budget limits when
fetching starts, the client limits bound one request, the deadline bounds
the run. The header no longer says any failed read makes the run partial
(the state listing and the issue search stop it). "(its own file or not)"
becomes "its own file, or a name the store refuses". main()'s catch comment
says a failed write lands there too. The clean-up sentence says to disable
the omni-queue refs protection ruleset first. A base (and its file) is
clipped to 60 characters inside its reason, so a long name no longer clips
the reason away.

New tests (each red before the code): "the watchdog's client is short: its
own limits, and a Retry-After above its largest wait is not waited for";
"the deadline: a fetch that never answers is stopped, one error line, exit
1, no write"; "past the write cut-off no write starts: a signal
established, no issue created, partial, exit 1"; "a normal run clears its
deadline timer: no handle is left behind"; "a long base name is clipped
inside its reason: the reason still says why".

Re-aimed tests (no assertion removed):
- "the read budget: past it no state file is fetched, the run is partial
  and says how far it got": the constant is now 150 (the 61-second clock
  still passes the budget after the third of six files).
- runMain() helper: its deps argument also carries a timer and a client
  factory (doc comment only).
2026-11-16 12:00:08 -03:00
diegosouzapw
a9499dbf6a fix(ci): omni-queue watchdog tells true reasons, keeps to a read budget and prints one line each
R1. An error thrown out of the run (the listing of state/ or the issue
search fails) is printed by main() as its message, one line, clipped, with
no stack trace; the run writes nothing and exits 1. The workflow's header
comment now says what a partial run does: a read failure is not a signal,
the run is partial, it may still open or reopen the issue for what it
established, never closes or rewrites it, and fails.

R2. A valid state document that is not where its base belongs is reported
with a true reason: "the document is for base B, which the queue does not
manage" (B's own file or not; a name the store refuses is never managed),
or "the document is for base B, which is stored in <stateFilePath(B)>".
Both lines add what to do (a managed base stored in that file has failing
ticks until it is fixed or deleted; otherwise the file is stray). The
sentence "every tick of such a base fails before it can record anything"
is gone. An unmanaged base's own file is no longer skipped in silence (the
re-review's release-v3.8.57 probe).

R3. WATCHDOG_READ_BUDGET_SECONDS = 180: before each state-file fetch the
run checks the time spent since it started (an injected clock); past it,
it stops fetching, the run is partial and one error line says "read budget
exhausted after N of M state files". timeout-minutes stays 5.

R4. Every name and reason that reaches the log goes through oneLine()
(the helper inert() is now built on): one line, clipped. main() flattens
any line break left in what it prints, so no log line can start a
workflow command.

Runbook, "Who is told, and when": the reasons, the read budget, the
one-line error of a run that stops, and the older-version unmanaged-base
file that is now reported until deleted.

New tests (each red before the code): "a valid document that is not where
its base belongs: three cases, three reasons"; "an error thrown out of the
run is one line: the listing of state/ fails, exit 1, nothing written";
"the read budget: past it no state file is fetched, the run is partial and
says how far it got"; "a crafted state file name never starts a log line:
no workflow command".

Re-aimed tests (no assertion removed):
- "a state file whose document is for another base is unreadable": the
  reasons name where the base is stored, carry misplaced: true, and the
  issue line carries the advice.
- "only a base with work is judged: in flight, paused, or a labeled PR
  targeting it": the unmanaged base's own file (state/main.json) is no
  longer written there; it is reported in the new three-cases test.
- "an unreadable state file is its own signal: not JSON, or not a valid
  state": the clean-up deletes state/nameless.json (a commit whose tree
  holds only the clean file) instead of leaving an unmanaged base's own
  file, which is now reported.
- runMain() helper: also returns the lines printed to the log and passes
  an optional second argument to main() (the clock).
2026-11-16 11:36:06 -03:00
diegosouzapw
61277ddb09 test(ci): omni-queue watchdog partial-run tests no longer wait on the default backoff
main() builds its own GitHub client with the default backoff, so the two
partial-run tests that left injected 502 answers for main() waited about
16 seconds each. Their main() part now gets a status the client does not
retry (403); the run() part keeps its 502.

The read-failure test also covers the fetch case: a state file that cannot
be fetched, and nothing else, opens no issue and fails the run.

Re-aimed tests (no assertion removed):
- "a partial run never closes or rewrites the open issue: the PR listing
  fails (the re-review's probe)": main() part answered with 403.
- "a partial run never closes the open issue: a state file cannot be
  fetched": main() part answered with 403.
- "a read failure alone opens no issue: it only fails the run": adds the
  fetch case (action none, no issue, main() exits 1 with one error line).
2026-11-16 11:26:11 -03:00
diegosouzapw
eb0bad5d8e Merge release/v3.8.54 into feat/omni-queue-cutover-2b 2026-11-16 11:20:09 -03:00
diegosouzapw
2104d91105 fix(ci): omni-queue watchdog never closes or rewrites from a partial read
A run whose reads failed judged a partial view as the truth: with the
labeled-PR listing failing, a base whose only work is labeled PRs counted
as having no work, nothing fired, and the run commented "... Closing." and
closed the issue; a state file that could not be fetched did the same and
exited 0, and the update branch rewrote the body without the signal.

- A run is partial when the listing of labeled PRs failed or a state file
  could not be fetched (a fetched file that cannot be parsed stays the
  unreadable-state signal). A partial run may open or reopen the issue for
  the signals it established; it never closes the issue, never posts the
  closing comment and never rewrites an open issue's body. It then exits
  1, one error line per failed read. Read failures are not signals: a
  short GitHub incident opens no issue; the red scheduled run is the
  channel for a read that keeps failing. runWatchdog returns partial and
  fetchErrors.
- The body carries a hidden hash line, <!-- omni-queue-watchdog:body:<12
  hex of sha256> -->, computed over the body without it; "the body
  differs" means the stored body lacks the hash line of the freshly
  rendered one, so line endings or a trailing newline from GitHub never
  cause a rewrite. The issue is still found by title and marker.
- A state file whose document validates but whose base, put through
  stateFilePath, does not give the file's path is unreadable ("the
  document is for base <base>"). An unmanaged base's own file is still
  skipped.
- A file name that is not ^state/[A-Za-z0-9._-]+\.json$ is shown through
  inert() (one line, in a code span with its backticks replaced), never
  inside a hand-made code span it could break out of.
- tick countFailedTick: a comment says the one-minute window between its
  millisecond limit and the watchdog's whole minutes is known and harmless.

New tests (watchdog.test.mjs): "a partial run never closes or rewrites the
open issue: the PR listing fails (the re-review's probe)" (no PATCH, no
comment, open; main() exits 1 with one line; the next complete run updates
then closes); "a partial run never closes the open issue: a state file
cannot be fetched" (same, and the fetch failure exits 1); "a read failure
alone opens no issue: it only fails the run"; "the body carries a hash of
itself: the same signals do not rewrite it, whatever GitHub does to line
endings" (CRLF and a trailing newline: no write; a changed signal: one
update); "a state file whose document is for another base is unreadable"
(release/v3.8.55 and main in state/release-v3.8.54.json, and a stray
file); "a crafted state file name stays one inert line: no mention, no
link, no heading" (the probe's name).

Re-aimed tests:
- watchdog "only a base with work is judged: in flight, paused, or a
  labeled PR targeting it": state/impostor.json moves to "a state file
  whose document is for another base is unreadable", where it is now
  reported.
- watchdog "an unreadable state file is its own signal: not JSON, or not a
  valid state": the clean-up file is an unmanaged base's own file
  (initialState("nameless")), since a file holding another base's document
  is now reported.
- tick "a base the queue does not manage is refused before anything is
  loaded or written": the line assert.ok(new UnmanagedBaseError("x")
  instanceof Error) is deleted (it could not fail); what main() does with
  the refusal is already asserted next to it (exit 1, one refusal line per
  dispatch naming the base and the pattern, no request at all, no state
  file, no issue, no comment). The unused import goes with it.
- The watchdog tests' client gets a short backoff (baseDelayMs 1,
  maxDelayMs 5) so injected 502 answers fail after the client's retries.

Runbook "Who is told, and when": says when both channels can speak for one
cause, lists the three unreadable-state cases, and says that a file or
listing the watchdog cannot fetch makes its run fail instead of opening an
issue, and that such a run never closes or rewrites the issue. The
workflow header says the same.
2026-11-16 11:06:36 -03:00
diegosouzapw
861474153a fix(ci): omni-queue watchdog is the backup channel, with a body that stays true
Round 1 made the watchdog report any state carrying `stalled` for 30
minutes, whatever `notified` said: every episode pinged the approvers
twice, a deliberate two-and-a-half-hour manual pause included. A state file
that cannot be read was skipped in silence, a failed listing of the labeled
PRs left the run green, the issue search grew with every dashboard ever
opened, and the issue body kept the signals of the run that opened it.

- Stalled signal, now the backup channel: only an episode that is not
  marked delivered (`notified` is not true), opened more than
  WATCHDOG_STALLED_GRACE_MINUTES ago, on a base that is not an orphan (no
  work AND a state older than WATCHDOG_LIMIT_MINUTES). The staleness
  signal is unchanged (it reads nothing but `updatedAt`).
- New signal, unreadable state: a state file that is not JSON, or that
  fails validateState (a managed base's own file, or one naming no base),
  is reported with its file name and the reason, one line, clipped, in a
  code span.
- A failed listing of the labeled PRs: the run judges what it can, handles
  its issue, then exits 1 with one error line (runWatchdog returns
  listingError; main fails on it).
- Issue search: the open issues with the label, plus the closed ones
  updated in the last WATCHDOG_REOPEN_HOURS (`since`), never `state: all`.
- The body has absolute times only (the Minutes column is gone): the same
  signals render the same body. An open issue whose body differs is
  updated in place (PATCH of the body only, no comment), keeping the
  mention line it was created with; a reopen rewrites the body too.
- CLI status: work counts labeled drafts, as discoverBases and the
  watchdog do (contracts.hasQueueWork, shared).
- Fake GitHub API: GET /issues honors `since`.

New tests: "assessStalled: an undelivered episode opened 30 minutes ago is
not reported, 31 is; a delivered one never" (with the orphan cases); "an
undelivered episode on an orphan base is not reported; a labeled PR on it
makes it work"; "an unreadable state file is its own signal: not JSON, or
not a valid state"; "the open issue's body follows the signals: updated in
place, no comment, mention line kept"; "the issue search is bounded: open
issues, and closed ones updated in the last 24 hours" (the two listings;
an issue closed 25 hours ago is not reopened); "a failed listing of the
labeled PRs is loud: judged what it could, then exit 1".

Re-aimed tests:
- "assessStalled: a state carrying stalled for 30 minutes is not reported,
  31 is" is now the assessStalled test above: a delivered episode is no
  longer reported (it was, as round 1 ruled); results carry openedAt
  instead of minutes.
- "a fresh state that carries stalled for 31 minutes is reported, not for
  30" is now "a fresh state with an undelivered episode is reported after
  30 minutes; a delivered one is not": the reported state has no
  `notified`, and a delivered one is checked not reported.
- "the issue is reused, not duplicated": the "| 120 |" minutes check is
  replaced by the absolute-time row and a check that no minute count is in
  the body.
- "the issue is closed with a comment once ticks complete again": the
  closing text names the three signals.
- "only a base with work is judged: in flight, paused, or a labeled PR
  targeting it": state/broken.json moves to the unreadable-state test,
  where it is reported; this test checks nothing unreadable is left.
- "flapping: closed when the queue recovers, reopened (no mention) within
  24 hours, new after": also checks the reopened body is the current one.
- cli.test.mjs "status prints the heartbeat age and STALE": a base whose
  only labeled PR is a draft is now work, hence STALE (4 STALE lines).

Runbook: "Who is told, and when" in the Incidents section (the dashboard
comment for an episode; the watchdog issue for no state saved, an episode
that could not be delivered, an unreadable state file; mention, update,
close, reopen; a failed listing fails the run); the entry-points sentence
and "Dashboard stopped updating" point at it.
2026-11-16 10:45:51 -03:00
diegosouzapw
bcf619dcd9 fix(ci): omni-queue ends an orphan episode and refuses an unmanaged base
An episode on a base that lost its work never ended: three failed ticks,
the label removed, and discoverBases no longer visited the base, so
`stalled` and `failedTicks` stayed for ever; a leftover count also made the
first failed tick weeks later raise the alert at once, with `since` weeks
in the past. And a raw dispatch with --base main created a dashboard for
`main` and mentioned the approvers.

- discoverBases also visits a base with an open dashboard issue whose
  stored state carries `stalled` or `failedTicks`. One completed tick there
  clears both and saves once; a later visit writes nothing and the base
  drops out of the list.
- A run of failures needs recency: countFailedTick starts a new run
  (failedTicks 1, failedSince now) when the stored state was last saved
  more than WATCHDOG_LIMIT_MINUTES (90, imported from watchdog.mjs, no
  cycle) before the failed tick.
- main() refuses a --base that config.bases does not match or whose name
  sanitizeBase rejects, before anything is loaded or written
  (assertManagedBase, UnmanagedBaseError): exit 1, one line naming the base
  and the managed pattern, no state file, no error record, no dashboard, no
  alert.
- contracts.hasQueueWork(state, labeled): in flight, paused, or a labeled
  PR on the base (drafts included); discoverBases uses it (the CLI and the
  watchdog follow).
- The failedSince doc says what is true: written and deleted with
  failedTicks, but validateState checks each field on its own.

New tests: "an episode on a base that lost its work ends: visited once,
cleared, then dropped" (the re-review's probe 3, through main()); "two
failed ticks, 91 minutes without a save, one more: a new run of 1, no
alert" and "two failed ticks, 89 minutes without a save, one more: 3 in a
row, the alert"; "a base the queue does not manage is refused before
anything is loaded or written" (probe 5: three --base main dispatches exit
1 with no request at all; a managed --base still ticks).

Reworded test messages (no assertion removed):
- "fail, complete, fail, fail: no alert; three failed ticks in a row: the
  alert": the message said the failure path created the dashboard; in this
  harness that is true (its dashboard module creates no issue), so the test
  now asserts it (one createIssue) and says why.
- "the freeze lifts and the batch then sits: the in-flight rule counts from
  the end of the hold": the last block's comment said it closes a hold; it
  lands the batch, and now asserts the landing (inFlight null, a landed
  event).

Runbook: the state-store section says ticks also visit a base whose state
carries `stalled` or `failedTicks`, and when a failed tick starts a new
count; the rollback note on failedTicks says why the 90-minute restart
does not cover a roll-forward.
2026-11-16 10:36:42 -03:00
Diego Rodrigues de Sa e Souza
8c60cc2d6e feat(release): refresh-derived verifies the generated files after it writes (#20310)
* feat(release): refresh-derived verifies the generated files after it writes

Agreed between the phase-1 and phase-4/5 owners of the plan 2026-11-13 and approved by the owner on 2026-11-15: release:refresh-derived ends with a verify-generated step that runs check:generated-artifacts (README SVGs, e2e-timings.json) and check:agent-skills-sync (generated SKILL.md) in release mode once the refresh has written. A generated file that still differs from its generator fails the step (exit 2). The step is skipped in --check (nothing reached the disk) and when --only leaves it out (a partial refresh leaves the other artifacts alone). refreshDerived() takes an injectable runNode for the tests.

* docs(changelog): number the refresh fragment after PR #20310
2026-11-16 10:08:35 -03:00
Diego Rodrigues de Sa e Souza
3a50632917 feat(docker): publish releases to the cheaperinference Docker Hub org; Electron updates from cheaper-inference (#20344)
Docker Hub cannot move a repository between namespaces, so diegosouzapw/omniroute keeps its pull history and every image, and each released version is copied from GHCR to cheaperinference/omniroute by the new docker-org-mirror workflow (no rebuild). Without the DOCKERHUB_ORG_* secrets the job stays green with a visible skip warning; a workflow_dispatch of docker-org-mirror.yml republishes a released version later. electron-builder now publishes and auto-updates from cheaper-inference/OmniRoute; older installs keep updating through GitHub's rename redirect.
2026-11-16 10:03:23 -03:00
diegosouzapw
af04ac5b23 fix(ci): omni-queue watchdog sees a stalled queue and knows a PR's base
The watchdog measured only how old each state file was. A queue whose every
tick fails still saves its state (main()'s failure path), so it looked
fresh; and a PR labeled on a base the queue does not manage aged the
freshest state past the limit and opened a false issue.

- A second signal: a base whose stored state has carried `stalled` for more
  than WATCHDOG_STALLED_GRACE_MINUTES (30, from the episode's openedAt, or
  its since in an older episode), whatever `notified` says
  (assessStalled, pure).
- Labeled PRs are listed with their base (listOpenPulls, as
  tick.discoverBases reads them): a labeled PR is work only for the base it
  targets, and only when that base has a state file. The job's permissions
  become contents: read, issues: write, pull-requests: read.
- One stable title, WATCHDOG_TITLE "omni-queue: the queue is not making
  progress"; the body says which signal fired (no state saved for N
  minutes, with the table, or reported itself stalled since <time>, with
  its reasons). Found again by that title and the hidden marker.
- Flapping: closed when nothing fires; when a signal fires again within
  WATCHDOG_REOPEN_HOURS (24) of the closing, the same issue is reopened with
  a comment, not recreated. Approvers are mentioned when an issue is
  created, never when it is reopened.
- CLI status: STALE from 90 minutes, not 75 (an idle healthy base saves
  about every 60 to 65 minutes and scheduled runs are often late).
- Comments say why the minutes differ on purpose: assessHealth compares
  fractional minutes; the watchdog and the CLI floor to whole minutes, as
  they print them.
- The fake GitHub API stamps closed_at on PATCH state closed (cleared on
  open), as GitHub does.

New tests: "a labeled PR to a base the queue does not manage reports
nothing" (and the same PR on a base with a stale state file is reported);
"assessStalled: a state carrying stalled for 30 minutes is not reported, 31
is"; "a fresh state that carries stalled for 31 minutes is reported, not
for 30"; "flapping: closed when the queue recovers, reopened (no mention)
within 24 hours, new after".

Re-aimed tests:
- workflows.test.mjs "omni-queue-watchdog.yml: the default token with
  exactly contents read and issues write, no App secret" is now "... with
  exactly contents read, issues write and pull-requests read, no App
  secret": the permissions pinned are the three.
- watchdog.test.mjs "the issue is reused, not duplicated": the title is the
  stable WATCHDOG_TITLE (no number, unchanged half an hour later); the
  minutes are checked in the body; the look-alike without the marker now
  carries the same title.
- watchdog.test.mjs "the issue is closed with a comment once ticks complete
  again": the closing comment names both signals.
- watchdog.test.mjs "only a base with work is judged: in flight, paused, or
  labeled PRs with no fresh state" is now "... or a labeled PR targeting
  it": the labeled PR targets the base it makes work, and the issue the
  paused base opened (closed since) is reopened.
- cli.test.mjs "status prints the heartbeat age and STALE": the boundary
  moves to 90 (not STALE) / 91 (STALE) minutes.

Runbook: the entry-points sentence names the watchdog's permissions, title
and both signals; the file table row; "Dashboard stopped updating" says a
failing tick still saves and what then reports it.
2026-11-16 08:29:43 -03:00
Diego Rodrigues de Sa e Souza
3a5f120a57 Merge pull request #20334 from cheaper-inference/fix/merge-train4-20261116
chore(release): merge train 4 of 3 PRs for v3.8.54 (2026-11-16)
2026-11-16 08:25:32 -03:00
diegosouzapw
45257beb8d fix(ci): omni-queue counts failed ticks and waits through a release freeze
Two predictable false alarms of the stalled-queue alert.

Three failures in a row now means three failed ticks in a row. The rule
read the last three events, but a completed idle tick leaves no event and
completed ticks append error events too (a landing pause, a lost candidate,
a refused withdrawal): three transient failures over a week alerted, and so
did one landing pause plus two failed ticks.
- New optional state fields failedTicks (a positive integer) and
  failedSince (ISO): main()'s failure path counts the tick in the save it
  already makes (countFailedTick); a tick that completes deletes both (one
  extra save per recovery, none while healthy). Validated when present; a
  state without them loads; older code ignores them.
- assessHealth's error-streak rule is failedTicks >= STALL_ERROR_STREAK,
  since failedSince; it no longer reads the history. Its tickCompleted
  input is gone (nothing else used it).

A batch held by a release freeze is waiting, not stalled. holdFrozen kept
the batch with its original startedAt, so the in-flight rule fired about
five hours into every freeze, mentioning the approvers.
- New optional inFlight.freezeHold {since, endedAt?}: set by the first
  tick that holds the batch, closed (endedAt) by the first tick that
  processes it without holding it (endFreezeHold) and by the landing stage
  (markLanding, saved before the landing). The other copies of the record
  keep it (back to testing, re-run, manual pause); an infra retry drops it
  (a new run, a new startedAt). Older code carries it along unchanged.
- assessHealth: an open hold is "waiting" with a reason that says so and
  since when, exempt from the in-flight rule; after the hold the rule
  counts from endedAt, not from the batch's start.

New tests: "assessHealth: a batch held by a release freeze is waiting, and
exempt from the in-flight rule while the hold lasts"; "fail, complete,
fail, fail: no alert; three failed ticks in a row: the alert"; "an error
event appended by a tick that completed (a landing pause) is not a failed
tick"; "a state without failedTicks loads; the field is validated when
present"; "a batch held by a release freeze for ten hours is waiting, with
no queue-stalled (live)" and "(shadow)"; "the freeze lifts and the batch
then sits: the in-flight rule counts from the end of the hold"; "a hold
ends at the first tick that processes the batch without holding it".

Re-aimed tests:
- "assessHealth: two error events in a row are not stalled, three are" is
  now "assessHealth: two failed ticks in a row are not stalled, three are":
  the boundary on failedTicks (2 idle, 3 stalled), the stable since, and
  error events in the history (with or without two failed ticks) not
  stalled; the tickCompleted case goes with the input.
- "three ticks that throw before the end of run(): one queue-stalled event
  and one comment": the reason reads "3 ticks in a row failed, the first
  at ..."; it also checks failedTicks 3 and 4, failedSince, and that the
  completed tick deletes both.
- "a dead queue is never silent: six throwing ticks and no dashboard issue
  yet": the dashboard the failure path creates also shows the stall.
- The dashboard tests' health() helper no longer passes tickCompleted.

Runbook: the queue-stalled row states the two rules as they are now; the
rollback list names failedTicks, failedSince and inFlight.freezeHold; the
sentence that said the queue has no stalled-queue alert says when it fires.
2026-11-16 08:10:20 -03:00
diegosouzapw
30901f3b86 fix(ci): omni-queue retries the stalled alert until it is delivered
The review's probe: one labeled PR, no dashboard issue yet, six ticks that
all throw. The episode was recorded, but its one comment had nowhere to go
and was never tried again, and every failed tick still moved updatedAt.
Nobody was told.

- state.stalled carries openedAt (when the tick recorded the episode) and
  notified: true once its comment is posted. While an episode is open and
  not delivered, every tick, completed or failed, tries again; the comment
  key stalled:<since> keeps the retries to one comment.
- main()'s failure path creates the dashboard issue when the base has none
  (createDashboard), rendered from the stored state with the queue marked
  as not read and no heartbeat line, so the alert has somewhere to go; it
  never rewrites an existing dashboard. If anything fails, the episode
  stays undelivered and the next tick tries again. It still never turns a
  failed tick into a success, never masks its error or exit code, never
  throws, and does not run for a dry-run.
- validateState accepts openedAt (ISO) and notified (true) when present;
  older code ignores both.

New tests: "a dead queue is never silent: six throwing ticks and no
dashboard issue yet" (the probe, through main()); "a stalled alert whose
comment fails three times is delivered on the fourth tick, once" (main());
"a stalled alert that cannot be posted is retried by every completed tick
until it is, then never again"; "createDashboard creates the issue
upsertDashboard and findDashboard find"; "a dashboard rendered without the
queue (main()'s failure path) says so, with no heartbeat".

Re-aimed tests (the episode now records openedAt and notified):
- "a pause older than 2 h: one queue-stalled event and one comment, not
  repeated (live)" and "(shadow)": state.stalled is
  {since, reasons, openedAt, notified: true}.
- "three ticks that throw before the end of run(): one queue-stalled event
  and one comment": the same two fields.
Extended: "a state without stalled loads" (valid and invalid openedAt /
notified); "a stalled alert that cannot be posted is logged; the tick still
fails with its own error" (the episode stays undelivered).

Runbook: the queue-stalled row says the comment is retried and the failure
path creates the dashboard; the rollback list names openedAt and notified.
2026-11-16 07:43:36 -03:00
diegosouzapw
129dae75bb feat(ci): queue health, heartbeat, stalled-queue alert and watchdog
Nothing told the owner when the queue stopped making progress. Now:

- dashboard: assessHealth({state, queue, config, now}) -> ok / idle /
  waiting / stalled, with stable reasons and the instant the oldest stall
  condition began (since). Stalled when paused for more than 120 min
  (a manual pause too), a candidate in flight for more than
  checksTimeoutMinutes + 60, eligible PRs and nothing started for more
  than batch.maxWaitMinutes + 30, or the last 3 events are errors. Each
  limit is exclusive. A new Health section shows the status, its reasons
  and the line "Heartbeat: ticks completing as of <YYYY-MM-DD HH:00Z>",
  which changes once per hour: an idle queue edits its dashboard hourly,
  a stopped heartbeat means no tick completed. findDashboard() finds the
  dashboard issue without creating one; stalledComment() is the alert.
- tick: at the end of a completed tick, the first stalled verdict of an
  episode records state.stalled = {since, reasons}, one queue-stalled
  event and, after the dashboard, one comment on the dashboard issue
  (key stalled:<since>) that mentions config.approvers; nothing more
  while the episode lasts; cleared once the queue is no longer stalled.
  Same in shadow mode (the dashboard is the queue's own issue); dry-run
  writes nothing. main()'s failure path (recordTickFailure) appends the
  error event and runs the same verdict on the stored state, so a queue
  whose every tick throws (a pre-blessing check that fails every tick)
  is alerted after three failed ticks. It never changes the failed
  tick's outcome or exit code, and a comment that cannot be posted is
  logged and ignored.
- contracts: event type queue-stalled; optional state field stalled,
  validated when present (older documents load; older code ignores it).
- cli: status prints "state saved <age> ago", and STALE when the save is
  older than 75 min on a base with work (in flight, paused, or labeled
  PRs that are not drafts).
- watchdog: new omni-queue-watchdog.yml, every 30 minutes, only in
  cheaper-inference/OmniRoute behind OMNI_QUEUE_ENABLED, with the
  default token limited to contents: read and issues: write, no secret,
  no environment, sparse checkout of the default branch, actions pinned
  by SHA. scripts/merge-queue/watchdog.mjs: assessStaleness (pure; 90
  minutes is not stale, 91 is) and a main that reads the state files,
  opens one issue "omni-queue: no tick completed for <N> minutes" (found
  again by a hidden marker), reuses it, and closes it with a comment
  once ticks complete again. Only bases ticks should visit are judged:
  in flight or paused, and, while open PRs carry the queue label, the
  freshest state. It never writes the state or touches a PR.
- runbook: the queue-stalled row, the rollback clean-up of queue-stalled
  and stalled, the watchdog in the entry points and the file table, and
  the "Dashboard stopped updating" sentence the heartbeat made false.

No new GitHub write method (commentOnce, createIssue, createIssueComment
and updateIssue are already in GH_WRITE_METHODS and WRITE_METHODS). No
new config key. config.json keeps mode shadow.

Re-aimed tests (dashboard.test.mjs), no assertion dropped:
- snapshot "renderDashboard snapshot: idle queue (shadow mode)": the
  Health section (idle, heartbeat 10:00Z) before "In flight".
- snapshot "renderDashboard snapshot: candidate in flight (live mode,
  with links)": the Health section (ok, heartbeat 10:00Z).
- "only the footer line depends on the clock and the run", renamed
  "only the footer line and the hourly heartbeat line depend on the
  clock and the run": within the hour only the footer differs and
  stableBody is equal (the old assertions, on a 10:42 / 10:59 pair);
  across hours (10:42 / 13:07) the heartbeat line differs too.
- "upsertDashboard skips the PATCH when only the footer line changed":
  the next tick at 10:55 instead of 11:00 (same hour).

New tests: dashboard (findDashboard; one per stall rule at its exact
limit; idle versus waiting; since; the heartbeat changes per hour, not
per tick; the Health section; stalledComment), tick (a pause older than
2 h, live and shadow; recovery; a state without stalled loads; dry-run;
three ticks that throw through main(); an alert that cannot be posted),
cli (status prints the heartbeat age and STALE), watchdog.test.mjs
(90 minutes is not stale, 91 is; a base with no state file is not
reported; the issue is reused, not duplicated; closed on recovery; only
bases with work; main), workflows (triggers and guard, permissions and
secrets, checkout and pins).
2026-11-16 06:47:35 -03:00
diegosouzapw
1c34599dc9 docs(ci): the omni-queue runbook says what the lanes change
Rows made false by the hotfix and base-repair lanes:
- resumed: also a base-red pause lifted by a landed repair
  (base repaired by #<n>), with the detail of each kind of resume;
- batch-started: a lane batch names its lane (lane hotfix, lane base-repair)
  instead of a window;
- batch.adaptive: a lane batch never moves the window; a suspected hang and
  a red verdict resting on a base check that timed out do not halve it.

The lanes.baseRepairLabel row gives the way out of a tried repair, and a
new Incidents paragraph covers an infra or error pause over a repair in
flight, a lane label removed during CI, and what shadow mode leaves.
2026-11-16 05:58:29 -03:00
diegosouzapw
4175143ffc fix(ci): omni-queue tells a tried repair both ways out, and not about an old head
A base-repair candidate that fails like the base records its head in
repairTried. The repair-not-fixing comment now names both ways out: push a
fix (a new head is tried again), or have an approver remove the base-repair
label so the PR goes back to the ordinary queue. When the PR's head moved
after the candidate was composed, the comment is skipped, as dequeueCulprit
does for a culprit: the entry is still recorded and the next prune drops it.

The header comment of tick.mjs no longer says that composition waits for an
unpaused queue: a base-repair batch is composed under a base-red pause.

New tests in tests/unit/merge-queue/tick.test.mjs:
- "a repair candidate red on its own under a base-red pause is re-run once,
  then takes the culprit path; the pause and the window stay" (fails when
  rerunApplies skips a lane batch);
- "a repair taken on an unpaused broken base goes through a base check that
  carries the lane, then is recorded as not fixing: repairTried, one comment,
  base-red pause" (fails when startBaseCheck drops the lane; also pins the
  new comment text, which no test pinned before);
- "a repair whose head moved after its candidate was composed is not told
  about the old head" (red before the guard).

No existing test re-aimed; no assertion removed.
2026-11-16 05:55:10 -03:00
diegosouzapw
74209182f4 feat(ci): hotfix lane and base-repair lane in the queue
Two lanes, each selected by a label of the new optional config section
`lanes` (shipped: omni-queue-hotfix, omni-queue-base-repair; without the
section there are no lanes and the queue behaves as before). A lane label
counts only when its latest `labeled` event is by an approver, and only on
a PR that is eligible like any other (queue label, approval status,
protected approval, no block label, no freeze); a PR with both labels is a
base repair.

- eligibility: laneOf(pr, ctx) and selectLane(candidates, ctx,
  {repairOnly}): a batch of one, oldest approval first, no wait; a hotfix
  before a base repair; repairOnly takes only a base repair. A base repair
  already tried at its current head (state.repairTried) is never picked.
  The tick passes the lane to evaluateEligibility, so the PR-gate rule is
  skipped for the base-repair lane only (Task 10).
- tick: startBatch tries selectLane before selectBatch, and the FIFO never
  takes a base-repair PR. A hotfix never replaces what is in flight. Under
  a base-red pause (with lanes) only the base-repair lane runs: a repair in
  flight is processed and a new repair batch can start; every other pause
  reason processes nothing. A repair lands through the normal path and, in
  live mode, lifts the pause (`resumed`, "base repaired by #n"); a shadow
  would-land does not. A repair candidate red like the base records
  repairTried[n] = head, comments once (repair-not-fixing:<h12>, not in
  shadow), keeps its labels, and pauses the base as base-red if it was not
  paused yet; red on its own it takes the normal culprit path. A lane batch
  never moves the adaptive window. inFlight.lane is kept by every copy of
  the record (infra retry, markLanding, leaveLandingStage, re-run,
  recomposition) and carried by the base check of a red lane batch and its
  pendingRed. repairTried entries go when the PR leaves the repair lane or
  its head changes.
- contracts: QUEUE_LANES; validateState checks inFlight.lane and
  repairTried when present (older documents load; older code ignores both).
- config: lanes.hotfixLabel / lanes.baseRepairLabel, label names distinct
  from each other and from label, protectedApprovalLabel and blockLabels
  (case-insensitive); default null. config.json keeps mode shadow.
- workflow: both lane labels in the tick job's label filter, nothing else.
- dashboard: the in-flight line names the lane.
- runbook: the two key rows, the rollback note on inFlight.lane and
  repairTried, and the sentences the lanes made false (strict FIFO, base-red
  pause, PR-gate row, label filter).

Re-aimed test: "the label names in the queue's job filters are the ones in
config.json" (workflows.test.mjs) now expects the two lane labels among the
tick's event-label literals; no assertion removed. New tests: eligibility
(lane label by a non-approver ignored; hotfix first, batch of one, no wait;
repairOnly; base-repair eligible with red gates, hotfix not), tick
(base-red repair lands and lifts the pause; shadow would-land keeps it;
repair failing like the base not recomposed, one comment; manual, error,
infra and tree-divergence pauses do nothing; hotfix jumps the FIFO without
replacing the batch in flight; freeze holds both lanes; lane batches never
move the window; no lanes section = as before; state without repairTried
loads), config (lanes key and Zod differential rows), workflows (lane
labels in the tick filter equal the config), dashboard (lane on the
in-flight line).
2026-11-16 05:18:50 -03:00
diegosouzapw
52ee148986 docs(ci): the omni-queue runbook says how a PR gate is read
The Eligibility prose and the prChecksRequired row said the newest run
of each workflow on the head counts. The code reads a gate once per check
suite that reported it, the worst state winning, and consults workflow
runs only when those suites disagree: then a suite of a run superseded by
a newer run of the same workflow and the same event is dropped. Until the
newest run's gate job has started, the previous run's result counts. Both
places now say so; the candidate's own CI still decides what lands.
2026-11-16 04:27:54 -03:00
diegosouzapw
044be3f94e fix(ci): an omni-queue gate run supersedes only a run of the same workflow and event
A PR gate read from two disagreeing check suites dropped the suite of
every run older than the newest run of its workflow. But runs cancel each
other only inside one concurrency group (the workflow and the ref): a
pull_request run and a workflow_dispatch run of ci.yml on the same head
never do. A red Gate / CI on the PR run next to a green dispatch at the
same SHA (a full-profile E2E) read success.

- eligibility.currentSuitePredicate groups the head's workflow runs by
  (workflowId, event); in each group only the highest run id is current.
  A run without an event is a group of its own (it supersedes nothing and
  nothing supersedes it). The known limit (two PRs sharing one head share
  their pull_request group) is stated in the comment.
- classify.classifyRed carries baseTimedOut (true only on the pr-red
  verdict of a base check that timed out); tick.followRedVerdict passes
  confirmed: !verdict.baseTimedOut to onPrRed, so a later root batch red
  on that base is bisected but does not halve the adaptive window, like
  the parked batch the timed-out check settled.
- eligibility.currentBatchWindow: the comment says what a loaded state
  can carry (validateState checks batchWindow).
- The tick fake (prGateRun) and the end-to-end world (reportPrGateRun)
  take an event option (default pull_request).

New tests (each failed before the code change):
- eligibility: "currentSuitePredicate: a run supersedes only a run of the
  same workflow and the same event"
- tick: "a workflow_dispatch run does not supersede the pull_request run
  of the same workflow"
- tick: "a later root batch red on a base whose base check timed out does
  not halve the window"
- integration: "scenario 8f: a green workflow_dispatch run of ci.yml does
  not supersede the red pull_request run"
- classify: "a base check that timed out is not redone: pr-red" gains the
  baseTimedOut assertions (true there, false on every other verdict)

Re-aimed tests (no assertion removed):
- eligibility "currentSuitePredicate: the newest run of each workflow is
  current; an unmapped suite is kept": its workflow runs now carry event
  pull_request (without an event each run is its own group); every
  assertion is unchanged.
- github "listWorkflowRuns by head_sha follows every page and carries the
  workflow and suite ids" is renamed "... and the event" and also pins
  the normalized event (and "" when the payload has none).
2026-11-16 04:21:16 -03:00
diegosouzapw
f24848b4ec Merge PR #20274 (docs/readme-claude-mcp-add) into merge train 4 2026-11-16 03:49:04 -03:00
diegosouzapw
4f94f1cd86 Merge PR #20322 (feat/omni-queue-cutover-2a) into merge train 4 2026-11-16 03:48:54 -03:00
diegosouzapw
70ea2f2303 Merge PR #20313 (fix/ui-kit-defects-1115) into merge train 4 2026-11-16 03:48:44 -03:00
diegosouzapw
5d4e0a6632 fix(ci): omni-queue window, config and state checks from the gate review
- A parked batch settled by a base check that timed out after its
  retries goes the PR-red way but is not a confirmed red batch: onPrRed
  takes { confirmed: false } from that settle path and keeps the
  adaptive window.
- A root batch classified as a suspected hang keeps the window: the
  missing test.
- config.mjs: an absent batch.startSize next to an invalid
  batch.maxSize no longer reports a second, spurious startSize error.
- contracts.mjs: validateState checks state.batchWindow, when present,
  as a positive integer; a state without it still loads and the read
  still clamps it to the configured sizes.
- eligibility.mjs exports prGatesReason(pr, ctx), the gate rule
  evaluateEligibility applies; the tick fake uses it instead of its own
  copy.

New tests: tick (hang keeps the window; a timed-out base check keeps it
while a green one halves it), config (only the maxSize error), contracts
(batchWindow), eligibility (prGatesReason).
2026-11-16 03:19:39 -03:00
diegosouzapw
2572d2055d fix(ci): a superseded workflow run no longer keeps an omni-queue PR gate red
ci.yml and quality.yml run on pull_request `edited` (a retarget) with
cancel-in-progress, and their gate job runs with `if: always()`: the
cancelled run still leaves a `Gate / CI` check run concluded `failure`,
in its own check suite, and the next run of the same workflow on the
same head is another suite. Taking the worst state among the newest run
of every suite kept such a PR out of every batch until its head moved.

The rule now: prCheckState(runs, name, suiteIsCurrent) stays pure and
only counts the suites suiteIsCurrent calls current (every suite when it
is not given). The tick builds it only for an ambiguous head, where two
or more suites carry a gate and their newest runs disagree
(prChecksNeedWorkflowRuns): it lists the head's workflow runs once
(listWorkflowRuns with headSha, paginated) and, of each workflow, only
the run with the highest id is current, with its suite
(currentSuitePredicate). A suite that maps to no listed run stays
current, and a failed listing leaves every suite current: unknown never
turns a gate green. A same-named job of another workflow is a different
workflow, so its suite stays current next to the real gate and the
worst still wins. A re-run of failed jobs stays in its suite, so the
newest run per suite still decides it.

API cost: none when no gate is ambiguous; one workflow-run listing per
ambiguous PR head per tick (pinned in tick tests).

- github.mjs: a workflow run carries workflowId (workflow_id).
- tick fake: h.prGateRun reports a gate from a new workflow run of a
  workflow (new suite, listed with its workflowId and suite id) or as a
  re-run in the same suite; listed: false hides it from the listing.
- end-to-end world: reportPrGateRun registers a pull_request workflow
  run with its suite and workflow id; fake GitHub serves workflow_id.
- runbook: the prChecksRequired row and the eligibility paragraph state
  the rule.

New tests: eligibility (suiteIsCurrent, currentSuitePredicate,
prChecksNeedWorkflowRuns), tick (a superseded red run with a newer green
run lets the PR in; a green job of another workflow and an unmapped red
suite keep it out; the listing only for an ambiguous head, a failed
listing counts every suite), end-to-end scenarios 8d and 8e, and the
github listing by head_sha across pages.

Re-aimed test: github "listWorkflowRuns filters and unwraps
workflow_runs; dispatchWorkflow posts inputs" (the normalized run now
carries workflowId; the payload gets a workflow_id).
2026-11-16 03:15:00 -03:00
diegosouzapw
6ac4b0a435 feat(ci): require both PR gates to enter a batch and size batches adaptively
A labelled, approved PR now enters a batch only when each check named in
the new config key prChecksRequired ("Gate / CI" and "Gate / Quality" in
the shipped config) is green on its head. Otherwise it is ineligible with
the new reason pr-checks-not-green (detail "Gate / CI failure; Gate /
Quality pending"), and nothing is done to it: the label stays, no comment
is posted, nothing is dequeued, and it becomes eligible by itself once its
gates turn green. The state of a gate is eligibility.prCheckState: the
worst of the newest run of each check suite with that name; only a GitHub
Actions success counts as green, any other completed conclusion (skipped
and neutral included) is red. snapshotPull reads the gates from the one
listCheckRuns it already made for prGreenCheck (no extra GitHub call with
the shipped config); revalidate still reads no PR gate, so a gate never
drops a PR from a batch about to land. The reserved ctx.lane "base-repair"
is exempt from the rule.

The batch size adapts with batch.adaptive (shipped true): a window stored
in state.batchWindow, starting at batch.startSize (shipped 6), halved
(down to batch.minSize) after a root batch confirmed red on its own PRs
(onPrRed, not a base-red verdict, an infra failure, a flaky job that
passed its re-run, a suspected hang or a bisection segment), and one more
(up to batch.maxSize, raised from 6 to 12) after a root batch that filled
the window lands or would land. selectBatch takes ctx.batchSize for both
the wait and the slice. A state without batchWindow starts at startSize;
a stored window above a lowered maxSize is clamped when read. With
batch.adaptive false the batch size is maxSize, as before. batch-started
names the window of a root batch ("; window W") and the dashboard line
reads "batch window W (max M)".

No new event type and no new GitHub write. Older code loads a state with
batchWindow and ignores it (rollback line added to the runbook). The
runbook gets the three new key rows, the corrected batch.maxSize and
batch.maxWaitMinutes rows, the eligibility row for pr-checks-not-green
and corrected sentences (batch size no longer fixed, PR checks now
required, revalidate skips the gates).

Test fakes: the tick harness's fake eligibility honours prChecks and
ctx.batchSize as the real functions do, and every open PR head reports
green gates by default (world.prGates); the end-to-end world reports
green gates on openPr / pushToPr (reportPrGates).

Re-aimed tests (they pinned values of the shipped config):
- tick.test.mjs "batch size is capped by config.batch.maxSize (6)" is now
  "batch size is the window: config.batch.startSize (6) on a new state,
  below maxSize (12)": same 8 PRs and the same batch of 6, now from the
  window, with startSize, maxSize and adaptive asserted.
- eligibility.test.mjs "selectBatch: at most batch.maxSize, the oldest
  first": maxSize is 12, so 15 candidates give 12 ("12 of 15").
- eligibility.test.mjs "selectBatch: waits for maxWaitMinutes while the
  batch is not full": the full batch that never waits has maxSize (12)
  PRs instead of a literal 6.
- config.test.mjs "owner decisions D-Q1..D-Q3 and the shadow start are
  pinned": the batch block is pinned as {maxSize 12, minSize 1,
  maxWaitMinutes 10, adaptive true, startSize 6} instead of maxSize 6.
- config.test.mjs mutation "batch minSize above maxSize": minSize is
  maxSize + 1 instead of a literal 7 (7 is valid with maxSize 12).
- dashboard.test.mjs "renderDashboard snapshot: idle queue (shadow mode)"
  and "renderDashboard snapshot: candidate in flight (live mode, with
  links)": the batch line reads "batch window 6 (max 12)" instead of
  "batch ≤ 6".
2026-11-16 01:57:16 -03:00
diegosouzapw
f43e49d635 fix(ci): the omni-queue re-run wait watches the runs it re-ran
Once a candidate has a rerun record, waitForRerun looked at every push run
of the candidate ref: a run a person re-ran earlier (attempt 2, completed)
satisfied "a second attempt is visible", so the old failure of the run the
queue had just asked to re-run was classified at once, while that re-run
was about to start. Both checks (the in-flight wait and the 30-minute guard)
now consider only the runs whose id is in rerun.runIds. The adoption, before
any record exists, still looks at every push run of the ref and stores the
ids it adopts.

The runbook says what each wait does at checksTimeoutMinutes: before the
re-run, classified without one; on a requested re-run, classified without
waiting any longer for its result. It also says that only the runs the queue
re-ran count for the 30-minute guard.

New test: "the re-run wait watches the runs it re-ran, not another run a
person re-ran earlier".
2026-11-16 00:58:30 -03:00
diegosouzapw
727c946c9a docs(ci): the omni-queue re-run waits for the candidate's runs, and the Actions permission order
- "Red candidates": the tick waits for every push run of the candidate's ref
  to conclude before it re-runs the failed jobs, then waits for the re-run,
  so a real failure is blamed later (by the rest of the CI run plus the
  re-run). Both waits end at checksTimeoutMinutes; RERUN_START_MINUTES only
  covers a re-run that never shows as a second attempt; a re-run started by a
  person or by a tick that died is adopted; a refused re-run is suffixed to
  checks-red.
- flaky-rerun row: the re-run happens after the candidate's runs end, and the
  later blame is named in the operator column.
- App permissions: the claim that GitHub refuses the re-run and classifies at
  once without Actions write was not established. The tick job asks for
  permission-actions: write when it mints the token, so grant "Actions: Read
  and write" and accept it on the installation before this version reaches
  the default branch; the other order is unmeasured and may fail every tick.
2026-11-16 00:31:37 -03:00
diegosouzapw
61cf61173f fix(ci): wait for a red candidate's runs to conclude before re-running its failed jobs
A candidate turns red at its first failed job while its CI workflow run is
still in progress (the matrices are fail-fast: false and the aggregate job
waits for every job). The re-run listed only failed push runs, found none at
that moment, and bisected or blamed in the same tick: the re-run never
happened. The test fakes hid it, because they finished the workflow run in
the same step as its check runs.

- The fakes can now keep a push run in progress while some of its check runs
  are completed and conclude it later (tick harness: runCi concluded: false,
  concludeRun; end-to-end world: runStatus "in_progress", concludeRuns). A
  re-run is attempt 2 of the same run id, first queued or in progress
  (startRerun), then completed (rerunCi / reportRerun). gh.rerunHidden keeps
  an accepted re-run invisible; manualRerun is a person's re-run.
- While a push run of the candidate ref is not completed, the tick does not
  classify and does not re-run: it notes the wait and returns, bounded by
  checksTimeoutMinutes from the candidate's start (then classified without a
  re-run). The re-run is asked for once every run has concluded.
- A push run at attempt 2 or later that is not completed is a re-run in
  flight, whoever asked for it: adopted as inFlight.rerun without a call or a
  flaky-rerun event, and waited for up to checksTimeoutMinutes. The 30-minute
  guard (RERUN_START_MINUTES) now only covers an accepted re-run that never
  shows as a second attempt.
- A wait takes a batch stored at the landing stage back to testing on the
  first red tick, so its land status is withdrawn while its runs finish.
- rerunApplies compares the record's ref with the candidate ref.
- A refused re-run (or an unreadable run listing) adds
  "; re-run refused (<status or reason>)" to that tick's checks-red detail.
- An adopted re-run counts the red batch once, at adoption.

Re-aimed test: "the re-run never starts: after 30 minutes the old failure is
classified" now sets gh.rerunHidden (the call is accepted and no second
attempt shows): an attempt that shows and is not completed is waited for up to
checksTimeoutMinutes instead, which the new tests cover. Extended (no
assertion removed): "a refused rerun (403, 404, 422) is noted and the batch is
classified as today" checks the checks-red suffix and a failed listing.

New tests: the in-progress wait and its end, the checksTimeoutMinutes bound
on both waits, the adoption after a died tick (red and green endings), a
re-run that starts late, a person's re-run, two push workflows with one
refusal, a red batch at the landing stage while it waits, and end-to-end
scenario 16 through the real classify and checks.
2026-11-16 00:27:11 -03:00
diegosouzapw
882cf39c02 docs(design-system): record the rules the UI review guards enforce
- Rule 4 said Tailwind utilities win over the kit. That is not true for
  typography: ci-typography.css is unlayered, so weight, tracking and
  leading classes are dead on headings, table cells and buttons, and
  font-mono is dead on th, td, button, input and textarea.
- New rules 8 to 11 name the guards added in this PR: theme colour
  names, the card class, chart ink, colour alpha, table names, keyboard
  rows and frames, progress semantics, kit overlays, and where the Input
  adapter sends className.
- The adapters list gains InteractiveTableRow and CodePreview.
- "Adding a screen" no longer tells authors to add keys to pt-BR.json and
  vi.json: a feature PR touches en.json only, and a test over a real
  non-English catalog loads it with the runtime English fallback.
2026-11-16 00:24:23 -03:00
diegosouzapw
f222899a8e fix(dashboard): close the custom range panel when the range is cleared from its trigger
The custom range button is the trigger of the picker's kit Popover, and
the "x" that clears an applied range sits inside it. Radix does not
dismiss on a press inside the trigger and the "x" stops the click that
would toggle it, so the panel stayed open on the dates that had just
been cleared and "Apply" brought the range back. The hand-made panel
closed on any press outside it.

The "x" now closes the panel together with the range.

Found by the independent review of #20313.
2026-11-15 23:54:44 -03:00
diegosouzapw
c7738ceae0 fix(dashboard): keep the provider picker matching an upper-case query in a Turkish locale
The "add provider" picker moved to the kit SearchableSelect, which
lowercases the query with the browser locale and does a substring match
on label + keywords. In a Turkish-locale browser "OPENAI" lowercases to
"openaı" (dotless ı), which is not in "openai", so the list came back
empty. The hand-made search it replaced folded both sides.

The option keywords now carry the folded name and its dotless spelling
(searchKeywordsFor in turkishText.ts). A query typed with accents still
does not match: the kit has no filter hook, and the comment says so.

Found by the independent review of #20313.
2026-11-15 23:52:24 -03:00
diegosouzapw
b8bcc669a5 feat(ci): re-run a candidate's failed jobs once before blaming a pull request
When a batch candidate or an ordinary bisection segment turns red and the
classifier would test the base (needs-base-check) or blame a pull request
(pr-red: bisection, or the culprit of a batch of one), the tick first asks
GitHub to re-run the failed jobs of the candidate's failed push run(s)
(POST /actions/runs/{id}/rerun-failed-jobs, with the App's own client) and
records inFlight.rerun {ref, requestedAt, afterMs, runIds, jobs} and the new
event flaky-rerun. A flaky job then no longer costs a bisection, a base
check or a dequeue.

- While every failure of a re-run job started at or before afterMs (the
  newest GitHub timestamp of the red attempt), the old failure is not read
  as the re-run's verdict: the tick waits, up to RERUN_START_MINUTES (30)
  after the request, then classifies the old failure.
- A green re-run lands; its checks-green detail reads
  "green after re-running <jobs> (flaky)". A red re-run is classified as
  before. Both details name at most five jobs, then "+N more".
- Never re-run: base checks, infra retries (attempts > 0), segments of a
  hang bisection, infra and base-red verdicts (a candidate whose only
  failures are job time limits stays on the infra path), and a push run
  GitHub already re-ran (runAttempt > 1: a tick that died after the call and
  before its save). listWorkflowRuns now returns runAttempt.
- A refused re-run (403, 404, 422 or any error) or an unreadable run list is
  noted and the batch is classified as before, in the same tick. A dry-run
  plans the re-run without calling GitHub; rerunFailedJobs is in
  GH_WRITE_METHODS and in the test fakes' WRITE_METHODS.
- A red batch stored at the landing stage leaves it (its land status is
  withdrawn) when its jobs are re-run. inFlight.rerun is kept by markLanding,
  leaveLandingStage and the manual pause, and cleared by the infra retry
  copy (a new ref).
- New optional config key flakyReruns (0 or 1, default 1), written in
  config.json; the Zod schema of config.test.mjs mirrors it. The tick token
  asks for permission-actions: write; the App installation needs Actions
  read and write (an owner action).
- Runbook: rows for the flaky-rerun event and the flakyReruns key, the
  rollback clean-up of flaky-rerun events, and the sentences the change made
  false (red-candidate intro, checks-red row, shadow-mode writes, the App's
  Actions permission).
- Test harnesses: config.flakyReruns is 0 by default in createHarness and in
  the end-to-end world (the scenarios written before test what follows the
  re-run); push workflow runs now carry a realistic conclusion and attempt;
  h.rerunCi and world.reportRerun report a re-run; the fake GitHub answers
  rerun-failed-jobs.

Re-aimed tests:
- workflows.test.mjs "least privilege: no default token scopes, App token
  scoped per job": the tick token's actions scope is now write (was read).
- github.test.mjs "listWorkflowRuns filters and unwraps workflow_runs;
  dispatchWorkflow posts inputs": the normalized run carries runAttempt (the
  raw run now has run_attempt 2).
2026-11-15 23:39:59 -03:00
Diego Rodrigues de Sa e Souza
225bedf8b5 fix(ci): report i18n docs drift as DRIFT in Release-Green (#20312)
The --full-ci observer ran `npm run i18n:check` as a HARD item. Feature
PRs no longer ship docs mirrors (the translation wave refreshes them at
release), so between releases the mirrors are stale by design and the
scheduled Release-Green reopened base-red #19329 with
"docs-sync-strict -> npm run i18n:check: FAIL — drift detected" on every
run since 2026-11-14.

Declare the gate as drift in the static profile, like check:circular-deps.
It still runs the same strict command (drift items do not get the pr gate
mode) and the result stays visible in the drift bucket; it just no longer
opens a base-red. The release cut keeps the strict verdict. The other
i18n gates (UI coverage, ICU, ratio) stay HARD.
2026-11-15 23:02:56 -03:00
diegosouzapw
8035acf576 fix(ci): drop the last mentions of commit statuses in the omni-queue verdict
The candidate verdict reads no commit status since the previous commit; three
places still said otherwise, and the remaining omni-queue/ filter on check
runs was tested nowhere.

- config.mjs: the LAND_STATUS_PREFIX comment no longer says a land status
  outside omni-queue/ would turn the candidate red. What is true now: the
  release ruleset requires that context by name, and the queue's namespace
  keeps it apart from the contexts third parties report; the verdict plays no
  part.
- checks.mjs header and evaluateChecks doc, OMNI_QUEUE.md "Accepting a
  candidate", checks.test.mjs header: the verdict mirrors the Mergify
  merge_conditions for check runs only. Mergify's #check-failure and
  #check-pending also count commit statuses; the queue deliberately reads
  none.

Re-aimed test:
- checks.test.mjs "the queue's own omni-queue/* statuses never count" is now
  "a check run named omni-queue/* never counts": a failed check run named
  omni-queue/x added to an all-green set still gives green, and a pending one
  does not keep it pending. It repeated the new status tests; it now covers
  the OWN_PREFIX filter, which no test covered (checked on a scratch copy:
  removing the filter line fails this test only).
2026-11-15 22:49:47 -03:00
diegosouzapw
2619a2945f fix(ci): keep third-party commit statuses out of a candidate's verdict
Anybody with statuses:write could turn an omni-queue candidate red, or keep
it pending, with a commit status on its SHA, and a third-party status turning
pending could send a batch stored at the landing stage back to "testing" and
reset its landing-attempts count. Only the check runs of the candidate's own
push now decide its verdict.

- checks.mjs: evaluateChecks takes no statuses and reads none, whoever created
  them and whatever their context or state; a required name that exists only
  as a status is "missing". statusAsRun and latestStatusByContext are removed,
  with the CommitStatus typedef and the run/status "source" field they needed.
- tick.mjs: readChecks no longer calls listCommitStatuses (one API call less
  per tick) and returns the runs only; evaluate passes no statuses. The land
  status and the approval statuses keep their own readers, unchanged.
- OMNI_QUEUE.md: "Accepting a candidate", the module table and "Who reads it"
  no longer say statuses count for the verdict.

New tests: checks.test.mjs "a failure status from another app on the
candidate does not make it red", "a pending status does not keep it pending",
"a success status with a required name is still missing"; tick-e2e.test.mjs
"a status an App posts on the candidate SHA never decides its verdict";
tick.test.mjs "a commit status of any creator has no effect on a batch stored
at the landing stage".

Re-aimed tests (they asserted that statuses count):
- checks.test.mjs "commit statuses: failure/error -> red, pending -> pending,
  newest per context wins": replaced by the first two new tests (failure,
  error, pending and newest-per-context now leave the verdict green).
- checks.test.mjs "a commit status can fail a required check but never
  satisfy it": the success half moved to "a success status with a required
  name is still missing"; the failure half is now "a failure status with a
  required name neither fails that check nor hides its run".
- checks.test.mjs "advisory statuses are tolerated like advisory runs": now
  "an advisory-named status is not even reported as an advisory failure"
  (and an advisory check run still is).
- checks.test.mjs "an Actions run in progress keeps the verdict pending until
  checksTimeoutMinutes": "a failure without any Actions run is still red" now
  uses a failed check run of another app; a failure status alone is a
  no-ci-run timeout.
- tick.test.mjs "held for several ticks: the status is read once, not every
  tick": statuses reads per tick [2, 1, 1, 1] -> [1, 0, 0, 0] (only the land
  status is read).
- tick.test.mjs "a queue that was never live reads and writes no land status
  in shadow mode": statuses reads on the candidate 1 -> 0.
2026-11-15 22:31:40 -03:00
diegosouzapw
21757ee751 test(dashboard): follow the update-step icons into UpdateProgressDialog
The amber-warning guard read the update-step <Icon name="warning"> from
HomePageClient.tsx. The update progress is now the kit dialog in
UpdateProgressDialog.tsx and the step icons moved with it, so the guard
found nothing. It reads the new file; both assertions (the warning token,
no bare text-yellow-500) are unchanged.
2026-11-15 21:54:55 -03:00
diegosouzapw
dcebd71065 test(dashboard): load the Chinese catalog with the runtime English fallback
The access-token settings test mounts the real zh-CN catalog with an
onError that throws. The CodePreview adapter now reads new common.* keys
that exist only in en.json until the translation wave runs, so the raw
catalog threw MISSING_MESSAGE and the tab never rendered.

The test now builds its messages the way src/i18n/request.ts does
(deepMergeFallback over the English catalog), as
analytics-token-breakdown.test.tsx already does. A key missing from both
catalogs still throws, and every Chinese string the test asserts is
unchanged.
2026-11-15 21:46:29 -03:00
diegosouzapw
dfff7f79c7 docs(changelog): add the fragment for the dashboard kit conformance defects 2026-11-15 21:19:28 -03:00
diegosouzapw
faa65df154 docs(ci): three omni-queue runbook sentences about withdrawals
docs/ops/OMNI_QUEUE.md:

- "Before a mode change or a stop", step 1: "history records no landed
  event" was too strong for the pause case. After a pause and a resume
  in live mode the next tick finds the candidate at the tip and records
  `landed`; only a base that then runs in shadow records none. The step
  now says both, and says to let the next live tick record a batch that
  is already the tip before pausing or changing the mode.
- Under the shadow table: a shadow tick also stores a withdrawal, when
  GitHub refuses its own withdrawal of a landing-stage batch. Reworded;
  the conclusion stays (every stored withdrawal comes from a batch live
  mode blessed, so a queue that was never live writes none).
- Step 2: a stored withdrawal dropped by the 20-entry limit leaves no
  field behind, so the operator also looks in the history for its error
  event, quoted as the code writes it ("<batchId>: stored withdrawal of
  <landing.statusContext> on <sha12> dropped (20 stored already); its
  newest status may still be success").
- "When the landing does not complete": the creator rule now says the
  rule of the previous commit (a status without a readable creator may
  only add a reason to withdraw, never remove one), and the prose lines
  past 100 columns are rewrapped.
2026-11-15 21:14:59 -03:00
diegosouzapw
e7bfdb0b3e fix(dashboard): drop weight, tracking and leading classes the kit overrides
The kit's ci-typography.css is imported without a layer, so its role
defaults (h1-h6: weight 500, leading 1.1, tracking -0.02em; button and th:
weight 500; td: weight 400) beat every Tailwind utility on those elements,
whatever the specificity. `font-semibold` on an <h3>, a TableCell or a
<button> read as a working style and did nothing.

A TypeScript-AST codemod removed 702 such classes from 266 files, with no
pixel changed: weight, tracking-* and leading-* on native h1-h6; weight and
tracking-* on TableCell, TableHead and SortableTableHead; weight on native
<button> and on the Button adapter. Classes with `!`, sizes, colours,
`uppercase` and `font-mono` stay.

tests/unit/dead-typography-classes.test.ts fails when one of them comes
back on those elements, and its first test fails the day the kit moves
the role defaults into a layer, which is when the guard must be reviewed.
2026-11-15 20:52:15 -03:00
diegosouzapw
7b42e81cb9 fix(ci): an omni-queue land status of unknown origin never hides the App's success
With the previous change, newestAppLandStatus returned the newest
omni-queue/land status among the App's and the unknown-creator ones. A
newer `pending` or `error` whose creator GitHub does not report then
hid the App's own `success`: a stored withdrawal was dropped and a
pause of a landing-stage batch withdrew nothing, where before that
change the `success` was withdrawn.

An unknown-creator status may now only add a reason to withdraw, never
remove one. The status that decides is the App's newest when it is
`success`; else the newest among the App's and the unknown-creator ones
when it is `success`; else nothing is withdrawn (the App's newest, or
the newest unknown one, is returned for the callers' log lines). A
status with a readable creator that is not the App's is still ignored
for both tests. The comments of withdrawAbandoned and retryWithdrawals
say the same.

New tests (tick.test.mjs): the App's `success` under a newer `pending`
or `error` of unknown creator is withdrawn on both paths: a stored
withdrawal (kept with attempts 2 while the write is refused, written on
the next tick) and a pause of a landing-stage batch; the App's
`failure` newer than its `success`, nothing unknown, writes nothing on
both paths. The tests of the previous change (an unknown `success`
alone is withdrawn; another user's status is ignored) stay green. No
test re-aimed.
2026-11-15 20:52:11 -03:00
diegosouzapw
c141c8c998 fix(dashboard): colour chart-toned text with the -ink token
`text-chart-N` paints with the pure chart token, which is picked for bars,
lines and dots and falls under 4.5:1 as text on the light theme. The kit
ships a readable ink for every slot and the bridge exposes it as
`text-chart-N-ink`, but only 16 uses had it against 105 of the pure token.

58 classes in 24 files that colour text (badges, pills, table values, stat
values, links) now use the ink. 47 keep the pure token because they colour
an icon, an icon chip or an SVG stroke, where 3:1 is enough.

tests/unit/chart-ink-for-text.test.ts accepts a bare text-chart-N only on
an icon element, an icon-only wrapper, an `iconColor` prop, an `icon`
property, or in one of five icon-only lookup tables listed with a reason.
2026-11-15 20:52:07 -03:00
diegosouzapw
15b59076d8 fix(dashboard): build translucent colours with color-mix, not a hex alpha suffix
Eight inline styles in seven files glued an 8-bit alpha to a colour string
(`${color}20`, `15`, `40`). The flow palette is `var(--orch-status-…)`, so
the circuit-breaker and cooldown badges of the combo studio produced
`var(--orch-status-error)20`: invalid CSS, and the badges had no
background. The provider icon tiles did the same with the catalog brand
colour, which only works for a 6-digit hex.

All eight now call flowColorAlpha (color-mix in srgb with transparent)
with the percentage the suffix stood for: 15 -> 8%, 20 -> 13%, 40 -> 25%.

tests/unit/color-alpha-concatenation.test.ts covers the helper and fails
on a colour-valued style that glues two hex digits to an interpolation.
2026-11-15 20:52:03 -03:00
diegosouzapw
a1a8e28dbb fix(dashboard): use the Card adapter where the bare card class painted nothing
No stylesheet defines `.card` (the kit classes are `ci-card…`), so the 14
elements written as `<div className="card p-5">` rendered padding only: no
surface, no border, no radius.

The 10 boxes of the search and compression analytics tabs (KPI tile, chart
sections, empty and error states) now render the Card adapter and keep
their padding class. The 4 result tiles of the translator compression
preview already draw their own inset panel (bg-bg-subtle + border), so
they only lose the dead class and look the same.

tests/unit/no-bare-card-class.test.ts fails on a className that carries
the bare `card` token. translator-friendly-compression counted the tiles
through that class and now counts the grid's children.
2026-11-15 20:51:57 -03:00
diegosouzapw
32f960018b fix(dashboard): replace colour classes that generate no CSS
58 class names across 22 files used a colour the theme does not define
(text-text, bg-bg-muted, text-text-secondary, bg-bg-secondary, bg-bg-card,
bg-bg-base, bg-background, bg-surface-muted, text-muted-foreground,
text-danger, bg-bg-main, bg-card-subtle, text-action). Tailwind 4 emits
nothing for them, so progress tracks had no background, muted text kept
the inherited colour and error text was not red.

Each one now uses the bridge name from the @theme inline block of
globals.css (text-text-main, bg-muted, text-text-muted, bg-bg-subtle,
bg-surface, bg-bg, text-error, text-primary).

tests/unit/theme-color-classes.test.ts reads every string literal of
src/app and src/shared and fails on a colour utility whose name is not in
the theme, the default palette or fd-*. No exception list.
2026-11-15 20:51:54 -03:00
diegosouzapw
11b55a96ee fix(dashboard): move hand-positioned popovers and tooltips onto the kit
Four panels opened by local state with `absolute … z-50` and two CSS-hover tooltips
had no portal and no collision handling, so an `overflow: hidden` ancestor clipped
them and they ran off the edge of the screen; two had no Escape or outside-press
handling at all (UI review 2026-11-15, defect 16).

- ClaudeCcDiscoveryInfoButton and SessionPicker: kit Popover.
- CustomRangePicker: kit Popover around its trigger (`open`/`onOpenChange`), instead
  of document mousedown/keydown listeners; UsageAnalytics passes the Custom button.
- ComboDefaultsTab "add provider" combobox: kit SearchableSelect, which covers the
  whole behaviour and adds aria-activedescendant.
- FeatureFlagCard description and CacheTrends bars: the Tooltip adapter, opened by
  keyboard focus as well as hover.

Left as they are, as justified exceptions in the guard: ApiKeyFilterDropdown (the kit
MultiSelectFilter has a different selection model) and HealthAccountTooltip (already
portaled and clamped; a kit HoverCard per capsule made the 200-capsule render about
2.5 times slower).

Guard: tests/unit/hand-positioned-overlays.test.ts.
2026-11-15 20:51:51 -03:00
diegosouzapw
02acdc1adb fix(dashboard): give every progress and quota bar progressbar semantics
41 of the 42 hand-made proportion and quota bars had no role="progressbar", so a
screen reader skipped them (UI review 2026-11-15, defect 13).

- 17 bars that the kit covers natively (8 px, accent or status tone, two-part) are now
  the kit Progress with `tone`/`segments`, a translated accessible name and a spoken
  value. BatchDetailModal reuses ProgressBarBicolor.
- 24 bars the kit cannot draw yet (4/6 px track, series colour, categorical segments)
  keep their drawing and gain role="progressbar", aria-valuemin/max/now and a name.
  QuotaMiniBar, the budget row bar and the home usage bar take the name as a prop.
- Stale workarounds over the kit Progress are removed: the health pool bar and the
  cache meter are no longer hidden behind aria-hidden, the import "fetching" bar is
  the kit indeterminate mode instead of a pulsing fake 60 %, and the indicator is no
  longer recoloured through `[&_.ci-progress__indicator]` classes (kit `tone`).

TeamBudgetCard stays hand-made: it already had the full semantics and drops
aria-valuenow while usage is unpriced, which the kit Progress cannot express.

Guard: tests/unit/progress-bars-have-semantics.test.ts (failed on 42 sites before).
2026-11-15 20:51:49 -03:00
diegosouzapw
db21df242b fix(dashboard): use the kit InfoTooltip and SidebarMenuAction where the exceptions expired
Two `kit-exception:` buttons were kept for gaps the kit has since closed
(0.0.87 and 0.0.106):

- `InfoTooltip` adapter: a native button, justified by "the kit icon
  Button is a 32 px control". The kit has its own `InfoTooltip` (24 px
  target, 16 px icon). The adapter now renders it and keeps `text` and
  `className` for its 33 uses. The trigger is named "More information"
  (translated) and the help text is its description; before, the whole
  help text was both the name and the tooltip, so it was read twice.
- Sidebar pin: a native button over `SidebarMenuButton`, because the kit
  `SidebarMenuAction` used a physical `right`. It uses
  `inset-inline-end` now and reveals itself on row hover or focus
  (`showOnHover`), so the pin is that component and the row's own
  padding and position classes are gone.

The other `kit-exception:` buttons are still valid and are not touched.
2026-11-15 20:51:47 -03:00
diegosouzapw
316834b5ae fix(dashboard): draw the command palette key hints with the kit Kbd
The palette kept four hand-styled `<kbd>` elements (Esc in the search
field, and the navigate / open / close hints in the footer), and
`dashboard-kit-sweep` exempted the file with "moves with the kit Command
palette" — which already happened.

They are the kit `Kbd` now (the two arrows as one `KbdGroup`), and the
exemption is removed, so the sweep covers the palette like every other
file.
2026-11-15 20:51:44 -03:00
diegosouzapw
a6be48f972 fix(dashboard): keep control classes off the Input adapter's wrapper
The `Input` adapter sends `className` to the kit `Field` wrapper and
`inputClassName` to the `<input>`. 36 call sites in 10 files wrote
classes meant for the control in `className`, where they had no effect
or drew a second box:

- `text-sm` and `font-mono` are dropped: the first repeats the kit
  control's 14 px, the second has no effect on an `<input>`.
- `text-xs` moves to `inputClassName`, where it applies.
- `rounded border bg-transparent p-2` is dropped in FalNativeFields
  (5 inputs and 3 selects): it framed the kit control with a second
  border.

Layout classes (`flex-1`, `w-64`, `md:col-span-2`) stay on the wrapper.
A static guard keeps `className` for wrapper layout; the framed
threshold rows in CompressionSettingsTab are its one listed exception.
2026-11-15 20:51:35 -03:00
diegosouzapw
06507b1125 fix(dashboard): pass translated text to kit components that kept English defaults
Kit components draw English text unless the screen passes it. Seven of
them still did, in every locale:

- Toaster: the close button ("Dismiss notification") and the
  screen-reader announcement ("Notification: ...") of every toast.
- SidebarRail: aria-label and native tooltip "Toggle sidebar".
- CodePreview (5 screens): "Copying...", the copy announcement, the copy
  error and the "<language> code" region name. A `CodePreview` adapter
  now fills every label from `common`; the screens import it instead of
  the kit component.
- Alert (3 in api-manager): the dismiss button had no translated name.
- Wizard, through `ModalWizard`: the step list name, the step-link
  prefixes, the completed suffix and Skip.
- LineChart (2) and CalendarHeatmap: `unavailableLabel`.

New keys are in en.json only; existing keys are reused where they exist.
2026-11-15 20:51:32 -03:00
diegosouzapw
c122655263 fix(dashboard): render the home update progress as a kit dialog
The "update in progress" notice on the home page was a hand-made
`fixed inset-0 z-[999]` box: no dialog role, no aria-modal and no focus
trap, so keyboard focus stayed on the page behind it.

It is now `UpdateProgressDialog`, built on the `Modal` adapter (kit
Dialog). It has no close button and ignores outside clicks; Escape does
nothing while the update runs or after it succeeds, and closes a failed
update like the Close button does.
2026-11-15 20:51:28 -03:00
diegosouzapw
275270084a fix(dashboard): translate the scrollbar label of three tables
A kit Table that draws its persistent horizontal scrollbar announces it
with the scrollbarLabel text, and the kit default is the English
"Table". Three tables did not pass one: usage by model and usage by
account (UsageStats) and the banked reset history. They now pass the
translated heading that already sits above each table.

A static guard fails on a kit Table that draws the persistent scrollbar
without scrollbarLabel.

The fourth table the review listed, the OAuth export preview, caps its
height with maxHeight, so the kit does not draw that scrollbar for it.
2026-11-15 20:51:25 -03:00
diegosouzapw
4f74616938 fix(dashboard): single frame for tables the frame guard could not see
The guard that keeps the Card as the only frame around a table saw a
table and a Card in the same JSX tree, or one import apart. Seven double
frames from the UI review escaped it: five in a card made by hand (a
bordered, rounded div or section) and two in a Card two components
above the table.

The guard now treats a card made by hand as a frame and follows the
components rendered below a frame at any depth, in the same file or
imported. On the base it lists ten violations, fixed the way #20181 and
#20213 did, by zeroing the table container border:

- cache page: the 24h trend panel becomes a plain section, like the
  "by provider" section beside it;
- encoder comparison, pricing compare groups, pricing provider
  accordion, webhook deliveries, banked reset history, Cursor model
  usage;
- proxy traffic panel and the skill inspector executions, which the
  review had not listed.

Tables rendered from markdown keep their frame: they are content inside
prose. That is the guard's one recorded exception.

Refs #19620
2026-11-15 20:51:23 -03:00
diegosouzapw
206edb521d fix(dashboard): give every kit table an accessible name
50 of the 74 hand-assembled kit tables had no accessible name. The kit
makes the table container a tab stop while it overflows and names it
only from scrollLabel, a caption or the table's aria-label, so on a
narrow screen a screen reader announced a stop with no name.
scrollbarLabel does not count: it only labels the persistent scrollbar.

43 tables already carried the translated text in scrollbarLabel and now
pass the same text in scrollLabel. The other seven take the heading
that sits above them (usage by model and by account, encoder
comparison, Cursor model usage) or a new English key: the per-provider
models table (providerStats.modelsTable) and the tables rendered from
markdown, which have no title (common.table).

A static guard fails on a kit Table without a name, with no exception
list.
2026-11-15 20:51:21 -03:00
diegosouzapw
ae0b187116 fix(dashboard): make clickable table rows work from the keyboard
Five hand-assembled kit tables opened something on a row click and
nothing on the keyboard: the request logger, the proxy logger, the batch
and batch-file lists and the conversations list. Only the DataTable
adapter handled Enter and Space.

The handling moves out of the adapter into InteractiveTableRow, a thin
adapter over the kit TableRow: the row is a tab stop, Enter and Space
run the same action as a click, and events from a control inside the
row are left to that control. The adapter and the five tables render it.

The provider-stats row keeps its pointer-only click: its disclosure
button is the keyboard path and carries aria-expanded. A static guard
fails on a new <TableRow onClick>.
2026-11-15 20:51:18 -03:00
diegosouzapw
31a02804ae fix(dashboard): stop the breadcrumb trail linking to 404s and translate its segments
The shell draws a breadcrumb on every dashboard page, one crumb per URL segment, and every
crumb but the last was a link. Six route prefixes only group sub-routes and have no page.tsx,
so their crumb answered 404: /dashboard/resilience, /dashboard/system, /dashboard/tools,
/dashboard/gamification, /dashboard/api-manager/<id> and /dashboard/plugins/<name>. And 26
route segments had no label: the trail showed the raw segment, capitalised, in every locale
("Log-export", "Mitm-proxy", "Omni-skills").

A crumb is now a link only when its URL has a page; a page-less prefix is plain text in the
trail. A segment's label comes, in order, from its `breadcrumbs` key, from the sidebar label
of the same route (`sidebar.<i18nKey>`, so /dashboard/log-export reads "Log export" and
follows the reader's locale), or from a sidebar key mapped by segment (the "System" group
title, "MITM Proxy", "1Proxy"). The eight segments no sidebar entry names get new
`breadcrumbs` keys in en.json. A provider id stays as it was.

The rules moved to src/shared/utils/breadcrumbTrail.ts (pure), so
tests/unit/breadcrumb-trail-routes.test.ts can check them against src/app/(dashboard): a
folder that gains or loses its page, or a new route segment without a label, fails there.
tests/unit/ui/adapters/breadcrumbs-trail.test.tsx pins the rendered trail.
dashboard-localization-contract.test.ts reads the label map from its new file.
2026-11-15 20:51:16 -03:00
diegosouzapw
de21f01224 fix(dashboard): give every dashboard route a kit PageHeader
The only title of 30 dashboard routes was the shell one (Header.tsx), which sits in a
`hidden … lg:flex` block: below 1024 px those pages had no heading, on screen or in the
accessibility tree. Three of them also rendered a second <h1> next to the shell title on
desktop (context/combos, costs/teams, providers/chatgpt/connect), and
/dashboard/compression/live had no title at any width.

Each route now opens with the kit PageHeader (compact), carrying the title and description
the shell showed for it, from the same keys (`sidebar.<i18nKey>`, `header.<…Description>`).
The header sits in the page file, or in the route's client component when the layout has a
fixed height, so the content keeps the room it had. The hand-made titles are gone: the
teams header and the conversations SectionHeader became the PageHeader (actions kept), the
Compression Hub card title is an <h2>, the ChatGPT connect page uses the provider name, and
the live compression page gets a title of its own (new `compressionStudio.liveTitle`).

/dashboard/providers and /home get the header from a small component of their own:
providers/page.tsx is frozen in size by a test and home/page.tsx has its data fetch pinned.

Guard: tests/unit/dashboard-page-header-coverage.test.ts walks every dashboard page.tsx that
is not a redirect and requires it to reach a PageHeader through the components it renders;
it also pins `compact`, the single <h1> per page and the shell keys. Two pages stay without
a PageHeader, with the reason recorded there: the onboarding wizard and the 2.5 s
"page moved" notice of system/mitm-proxy.
2026-11-15 20:51:10 -03:00
diegosouzapw
26169ec897 docs(ci): say what the omni-queue runbook can and cannot promise about withdrawals
docs/ops/OMNI_QUEUE.md:

- The would-land row of the Events table and precondition 9 of the
  cut-over now name both shadow suffixes: "live mode would pause: queue
  refs unprotected (...)" and "<check> could not run (...): live mode
  would fail the tick". The precondition asks that recent would-land
  events carry neither before the mode goes to live.
- "Two cases are only bounded" was wrong for the late-throwing tick:
  the attempts limit only counts ticks that store the landing stage
  again, so while every tick throws before that point (a base that moved
  and a recomposition push that fails each time) the stage stays
  landing, landAttempts is never set, nothing pauses and the status
  stays success. The runbook now says so, that a pause of the base
  withdraws it, and that it is a known limit until the next PR.
- "Before a mode change or a stop", step 1: before pausing, check that
  a batch at stage landing is not already the tip of the base. One that
  did land (push done, state save lost) and meets the pause or a shadow
  tick first gets a failure land status on the base tip and no landed
  event; the runbook says what the operator sees and that nothing needs
  undoing.
- Shadow table: the failure land status is written only as a
  withdrawal, now spelled out under the table: on the commits of a batch
  stored at the landing stage whose newest App status is success or
  cannot be read (withdrawn anyway), and on stored withdrawals.

scripts/merge-queue/tick.mjs: the withdrawAbandoned comment line of
about 120 columns is wrapped, and the note of leaveLandingStage says
"its land status would go" in a dry-run (which withdraws nothing)
instead of "goes".

Test: the dry-run test added in the previous commit ("dry-run in shadow
on a batch stored at the landing stage writes nothing and changes no
state") also asserts the dry-run note wording. No test re-aimed.
2026-11-15 20:26:59 -03:00
diegosouzapw
68fa369d0c fix(ci): withdraw an omni-queue land status of unknown origin
newestAppLandStatus (tick.mjs) skipped an omni-queue/land status whose
creator was missing or null. A `success` of unknown origin was then not
withdrawn by withdrawAbandoned, and retryWithdrawals dropped the stored
entry for it as "nothing of the queue's". The safe direction is the
other one: a withdrawal only ever writes `failure`.

A status without a readable creator (missing, null or empty) now counts
as possibly the App's: when it is the newest among the App's statuses
and the unknown ones and it is `success`, the withdrawal is written,
and a stored entry is kept until that write succeeds. A status with a
readable creator that is not `<appSlug>[bot]` is still ignored.

Runbook: the "When the landing does not complete" paragraphs say how a
status without a readable creator is counted.

New tests (tick.test.mjs): an abandoned landing-stage batch whose only
land status is a `success` with `creator: null` (and with no creator
field) gets `failure` written, a later readable other creator's status
ignored; stored withdrawals of such successes are kept while the write
is refused and written on the next tick, while a readable other
creator's `success` and an unknown `success` under a newer App `failure`
are dropped as before; a dry-run in shadow on a batch stored at the
landing stage writes nothing and leaves the state unchanged (the path
F2 newly reaches; it passed before this change). No test re-aimed.
2026-11-15 20:14:36 -03:00
diegosouzapw
53e6ced762 fix(ci): read the omni-queue candidate chain without a forgeable record separator
firstParentChain (land.mjs) framed the commits of the first-parent chain
with %x1e and skipped any fragment without NULs. A commit message can
hold \x1e, so a planted merge commit with the honest tree, parents and
base trailer, followed by \x1e, a blank line and
"Omni-Queue-Base: <PR head>", passed verifyComposition (trees included)
while candidate-base.mjs, which parses the whole message, resolved the
PR head as the base: the candidate's base-relative gates compared
nothing.

The chain is now read with every field NUL-terminated. A commit message
cannot hold a NUL (git truncates %B at one, so both readers see the same
message), and output that does not split into SHA/parents/message
triples is a composition mismatch instead of being skipped:
"the first-parent chain cannot be read as whole commits" or
"... cannot be read past commit <n>". mergedPrsBetween keeps the commits
read before such a break.

Both readers keep the last Omni-Queue-Base of the trailer block, but a
merge commit with more than one line keyed Omni-Queue-Base, in any
paragraph, is now a mismatch in verifyComposition:
"merge commit <sha12> of #<n> carries <count> Omni-Queue-Base trailers".
The queue never writes two.

Runbook: item 1 of "Before the land status is written" and the
troubleshooting list name the new rule and the new details.

New tests (real git, land.test.mjs): the probe is refused with and
without trees (and resolveCandidateBase is shown to read the PR head
from it); two base trailers in the trailer block, in either order or
the same base twice, and a second one in the body are refused; tampered
chain output (a trailing fragment, a field too many, a record that is
not a commit) is a mismatch; an honest candidate of one PR, a batch of
two and a stacked one still pass. No test re-aimed.
2026-11-15 20:10:14 -03:00
diegosouzapw
432189928e fix(ci): no land-token hint for a rate limit on an omni-queue squash landing
A rate-limit 403 is not an authentication failure (isAuthFailure), but
the place that adds the land-token hint to a failed landing still tested
AUTH_FAILURE_RE alone against the verdict's detail. With actor "owner"
and squash-api, a per-PR merge refused by a 403 rate limit (merge-failed,
detail "#N: 0 PUT ... -> 403: API rate limit exceeded ...") paused with
"check OMNI_QUEUE_LAND_TOKEN" although the token was fine.

That place now uses the same rule as the rest of the tick
(isAuthFailureText): a detail that matches RATE_LIMIT_RE is never an
authentication failure and never gets the hint. The pause itself is
unchanged. The runbook sentence that described the old behaviour now
describes the new one.

New test: squash-api, owner lands, a merge refused with a 403 whose
message is a rate limit (primary and secondary) pauses without the token
hint; the same with a refused credential carries it. No test re-aimed.
2026-11-15 18:36:19 -03:00
diegosouzapw
1745689856 fix(ci): count a failed status read as an omni-queue withdrawal attempt
A stored land-status withdrawal whose status read throws stayed in
landWithdrawals with its attempts unchanged, so the count understated the
retries. A failed read now counts an attempt, exactly as a refused write
does. The entry stays stored and is tried again on the next tick: the
count never drops an entry, the queue never gives up on withdrawing a
blessing.

LandWithdrawal.attempts (contracts.mjs) and the runbook now describe the
field as failed attempts so far (a read that failed or a write that was
refused). The retry log lines say "failed attempts" accordingly.

Re-aimed test: "stored withdrawals are retried on a paused queue; a
refusal counts an attempt, an unreadable status changes nothing" is now
"stored withdrawals are retried on a paused queue; a refusal and an
unreadable status each count an attempt": the unreadable entry is
expected with attempts + 1 instead of untouched.

New test: a stored withdrawal whose land status cannot be read stays
stored, one attempt per tick, nothing written (three ticks, attempts
grows by three, no status written).
2026-11-15 18:33:00 -03:00
diegosouzapw
ffc00a4e11 docs(ci): correct the omni-queue runbook on withdrawals, holds and pauses
Corrections from the whole-branch review, each checked against the code:

- Events, land-rejected: names the release-freeze hold
  ("base-frozen: ...; <batch> waits for the freeze to lift", once per batch),
  which keeps the batch in flight and does not recompose it; the base-moved
  and batch-changed cases say what each recomposes.
- When the landing does not complete: the end-of-tick withdrawal runs in every
  mode, never in a dry-run, for any batch no longer kept at the landing stage;
  the second try in the same tick happens only for a refusal during the
  landing's own revoke; a tick that fails after the landing stage was saved
  has saved that stage, the attempt count and everything before it; the two
  cases that are only bounded are listed (a tick that throws late, and a full
  withdrawal list dropping its oldest entry with an error event).
- squash-api: a failed per-PR merge call, a rate limit included, is caught
  inside landSquashApi and pauses as merge-failed, not retried (and, with
  actor owner, a 403 rate limit there gets the token hint).
- Pause and resume: says what a paused base's ticks still do (stored
  withdrawals, PR snapshot and eligibility, stray ref cleanup, dashboard) and
  that the pause tick withdraws a landing-stage batch's status.

The composition-check sentence (F1) and the cut-over precondition on mode
changes (F2) were corrected in their own commits.
2026-11-15 18:16:04 -03:00
diegosouzapw
4cf7d1c6d7 test(ci): end-to-end negative for the omni-queue queue-refs lock
world.unprotect existed in the queue-world helper and no scenario used it.
Scenario 2d runs on real git, live mode: the queue-refs ruleset stops
enforcing update on omni-queue-state while a batch is green. The candidate is
not blessed, the base does not move, the queue pauses with the
unprotected-refs text and the PR keeps its label. With the rules enforced
again and the queue resumed, the PR is composed again and lands, blessed by
the App.

Tests added (integration/tick-e2e.test.mjs):
- scenario 2d (live): queue refs unprotected, the green batch is not blessed
  and the queue pauses; protected again and resumed, it lands

Tests re-aimed: none.
2026-11-15 18:10:52 -03:00
diegosouzapw
a98dba281b fix(ci): keep omni-queue shadow ticks going when a pre-blessing check cannot run
A rules read that throws, or a git error inside the tree recomposition of the
composition check, threw on every tick after the expensive steps. Shadow mode,
which production runs, is newly exposed: both reads are new there.

In shadow mode an error of either check (not a verdict) no longer fails the
tick: the would-land event is recorded with a suffix that names the check and
the error on one line, clipped to 200 characters:
"; composition check could not run (<why>): live mode would fail the tick" or
"; queue refs check could not run (<why>): live mode would fail the tick".
A composition mismatch still pauses in shadow. In live mode nothing changes:
the error propagates and the tick fails closed, nothing blessed.

Tests added (tick.test.mjs):
- shadow: a rules read that throws does not fail the tick: would-land names
  the check and why
- shadow: a git error while recomposing does not fail the tick: would-land
  names the check and why
- live: a git error while recomposing fails the tick: nothing blessed, no
  pause
The live rules-read case is the existing test "a rules read that throws fails
the tick: nothing blessed, no pause" (unchanged).

Tests re-aimed: none.

Runbook: the composition and queue-refs checks and the shadow "Live-mode
locks" bullet give the shadow suffix; a new known limit says a persistent
check error in live fails every tick without a pause or an alert, and how the
operator gets out (pause, fix, resume; removing the label drops the PR from
the batch). The tick.mjs header comment says the same.
2026-11-15 17:58:02 -03:00
diegosouzapw
69ff2d0748 fix(ci): only the App's land statuses decide an omni-queue withdrawal
Both readers of the land status (withdrawAbandoned and retryWithdrawals)
took the newest status of the context whoever created it, while the release
ruleset counts only the App's. After a stranded blessing, a collaborator who
posted pending in omni-queue/land made a pause write nothing and
retryWithdrawals drop the entry, leaving the App's success in force.

Both now read through newestAppLandStatus: only statuses created by
<appSlug>[bot] (the creator github.normalizeStatus carries), the same way
eligibility counts only the App's approval status. The App's newest status
decides: success -> withdraw; anything else, or none -> nothing to withdraw.

The fake GitHub of the tick tests records the creator of the statuses it
writes (the App's bot user for the App's client), and the seeding helpers
diedAfterBlessing and setLand create App statuses unless told otherwise.

Tests added (tick.test.mjs):
- a later status by another user does not hide the App's success: a stored
  withdrawal writes failure, kept until it succeeds (the probe)
- a later status by another user does not hide the App's success from an
  abandoned landing-stage batch
- a success by another user only is not the queue's to withdraw

Test re-aimed:
- "a stored withdrawal for a SHA that is no longer success is dropped
  without a write" is now "a stored withdrawal for a SHA whose newest App
  status is not success is dropped without a write": the superseding pending
  status is the App's (another user's pending is the probe above), and a
  case with a success created only by another user is added.

Runbook: the withdrawal paragraphs say that only the App's statuses count.
2026-11-15 17:44:58 -03:00
diegosouzapw
29b29f1688 fix(ci): withdraw a live blessing in shadow mode too
withdrawAbandoned and retryWithdrawals returned early in shadow. A live tick
that blessed a batch and died, followed by a switch to shadow, left the
candidate with the App's success and no record in the state: the shadow
tick recorded would-land and cleared the batch, and stored landWithdrawals
were never retried.

Both withdrawal paths now run in every mode (never in a dry-run). They only
write failure on a commit whose land status is success, and only live mode
stores a batch at the landing stage or a withdrawal, so a queue that was
never live reads and writes no land status. A shadow tick that finds a batch
stored at the landing stage sends it back to "testing" and withdraws its
status first (leaveLandingInShadow), before it records it as would-land,
drops, recomposes or leaves it on a paused base.

Tests added (tick.test.mjs):
- live -> shadow: a batch a live tick blessed and left at the landing stage
  loses its status on the first shadow tick (the probe)
- live -> shadow on a paused base: a batch left at the landing stage loses
  its status too
- a queue that was never live reads and writes no land status in shadow mode
  (pins the counts)

Test re-aimed:
- "stored withdrawals are never retried in shadow mode nor in a dry-run" is
  now "stored withdrawals are retried in shadow mode too (a queue switched
  from live), never in a dry-run": the shadow half asserts the failure write,
  one status read and the entry gone; the dry-run half is unchanged.

Runbook: a new "Before a mode change or a stop" procedure (pause, check no
batch at stage landing and an empty landWithdrawals, then change), cited by
the kill switch, the rollback and the cut-over preconditions; the shadow
claims about land statuses are corrected.
2026-11-15 17:32:26 -03:00
diegosouzapw
1df1dcc946 fix(ci): pin the Omni-Queue-Base trailer in the omni-queue composition check
verifyComposition checked the PR and head trailers, the parents and the
trees, but not Omni-Queue-Base. The candidate's CI takes its base from that
trailer (candidate-base.mjs), constrained only to be an ancestor: a one-PR
candidate with the honest tree and parents and a base trailer naming the PR
head passed, and CI then compared <PR head>..<candidate>, seeing nothing.

Every merge commit of the candidate's first-parent chain must now carry
Omni-Queue-Base equal to the expected base SHA. A missing or different value
is a mismatch with its own detail, and pauses like the other composition
mismatches.

Tests added (integration/land.test.mjs):
- verifyComposition refuses a candidate whose Omni-Queue-Base trailer is not
  the expected base (the probe, with and without trees; a missing trailer;
  the honest candidate still passes)
- verifyComposition checks the base trailer on every commit of a longer chain

Runbook: the composition check lists the base trailer, says what it does not
compare (subject, the other trailers, author and committer), and the
incident entry names the new mismatch.
2026-11-15 17:21:48 -03:00
diegosouzapw
01736be09e docs(ci): stop the omni-queue runbook from overstating four checks
Task 7 re-review, fix round 2 (docs and one test comment, no behaviour change):

- "Landing paused: the landing was refused": the landing ended with the
  verdict (not-descendant is a local check before any push, not GitHub's
  answer); auth-failed has the same detail format and points to the
  authentication case under Who lands.
- Shadow mode: only the composition and queue-refs checks run in shadow; the
  base-tip and land-token checks are live only.
- Base moved: squash-api refuses any move, forward ones included; merge-ff
  refuses a move anywhere other than towards the candidate. "Nothing is lost"
  is tied to the refused landing, before the merge-ff exception.
- Red candidates items 2 and 5: "one retry" becomes "up to infraRetries
  retries, then an infra pause on the failure after the last one". The
  infra-paused row points to hang-suspected when every run only hit a job time
  limit.
- runbook.test.mjs: the probe comment says it assumes every accepted key is
  also validated, instead of naming a rule that is written nowhere.
2026-11-15 15:42:28 -03:00
diegosouzapw
51081253db docs(ci): tighten the omni-queue runbook wording after review
Task 7 review, fix round 1 (docs and one test comment, no behaviour change):

- Events table, error row: names the landing that was refused, the stored
  withdrawal dropped from a full list and the candidate gone from origin. A new
  Incidents entry, "Landing paused: the landing was refused" (landing <batch>
  failed (<reason>): rejected, not-descendant, merge-failed), makes "each pause
  detail has an entry in Incidents" true.
- Base moved: the push refuses a base that moved anywhere other than towards
  the candidate; with merge-ff a tip between the stored base and the candidate
  still lands the exact tested tree, with no land-rejected.
- Configuration keys: landing.identity is the exception to "a key without a
  default is required".
- Infra retries: "a second failure" holds only for infraRetries 1; the pause
  comes after the last of infraRetries retries (the first failure with 0),
  refs -r1, -r2, ... (Red candidates item 1, the infra-retry and infra-paused
  rows, the Infra failure incident).
- A failed tick saves nothing but an error event.
- Shadow mode: the would-land "live mode would pause: queue refs unprotected"
  suffix and the composition-mismatch pause, linked to the locks section.
- Ruleset examples name <owner>/<rehearsal-repo> instead of the sandbox.
- runbook.test.mjs: the config-key probe relies on every accepted key being
  validated; a key that only sits in an allowlist would be missed.
2026-11-15 15:19:35 -03:00
diegosouzapw
34b8fd3381 docs(ci): omni-queue runbook for the live-mode locks, with event and config tables
docs/ops/OMNI_QUEUE.md catches up with Tasks 1 to 6 of the cut-over part 2:

- New "## Events" table (every EVENT_TYPES entry: when it happens, what the
  operator does) and "## Configuration keys" table (every key validateConfig
  reads, nested ones dotted: type, default, effect). infra-retry,
  pr-skipped-conflict and batch.minSize were named nowhere before.
- New "Before the land status is written": the composition check with the
  tree recomposition, the queue-refs protection read and the live base-tip
  check, with the pause texts as tick.mjs writes them.
- Known limits: "the composition check does not verify trees" and "the queue
  does not check that the queue-refs ruleset exists" are replaced by what is
  still true (bypass actors are not read; the recomposition depends on the
  runner's git, measured in shadow mode).
- Who lands / State: a held batch goes back to testing and its status is
  withdrawn; refused withdrawals are stored in landWithdrawals and retried;
  inFlight.landAttempts and LANDING_ATTEMPTS_LIMIT; a rate-limit 403 is not an
  authentication failure.
- Incidents: base moved before the blessing, base not found, queue refs not
  protected, three landing attempts without a verdict, tree mismatch possibly
  caused by the runner's git.
- App install and cut-over: OMNI_QUEUE_APP_CLIENT_ID replaces OMNI_QUEUE_APP_ID
  as the environment secret; the numeric id only feeds apply-ruleset.mjs
  --app-id. One App per repository that holds its key, stated as a rule, and
  "the key exists in this environment only" added to the preconditions of
  mode: live.
- Rollback: the older code carries landWithdrawals without acting on it; what
  to check before rolling forward again.

tests/unit/merge-queue/runbook.test.mjs fails when either table misses or
invents an entry. Event types come from EVENT_TYPES; config keys are recorded
by running validateConfig on a Proxy that logs every property it reads, so
optional keys (landing.actor) are found without a list typed in the test.

Carried from the Task 6 re-review (comments and one test, no behaviour change):
- tick.mjs header: a missing base pauses the queue.
- land.mjs landMergeFf: a tip between the stored base and the candidate is
  reached by the live tick only in the race after its own tip read.
- tick.test.mjs: live, the base branch does not exist: paused error with the
  "not found: not blessed, not landed" detail, no commit status, no landing.
2026-11-15 14:51:11 -03:00
diegosouzapw
3ccfeff707 fix(ci): bless a batch only when the stored base is the real base tip
Task 6 review finding: a planted BASE passed the tree lock. verifyComposition walks
the first-parent chain back to the stored baseSha, which comes from the state branch.
A record naming a commit E that is not the base tip (carrying a payload), with a
candidate that honestly merges approved, current PR heads onto E, recomposes
correctly, so live merge-ff wrote omni-queue/land = success on the candidate before
landMergeFf refused with base-moved; in that window the blessed candidate could be
pushed by hand as a fast-forward carrying E.

In live mode landOrWouldLand now reads the base tip once at the top (the value the
"already the tip" shortcut already used, now read for squash-api too) and, after the
queue-refs protection check and before the landing-attempts limit and markLanding,
requires it to equal f.baseSha. Otherwise nothing is blessed and the batch takes the
existing base-moved path (land-rejected "base moved: base <b> is at <tip>, expected
<baseSha>; recomposing" and the recompose), now shared through Tick.baseMoved with
the landing's own base-moved result. A base that no longer exists pauses (reason
error, "base <b> not found: not blessed, not landed"), as the landing's "rejected"
did before, instead of a recompose that cannot fetch it. A batch already at the
landing stage is not blessed again; withdrawAbandoned turns the previous tick's
success into failure. Shadow and dry-run behaviour unchanged (dry-run now plans the
recompose). No new event type or config key.

Test fake: world.baseMovesOnLand moves the base inside the fake landings (somebody
merged between the tip read and the push), so tests of the bless-then-refused path
still reach it.

Re-aimed tests (they moved the base before the tick to make the fake landing answer
base-moved after the blessing; that base is now refused before the blessing, so they
move it during the landing instead, assertions unchanged):
- "base moved before landing: push refused → ..." renamed "base moved during the
  landing: push refused → the same PRs are recomposed on the new tip": before,
  h.gh.branches.set(BASE, MANUAL) before the tick; now h.world.baseMovesOnLand =
  MANUAL. Still asserts one landing attempt on BASE0, land-rejected, recomposed on
  MANUAL.
- "landing that does not complete turns the land status into failure": before,
  base set before the tick; now baseMovesOnLand. Still asserts success then failure
  (base-moved) on the candidate and the recompose.
- "a withdrawal refused twice in one tick is stored and retried by the next tick":
  same change; same assertions.
- "at most 20 stored withdrawals, one per SHA: ...": same change; same assertions.

New tests: live merge-ff and squash-api with a stored base that is not the tip (no
createCommitStatus at all, no landing, exact land-rejected detail, recomposed on the
tip); a batch stored at the landing stage whose base moved (not blessed again, the
previous success withdrawn as "batch abandoned"); shadow with a moved base (pinned:
would-land on the stored base, no land-rejected); live dry-run plans the recompose;
end-to-end scenario 5c with the real modules and git (batch composed on E, base
rewound off E: never blessed, recomposed on the tip without E). The case "base tip
equals the stored base blesses and lands" stays covered by "live merge-ff: the
candidate gets the land status from the App before the owner pushes".
2026-11-15 13:51:26 -03:00
diegosouzapw
1374b95fed feat(ci): bless only with the queue refs protected and the candidate tree recomposed
The final review of cut-over part 1 parked one residual risk as the main condition
for live mode: verifyComposition checks the shape of a candidate (first-parent chain,
trailers, second parents) but never the tree of its merge commits. Someone with write
access who is not the queue could plant an in-flight record plus a candidate whose
merge commit names a queued, approved PR with the right parents and trailers and
carries any tree, and the queue would bless and land it. The only barrier was the
queue-refs ruleset, which nothing in the tick checked.

Two independent locks, both evaluated before anything is blessed:

- verifyComposition({ trees: true }) recomposes every merge commit of the chain with
  compose.mergeTree(parents[0], parents[1]), the exact call the composer makes, and
  refuses a commit whose tree differs, or whose parents conflict or share no history
  ("merge commit <sha12> of #<n>: tree <t12>, recomposing gives <r12|conflict>"). The
  tick asks for it in live and in shadow; a failure takes the existing composition
  mismatch pause (reason "error"). mergeTree and haveCommonAncestor are now exported.
- refs-guard.mjs (new) reads the ACTIVE rules of omni-queue-state and of the batch's
  candidate ref through the new github.getBranchRules (GET /rules/branches/<branch>,
  every page, read-only) and lists every creation/update/deletion rule GitHub does not
  enforce. In landOrWouldLand it runs right after the composition check and before the
  landing-attempts limit, at most once per tick, never stored. Live: an unprotected ref
  pauses ("queue refs are not protected (...): not blessed, not landed; apply
  apply-ruleset.mjs --kind queue-refs, then resume"), whatever the attempt count.
  Shadow: never pauses; the would-land detail gets "; live mode would pause: queue refs
  unprotected (...)". Dry-run: reads (GET) and plans. A read error fails the tick (no
  pause, nothing blessed). Bypass actors are not checked (the App token cannot read
  them). The manual bless is unchanged; no new event type or config key.

Fakes default to "protected": the tick fake GitHub (getBranchRules, branchRules map,
gh.unprotect / h.unprotect) and the HTTP fake (GET /rules/branches/<branch>,
fake.branchRules, fake.unprotect, exposed as world.unprotect) answer the queue-refs
rules for omni-queue-state and any omni-queue/ name. The fake verifyComposition
records `trees`.

Re-aimed test (no assertion dropped):
- "a stored batch is checked against its candidate before the would-land and the
  bless": before, the recorded verifyComposition call was {expectedBaseSha,
  candidateSha, prs, treeSha} in shadow and the squash-api call carried the stored
  tree; now the shadow call must also carry trees: true and the squash-api call must
  carry [stored tree, trees: true]. Why: the fake now records the new argument, and
  the test pins that the tick asks for the tree check in shadow and in live.

New tests: refs-guard.test.mjs (4), github getBranchRules (1), real-git
verifyComposition with trees (3: composed batch with a stacked PR and a real
same-file merge, from a fresh scratch repository too; planted tree on the last and on
a middle merge commit; conflicting and unrelated parents), tick (8: live merge-ff and
squash-api pause on a missing update rule; an unprotected candidate ref beats the
attempts limit; shadow note; read error fails the tick; dry-run; a tree mismatch
pauses before the rules read in live and shadow).
2026-11-15 13:33:53 -03:00
diegosouzapw
53a290900b Merge remote-tracking branch 'origin/release/v3.8.54' into feat/omni-queue-cutover-2a 2026-11-15 13:13:08 -03:00
diegosouzapw
09598c4bd7 fix(ci): withdraw the land status of a held batch and retry failed withdrawals
A batch stored at the landing stage (blessed, or about to be) that the
queue holds instead of landing kept its omni-queue/land success for as
long as the hold lasted: withdrawAbandoned skips a batch still at the
landing stage. A release-freeze (holdFrozen) or checks back to pending
now move the batch to stage "testing" without landAttempts
(leaveLandingStage, the manual pause's existing rule), so the same tick's
withdrawAbandoned turns success into failure, later held ticks read
nothing, and markLanding + blessForLanding bless it again (attempt 1)
only right before it lands.

A failure write GitHub refused was only an error event: later ticks
forgot the stray success. withdrawLandStatus now keeps each refused SHA
in the optional state field landWithdrawals (sha, batchId, candidateSha,
why, since, attempts; at most 20, one per SHA, the oldest dropped with an
error event), and retryWithdrawals, right after maybeAutoResume (paused
or not; never in shadow or dry-run), re-reads the newest land status and
writes failure again where it is success. An entry goes when that write
succeeds or the status is no longer success; a refusal counts an
attempt; a failed read leaves it as it is. markLanding (in the save that
precedes the blessing) and a manual bless drop the entry of a commit
blessed on purpose. validateState accepts the field as optional and
refuses a malformed one. No new event type, no new config key.

Re-aimed tests:
- "release-freeze opened during CI: the green batch is held, then lands
  after the freeze": before, one batch never blessed, held then landed.
  Now the same body runs twice; the second run (named "a batch at the
  landing stage held by a release-freeze: its land status turns failure;
  blessed again when the freeze lifts and it lands") stores the batch at
  the landing stage with success first. Every original assertion stays in
  both runs; both now also assert stage "testing" without landAttempts
  while held, and the exact status writes: none while held for the
  never-blessed batch, one withdrawal for the blessed one, then the
  blessing right before the landing.

New tests: checks back to pending (withdrawn, re-blessed as attempt 1),
held for several ticks (one land-status read), a withdrawal refused twice
in one tick (stored, then retried), a stored withdrawal no longer success
(dropped without a write), a state without landWithdrawals, retries on a
paused queue (refusal counts, unreadable status untouched), none in
shadow or dry-run, the 20-entry bound, a head blessed by the current
batch never un-blessed, a manual bless dropping its entry, and
validateState cases in state.test.mjs.
2026-11-15 12:38:55 -03:00
diegosouzapw
ab818cff27 fix(ci): bound a landing error that repeats on every tick
A landing that throws without an auth failure withdraws the blessing and
rethrows, but the stored in-flight batch stayed at stage "landing", and
markLanding returned at once for such a batch. Every later tick blessed,
landed and threw again, forever: a success/failure land status pair per
commit and one error event per tick, with nobody told the queue was stuck.

- markLanding counts each attempt in inFlight.landAttempts and saves it
  before the blessing (1 on the first transition, +1 when the batch is
  already at "landing"; a document of the older code without the field
  counts as 1). A lost save throws before anything is blessed.
- landOrWouldLand, after the composition check and before markLanding:
  a batch at "landing" with landAttempts >= LANDING_ATTEMPTS_LIMIT (3) is
  not blessed or landed again; the queue pauses (pauseLanding, reason
  "error") naming the count and the last recorded error. withdrawAbandoned
  still withdraws any success left behind.
- landAttempts is dropped whenever the stage leaves "landing": the manual
  pause that downgrades the stage and the infraPath retry copy. The base
  check and new batch objects are built fresh and never carried it.
- validateState accepts inFlight.landAttempts only as a non-negative
  integer when present.
- isAuthFailure no longer treats a 403 whose message names a rate limit
  as a credential failure: it is retried like any error without a
  verdict, within the new bound. A 401, and any other 403, still pause.

No new event type, no new config key. No existing test was re-aimed:
every existing assertion holds unchanged.
2026-11-15 12:12:44 -03:00
diegosouzapw
902e644c44 test(ci): end-to-end scenarios for the base check and the hang path on the real modules
Scenarios 11 to 14 of tick-e2e run the real tick, classify, checks, compose,
land and bisect against the fake GitHub without seeding a green base, so a red
batch on a tip with no verdict goes through the base check first:

- 11: red batch on a tip pushed from outside; the bare base is green, then the
  bisection isolates the culprit and the other two land.
- 12: the bare base fails the same job; base-red pause matched by check name
  only, labels kept, and the pause lifts when a repair moves the tip.
- 13: a job cancelled at its time limit on both runs: infra-retry,
  hang-suspected, base check, hang bisection without a retry per segment;
  the culprit comment names the job.
- 14: the base check never gets a CI run; after its retry the verdict is
  stored as timeout and the parked batch is bisected as PR-red.

queue-world gains brokenBases, hangs, failingJob and hangJob, reportChecks
options failureOutput, annotations and extraRuns, and a ciInFlight that knows
a base check from a batch. Failures in the new scenarios have the shape GitHub
Actions gives them here: the test job with only the exit-code annotation, a
hang as a cancelled job with the maximum execution time annotation, and
"Gate / CI" failing with them. Scenarios 1 to 10 keep the previous shape.
2026-11-15 11:54:29 -03:00
diegosouzapw
420ab751b6 chore: leave translated catalogs, mirrors and generated files to the release refresh
Plan 2026-11-13 (derived values resolved only at release): a feature PR edits only the English
sources (src/i18n/messages/en.json, bin/cli/locales/en.json, the English docs) and the generators'
inputs. The other locale catalogs, the docs/i18n mirrors, .i18n-state.json, PROVIDER_REFERENCE.md,
the generated README SVGs and skills, and config/quality/e2e-timings.json are rewritten once by the
release refresh or a translation wave (config/quality/derived-paths/*.json). This commit restores
those files to the PR's merge base so the PR stops conflicting with every sibling that touched
them; the PR's own changes are untouched. Missing translations fall back to English at runtime
until the release refresh translates them.
2026-11-15 11:46:43 -03:00
diegosouzapw
a5afb850ff test(ci): drive the tick tests with the real red classifier
createFakeModules() carried its own copies of classifyRed and
extractSignatures. They matched a key present on one side only, kept the
shard suffix in the check name, counted only startup_failure as
infrastructure and had no aggregate-gate step, so a tick test could take
a route through the state machine that production never takes. The
fake classify module is now the real classifyRed, extractSignatures,
hangSignatures and normalizeCheckName from scripts/merge-queue/classify.mjs
(pure, no I/O). Nothing under scripts/ changes.

The failure annotation runCi reports on a red composition now has the
shape the real extractSignatures reads (path = test file, title = test
name, an assertion message), exported as FAILURE / FAILURE_KEY.

New test, through the tick:
- "a key on one side only never matches; both empty match by check
  name": a red base verdict with a key against a keyless candidate, a
  keyless base against a keyed candidate, and keyless on both sides but
  another check are each pr-red (PR dequeued, no pause, no new base
  check); keyless on both sides with the same check name is a base-red
  pause whose detail says the match was by check name only. Fails with
  the old fake (base-red pause, detail "fake:base-red").

Re-aimed tests:
- "base-red: a red batch with a base-red issue open runs a base-check,
  then pauses": before, the parked signature key was the raw annotation
  title "tests/unit/widget.test.ts"; now it is the real key of the
  realistic annotation, FAILURE_KEY ("<path> <title>", lower-cased).
  The rest of the scenario is unchanged.
- "the fake classifier never redoes a base check that timed out (same
  precedence as the real one)" is now "the harness classifies with the
  real module: a base check that timed out is never redone": before, it
  pinned the fake's precedence to the real one; there is no fake left,
  so it now asserts that each of the four classify functions of the
  harness is the real one, and keeps every earlier assertion (no base
  check started, the PR is the culprit, logged pr-red).

Cleanup: the per-test swaps to the real classify module (hangHarness and
four tests) are gone, since the harness already uses it.

Queue suite: 636 -> 637 tests, all passing.
2026-11-15 11:32:36 -03:00
diegosouzapw
ca1b895327 fix(ci): mint the omni-queue App token with client-id
actions/create-github-app-token deprecates its app-id input. Both jobs
of omni-queue.yml (approval and tick) now pass
client-id: ${{ secrets.OMNI_QUEUE_APP_CLIENT_ID }} (the App's Client ID)
instead of app-id: ${{ secrets.OMNI_QUEUE_APP_ID }}. Nothing else in the
two steps changes. The numeric App id stays an operator-side value of
apply-ruleset.mjs and is no longer a workflow secret.

Tests (workflows.test.mjs):
- re-aimed: "least privilege: no default token scopes, App token scoped
  per job" now asserts the client-id input instead of app-id, and its
  pinned secret set swaps OMNI_QUEUE_APP_ID for OMNI_QUEUE_APP_CLIENT_ID.
- new: "omni-queue.yml: both jobs mint the token with client-id from
  OMNI_QUEUE_APP_CLIENT_ID, never app-id".

The owner must create OMNI_QUEUE_APP_CLIENT_ID in the omni-queue
environment before this lands.
2026-11-15 11:19:45 -03:00
diegosouzapw
9e34897317 docs(readme): fix the Claude Code MCP setup command
README.md taught `claude mcp add-server omniroute --type http --url ...`,
which Claude Code does not accept: there is no `add-server` subcommand and
the transport flag is `--transport`. Even with the right syntax the call
would fail, because the HTTP transport is off by default (`mcpTransport`
defaults to stdio) and `/api/mcp/stream` requires a key with the `manage`
or `mcp:connect` scope (`requireManagementAuth(..., { acceptMcpConnectScope })`).

Replace it with the two commands that work: enable the streamable-http
transport, then add the server with `--transport http` and the bearer key.
The same code line is fixed mechanically in the 66 translated README
mirrors; the translated comment above it is left untouched.

Reported in discussion #20128.
2026-11-15 09:33:01 -03:00
Diego Rodrigues de Sa e Souza
094a1aa1c0 fix(ci): stop the Codecov uploader from scanning the coverage shards (main) (#19332) 2026-11-08 22:33:19 -03:00
Diego Rodrigues de Sa e Souza
7eb1b69b51 fix(ci): give the Sonar JS/TS analyzer enough heap (#19280)
Cherry-pick of #19179 to main, so PRs based on main scan with the same heap as the release branch.
2026-11-07 17:13:02 -03:00
Diego Rodrigues de Sa e Souza
0461722b05 fix(electron): make the shared standalone bundle portable and fast to restore (#19283)
Port of #19239 (release/v3.8.54) to main, so the v3.8.53 macOS arm64
installer can be built through the shared standalone job. The per-leg
Next build on the arm64 runner hit the 6 h job limit on 2026-11-06.

Keeps traced symlinks verbatim in the colocated optionals, normalizes
Windows separators in the manifest and refuses relative escapes under
standalone/, and replaces the quadratic tarball block reader with a
bounded chunk queue. Scripts and tests only; the changelog fragment
stays on release/v3.8.54.
2026-11-07 16:41:01 -03:00
4176 changed files with 420959 additions and 283610 deletions

View File

@@ -155,9 +155,16 @@ jobs:
# PR acceleration is not release-candidate provenance.
cache: ${{ github.event_name == 'pull_request' }}
- run: npm run check:node-runtime
# External state (the npm advisory database; "externalState" in
# config/quality/release-green-static-profile.json): advisory on an omni-queue candidate,
# so an advisory published during the batch's CI cannot throw the batch out.
- run: npm run audit:deps
continue-on-error: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/') }}
# The cache, the JSON report and its upload run even when a step above failed:
# quality-gate still runs on a failed lint job and its ESLint download is strict, so a
# missing artifact would skip the complexity / duplication / dead-code ratchets too.
- name: Restore ESLint file cache
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && !cancelled()
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
@@ -172,6 +179,7 @@ jobs:
# Single ESLint inventory (JSON) — quality-gate reuses the artifact instead of
# a second cold full-tree pass for eslintWarnings ratchet counts.
- name: ESLint (JSON report)
if: ${{ !cancelled() }}
run: npm run lint:json
- name: Upload ESLint results
if: always()
@@ -236,6 +244,13 @@ jobs:
env:
CANDIDATE_BASE: ${{ needs.changes.outputs.candidateBase }}
run: npm run check:ai-attribution -- --range "$CANDIDATE_BASE..$GITHUB_SHA"
# Release-Green holds test-masking as a hard gate; on pull requests it runs in PR Test
# Policy, which never runs on a push. A candidate is judged here, against its base.
- name: Detect test-masking against the omni-queue candidate base
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/')
env:
GITHUB_BASE_SHA: ${{ needs.changes.outputs.candidateBase }}
run: npm run check:test-masking
# A test parked in vitest.config.ts's exclude list does not run, and looks like
# coverage to whoever reads the tree. 62 files accumulated behind a comment pointing
# at #8618 — closed in August while the list grew to 62; 51 of them passed when
@@ -384,12 +399,19 @@ jobs:
run: npm run check:type-coverage
- name: Compression budget ratchet (F2.4 / N4)
run: npm run check:compression-budget
# Kit type scale (#19066 block 7): sizes under 12 px and font-bold may only go down. The
# pre-commit hook runs it too, but `git commit --no-verify` skips the hook.
- name: Type scale ratchet
run: npm run check:type-scale-ratchet -- --ratchet
# CodeQL alerts ratchet — BLOQUEANTE (promovido de advisory na v3.8.26).
# Lê metrics.codeqlAlerts.value de quality-baseline.json e sai 1 SOMENTE numa
# regressão real (alertas abertos > baseline). Falha de medição (gh/auth/api)
# é skip gracioso com exit 0 — security-events:read no job-level permissions.
# External state (the repository's open code-scanning alerts): advisory on an omni-queue
# candidate, blocking everywhere else.
- name: CodeQL alerts ratchet (blocking)
run: npm run check:codeql-ratchet
continue-on-error: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Append summary
@@ -475,17 +497,22 @@ jobs:
run: |
set +e
mkdir -p "$HOME/.local/bin"
# gitleaks — download latest linux x64 tarball via gh (authed), extract binary
# Pinned to quality.yml's versions: a scanner release must not change a ratchet's
# verdict mid-cycle, nor give one gate two verdicts on one omni-queue candidate.
GITLEAKS_VERSION=v8.30.1
OSV_SCANNER_VERSION=v2.3.8
OASDIFF_VERSION=v1.19.1
# gitleaks — pinned linux x64 tarball via gh (authed), extract binary
rm -rf /tmp/gl && mkdir -p /tmp/gl
gh release download --repo gitleaks/gitleaks --pattern '*linux_x64.tar.gz' --dir /tmp/gl
gh release download "$GITLEAKS_VERSION" --repo gitleaks/gitleaks --pattern '*linux_x64.tar.gz' --dir /tmp/gl
tar -xzf /tmp/gl/*linux_x64.tar.gz -C "$HOME/.local/bin" gitleaks
# osv-scanner — download latest linux amd64 bare binary via gh (authed)
# osv-scanner — pinned linux amd64 bare binary via gh (authed)
rm -rf /tmp/osv && mkdir -p /tmp/osv
gh release download --repo google/osv-scanner --pattern '*linux_amd64' --dir /tmp/osv
gh release download "$OSV_SCANNER_VERSION" --repo google/osv-scanner --pattern '*linux_amd64' --dir /tmp/osv
install -m 0755 /tmp/osv/*linux_amd64 "$HOME/.local/bin/osv-scanner"
# oasdiff — download latest linux amd64 tarball via gh (authed), extract binary
# oasdiff — pinned linux amd64 tarball via gh (authed), extract binary
rm -rf /tmp/oasd && mkdir -p /tmp/oasd
gh release download --repo oasdiff/oasdiff --pattern '*linux_amd64.tar.gz' --dir /tmp/oasd
gh release download "$OASDIFF_VERSION" --repo oasdiff/oasdiff --pattern '*linux_amd64.tar.gz' --dir /tmp/oasd
tar -xzf /tmp/oasd/*linux_amd64.tar.gz -C "$HOME/.local/bin" oasdiff
# ALWAYS export the bin dir (even if any step above failed)
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
@@ -512,9 +539,11 @@ jobs:
# failure in the advisory-scanner step above surfaces here as
# `vulnCount=INCOMPLETE reason=binary-absent`. See the CVE-variance note in
# docs/security/SUPPLY_CHAIN.md — a newly-disclosed CVE on an unchanged dep can
# red this gate; the fix is to bump the dep or re-baseline metrics.vulnCount.
# red this gate; the fix is to bump the dep or re-baseline metrics.vulnCount. That variance
# is external state: advisory on an omni-queue candidate, blocking everywhere else.
- name: Vulnerability ratchet (osv-scanner, ratchet, blocking)
run: npm run check:vuln-ratchet -- --ratchet
continue-on-error: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/') }}
# BLOCKING ratchet (Etapa 2): zizmorFindings must not regress vs the baseline.
# ONLY zizmor is ratcheted — actionlint findings are reported, not blocking.
# Both tools must complete with valid reports. Missing/broken scanners or

97
.github/workflows/docker-org-mirror.yml vendored Normal file
View File

@@ -0,0 +1,97 @@
name: Mirror Docker image to the Docker Hub org
# Copies a published release from ghcr.io/cheaper-inference/omniroute to the Cheaper Inference
# Docker Hub organization (cheaperinference/omniroute). The legacy diegosouzapw/omniroute keeps
# receiving the same images from docker-publish.yml: Docker Hub cannot move a repository between
# namespaces, so its pull history stays there and both are published in parallel.
#
# Two entry points:
# - workflow_call from docker-publish.yml, right after a release's manifests are created;
# - workflow_dispatch to (re)publish an already released version to the org only, for example
# once the org owner provides the credentials. It copies the existing images and does not
# rebuild anything (minutes, not the ~2 h of a docker-publish dispatch).
#
# Without the DOCKERHUB_ORG_USERNAME / DOCKERHUB_ORG_TOKEN secrets the job skips with a warning
# annotation and a job-summary line and stays green (scripts/ci/docker-org-mirror.mjs).
on:
workflow_call:
inputs:
version:
description: "Released version to mirror (e.g. 3.8.54)"
required: true
type: string
promote_latest:
description: "Also move :latest and :latest-web on the org repository"
required: false
type: boolean
default: false
secrets:
DOCKERHUB_ORG_USERNAME:
required: false
DOCKERHUB_ORG_TOKEN:
required: false
workflow_dispatch:
inputs:
version:
description: "Released version to mirror (e.g. 3.8.54)"
required: true
type: string
promote_latest:
description: "Also move :latest and :latest-web (only when this is the highest stable version)"
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
mirror:
name: Copy release to cheaperinference/omniroute
runs-on: ${{ vars.DOCKER_AMD64_RUNNER == 'blacksmith' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 45
# One group for every mirror run, whatever the caller: docker-publish groups by github.ref,
# so two releases never share its group and their mirrors could otherwise overlap. Queued
# here, the later run re-reads origin's tags (the script's :latest recheck) after the earlier
# one finished, so an older release cannot move :latest back. GitHub keeps one pending run per
# group: a pending mirror replaced by a newer one shows as cancelled and is re-run with a
# workflow_dispatch of this workflow.
concurrency:
group: docker-org-mirror
cancel-in-progress: false
permissions:
contents: read
env:
HAS_ORG_CREDENTIALS: ${{ secrets.DOCKERHUB_ORG_USERNAME != '' && secrets.DOCKERHUB_ORG_TOKEN != '' }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
fetch-depth: 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Copy the release images
id: mirror
env:
VERSION: ${{ inputs.version }}
PROMOTE_LATEST: ${{ inputs.promote_latest && 'true' || 'false' }}
DOCKERHUB_ORG_USERNAME: ${{ secrets.DOCKERHUB_ORG_USERNAME }}
DOCKERHUB_ORG_TOKEN: ${{ secrets.DOCKERHUB_ORG_TOKEN }}
run: node scripts/ci/docker-org-mirror.mjs
- name: Update the org repository description
# The README follows :latest: only when this run actually moved it (the script rechecks
# the promote_latest request against origin's tags and may decline it).
if: env.HAS_ORG_CREDENTIALS == 'true' && steps.mirror.outputs.promoted == 'true'
continue-on-error: true
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5
with:
username: ${{ secrets.DOCKERHUB_ORG_USERNAME }}
password: ${{ secrets.DOCKERHUB_ORG_TOKEN }}
repository: cheaperinference/omniroute
short-description: "OmniRoute — Unified AI proxy. Route any LLM through one endpoint."
readme-filepath: ./README.md

View File

@@ -897,6 +897,30 @@ jobs:
short-description: "OmniRoute — Unified AI proxy. Route any LLM through one endpoint."
readme-filepath: ./README.md
# Second Docker Hub repository, owned by the Cheaper Inference organization. Docker Hub cannot
# move a repository between namespaces, so diegosouzapw/omniroute (and its pull history) keeps
# receiving every image above and the release is copied here from GHCR, same manifests.
# Released versions only (not main/next). Without the DOCKERHUB_ORG_* secrets the called job
# skips with a warning and stays green, so a missing org credential never blocks a release;
# republish later with a workflow_dispatch of docker-org-mirror.yml (copy only, no rebuild).
mirror-org-dockerhub:
name: Mirror to the Docker Hub org
needs: [prepare, merge]
if: >-
!cancelled() && github.event_name != 'schedule' &&
needs.merge.result == 'success' &&
needs.prepare.outputs.version != 'main' && needs.prepare.outputs.version != 'next' &&
(github.event_name != 'schedule' || github.repository == 'cheaper-inference/OmniRoute')
permissions:
contents: read
uses: ./.github/workflows/docker-org-mirror.yml
with:
version: ${{ needs.prepare.outputs.version }}
promote_latest: ${{ needs.prepare.outputs.promote_latest == 'true' }}
secrets:
DOCKERHUB_ORG_USERNAME: ${{ secrets.DOCKERHUB_ORG_USERNAME }}
DOCKERHUB_ORG_TOKEN: ${{ secrets.DOCKERHUB_ORG_TOKEN }}
# #14560: alert when the only omni-build runner goes offline. Mirrors the
# nightly-release-green issue loop: open a deduplicated tracking issue when
# no online runner carries the label, comment with fresh evidence while it

View File

@@ -66,6 +66,10 @@ jobs:
# A freeze issue is titled "🔒 release-freeze: vX.Y.Z in progress"; v3.8.5 must not
# match v3.8.52, and a freeze that names no version freezes everything.
VER_RE=$(printf '%s' "${BASE#release/}" | sed 's/\./\\./g')
# A checked assignment: a failed lookup fails the step. Fed through `< <(gh ...)`, the
# failure was invisible to set -e, the loop read EOF and the run went on as not frozen.
FREEZES=$(gh issue list --repo "$GITHUB_REPOSITORY" --label release-freeze --state open \
--json number,title --jq '.[] | "\(.number)\t\(.title)"')
FROZEN=""
while IFS=$'\t' read -r NUM TITLE; do
[ -n "$NUM" ] || continue
@@ -73,8 +77,7 @@ jobs:
|| ! printf '%s' "$TITLE" | grep -qE 'v[0-9]+\.[0-9]+\.[0-9]+'; then
FROZEN="#$NUM"
fi
done < <(gh issue list --repo "$GITHUB_REPOSITORY" --label release-freeze --state open \
--json number,title --jq '.[] | "\(.number)\t\(.title)"')
done <<< "$FREEZES"
RED=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open \
--search "Release branch not green: $BASE in:title" --json number --jq '.[0].number // empty')
{
@@ -122,6 +125,12 @@ jobs:
run: |
set -euo pipefail
TITLE="chore(docs): refresh derived numbers on ${BASE}"
# The fetched tip is the robot's own only when the bot both authored AND committed it:
# `git commit --amend --no-edit` on the bot commit keeps the bot as author but records
# the maintainer as committer, and that hand fix must be neither closed nor overwritten.
robot_tip() {
[ "$(git log -1 --format='%ae %ce' FETCH_HEAD)" = "$BOT_EMAIL $BOT_EMAIL" ]
}
git add -A
if git diff --cached --quiet; then
echo "Every derived number on \`$BASE\` already matches the live code." >> "$GITHUB_STEP_SUMMARY"
@@ -132,7 +141,7 @@ jobs:
--json number --jq '.[0].number // empty')
if [ -n "$STALE" ]; then
git fetch -q --depth=1 origin "$REFRESH_BRANCH"
if [ "$(git log -1 --format=%ae FETCH_HEAD)" = "$BOT_EMAIL" ]; then
if robot_tip; then
gh pr close "$STALE" --repo "$GITHUB_REPOSITORY" \
--comment "Closed by the nightly derived refresh: \`$BASE\` already matches the live code (${RUN_URL})." > /dev/null
echo "Closed the stale refresh PR #$STALE." >> "$GITHUB_STEP_SUMMARY"
@@ -151,7 +160,7 @@ jobs:
REMOTE_SHA=$(git ls-remote --heads origin "$REFRESH_BRANCH" | cut -f1)
if [ -n "$OPEN_PR" ] && [ -n "$REMOTE_SHA" ]; then
git fetch -q --depth=1 origin "$REFRESH_BRANCH"
if [ "$(git log -1 --format=%ae FETCH_HEAD)" != "$BOT_EMAIL" ]; then
if ! robot_tip; then
echo "PR #${OPEN_PR%% *} has commits pushed by hand; not overwriting them." >> "$GITHUB_STEP_SUMMARY"
exit 0
fi

View File

@@ -134,6 +134,10 @@ jobs:
JWT_SECRET: ci-nightly-secret-with-sufficient-length-for-validation
API_KEY_SECRET: ci-nightly-api-key-secret-long
DISABLE_SQLITE_AUTO_BACKUP: "true"
# Same gate mode as the observer's own HARD gates (withHardGateMode in
# validate-release-green.mjs): these results feed its verdict through --suites-from.
# Release-mode assertions (e.g. locale key parity) belong to the release cut.
OMNIROUTE_GATE_MODE: "pr"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
@@ -473,6 +477,10 @@ jobs:
JWT_SECRET: ci-nightly-secret-with-sufficient-length-for-validation
API_KEY_SECRET: ci-nightly-api-key-secret-long
DISABLE_SQLITE_AUTO_BACKUP: "true"
# Same gate mode as the observer's own HARD gates (withHardGateMode in
# validate-release-green.mjs): these results feed its verdict through --suites-from.
# Release-mode assertions (e.g. locale key parity) belong to the release cut.
OMNIROUTE_GATE_MODE: "pr"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:

View File

@@ -520,9 +520,23 @@ jobs:
PKG_VERSION=$(node -p "require('./package.json').version")
PKG_NAME=$(node -p "require('./package.json').name")
# Exit 0 when npm has ${PKG_NAME}@$1, 1 when it definitely does not (no output, or
# npm's E404). Any other answer is a registry failure: it fails the step instead of
# reading as "not published" (the `npm view ... || true` it replaces did).
npm_has_version() {
local out err rc=0
err=$(mktemp)
out=$(npm view "${PKG_NAME}@$1" version 2>"$err") || rc=$?
if [ "$rc" -eq 0 ] && [ "$out" = "$1" ]; then rm -f "$err"; return 0; fi
if [ "$rc" -eq 0 ] && [ -z "$out" ]; then rm -f "$err"; return 1; fi
if [ "$rc" -ne 0 ] && grep -q 'code E404' "$err"; then rm -f "$err"; return 1; fi
echo "::error::npm view ${PKG_NAME}@$1 was inconclusive (exit $rc): ${out}" >&2
cat "$err" >&2
exit 1
}
# 1) Skip if current version is not yet published (no bump needed)
PUBLISHED="$(npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null || true)"
if [ "$PUBLISHED" != "$PKG_VERSION" ]; then
if ! npm_has_version "$PKG_VERSION"; then
echo "✅ ${PKG_NAME}@${PKG_VERSION} is new — no bump needed."
echo "bumped=false" >> "$GITHUB_OUTPUT"
exit 0
@@ -537,16 +551,35 @@ jobs:
exit 0
fi
# 3) Check if plugin dir actually changed since that tag
if git diff --quiet "$PREV_TAG" -- "@omniroute/opencode-plugin/"; then
# 3) Check if plugin dir actually changed since that tag. The step runs inside the
# plugin folder and git resolves pathspecs against the current directory, so the
# folder is "." here (the repo-root path matched nothing and no change was ever seen).
if git diff --quiet "$PREV_TAG" -- .; then
echo "⏭️ No plugin changes since $PREV_TAG — nothing to publish."
echo "bumped=false" >> "$GITHUB_OUTPUT"
exit 0
fi
# 4) Auto-bump patch version
npm version patch --no-git-tag-version --allow-same-version
NEW_VERSION=$(node -p "require('./package.json').version")
# 4) Auto-bump the patch version past every version npm already has. The bump only
# exists in this job's workspace (the committed manifest keeps the old version), so a
# later release with plugin changes starts from the same manifest: a single bump
# recomputed a version an earlier release had published, and the publish step below
# skipped it without publishing the change.
# Every candidate is looked up before it can be selected; 50 taken candidates fail.
NEW_VERSION=""
for _ in $(seq 1 50); do
npm version patch --no-git-tag-version --allow-same-version
CANDIDATE=$(node -p "require('./package.json').version")
if ! npm_has_version "$CANDIDATE"; then
NEW_VERSION="$CANDIDATE"
break
fi
echo "${PKG_NAME}@${CANDIDATE} is already on npm — bumping again."
done
if [ -z "$NEW_VERSION" ]; then
echo "::error::${PKG_NAME}: no unpublished patch version within 50 bumps of ${PKG_VERSION}."
exit 1
fi
echo "bumped=true" >> "$GITHUB_OUTPUT"
echo "📦 Auto-bumped ${PKG_NAME} from ${PKG_VERSION} to ${NEW_VERSION}"
@@ -610,9 +643,23 @@ jobs:
PKG_VERSION=$(node -p "require('./package.json').version")
PKG_NAME=$(node -p "require('./package.json').name")
# Exit 0 when npm has ${PKG_NAME}@$1, 1 when it definitely does not (no output, or
# npm's E404). Any other answer is a registry failure: it fails the step instead of
# reading as "not published" (the `npm view ... || true` it replaces did).
npm_has_version() {
local out err rc=0
err=$(mktemp)
out=$(npm view "${PKG_NAME}@$1" version 2>"$err") || rc=$?
if [ "$rc" -eq 0 ] && [ "$out" = "$1" ]; then rm -f "$err"; return 0; fi
if [ "$rc" -eq 0 ] && [ -z "$out" ]; then rm -f "$err"; return 1; fi
if [ "$rc" -ne 0 ] && grep -q 'code E404' "$err"; then rm -f "$err"; return 1; fi
echo "::error::npm view ${PKG_NAME}@$1 was inconclusive (exit $rc): ${out}" >&2
cat "$err" >&2
exit 1
}
# 1) Skip if current version is not yet published (no bump needed)
PUBLISHED="$(npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null || true)"
if [ "$PUBLISHED" != "$PKG_VERSION" ]; then
if ! npm_has_version "$PKG_VERSION"; then
echo "✅ ${PKG_NAME}@${PKG_VERSION} is new — no bump needed."
echo "bumped=false" >> "$GITHUB_OUTPUT"
exit 0
@@ -627,16 +674,35 @@ jobs:
exit 0
fi
# 3) Check if plugin-v2 dir actually changed since that tag
if git diff --quiet "$PREV_TAG" -- "@omniroute/opencode-plugin-v2/"; then
# 3) Check if plugin-v2 dir actually changed since that tag. The step runs inside the
# plugin folder and git resolves pathspecs against the current directory, so the
# folder is "." here (the repo-root path matched nothing and no change was ever seen).
if git diff --quiet "$PREV_TAG" -- .; then
echo "⏭️ No plugin-v2 changes since $PREV_TAG — nothing to publish."
echo "bumped=false" >> "$GITHUB_OUTPUT"
exit 0
fi
# 4) Auto-bump patch version
npm version patch --no-git-tag-version --allow-same-version
NEW_VERSION=$(node -p "require('./package.json').version")
# 4) Auto-bump the patch version past every version npm already has. The bump only
# exists in this job's workspace (the committed manifest keeps the old version), so a
# later release with plugin changes starts from the same manifest: a single bump
# recomputed a version an earlier release had published, and the publish step below
# skipped it without publishing the change.
# Every candidate is looked up before it can be selected; 50 taken candidates fail.
NEW_VERSION=""
for _ in $(seq 1 50); do
npm version patch --no-git-tag-version --allow-same-version
CANDIDATE=$(node -p "require('./package.json').version")
if ! npm_has_version "$CANDIDATE"; then
NEW_VERSION="$CANDIDATE"
break
fi
echo "${PKG_NAME}@${CANDIDATE} is already on npm — bumping again."
done
if [ -z "$NEW_VERSION" ]; then
echo "::error::${PKG_NAME}: no unpublished patch version within 50 bumps of ${PKG_VERSION}."
exit 1
fi
echo "bumped=true" >> "$GITHUB_OUTPUT"
echo "📦 Auto-bumped ${PKG_NAME} from ${PKG_VERSION} to ${NEW_VERSION}"

View File

@@ -0,0 +1,83 @@
name: omni-queue watchdog
# The queue's dead-man switch (docs/ops/OMNI_QUEUE.md). Every 30 minutes it reads each base's
# state file on the omni-queue-state branch and keeps ONE issue,
# "omni-queue: the queue is not making progress", open while one of its signals holds: a base that
# ticks should be visiting (work: in flight, a pause, a stored land-status withdrawal, a labeled
# PR) has saved no state for more than 90 minutes; a managed base that labeled PRs target has no
# state file, and the newest update of those PRs is more than 90 minutes old; a stalled episode's
# dashboard comment has not been posted 30 minutes after it opened; a state file cannot be read
# (not JSON, fails validateState, or its document is for a base the queue does not manage or for a
# base stored in another file); or the queue's config does not load or validate (then nothing else
# is judged, the issue is never closed by that run, and the run fails); it keeps the body up to date, closes the issue once nothing holds, and reopens it
# if something holds again within 24 hours (scripts/merge-queue/watchdog.mjs). A failed read of
# the open labeled PRs or of a state file is not a signal: the run is partial. A partial run may
# still open or reopen the issue for what it did establish, never closes it or rewrites its body,
# and fails, so a read that keeps failing shows as a red run of this workflow. When the listing of
# the state directory or the issue search fails, the run stops, writes nothing and prints one line.
# Time: no state-file fetch starts after 150 s and no write sequence after 210 s (both make the
# run partial); one request is bounded by the watchdog's own client limits (3 attempts of 15 s,
# waits of at most 15 s: 75 s); the script stops the run at 240 s with one error line and exit 1.
# That leaves this job's timeout-minutes about a minute for checkout and setup-node; only when they
# take longer is the run killed before it prints its line.
#
# Deliberately separate from omni-queue.yml, so that it works when the queue's own workflow
# cannot: no App token (a tick that dies minting it, or an uninstalled App, is what it catches),
# no `omni-queue` environment, no secret at all. It runs with this workflow's default token,
# limited to `contents: read` (the state files, the default branch's scripts), `issues: write`
# (its one issue) and `pull-requests: read` (the open PRs carrying the queue label, with their
# base). It never writes the state and never writes to a pull request.
#
# Security posture: no job checks out or runs PR code. The one job checks out the DEFAULT branch
# (sparse: scripts/merge-queue + config/merge-queue only, credentials not persisted) and runs a
# zero-dependency Node script; no npm install. Every action is pinned by commit SHA (the same
# pins as omni-queue.yml).
#
# Kill switch: inert unless the repository variable OMNI_QUEUE_ENABLED is 'true', and only in
# cheaper-inference/OmniRoute (a fork or a sandbox copy never runs it as is).
on:
schedule:
# Every 30 minutes, off the busy :00 / :30 slots.
- cron: "17,47 * * * *"
workflow_dispatch:
permissions: {}
jobs:
watchdog:
name: Watchdog
# The last clause is the scheduled-run guard every scheduled job here carries
# (scripts/check/check-workflows.mjs); the repository clause before it also keeps a manual run
# in this repository only.
if: >-
vars.OMNI_QUEUE_ENABLED == 'true'
&& github.repository == 'cheaper-inference/OmniRoute'
&& (github.event_name != 'schedule' || github.repository == 'cheaper-inference/OmniRoute')
runs-on: ubuntu-latest
timeout-minutes: 5
# One run at a time: two overlapping runs could each open the issue.
concurrency:
group: omni-queue-watchdog
cancel-in-progress: false
permissions:
contents: read
issues: write
pull-requests: read
steps:
# The default branch's watchdog, never a PR's code.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
sparse-checkout: |
scripts/merge-queue
config/merge-queue
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
package-manager-cache: false
node-version: "24"
- name: Check that queue ticks are completing
env:
GITHUB_TOKEN: ${{ github.token }}
run: node scripts/merge-queue/watchdog.mjs

View File

@@ -112,7 +112,7 @@ jobs:
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ secrets.OMNI_QUEUE_APP_ID }}
client-id: ${{ secrets.OMNI_QUEUE_APP_CLIENT_ID }}
private-key: ${{ secrets.OMNI_QUEUE_APP_PRIVATE_KEY }}
permission-contents: read
permission-pull-requests: read
@@ -142,9 +142,10 @@ jobs:
# label change, and an operator who cancels the run mid-incident must stop the tick too.
#
# A pull request event starts a tick only when it can change what the queue does: the
# event's label is an approval label or one of config.json's `blockLabels`, the pull request
# carries the queue label, or a merge moved a base. Anything else (a label on, or a push to,
# a pull request that is not queued) starts nothing; the 5-minute cron stays the safety net.
# event's label is an approval label, one of config.json's `blockLabels` or one of its two
# `lanes` labels (hotfix, base repair), the pull request carries the queue label, or a merge
# moved a base. Anything else (a label on, or a push to, a pull request that is not queued)
# starts nothing; the 5-minute cron stays the safety net.
# Same label literals as config/merge-queue/config.json: rename in BOTH places. And only a
# pull request into a release/v* branch, like the approval job: the queue manages release
# bases only, and no App token is minted for any other pull request.
@@ -161,6 +162,8 @@ jobs:
|| github.event.label.name == 'hold-vps'
|| github.event.label.name == 'do-not-merge'
|| github.event.label.name == 'wip'
|| github.event.label.name == 'omni-queue-hotfix'
|| github.event.label.name == 'omni-queue-base-repair'
|| contains(github.event.pull_request.labels.*.name, 'omni-queue')
|| (github.event.action == 'closed' && github.event.pull_request.merged == true))))
runs-on: ubuntu-latest
@@ -182,7 +185,7 @@ jobs:
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ secrets.OMNI_QUEUE_APP_ID }}
client-id: ${{ secrets.OMNI_QUEUE_APP_CLIENT_ID }}
private-key: ${{ secrets.OMNI_QUEUE_APP_PRIVATE_KEY }}
permission-contents: write
# GitHub refuses a push by an App token that creates or updates a file under
@@ -196,7 +199,9 @@ jobs:
# bless, and withdrawn (failure) when a landing does not complete.
permission-statuses: write
permission-checks: read
permission-actions: read
# POST /actions/runs/{id}/rerun-failed-jobs: a red candidate's failed jobs are re-run
# once before a pull request is blamed (config flakyReruns).
permission-actions: write
# The default branch's orchestrator, never the PR's code.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:

View File

@@ -272,6 +272,10 @@ jobs:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha || needs.changes.outputs.candidateBase }}
# Other checks may use this local ref; OpenAPI reads immutable event commits.
BASE_REF: ${{ github.base_ref && format('origin/{0}', github.base_ref) || '' }}
# External-state gates of this loop ("externalState" in
# config/quality/release-green-static-profile.json: the OSV database), advisory on an
# omni-queue candidate only. Empty on every other event: they block as before.
EXTERNAL_STATE_GATES: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/') && 'vuln-ratchet' || '' }}
run: |
set -uo pipefail
gates=(
@@ -347,6 +351,17 @@ jobs:
npm run check:ts7-diagnostics-ratchet -- --base-ref "$PR_BASE_SHA" || failed+=("ts7-diagnostics-ratchet")
echo "::endgroup::"
fi
# A failed gate named in EXTERNAL_STATE_GATES (filled on an omni-queue candidate only)
# is a warning there, not a failed gate.
counted=()
for g in "${failed[@]}"; do
if [[ " ${EXTERNAL_STATE_GATES:-} " == *" $g "* ]]; then
echo "::warning::check:$g failed (external state, advisory on an omni-queue candidate)"
else
counted+=("$g")
fi
done
failed=("${counted[@]}")
if (( ${#failed[@]} )); then
printf '::error::%d gate(s) failed: %s\n' "${#failed[@]}" "${failed[*]}"
exit 1
@@ -524,9 +539,11 @@ jobs:
run: node scripts/quality/check-quality-ratchet.mjs --allow-missing --require-tighten
# CodeQL alerts ratchet — same semantics as ci.yml quality-gate: exits 1 ONLY
# on a real regression (open alerts > baseline in quality-baseline.json);
# a measurement failure (gh/auth/api) self-skips with exit 0.
# a measurement failure (gh/auth/api) self-skips with exit 0. External state (the
# repository's open alerts): advisory on an omni-queue candidate, like ci.yml.
- name: CodeQL alerts ratchet (blocking)
run: npm run check:codeql-ratchet
continue-on-error: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/omni-queue/') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Append ratchet summary

36292
.i18n-state.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -963,7 +963,8 @@ export async function collectCatalog(
apiFormat: opts.apiFormat,
});
if (servedCombo) {
mapped.name = buildModelDisplayName({ rawId: mapped.name, isCombo: true });
// From the raw id: the mapper's name already carries the provider prefix.
mapped.name = buildModelDisplayName({ rawId: entry.id, isCombo: true });
}
const enrichmentEntry = lookupEnrichment(
entry.id,

View File

@@ -579,6 +579,12 @@ export function applyEnrichment(
typeof context.rawModelId === "string" && context.rawModelId.length > 0
? context.rawModelId
: "";
// An entry with no name (pricing or free-tier data only) names the model from
// its id. Without a raw id from the caller (the /api/combos pass) that is the
// model's own id, else the builder gets nothing and renders `combo - `.
const hasEnrichmentName =
typeof enrichment.name === "string" && enrichment.name.trim().length > 0;
const nameSourceId = rawModelId || (hasEnrichmentName ? "" : model.id);
let providerDisplayName = enrichment.providerDisplayName;
if (
(!providerDisplayName || providerDisplayName.trim().length === 0) &&
@@ -588,7 +594,7 @@ export function applyEnrichment(
providerDisplayName = rawModelId.slice(0, rawModelId.indexOf("/"));
}
const built = buildModelDisplayName({
rawId: rawModelId,
rawId: nameSourceId,
enrichmentName: enrichment.name,
providerAlias: enrichment.providerAlias,
providerDisplayName,

View File

@@ -318,8 +318,12 @@ export function buildModelDisplayName(params: ModelDisplayNameParams): string {
// Split off a leading provider prefix (`Provider - rest`) when present.
let work = rawBase.trim();
let prefixWasFree = false;
const dashMatch = work.match(/^(.+?)\s+-\s+(.+)$/);
if (dashMatch) {
// A free marker on the name's provider prefix (`[Free] Cloudflare - ...`)
// still marks the entry free, even when the label comes from elsewhere.
prefixWasFree = stripFreeMarkers(dashMatch[1]!).wasFree;
if (!provider) provider = dashMatch[1]!.trim();
// Remove a leading [Free] from provider if present.
const pm = stripFreeMarkers(provider);
@@ -348,7 +352,7 @@ export function buildModelDisplayName(params: ModelDisplayNameParams): string {
// Free markers.
const { text: cleanedModel, wasFree } = stripFreeMarkers(work);
const model = cleanedModel.length > 0 ? cleanedModel : work;
const isFree = !!params.isFree || wasFree;
const isFree = !!params.isFree || wasFree || prefixWasFree;
if (
editor &&
@@ -454,7 +458,10 @@ export function disambiguateDisplayNames(
for (const entry of entries) {
let name = renamed.get(entry.id) ?? entry.name;
if (globalSeen.has(name)) {
name = `${entry.name} (${entry.id})`;
// The key suffix can itself be a name already kept: count up until free.
const base = `${entry.name} (${entry.id})`;
name = base;
for (let n = 2; globalSeen.has(name); n++) name = `${base} (${n})`;
renamed.set(entry.id, name);
}
globalSeen.add(name);

View File

@@ -988,10 +988,13 @@ describe("disambiguation stays unique across groups", () => {
{ id: "b/m", owned_by: "b", context_length: 1000 },
{ id: "c/keep", owned_by: "c", context_length: 1000 },
]);
// One shared provider label, so the raw names really collide across groups:
// `P - X` twice (renamed by route to `P - X (a)` / `P - X (b)`) and a kept
// `P - X (a)` that the first route rename lands on.
const enrichment = new Map([
["a/m", { name: "X" }],
["b/m", { name: "X" }],
["c/keep", { name: "X (a)" }],
["a/m", { name: "X", providerDisplayName: "P" }],
["b/m", { name: "X", providerDisplayName: "P" }],
["c/keep", { name: "X (a)", providerDisplayName: "P" }],
]);
const collected = await collectCatalog(
{ ...baseOpts, enrichment },
@@ -1003,6 +1006,12 @@ describe("disambiguation stays unique across groups", () => {
collected.entries.get("omniroute/c/keep")?.name,
];
for (const name of names) assert.ok(name, "every entry keeps a published name");
assert.notEqual(names[0], "P - X", "the shared name is disambiguated by route");
assert.notEqual(names[1], "P - X", "the shared name is disambiguated by route");
assert.ok(
names.includes("P - X (a)"),
`the cross-group collision on P - X (a) is reached: ${JSON.stringify(names)}`
);
assert.equal(
new Set(names).size,
3,

View File

@@ -186,6 +186,37 @@ describe("collectCatalog combo source", () => {
assert.equal(collected.entries.has("omniroute/Mixed"), false, "a paid member drops the combo");
assert.equal(collected.counts.combos, 1);
});
// CodeRabbit R5 (#19191): a /v1/models combo row is named from its raw id, not
// from the mapper's already-formatted `omniroute - <id>` name.
it("models: a combo row with no overlay entry is named combo - <id>", async () => {
const collected = await quiet(() =>
collectCatalog({ ...baseOpts, combosSource: "models" }, {
models: async () => [{ id: "m1" }, { id: "My Combo", owned_by: "combo" }],
} as never)
);
assert.equal(collected.entries.get("omniroute/My Combo")?.name, "combo - My Combo");
});
// CodeRabbit R2 (#19191): an /api/combos overlay entry with pricing but no name
// must not blank the combo name to `combo - `.
it("default: a combo overlay entry without a name keeps the combo name", async () => {
const collected = await quiet(() =>
collectCatalog(
{
...baseOpts,
enrichment: new Map([["x", { pricing: { input: 1, output: 2 } }]]) as never,
},
{
models: async () => [{ id: "m1" }],
combos: async () => [{ id: "x", name: "Duo", models: [{ kind: "model", model: "m1" }] }],
} as never
)
);
const duo = collected.entries.get("omniroute/Duo");
assert.equal(duo?.name, "combo - Duo");
assert.equal(duo?.cost.input, 1, "the pricing overlay still applies");
});
});
function setupCtx(options: Record<string, unknown>) {

View File

@@ -49,6 +49,16 @@ describe("the enrichment overlay reaches the picker", () => {
assert.equal(m.name, "combo - Combo Fast");
});
it("keeps a combo's name when its overlay entry carries no name (CodeRabbit R2)", () => {
const m = applyEnrichment(
model("Duo", "combo - Duo"),
{ pricing: { input: 1, output: 2 }, freeType: "recurring-monthly" as const },
{ isCombo: true }
);
assert.equal(m.name, "combo - Duo");
assert.equal(m.cost.input, 1);
});
it("still overlays pricing", () => {
const m = applyEnrichment(model("x"), { pricing: { input: 3, output: 15 } });
assert.equal(m.cost.input, 3);

View File

@@ -129,6 +129,21 @@ describe("compact model names", () => {
assert.equal(m.name, "🆓 Nvidia - Nemotron 3 Ultra");
});
it("keeps a free marker carried on the provider prefix (CodeRabbit R4)", () => {
assert.equal(
buildModelDisplayName({
rawId: "cf/open-m",
enrichmentName: "[Free] Cloudflare - Open Model",
}),
"🆓 Cloudflare - Open Model"
);
const m = applyEnrichment(model("cf/open-m", "cf/open-m"), {
name: "[Free] Cloudflare - Open Model",
providerDisplayName: "Cloudflare",
});
assert.equal(m.name, "🆓 Cloudflare - Open Model");
});
it("uses a suffix marker for free entries and none otherwise", () => {
const free = buildModelDisplayName({
rawId: "opencode-go/beam-free",

View File

@@ -7,7 +7,11 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { formatFreeBudget, type FreeModelFreeType } from "../src/shared/naming.js";
import {
disambiguateDisplayNames,
formatFreeBudget,
type FreeModelFreeType,
} from "../src/shared/naming.js";
test("formatFreeBudget: recurring-daily formats tokens/day", () => {
assert.equal(
@@ -84,3 +88,22 @@ test("formatFreeBudget: uncapped budget has no counters, label only", () => {
"(uncapped)"
);
});
// CodeRabbit R3 (#19191): the publication-key fallback can itself be a name another
// entry already keeps; fallback candidates are checked until one is unused.
test("disambiguateDisplayNames: a fallback name that is already taken is not reused", () => {
const entries = [
{ id: "p/d", name: "X (a) (p/c)" },
{ id: "p/a/m", name: "X" },
{ id: "p/b/m", name: "X" },
{ id: "p/c", name: "X (a)" },
];
const renamed = disambiguateDisplayNames(entries);
const finalNames = entries.map((entry) => renamed.get(entry.id) ?? entry.name);
assert.equal(
new Set(finalNames).size,
entries.length,
`published names must be unique: ${JSON.stringify(finalNames)}`
);
assert.equal(finalNames[0], "X (a) (p/c)", "an entry that is already unique keeps its name");
});

View File

@@ -1,12 +1,12 @@
{
"name": "@omniroute/opencode-plugin",
"version": "0.2.1",
"version": "0.2.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@omniroute/opencode-plugin",
"version": "0.2.1",
"version": "0.2.2",
"license": "MIT",
"dependencies": {
"zod": "^4.6.7"

View File

@@ -1,6 +1,6 @@
{
"name": "@omniroute/opencode-plugin",
"version": "0.2.1",
"version": "0.2.2",
"description": "OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @opencode-ai/plugin contract.",
"type": "module",
"main": "./dist/index.js",

File diff suppressed because it is too large Load Diff

View File

@@ -65,7 +65,7 @@
<div align="center">
| | v3.8.50 | **v3.8.51** | `v3.8.54+` |
| | v3.8.50 | **v3.8.51** | `v3.8.55+` |
| ------------------------- | :-----------------------: | :---------: | :-------------------: |
| 🌐 Providers | 352 | **358** | 394 |
| 🧠 Unique chat model IDs | 1320 | **1374** | 1491 |
@@ -593,7 +593,7 @@ the current catalog at **[radar.omniroute.online/planos](https://radar.omniroute
</div>
> Recent highlights from **v3.8.20 → v3.8.54**. Full history in [`CHANGELOG.md`](CHANGELOG.md).
> Recent highlights from **v3.8.20 → v3.8.55**. Full history in [`CHANGELOG.md`](CHANGELOG.md).
- **⚖️ `quota-weighted` routing** — the 20th combo strategy skips exhausted accounts, then draws among the rest in proportion to leftover quota ÷ in-flight load, keeping existing conversations pinned. → [Auto-Combo](docs/routing/AUTO-COMBO.md)
- **🧰 Headless mode** — `omniroute serve --headless` (or `OMNIROUTE_HEADLESS=1`) runs only the `/v1/*` proxy engine, with the dashboard and dashboard-only subsystems off. → [Headless Mode](docs/guides/HEADLESS.md)
@@ -929,7 +929,9 @@ Expose OmniRoute over **MCP**, **A2A**, a **REST API**, **webhooks** or a **remo
```bash
# Give Claude Code the full OmniRoute toolset over MCP:
claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp/stream
omniroute mcp enable --transport streamable-http
claude mcp add --transport http omniroute http://localhost:20128/api/mcp/stream \
--header "Authorization: Bearer <api-key-with-manage-scope>"
```
<sub>📖 [MCP Server](docs/frameworks/MCP-SERVER.md) · [A2A Server](docs/frameworks/A2A-SERVER.md) · [Agent Protocols](docs/frameworks/AGENT_PROTOCOLS_GUIDE.md)</sub>
@@ -1041,7 +1043,7 @@ omniroute
```
> 💡 See `npm warn ERESOLVE` or peer-dep warnings? [They're harmless](docs/guides/TROUBLESHOOTING.md#npm-install-warnings-eresolve--peer--deprecated).
> **Using npm 11 or later?** npm may block package lifecycle scripts unless they are allowed. OmniRoute's `postinstall` (`node scripts/build/postinstall.mjs`) is required to prepare its native runtime files. Allow the packages named in npm's warning when installing globally. For the package set reported by OmniRoute 3.8.54:
> **Using npm 11 or later?** npm may block package lifecycle scripts unless they are allowed. OmniRoute's `postinstall` (`node scripts/build/postinstall.mjs`) is required to prepare its native runtime files. Allow the packages named in npm's warning when installing globally. For the package set reported by OmniRoute 3.8.55:
>
> ```bash
> npm install -g --allow-scripts=omniroute,keytar,onnxruntime-node,@parcel/watcher,@swc/core,protobufjs,esbuild omniroute
@@ -1836,7 +1838,7 @@ MIT License - see [LICENSE](LICENSE) for details.
**[⬆ Back to top](#-omniroute)** · Built with ❤️ for the open-source AI community.
<sub>Created by <a href="https://github.com/diegosouzapw">Diego Souza</a> · OmniRoute v3.8.54 · Node ≥22.22.2 · MIT License · <a href="https://omniroute.online">omniroute.online</a></sub>
<sub>Created by <a href="https://github.com/diegosouzapw">Diego Souza</a> · OmniRoute v3.8.55 · Node ≥22.22.2 · MIT License · <a href="https://omniroute.online">omniroute.online</a></sub>
</div>
<!-- GitHub Discussions enabled for community Q&A -->

View File

@@ -5,7 +5,7 @@
If you discover a security vulnerability in OmniRoute, please report it responsibly:
1. **DO NOT** open a public GitHub issue
2. Use [GitHub Security Advisories](https://github.com/diegosouzapw/OmniRoute/security/advisories/new)
2. Use [GitHub Security Advisories](https://github.com/cheaper-inference/OmniRoute/security/advisories/new)
3. Include: description, reproduction steps, and potential impact
## Response Timeline
@@ -38,7 +38,7 @@ After 3.8.59 the next version is **3.9.0**, which opens the long-term support li
whichever is later**. The resulting end date is recorded in the 3.9.0 release notes and in
[`ROADMAP.md`](ROADMAP.md) when the cut happens.
- **Reporting a vulnerability in the LTS line:** same channel as any other version —
a private [GitHub Security Advisory](https://github.com/diegosouzapw/OmniRoute/security/advisories/new),
a private [GitHub Security Advisory](https://github.com/cheaper-inference/OmniRoute/security/advisories/new),
never a public issue. Say which version you tested (for example `3.9.2`); fixes land on
`stable/v3` and are forward-ported to v4.
- **Security baseline at the LTS cut:** measured scanner state, route-guard and

View File

@@ -21,6 +21,7 @@ import { t } from "../i18n.mjs";
import { resolveDataDir } from "../data-dir.mjs";
import { resolveActiveContext } from "../contexts.mjs";
import { quoteShellArgsForSpawn } from "../utils/winShellArgs.mjs";
import { isLoopbackUrl } from "../api.mjs";
import {
buildClaudeEnv,
fetchModelContextWindow,
@@ -44,6 +45,41 @@ function getVersionCachePath() {
return join(getFccDataDir(), "version-cache.json");
}
// ─── Plain-HTTP guard for the credential ─────────────────────────────────────
/** Opt-in for sending the key over plain HTTP to a non-loopback host. */
export const ALLOW_INSECURE_REMOTE_ENV = "OMNIROUTE_ALLOW_INSECURE_REMOTE";
/**
* Why fcc-claude must not send `authToken` to `baseUrl`, or null when it may.
*
* The bearer key goes to the catalog (GET /v1/models), to /v1/messages in
* --test mode and to claude itself, so a non-loopback `http://` target would
* carry it in plaintext (CWE-319). Loopback HTTP, HTTPS and requests without
* a credential are fine. An operator on a network they trust (a LAN server at
* http://192.168.x.y:20128) opts in with OMNIROUTE_ALLOW_INSECURE_REMOTE=1;
* the variable must come from the shell or the data-dir `.env`, since a `.env`
* in the working directory cannot set it (bin/cli/utils/untrustedCwdEnv.mjs).
* The message names only the origin: never the key or URL userinfo.
*/
export function insecureRemoteRefusal(baseUrl, authToken, env = process.env) {
if (!authToken || !String(authToken).trim()) return null;
let url;
try {
url = new URL(baseUrl);
} catch {
return null; // not a URL: every request fails before anything is sent
}
if (url.protocol !== "http:" || isLoopbackUrl(url.href)) return null;
if (/^(1|true)$/i.test(String(env[ALLOW_INSECURE_REMOTE_ENV] ?? "").trim())) return null;
const origin = `${url.protocol}//${url.host}`;
return (
`[fcc-claude] Refusing to send your OmniRoute API key in plaintext to ${origin}: ` +
`it is plain http:// and not a loopback address. Use an https:// URL, or, on a ` +
`network you trust, set ${ALLOW_INSECURE_REMOTE_ENV}=1 in your shell to allow it.`
);
}
// ─── Default fallback chain (FCC style) ──────────────────────────────────────
const DEFAULT_FALLBACK_MODELS = ["auto/best-coding", "auto/best-chat", "auto/fast"];
@@ -163,6 +199,11 @@ export async function* streamMessages(
*/
export async function runTestCommand(opts = {}) {
const { baseUrl, authToken } = resolveLaunchTarget(opts);
const refusal = insecureRemoteRefusal(baseUrl, authToken);
if (refusal) {
console.error(refusal);
return 1;
}
const prompt = opts.test || opts.prompt || "Say hi";
const chain = loadFallbackChain(opts);
const fallbackModels = chain.models?.slice(1) || [];
@@ -299,6 +340,11 @@ export async function runFccClaude(opts = {}, claudeArgs = []) {
// Normal mode: launch the claude binary.
const { baseUrl, authToken } = resolveLaunchTarget(opts);
const refusal = insecureRemoteRefusal(baseUrl, authToken);
if (refusal) {
console.error(refusal);
return 1;
}
// Health check
try {

View File

@@ -49,7 +49,10 @@ export function buildClaudeEnv(baseEnv, baseUrlOrPort, authToken, opts = {}) {
// stays stripped (above) so it can't shadow the Bearer token.
env.ANTHROPIC_AUTH_TOKEN = (authToken && String(authToken).trim()) || "omniroute-no-auth";
env.CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY = "1";
// Window sizing for a model with a known real window: see claudeWindowEnv.
// Window sizing for a model with a known real window: see claudeWindowEnv. It owns both
// keys, including when it omits one, so an inherited value (--inherit-env) must not survive.
delete env.CLAUDE_CODE_AUTO_COMPACT_WINDOW;
delete env.CLAUDE_CODE_MAX_CONTEXT_TOKENS;
Object.assign(env, claudeWindowEnv(opts.contextWindow));
// Profile isolation (Claude Code has no native profiles — CLAUDE_CONFIG_DIR is
// the idiomatic mechanism: separate settings/credentials/history/cache per dir).

View File

@@ -30,7 +30,14 @@ function isBlank(value) {
return value === undefined || value === null || String(value).trim() === "";
}
function toAuthSource(targetOpts, baseUrl) {
/**
* Where the credential a plan launches with comes from. `authToken` is the
* credential the target's own resolver returned, so a variable that target
* never reads (Codex ignores ANTHROPIC_AUTH_TOKEN) is not reported as the
* source of a launch that actually gets the no-auth sentinel.
*/
function toAuthSource(targetOpts, baseUrl, authToken) {
if (isBlank(authToken)) return "none";
const explicit =
!isBlank(targetOpts.token) || !isBlank(targetOpts.apiKey) || !isBlank(targetOpts["api-key"]);
if (explicit) return "option";
@@ -144,7 +151,7 @@ async function buildClaudePlan(rawOpts, args = []) {
args: spawnArgs,
model: merged.model || undefined,
envDiff: envPreview(process.env, env),
authSource: toAuthSource(rawOpts, baseUrl),
authSource: toAuthSource(rawOpts, baseUrl, authToken),
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
};
}
@@ -178,7 +185,7 @@ async function buildCodexPlan(rawOpts, args = []) {
args: spawnArgs,
model: merged.model || undefined,
envDiff: envPreview(process.env, env),
authSource: toAuthSource(rawOpts, baseUrl),
authSource: toAuthSource(rawOpts, baseUrl, authToken),
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
providerArgs,
profileArgs,
@@ -345,7 +352,7 @@ async function buildGenericPlan(target, rawOpts, args = []) {
args: quoteShellArgsForSpawn(fullArgs, process.platform, commandSpec.shell),
model: model || undefined,
envDiff: envPreview(process.env, env),
authSource: toAuthSource(rawOpts, baseUrl),
authSource: toAuthSource(rawOpts, baseUrl, authToken),
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
modelArgs,
configOverlay:

View File

@@ -181,13 +181,17 @@ async function terminatePids(allPids, { kill, running, wait, identify }) {
// A listener on the port is only stopped when its command line names OmniRoute (same proof
// as the pid-file path). A foreign or unreadable one is someone else's server: leave it alone
// and do not report the port free.
// A "gone" pid had no process behind it when classified: nothing to signal.
const pids = [];
let skipped = 0;
for (const p of allPids) {
const identity = identify(p);
if (identity === "ours" || identity === "gone") pids.push(p);
else console.error(`Skipped PID ${p} on the port: it does not look like an OmniRoute process.`);
if (identity === "ours") pids.push(p);
else if (identity !== "gone") {
skipped++;
console.error(`Skipped PID ${p} on the port: it does not look like an OmniRoute process.`);
}
}
const skipped = allPids.length - pids.length;
if (pids.length === 0) return skipped === 0;
for (const p of pids) {
try {
@@ -195,11 +199,23 @@ async function terminatePids(allPids, { kill, running, wait, identify }) {
} catch {}
}
await wait(1000);
// A pid that exited during the wait can already belong to another process: prove it is still
// OmniRoute before SIGKILL. A foreign or gone survivor means ours exited; an unproven one
// cannot be counted as stopped.
const escalated = [];
let unproven = false;
for (const p of pids) {
try {
if (running(p)) kill(p, "SIGKILL");
} catch {}
if (!running(p)) continue;
const identity = identify(p);
if (identity === "ours") {
try {
kill(p, "SIGKILL");
} catch {}
escalated.push(p);
} else if (identity === "unknown") {
unproven = true;
}
}
// Confirm the port is free: any PID still alive means we failed.
return skipped === 0 && pids.every((p) => !running(p));
// Confirm the port is free: any OmniRoute PID still alive means we failed.
return skipped === 0 && !unproven && escalated.every((p) => !running(p));
}

View File

@@ -1,5 +1,5 @@
import { execFileSync } from "node:child_process";
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
import { existsSync, mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { resolveDataDir } from "../data-dir.mjs";
@@ -45,6 +45,7 @@ export function classifyPidIdentity(pid, deps = {}) {
const run = deps.execFileSync || execFileSync;
try {
let commandLine;
let argv = null;
if (platform === "win32") {
// Pid goes in by env, never into the script (Hard Rule #13). One retry:
// a cold PowerShell start can time out once.
@@ -78,9 +79,11 @@ export function classifyPidIdentity(pid, deps = {}) {
} else {
const read = deps.readFileSync || ((file) => readFileSync(file, "utf8"));
commandLine = String(read(`/proc/${pid}/cmdline`));
// NUL-separated argv; process.title rewrites it in place and pads it with NUL bytes.
argv = commandLine.split("\0").filter(Boolean);
}
// process.title rewrites cmdline in place and pads it with NUL bytes.
return OMNIROUTE_COMMAND.test(String(commandLine).replaceAll("\0", " ")) ? "ours" : "foreign";
const isFile = deps.isFile || isRegularFile;
return commandIdentity(argv ?? splitCommandLine(String(commandLine)), argv === null, isFile);
} catch (err) {
// No /proc/<pid> entry while procfs is mounted: the process is gone, so
// there is nothing to signal. Without procfs, "gone" cannot be told from
@@ -90,8 +93,115 @@ export function classifyPidIdentity(pid, deps = {}) {
}
}
// Install dirs like "omniroute-main" or "my-omniroute" are legitimate, so match the substring.
function isRegularFile(file) {
try {
return statSync(file).isFile();
} catch {
return false;
}
}
// Install dirs like "omniroute-main" or "my-omniroute" are legitimate, so match the substring,
// but only in the executable, the script a JS runtime runs, or the process title ("omniroute
// (v16.2.9)" is argv[0] after the rename). An argument such as --log=/tmp/omniroute.log proves
// nothing about the process.
const OMNIROUTE_COMMAND = /omniroute/i;
const JS_RUNTIME = /(?:^|[\\/])(?:node|nodejs|bun)(?:\d+(?:\.\d+)*)?(?:\.exe)?$/i;
const EXECUTABLE_END = /(?:^|[\\/])(?:(?:node|nodejs|bun)(?:\d+(?:\.\d+)*)?|[^\\/]+\.exe)$/i;
const SCRIPT_END = /\.[cm]?[jt]s$/i;
// Runtime options that take their value as the next argument.
const RUNTIME_VALUE_OPTIONS = new Set([
"-r",
"--require",
"--import",
"--loader",
"--experimental-loader",
"--preload",
"-C",
"--conditions",
"--env-file",
"--title",
"--input-type",
]);
// Bare runtime options known to take no separate value. Exact names only: no prefix is safe
// (--trace-event-file-pattern, --experimental-sea-config and --inspect-port all take one), and
// any other bare option may take the next token as its value, so what follows it cannot be
// proven to be the script. `--opt=value` forms carry their value and are always skipped.
// OmniRoute spawns itself with --dns-result-order=, --max-old-space-size= (both `=` forms),
// --import / --preload <path> (RUNTIME_VALUE_OPTIONS) and --no-warnings (plugins/loader.ts).
const RUNTIME_FLAGS = new Set([
"--no-warnings",
"--enable-source-maps",
"--no-deprecation",
"--trace-warnings",
"--trace-deprecation",
"--trace-uncaught",
"--throw-deprecation",
"--expose-gc",
"--smol",
]);
const RUNTIME_INLINE_CODE = /^(?:-e|-p|-pe|-ep|--eval|--print)(?:=|$)/;
// macOS ps and Windows CommandLine give one string. Double quotes group an argument.
function splitCommandLine(commandLine) {
const tokens = [];
for (const match of commandLine.trim().matchAll(/"([^"]*)"?|(\S+)/g)) {
tokens.push({ value: match[1] ?? match[2], quoted: match[1] !== undefined });
}
return tokens;
}
// An unquoted path with a space ("C:\Program Files\nodejs\node.exe", "/Users/me/Application
// Support/node") arrives as several tokens, but so does a path followed by an argument
// ("/srv/other/server omniroute.js"). Joining is a guess, so it fails closed: a joined path counts
// only when it is a real file and no shorter candidate (the first token alone included) is one.
// Anything else is `ambiguous`. When no join reaches a recognised end (`isEnd`), the first token
// stands alone: it is a prefix of the real path, so a match in it is still sound.
function joinPathTokens(tokens, start, isEnd, joinable, isFile) {
const first = tokens[start];
const single = { value: first.value, next: start + 1, ambiguous: false };
if (!joinable || first.quoted || isEnd(first.value)) return single;
const shorter = [first.value];
let value = first.value;
for (let k = start + 1; k < tokens.length; k++) {
const token = tokens[k];
if (token.quoted || /^(?:[-/\\]|[A-Za-z]:)/.test(token.value)) break;
value += ` ${token.value}`;
if (isEnd(value)) {
const proven = isFile(value) && !shorter.some((candidate) => isFile(candidate));
return { value, next: k + 1, ambiguous: !proven };
}
shorter.push(value);
}
return single;
}
// `joinable`: the tokens came from a space-joined string, not an exact argv.
function commandIdentity(rawTokens, joinable, isFile) {
const tokens = rawTokens.map((t) => (typeof t === "string" ? { value: t, quoted: false } : t));
if (tokens.length === 0) return "foreign";
const exe = joinPathTokens(tokens, 0, (v) => EXECUTABLE_END.test(v), joinable, isFile);
if (exe.ambiguous) return "unknown";
if (OMNIROUTE_COMMAND.test(exe.value)) return "ours";
if (!JS_RUNTIME.test(exe.value)) return "foreign";
for (let i = exe.next; i < tokens.length; i++) {
const arg = tokens[i].value;
// Inline code (-e/-p) has no script file to prove anything.
if (RUNTIME_INLINE_CODE.test(arg)) return "foreign";
if (arg === "--") {
if (i + 1 >= tokens.length) return "foreign";
i++;
} else if (arg.startsWith("-")) {
if (RUNTIME_VALUE_OPTIONS.has(arg)) i++;
else if (!arg.includes("=") && !RUNTIME_FLAGS.has(arg)) return "unknown";
continue;
}
const script = joinPathTokens(tokens, i, (v) => SCRIPT_END.test(v), joinable, isFile);
if (script.ambiguous) return "unknown";
return OMNIROUTE_COMMAND.test(script.value) ? "ours" : "foreign";
}
return "foreign";
}
// The pid in a pid file, or null when none can be signalled safely. A dead pid
// is still returned so callers keep their stale-file handling; a live pid that

View File

@@ -15,14 +15,19 @@ import { isRequireApiKeyValueEnabled } from "../../../src/shared/utils/requireAp
* environment can still set every key.
*
* A key is listed only when no value it accepts can load code, pick a file,
* name a remote host, change TLS or relax a security policy. Values are
* checked too: ports must be numbers, and locale and time zone names may not
* be paths. The ports still decide which local port the CLI talks to, and so
* which local listener gets the API key, the context token and the CLI
* machine token (`x-omniroute-cli-token`).
* name a remote host, pick a local listener, change TLS or relax a security
* policy. Values are checked too: locale and time zone names may not be paths.
*
* PORT, API_PORT and DASHBOARD_PORT are deliberately NOT listed. Without a
* base URL from a higher-precedence source the CLI talks to
* `http://localhost:<PORT>`, and it attaches the API key, the context token
* and the CLI machine token (`x-omniroute-cli-token`) to any loopback
* destination without checking which process listens there. A port from this
* file would let it hand those credentials to a listener of its choosing
* (CodeRabbit I6, CWE-522). The shell, the data-dir `.env` and `--port` can
* still set the ports.
*/
const PORT_VALUE = /^[0-9]{1,5}$/;
// Locale names such as `en_US.UTF-8` or `de_DE@euro`. glibc reads a name that
// contains a slash as a path to locale files, so slashes are not allowed.
const LOCALE_VALUE = /^[A-Za-z0-9_.@-]{1,64}$/;
@@ -34,22 +39,11 @@ const LOCALE_LIST_VALUE = /^[A-Za-z0-9_.@:-]{1,64}$/;
// That also rejects the `:Area/City` form and POSIX rules with `,` or `<>`.
const TZ_VALUE = /^[A-Za-z0-9_+-][A-Za-z0-9_+/-]{0,63}$/;
const FLAG_VALUE = /^[A-Za-z0-9]{0,16}$/;
function isPort(value) {
if (!PORT_VALUE.test(value)) return false;
const n = Number(value);
return n >= 1 && n <= 65535;
}
const PORT_RULE = { check: isPort, expected: "a port number from 1 to 65535" };
const LOCALE_RULE = { check: (v) => LOCALE_VALUE.test(v), expected: "a locale name" };
const FLAG_RULE = { check: (v) => FLAG_VALUE.test(v), expected: "up to 16 letters or digits" };
/** Allowed keys, each with the check its value must pass. */
const ALLOWED = new Map([
// The local ports the server listens on and the CLI talks to.
["PORT", PORT_RULE],
["API_PORT", PORT_RULE],
["DASHBOARD_PORT", PORT_RULE],
// The parser the server gate uses, so the file can turn enforcement on but
// never off, and a value that already turned it on is not dropped on upgrade.
["REQUIRE_API_KEY", { check: isRequireApiKeyValueEnabled, expected: "true, 1 or yes" }],
@@ -78,8 +72,8 @@ export function isPlainEnvKey(key) {
/**
* Why a `.env` in the working directory may not set `key` to `value` (the
* parsed value), or null when it may. Names must match exactly: on Linux and
* macOS `port=` sets a variable nothing reads, and on Windows it would set
* PORT, so a name in another case is skipped on every platform.
* macOS `tz=` sets a variable nothing reads, and on Windows it would set
* TZ, so a name in another case is skipped on every platform.
*
* - `{ kind: "name" }`: not an allowed key.
* - `{ kind: "case", name }`: an allowed key written in another case.

View File

@@ -1 +0,0 @@
- **feat(video):** connect consented Video Bridge frame drill-down to the request path — already-derived JPEG frames are published through a shared tenant-bound lifecycle only with explicit operator and authenticated per-part consent (raw videos stay out of retention); JSON/SSE responses return bounded opaque handles, Video settings expose independent retention/remote-read controls and aggregate-only usage, and authenticated preview/standard/detail reads, isolated idempotent deletion, cancellation, TTL/quota cleanup and actual-content variant provenance are supported with bounded queries, sanitized errors and the 32 MiB serialized response limit. Defaults remain off; real-model promotion and deployment require separate evidence ([#16074](https://github.com/diegosouzapw/OmniRoute/pull/16074)).

View File

@@ -1 +0,0 @@
- **fix(providers):** treat TypeSafe (Jev) as a decisions-only provider: a chat request routed to `typesafe` now fails fast with HTTP 400 pointing at `POST /v1/systemone` instead of falling through to the default executor (which targets the OpenAI endpoint with the TypeSafe key), imported or discovered TypeSafe models are never classified as chat models, and Jev aliases get an input-only default price ([#14498](https://github.com/cheaper-inference/OmniRoute/pull/14498), [#13987](https://github.com/cheaper-inference/OmniRoute/issues/13987)) — thanks @seanford

View File

@@ -1 +0,0 @@
- **feat(systemone):** `POST /v1/systemone` can serve `ollama-local/<model>` decisions models on the local Ollama of the existing `ollama-local` connection (its base URL, default `http://localhost:11434/v1`, never a request field), with Ollama's own limits checked before any upstream call (2–26 candidates per choice/score question, at most 64 questions, no chat sampling fields, raw base64 images only, 64 KiB / 32 MiB body cap); opt-in through the `SYSTEMONE_OLLAMA_LOCAL_BACKEND_ENABLED` feature flag (default off) ([#14667](https://github.com/diegosouzapw/OmniRoute/pull/14667)) — thanks @PixmaNts

View File

@@ -1 +0,0 @@
- **feat(api-keys):** `/v1/me/status` now reports today's and this week's USD, request and token usage, a `limits[]` list covering every per-key limit (daily/weekly USD usage limits, budgets, token limits, key quota) measured on its own enforcement window, and masked account labels plus cache-first `accountQuotas` limited to the connections the key can reach and the providers the admin chose to share. The endpoint also accepts `x-api-key`. A per-key `anthropicRateLimitHeaders` mode (`auto` / `forward` / `strip`) controls whether pooled accounts' `anthropic-ratelimit-*` and `anthropic-organization-id` headers reach the client; `auto` forwards them only for keys pinned to one shared connection. The API manager gains the matching controls and a per-key details page with usage, limits, account quotas and editors for token limits and key quota ([#14771](https://github.com/diegosouzapw/OmniRoute/pull/14771)).

View File

@@ -1 +0,0 @@
- **feat(usage):** attribute proxied requests to coding-agent sessions and projects for team usage reporting, recording session token counters, priced cost, working directory, and project repo ([#14833](https://github.com/diegosouzapw/OmniRoute/pull/14833)) — thanks @fouadSalkini

View File

@@ -1 +0,0 @@
- **feat(api):** add `/v1/me/sessions` self-service API key endpoints to list and inspect agent sessions with project, client, date, and sorting filters ([#14840](https://github.com/diegosouzapw/OmniRoute/pull/14840)) — thanks @fouadSalkini

View File

@@ -1 +0,0 @@
- **feat(api):** per-key `anthropicRateLimitHeaders` policy to forward or strip upstream Anthropic account-identity and quota headers on both streaming and non-streaming responses, preserving legacy forwarding by default ([#14862](https://github.com/diegosouzapw/OmniRoute/pull/14862)) — thanks @fouadSalkini

View File

@@ -1 +0,0 @@
- **feat(chatgpt):** Add the official "Sign in with ChatGPT" provider (`chatgpt`): dynamic registration with PKCE, live account model discovery, inference through the public Responses API and refresh with `earliest_refresh_at` — separate from `codex` and `chatgpt-web`. Routing fails closed to the registration that advertises the model; the ChatGPT catalog keeps its own owner and never inherits Cursor `auto*` aliases. ([#15201](https://github.com/diegosouzapw/OmniRoute/pull/15201) — thanks @JxnLexn)

View File

@@ -1 +0,0 @@
- **feat(routing):** new `jev` combo strategy — you order the providers, one TypeSafe System One `choice` call admits the winner plus up to 4 fallbacks (options at or above 0.15 confidence) for each request; a missing key, timeout or low confidence falls open to your own order, live session pins skip the call, and the combo editor shows a privacy note because the latest user message is sent to TypeSafe. The TypeSafe call is opt-in through the `COMBO_JEV_STRATEGY_ENABLED` feature flag (default off): a stored TypeSafe key alone never sends traffic, and with the flag off a jev combo keeps your order ([#15279](https://github.com/diegosouzapw/OmniRoute/pull/15279)) — thanks @miguelenes

View File

@@ -1 +0,0 @@
- **feat(sse):** Agentic pipelines detect repeated tool rounds with unchanged, call-matched results and consecutive failed rounds across native protocols, then return control to the planner. Incomplete or ambiguous parallel rounds do not falsely stop execution ([#15420](https://github.com/diegosouzapw/OmniRoute/pull/15420)) — thanks @potatosips.

View File

@@ -1 +0,0 @@
- **feat(sse):** Agentic pipelines support opt-in context compaction with per-model character budgets for the planner and each executor fallback, preserved instructions and active tool boundaries, and pre-dispatch oversize rejection. Exact incremental size accounting avoids repeated whole-history serialization; structured screenshot results remain intact ([#15421](https://github.com/diegosouzapw/OmniRoute/pull/15421)) — thanks @potatosips.

View File

@@ -1 +0,0 @@
- **feat(intelligence):** the `models_dev_tier` intelligence source is now persisted (rebuilt after every capabilities sync and on demand via `POST /api/intelligence/sync {"rebuildTier": true}`), `user_override` entries get a management-authed `POST`/`DELETE /api/intelligence/overrides` API, and `GET /api/intelligence/sync` reports per-source health in `sourcesDetail` ([#15906](https://github.com/cheaper-inference/OmniRoute/pull/15906) — thanks @pizzav-xyz)

View File

@@ -1 +0,0 @@
- Add an explicit per-account Codex quota query beside Quota, available even when quota details are hidden, without consuming reset credits. Distinguish current, partial, stale and failed observations; prevent duplicate requests and reconcile the account list without claiming that a cooldown was released. Backend recovery diagnostics and automatic recovery validation remain separate work for #16161.

View File

@@ -1 +0,0 @@
- **feat(dashboard):** set a model's context window when adding a custom model and from the catalog model list of native providers, so a model whose window the catalog does not know yet no longer falls back to 128k; a context-only override no longer turns a catalog model into a custom one ([#16178](https://github.com/diegosouzapw/OmniRoute/pull/16178))

View File

@@ -1 +0,0 @@
- **feat(usage):** report provider-reported cache-read tokens in usage analytics and retained daily summaries, with partial-coverage indicators for legacy or filtered history while preserving billing calculations ([#16452](https://github.com/diegosouzapw/OmniRoute/pull/16452)) — thanks @KiaroSama

View File

@@ -1 +0,0 @@
- **feat(proxy):** report per-proxy and aggregate application-payload upload and download traffic, including retry attempts and incomplete transfers, without presenting payload counts as wire traffic or billing measurements ([#16455](https://github.com/diegosouzapw/OmniRoute/pull/16455)) — thanks @KiaroSama

View File

@@ -1 +0,0 @@
- **feat(gemini-web):** add opt-in `gemini-4-argon` model support to the `gemini-web` provider registry with UI mode selection and verification descriptor; off by default until its selectors are checked live, enable with `OMNIROUTE_GEMINI_WEB_ARGON_ENABLED=1` ([#16573](https://github.com/diegosouzapw/OmniRoute/pull/16573))

View File

@@ -1 +0,0 @@
- Use registered local-provider URLs for model discovery and synchronized embedding routes, and align Docker Model Runner's default with its engine-neutral OpenAI endpoint. Docker Model Runner embedding requests now accept keyless connections while preserving configured credentials and per-model capability checks. (#16670)

View File

@@ -1 +0,0 @@
- **feat(systemone):** `POST /v1/systemone` can serve TypeSafe Jev and Cloudflare Clef / Clef-flash on Cloudflare Workers AI through the existing `cloudflare-ai` connection (`cloudflare-ai/jev`, `cloudflare-ai/clef`, `cloudflare-ai/clef-flash`, alias `cf/`), as a new `systemOneRegistry` backend, opt-in through the `SYSTEMONE_CLOUDFLARE_BACKEND_ENABLED` feature flag (default off) ([#16676](https://github.com/diegosouzapw/OmniRoute/pull/16676)) — thanks @xiaoyaner0201

View File

@@ -1 +0,0 @@
- feat(codex): add global and per-connection Ultrafast defaults scoped to GPT-6 Astra and GPT-6.1 Sol, while preserving explicit request and API-key precedence. (#16678)

View File

@@ -1 +0,0 @@
- **feat(mitm):** Antigravity MITM can map Claude Sonnet 5.5 / Opus 5.5 (low/medium/high tiers) to OmniRoute routes ([#16709](https://github.com/diegosouzapw/OmniRoute/pull/16709)) — thanks @lmortezal

View File

@@ -1 +0,0 @@
- **feat(images):** Antigravity image edits accept multiple reference images (data URL or raw base64; remote URLs stay rejected), each forwarded as its own inline part; invalid references fail fast with a 400 and text-only answers surface as an error ([#16731](https://github.com/diegosouzapw/OmniRoute/pull/16731)) — thanks @yheiakadylan

View File

@@ -1 +0,0 @@
- **feat(resilience):** dashboard editor for operator error cooldown rules, optional status/match conditions, and an opt-in per-provider catch-all cooldown that never shortens a longer upstream Retry-After/reset hint ([#16734](https://github.com/diegosouzapw/OmniRoute/pull/16734)) — thanks @zyizyiz

View File

@@ -1 +0,0 @@
- **feat(dashboard):** "New models" inbox — model sync records each provider's listing (first sync seeds a baseline) and the Providers toolbar shows newly added models with an unread badge, grouped by provider, with mark-as-read ([#16864](https://github.com/diegosouzapw/OmniRoute/pull/16864)) — thanks @ErfanBagheri404

View File

@@ -1 +0,0 @@
- **feat(providers):** `opencode-server` provider — a native executor for the opencode CLI's local headless server (`opencode serve`) that translates OpenAI chat/Responses requests to opencode sessions/parts with streaming, tool-call envelope support; the server is started from the dashboard (local-only `/api/services/opencode-server/{status,start,stop}`) or with `opencode serve`, never from a chat request; only the server URL is a dashboard setting, the CLI binary is env-only (`OPENCODE_SERVER_BIN`) and the spawned server gets a minimal environment; it speaks the opencode v1 server API, and an opencode 2.x server is detected and answered with a clear "unsupported opencode server version" error instead of being treated as healthy ([#16995](https://github.com/cheaper-inference/OmniRoute/pull/16995)) — thanks @cmbergamo

View File

@@ -1 +0,0 @@
- **feat(providers):** Added EmpirioLabs AI (`empiriolabs`) as an OpenAI-compatible API-key provider (`https://api.empiriolabs.ai/v1`), with live model discovery limited to chat models and API key checks against the authenticated `/v1/account/usage` endpoint ([#17209](https://github.com/cheaper-inference/OmniRoute/pull/17209), [#19316](https://github.com/cheaper-inference/OmniRoute/pull/19316)) — thanks @Adam-Dalloul

View File

@@ -1,4 +0,0 @@
- **feat(providers):** add the MiniMax Code provider — OmniRoute can now route chat completions through the managed MiniMax subscription gateway under the `minimax-code` / `mmcode` alias. The gateway path reads the local refresh token of the user's own MiniMax Code profile (`~/.minimax/auth/prod/<region>/mcode-public/auth.json`) and rewrites the auth files of that profile when the account rotates the credential, so the CLI and the local agent pick the rotated credential up on their next session; OmniRoute does not persist a separate provider credential in its connection database. The transport speaks the native tool protocol, so a request that carries client tools comes back as `tool_calls` for the client to execute, and a refusal of the gateway keeps its own status instead of being renamed into an outage of the model ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
- **feat(oauth):** the MiniMax Code provider can now be signed in from the dashboard — the provider page offers the MiniMax account device-code flow (RFC 8628 + S256-PKCE), the panel shows the verification URL and the code to confirm, and the credential that comes back is written into the local MiniMax Code profile, so the CLI and the local agent pick it up on their next session; the dashboard connection row stores no access or refresh token; the provider itself stays a no-auth provider: the dashboard connection is the account entry, the local profile is the credential ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
- **fix(sse):** refuse an oversized MiniMax Code request with a request-scoped 413 — a request that did not fit the ceiling of the managed gateway was refused with a status that the combo layer renamed into a 502, and a 502 is in the model-lockout list, so one request that was too large took the MiniMax leg out of every combo for minutes and the next request answered 503; the refusal is now a 413 marked `invalid_request_error`, which is a property of the request and never of the model ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
- **fix(sse):** the MiniMax Code executor answers 499 while the instance is draining — a graceful shutdown tears the transport down under the requests that are still in flight, so the failure is evidence about our own shutdown and not about the health of the provider, but a 502 said the opposite: it is in the model-lockout list and in the provider-breaker list, and it is not exempt from the connection cooldown, so the account was written as `unavailable` with a `rateLimitedUntil` into the `provider_connections` table — a state that outlives the restart; the answer during a drain is now 499, the status an aborted caller already gets, which carries `client_disconnected` and is exempt from that cooldown ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))

View File

@@ -1 +0,0 @@
- **feat(usage):** Preserve provider-reported 5-minute and 1-hour cache-write tiers through response translation, call logs, and Cache Health diagnostics; keep legacy unknown tiers explicit and existing quota deductions unchanged; translated Claude and OpenAI usage now also carries `usage.cache_creation` (additive) ([#17307](https://github.com/diegosouzapw/OmniRoute/pull/17307)) — thanks @xiaoyaner0201

View File

@@ -1 +0,0 @@
- **feat(combo):** new `expiry-first` combo routing strategy (the 21st) — orders targets by the provider-level expiry-first salvage score, using the quota window of the model family each target spends, with a relative tie band and priority order kept for targets without quota telemetry ([#17829](https://github.com/cheaper-inference/OmniRoute/pull/17829)) — thanks @HouMinXi

View File

@@ -1 +0,0 @@
- **feat(search):** Keenable web search and fetch provider (`keenable-search`, alias `keenable`): keyless by default, with an optional API key that only lifts the per-IP rate limits. Serves `/v1/search` (web only, fallback-only so it never displaces a configured paid provider) and `/v1/web/fetch` (Markdown only, capped at 100,000 characters) ([#17920](https://github.com/diegosouzapw/OmniRoute/pull/17920)) — thanks @ilya-bogin-keenable

View File

@@ -1 +0,0 @@
- **feat(search):** Add `codex-search` (alias `codex_search`) for web/news search through connected Codex (ChatGPT) accounts. A request that names `codex-search` uses it directly; automatic selection is opt-in behind the `CODEX_SEARCH_AUTO_FALLBACK_ENABLED` flag (default off), which keeps configured search providers first and tries Codex before keyless fallbacks while preserving other providers' order, API-key connection scopes and REST provider blocks. Parse bounded SSE responses into source-grounded rows and log upstream tokens/search counts. Search failures only apply an in-memory search-specific backoff, capped at 60 seconds; they never change shared chat-account health. Searches consume subscription quota, use a 60-second default timeout unless explicitly configured otherwise, and treat time/domain constraints as hints. A search-locked account is skipped in favour of another provider rather than another Codex account. ([#17933](https://github.com/cheaper-inference/OmniRoute/pull/17933)) — thanks @xiaoyaner0201

View File

@@ -1 +0,0 @@
- Add `POST /api/keys/import` to register caller-supplied API keys with create-key policies, atomic duplicate checks, non-mutating UUID retries, management authentication, and masked responses without restoring unrelated configuration ([#18010](https://github.com/cheaper-inference/OmniRoute/pull/18010)) — thanks @xiaoyaner0201.

View File

@@ -1 +0,0 @@
- **Dots Studio tool-call markup**: `<dots_function_call>` text blocks (structured `<invoke>` or pure JSON) are converted into real tool calls in the Claude stream translator and the OpenAI response sanitizer, accepting both OpenAI-shaped and Anthropic-shaped client tools (including tools declared without a schema). On the Claude stream an unfinished block, or an opener split mid-tag across chunks, is held back until it completes; on the OpenAI leg the scrub covers non-streaming responses only (streamed OpenAI deltas are passed through unchanged) (#18024).

View File

@@ -1 +0,0 @@
- **feat(providers):** RenderHour provider for images, video and speech — sign in with a RenderHour subscription (OAuth PKCE, paid in plan credits) or paste an `rh_…` API key (paid from the dollar balance); models as `renderhour/<model>` ([#18103](https://github.com/cheaper-inference/OmniRoute/pull/18103) — thanks @sha367)

View File

@@ -1 +0,0 @@
- **feat(providers):** MegaBrain as a dual-auth provider (`megabrain` / `mb`): sign in with a MegaBrain account through Kilo's device-code flow on `api.getmegabrain.com` or paste `mb-v1-…` API keys; requests carry `X-KILOCODE-FEATURE: omniroute` so they run on the account's plan (session and weekly limits, shown in Provider Limits), and a 403 for a model the account cannot pay for (`plan_tier_required`, `extra_usage_off`) locks only that model instead of banning the connection ([#18129](https://github.com/diegosouzapw/OmniRoute/pull/18129))

View File

@@ -1 +0,0 @@
- **feat(providers):** add an Import auth modal to the Antigravity CLI (`agy`) provider page: loopback-only 1-click import of the local CLI login (`AGY_TOKEN_FILE`, Linux keyring, `~/.gemini/antigravity-cli/` and AgentControl profiles), single token file/paste and bulk JSON import ([#18181](https://github.com/cheaper-inference/OmniRoute/pull/18181)) — thanks @ziuus

View File

@@ -1 +0,0 @@
- **feat(plugin):** render picker names as `Provider - Model` with a leading free icon, the free-tier budget kept as a `· 1M tokens/month` suffix, the editor of an explicit `Editor: Model` name in trailing parentheses, and `combo - slug` for combos. Behavior change: `providerTag` no longer removes the provider prefix (the provider is now always shown); `providerTag: false` only drops the editor parenthesis, and configs that matched entries by their old exact name need updating ([#18230](https://github.com/cheaper-inference/OmniRoute/pull/18230)) — thanks @maxmad64bis

View File

@@ -1 +0,0 @@
- **feat(providers):** GitHub Copilot embeddings (`github/text-embedding-3-small`, `github/text-embedding-ada-002`) through the Copilot API with the exchanged Copilot token, refreshed before dispatch ([#18291](https://github.com/cheaper-inference/OmniRoute/pull/18291)) — thanks @AppleVibe, @tmaarcxs

View File

@@ -1 +0,0 @@
- **feat(providers):** the Grok CLI catalog now lists `grok-4.7-build-fast` (Grok 4.7 on Grok Build's faster lane, 500k window, low–xhigh efforts) and `grok-code-fast-1`, both accepted by the Grok Build proxy but missing from the static catalog that the pickers fall back to before live discovery runs ([#18318](https://github.com/cheaper-inference/OmniRoute/pull/18318)) — thanks @cristianob

View File

@@ -1,6 +0,0 @@
- **feat(dashboard):** the "Import only free models" option now also works on OpenAI/Anthropic-compatible nodes. It keeps only models that the endpoint's own `/models` list marks as free and that have no paid signal; models without free evidence are never imported as free ([#18320](https://github.com/cheaper-inference/OmniRoute/pull/18320)) — thanks @IlyaKhalafi / @maryasov
- **fix(providers):** positive discovery prices and explicit paid flags override free catalog entries and Free badges, and remain available through named-provider discovery, cache, and model sync (Refs #17028).
- **fix(providers):** retire five unconditionally free Ollama Cloud entries after checking current model prices, document seven free offers with their eligibility limits, and expose Requesty's NVIDIA trial training restriction (Refs #17028).
- **fix(providers):** stop advertising OpenCode-only free offers as generally available through the proxy, including cached Free badges, while keeping the provider and normal imports available and leaving uncertain pricing unclassified. Existing free-only connections retain their preference and an explicit opt-out control (Refs #17028).
- **fix(providers):** remove static free grants for retired Ollama DeepSeek V4 Flash, Ollama GLM5.1 and Tencent Hunyuan Pro, while preserving normal model imports (Refs #17028).
- **fix(providers):** remove static free grants for AINative’s retired `nous-coder` alias and Enterprise-tier `deepseek-r1`, preserving normal imports (Refs #17028).

View File

@@ -1 +0,0 @@
- **feat(dashboard):** the Quota Tracker provider order now follows the operator across browsers (saved as `settings.quotaProviderOrder` through `PATCH /api/settings`, with local storage kept as the cache), and the Full layout's provider sections get the same drag grips and "Restore default order" action as the overview; display-only, connection priority is never touched ([#18344](https://github.com/cheaper-inference/OmniRoute/pull/18344)) — thanks @ape1121

View File

@@ -1 +0,0 @@
- **feat(usage):** The Cursor Quota card shows per-model API tokens (input, output, cache read/write) and the cost Cursor billed for the current cycle, fetched fail-open so the existing % bars render unchanged when that call fails ([#18346](https://github.com/cheaper-inference/OmniRoute/pull/18346)) — thanks @AMSeify

View File

@@ -1 +0,0 @@
- **feat(dashboard):** "Quota check" toggle for OpenAI- and Anthropic-compatible nodes reads a standard `/credits` balance into Provider Limits; `anthropic-compatible-*` keys now use the configurable quota fetcher, which goes through the SSRF-guarded outbound fetch ([#18350](https://github.com/cheaper-inference/OmniRoute/pull/18350)) — thanks @MWGE22629

View File

@@ -1 +0,0 @@
- **feat(audio):** Cloudflare Workers AI Deepgram Nova-3 transcription (`cf/@cf/deepgram/nova-3`) with opt-in speaker diarization and `verbose_json` words, per-speaker segments and `num_speakers` ([#18352](https://github.com/cheaper-inference/OmniRoute/pull/18352)) — thanks @LeandroTechify

View File

@@ -1 +0,0 @@
- **feat(providers):** custom JSON API provider nodes — an OpenAI-compatible node with `apiType: "custom-json"` fills a JSON request template (`{{prompt}}`, `{{messages}}`, `{{model}}`, `{{request.<path>}}`; substitution only) for any JSON business endpoint, reads the reply from a response path and returns it in the client's format; business requests are never replayed (no retry, no account or combo fallback). API-only for now, see `docs/guides/CUSTOM_JSON_API.md` ([#18353](https://github.com/cheaper-inference/OmniRoute/pull/18353)) — thanks @lyccccy

View File

@@ -1 +0,0 @@
- **feat(providers):** add ParalonCloud API-key provider (chat + embeddings) ([#18356](https://github.com/cheaper-inference/OmniRoute/pull/18356)) — thanks @robertjitaru

View File

@@ -1 +0,0 @@
- **feat(dashboard):** the OpenAI-compatible Add and Edit provider modals offer the **Custom JSON API** type — HTTP method, auth (bearer, API key header or none), a request-template editor with simple fields or full JSON, the response path and a "Send test request" button — validated in the browser with the same schema the server uses ([#18359](https://github.com/cheaper-inference/OmniRoute/pull/18359)) — thanks @lyccccy

View File

@@ -1 +0,0 @@
- **feat(api-keys):** rolling 5-hour USD budget per API key, enforced next to the daily/weekly limits and reported on the API key endpoints ([#18362](https://github.com/cheaper-inference/OmniRoute/pull/18362)) — thanks @sajjadsaharkhan

View File

@@ -1 +0,0 @@
- **feat(services):** the in-memory session TTL is now configurable via `OMNIROUTE_SESSION_TTL_MIN` (minutes; default stays 15 and invalid values keep the default) ([#18394](https://github.com/cheaper-inference/OmniRoute/pull/18394)) — thanks @jjxyxsjr

View File

@@ -1 +0,0 @@
- **feat(dashboard):** Codex connections on the provider page show whether each one is a personal plan or a Business seat, with the ChatGPT workspace name ("· Business · <workspace>", role in the tooltip), and the plan badge reads "Business Pro Lite" instead of `self_serve_business_prolite`. The usage sync reads the workspace from ChatGPT's accounts endpoint at most once a week per connection, after a successful usage fetch and with a 15 s timeout; until then the kind falls back to the plan type ([#18412](https://github.com/cheaper-inference/OmniRoute/pull/18412) — thanks @feci).

View File

@@ -1 +0,0 @@
- **feat(auto-combo):** the reset-aware no-quota floor score is now a per-combo config field (`resetAwareNoQuotaFloor`, default stays 0.5) instead of a hardcoded midpoint ([#18435](https://github.com/cheaper-inference/OmniRoute/pull/18435)) — thanks @jjxyxsjr

View File

@@ -1 +0,0 @@
- **feat(sse):** a `STREAM_READINESS_TIMEOUT` now says which failure shape it was: the result carries `anyByteAt` (null = the upstream went fully silent, not one raw byte; an epoch-ms value = transport alive with keepalive bytes but no content event) and the 504 response repeats it in an `X-OmniRoute-Any-Byte-At` header for external tooling. The timeout log line names the shape too. Pure telemetry — no routing or retry decision reads it.

View File

@@ -1 +0,0 @@
- **feat(providers):** add deAPI (`deapi`), an API-key media provider on its OpenAI-compatible gateway (oai.deapi.ai/v1) — image generation, text-to-speech, transcription, embeddings, and async video through a new `deapi-video-job` preset that downloads the key-gated `/v1/videos/{id}/content` result; the OpenAI-compatible speech path now forwards `instructions` when given ([#18593](https://github.com/cheaper-inference/OmniRoute/pull/18593)) — thanks @Pietrus-914

View File

@@ -1 +0,0 @@
- **feat(dashboard):** Costs > Pricing gets a Providers "Configured only" filter (providers with a connection, plus no-auth providers that are turned on), and a model search lists only the matching models under each provider ([#18651](https://github.com/cheaper-inference/OmniRoute/pull/18651))

View File

@@ -1 +0,0 @@
- **feat(dashboard):** "Needs verification (N)" status pill on the provider connections list that shows only the Antigravity accounts holding a stored Google verify-account link, so operators can work through `403 VALIDATION_REQUIRED` accounts one by one; hidden while no account needs verification ([#18662](https://github.com/cheaper-inference/OmniRoute/pull/18662)) — thanks @bufftop25

View File

@@ -1 +0,0 @@
- **feat(combo):** opt-in `OMNIROUTE_COMBO_MAX_DEADLINE_FAILURES` sub-budget terminates a combo with a clean 504 after N stream-readiness deadline failures instead of rotating every remaining target against a stalled upstream ([#18721](https://github.com/cheaper-inference/OmniRoute/pull/18721)) — thanks @jjxyxsjr

View File

@@ -1 +0,0 @@
- **feat(routing):** add endpoint-specific combo routes with independent targets, strategies and config for Chat, search/fetch, embeddings, rerank, images, video, music, OCR and audio surfaces. `/v1/search`, `/v1/web/fetch`, `/v1/music/generations`, `/v1/music`, `/v1/sound-generation` and `/v1/ocr` resolve saved combo names while preserving native response contracts, account pins and caller key scopes. Mixed combinations filter incompatible targets before credential selection. Related to #10274; fixes #17858.

View File

@@ -1 +0,0 @@
- **feat(translator):** per-node `thinkingReplay` capability declaration (`redacted`/`text`/`none`) on the `modelCompatOverrides` entry, settable through `PUT /api/provider-models`, overrides the provider-prefix assumption about replayed thinking shape — `text` forces plain `thinking` blocks for Claude-shape upstreams that reject `redacted_thinking`, `none` leaves replayed thinking untouched and keeps thinking enabled for upstreams that want no precursor ([#18739](https://github.com/cheaper-inference/OmniRoute/pull/18739)) — thanks @jjxyxsjr

View File

@@ -1 +0,0 @@
- **feat(vision):** opt-in `OMNIROUTE_IMAGE_NORMALIZATION` normalizes inline base64 images before dispatch (RGB, ≤4096px long edge, ~4MP, baseline JPEG/PNG) so Qwen2-VL-style vision pipelines stop 400ing or hanging on oversized/exotic images ([#18740](https://github.com/cheaper-inference/OmniRoute/pull/18740)) — thanks @jjxyxsjr

View File

@@ -1 +0,0 @@
- **feat(dashboard):** Costs > Pricing can compare one model across providers: a **View: Compare models** toggle lists each model with every provider offering it, input / output / cached price, cheapest first, unpriced offers marked as such; the Configured-only and Auth filters apply and variants stay on their own row ([#18775](https://github.com/cheaper-inference/OmniRoute/pull/18775), closes [#18642](https://github.com/cheaper-inference/OmniRoute/issues/18642))

View File

@@ -1 +0,0 @@
- **feat(providers):** Gemini AI Studio Lyria 3 models (`lyria-3-pro-preview`, `lyria-3-clip-preview`, `lyria-3.5`) are callable through `POST /v1/music/generations` instead of being advertised as music and rejected with `400 Invalid music model` ([#18797](https://github.com/cheaper-inference/OmniRoute/pull/18797)) — thanks @LuisAlejandro

View File

@@ -1 +0,0 @@
- **feat(gemini):** Pass an explicit per-image `media_resolution` (`low` through `ultra_high`) through the OpenAI to Gemini conversion as `Part.mediaResolution` for inline and remote images; opt-in, and `detail` keeps its meaning ([#18844](https://github.com/cheaper-inference/OmniRoute/pull/18844)) — thanks @Bl0ck154

View File

@@ -1 +0,0 @@
- **feat(dashboard):** the combo builder shows a Nadir settings section (API key, timeout, self-hosted base URL) when the router strategy is `nadir`, so a dashboard-built combo no longer needs hand-edited JSON or env vars to set `config.nadir` ([#18846](https://github.com/cheaper-inference/OmniRoute/pull/18846)) — thanks @doramirdor

View File

@@ -1 +0,0 @@
- **feat(providers):** add an opt-in schema-driven Fal gateway behind `FAL_NATIVE_ENABLED` (off by default): the `/v1/fal` routes, the `/api/providers/{id}/fal` schema routes, a Fal panel on the provider page and live catalog discovery, plus schema validation of Fal requests on the image, video and music routes. With the flag off, Fal requests keep their established shape, endpoint mapping and response format. ([#18849](https://github.com/cheaper-inference/OmniRoute/pull/18849)) — thanks @KiaroSama

View File

@@ -1 +0,0 @@
- **feat(executors):** Gzip request bodies of 4096+ characters sent to the official `api.anthropic.com`, as Claude Code 2.1.3xx does. Long agent sessions re-upload 0.5-10 MB of JSON each turn; it compresses 3-4x (gzip level 3: 3 MB in 27 ms). Skipped behind a proxy, TLS impersonation or `NODE_EXTRA_CA_CERTS`. A refused encoding (415, a non-Anthropic 400/403, or an origin JSON-parse 400) is resent uncompressed once and that origin stays uncompressed for one hour; ordinary API errors are never resent. Opt out with `OMNIROUTE_GZIP_REQUEST_BODIES=0`.

View File

@@ -1 +0,0 @@
- **feat(observability):** opt-in V8 heap pressure log: with `OMNIROUTE_HEAP_DIAGNOSTICS_ENABLED=1` the event-loop stall recorder logs heap, RSS and inflight numbers at most once a minute when `heapUsed` passes `OMNIROUTE_HEAP_DIAGNOSTICS_THRESHOLD_MB` (default 900) ([#19054](https://github.com/cheaper-inference/OmniRoute/pull/19054)) — thanks @Bl0ck154

View File

@@ -1 +0,0 @@
- **feat(usage):** Zed Hosted Models connections show the remaining USD credit on the Provider Limits page when the operator pastes the optional Orb billing portal link into the connection settings, stored as a credential (encrypted at rest, stripped from API responses) and displayed without affecting routing or connection parking ([#19065](https://github.com/cheaper-inference/OmniRoute/pull/19065)) — thanks @wray-lee

View File

@@ -1 +0,0 @@
- **feat(providers):** Upgrade the existing Microsoft 365 Copilot provider with work/school PKCE sign-in, account-safe reauthentication, the documented model catalog, single-generation emulated tools, bounded native turns, distinct model-licence and account-throttle handling, and Copilot safety refusals (`Disengaged`) surfaced as terminal provider safety stops rather than retryable upstream errors. Follow-up requests continue the same Copilot conversation: one that extends the previous reply exactly (same connection, model profile and tool set, unchanged history, and that reply's tool-call ids or text) sends only the new messages instead of opening a new conversation with the whole history, which is what Copilot's per-user thread throttle counts; anything doubtful starts fresh, and a content-less `InternalError` is re-sent once in a fresh conversation and otherwise surfaces as `m365_internal_error`. Continuations live in process memory, so a restart starts fresh conversations. Image input works like the web client: each image (data URL or public HTTPS URL) is uploaded into the turn's conversation and attached to the message, and a failed upload fails the request. `/v1/images/generations` serves `copilot-m365-web/m365-copilot-image` through Copilot's built-in image tool (one turn per image; the artifacts are downloaded with a Designer token minted from the sign-in's refresh token, and a used-up image budget is a 429). Answers keep their web sources: Copilot's inline citation markers become numbered links with `url_citation` annotations instead of leaking as private-use characters, and its reasoning summary is returned as `reasoning_content`. An expired or revoked sign-in is reported as `401 m365_unauthorized` instead of a generic connection failure, and Test Connection fails on an expired sign-in that nothing can refresh, while a signed-in connection's test renews an expired access token instead of answering "Provider test not supported". A refusal carrying `ReasoningTurnExhausted` (the per-account cap on Think deeper turns) is reported as `429 reasoning_turns_exhausted`, not as a model's priority access. The same refusal takes the other `gpt-5.5`/`gpt-5.6` Think deeper models out of rotation on that connection, so a combo does not spend a turn on each. Legacy HAR connections remain supported.

View File

@@ -1 +0,0 @@
- **feat(executors):** opt-in Bun relay (`OPENCODE_FREE_TIER_RELAY_URL`) and canonical OpenCode CLI prompt/tools for gated free-tier OpenCode requests, which the upstream otherwise answers with 429 FreeUsageLimitError to non-Bun clients; calls to injected CLI tools are filtered from the stream; plaintext `http://` relay URLs are accepted for loopback hosts only and a non-loopback relay bind requires `OPENCODE_FREE_RELAY_TOKEN` and a proxy allowlist ([#19128](https://github.com/cheaper-inference/OmniRoute/pull/19128)) — thanks @DavyMassoneto

View File

@@ -1 +0,0 @@
- **feat(skills):** opt-in `agent-sandbox` runtime for the skill sandbox — `execute_command` / `eval_code` can run in a remote Kubernetes sandbox (kubernetes-sigs/agent-sandbox warm pools, e.g. gVisor) instead of a local container; selected with `SKILLS_SANDBOX_RUNTIME=agent-sandbox`, never auto-detected

View File

@@ -1 +0,0 @@
- **feat(antigravity):** add opt-in, per-account Antigravity physical-send phase timing diagnostics without logging request content or credentials ([#19133](https://github.com/cheaper-inference/OmniRoute/pull/19133)) — thanks @Bl0ck154

Some files were not shown because too many files have changed in this diff Show More