Skip to content

Fork CI health: attention - #485

Merged
lab-agent-np[bot] merged 7 commits into
mainfrom
nplez1/issue-482
Nov 26, 2026
Merged

lab-agent-np[bot] merged 7 commits into
mainfrom
nplez1/issue-482

Conversation

@lab-agent-np

@lab-agent-np lab-agent-np Bot commented Nov 26, 2026

Copy link
Copy Markdown

Fixes #482

Summary

fork-performance-contracts was red on main at 767c078fde1 (run 45683322849, 2026-11-25). Only the windows-latest leg failed:

FAIL src/main/native-chat/agent-session-journal/journal-domain-operation-window.performance.test.ts
     > stops reading a long send family at its first member older than the newest turns
Error: Test timed out in 30000ms.

The test is upstream's, and reached main with the 2026-11-24 sync (1350 commits) — the 11-23 run of the lane was green only because the file was not here yet. Its fixture builds twelve SQLite chats of up to 500 turns (≈3,900 turns × 3 journal applies) in tmpdir(). That is 1.6 s on this Mac and 26.6–34.6 s on windows-2022, against Vitest's 30 s default: the same test on the same runner took 26,610 ms, 33,065 ms and 34,636 ms across three runs, so the cap was a coin flip. The contract counts rows returned to our code, never wall clock — the 30 s default is the only wall-clock budget in it.

The change, three files and +71/−2:

  • src/main/native-chat/agent-session-journal/journal-domain-operation-window.performance.test.ts — two closing }) become }, 120_000), on the test that failed and on the file's other fixture-heavy test, with a one-line reason above each (the fork's test-timeout-needs-reason ratchet requires one, and it is right to).
  • local/checks/host-mesh-upstream-seams.mjs — the six lines this costs in an upstream file are declared as a seam with a measured budget of 6, which is the register that keeps a fork hunk in upstream's tree visible and bounded.
  • LOCAL-PATCHES.md — the audit entry: symptom, measurements, anchors, upstream precedent, and what the next sync resolves.

Upstream made this exact call itself. Commit 7b6c852e2de (stablyai#47789), after our sync base, raises the same test to 120_000 with the comment "about 30s on a Windows runner; it counts work, not time". This PR takes that code line; the reason lives in LOCAL-PATCHES.md rather than in a fork comment above upstream's code (the fork's comment ratchet, 4764/4764 unchanged), and the entry records the one hunk the next sync will collide with and how to resolve it.

No allowlist was widened. Nothing was added to local/nightly-linux-known-red.json, local/unit-known-red.json or local/actions-enablement-contract.mjs; the tests still run on all three legs and still assert the same operation counts.

Verification

check result
pnpm tc passed (31 s, machine-queued)
pnpm exec vitest run --config config/vitest.performance.config.ts src/main/native-chat/agent-session-journal/journal-domain-operation-window.performance.test.ts --maxWorkers=2 7/7 passed, 4.6 s
pnpm run check:code-quality:changed 0 new findings across 3 changed files
orca-queue node local/gate-lint.mjs PASS — 54 green, 1 failing: 3 known red, 0 new; 55 steps; 92.6 s
node local/checks/host-mesh-upstream-seams.mjs --base origin/main 1 upstream file, 6 lines — all declared and within budget
node local/check-upstream-file-comments.mjs 4764/4764 lines, 0 stale entries
node config/scripts/static-analysis/ratchets/test-quality/check-flaky-test-pattern-ratchet.mjs OK — 126 grandfathered findings, 0 new
pnpm check:changed 26 of 27 green. The one failure, max-lines-ratchet, fails identically on a clean origin/main worktree (three rows allowlisted in local/lint-known-red.json for the lint gate) — pre-existing, unrelated to this diff, not fixed here

Unit gate: not required. The diff touches src/main/** (one test file), local/checks/** (fork tooling) and *.md — no global input (package.json, the lockfiles, config/**, a root tsconfig*.json, src/packages/**, src/shared/**, or anything outside the source/test/doc/fork-tooling trees).

The runner that reddened is the one that decides, so the lane was dispatched on this branch rather than trusted from a Mac:

  • run 45780910456 at 803bad1e65f — green on all three legs: ubuntu-24.04 1m51s, macos-15 3m45s, windows-2022 2m45s. The test that reddened took 26,610 ms and passed. That SHA is the last commit touching code or checks; the two commits after it edit LOCAL-PATCHES.md only.
  • run 45780202134 at 41a041bc6f2 — green on all three legs, the same test at 26,777 ms.
  • run 45779423920 at 12957a82e44 (the code commit alone) — green on all three legs, the same test at 34,636 ms.

Those three numbers are the measurement behind the fix: the same test, on the same runner, has taken 26.6 s, 33.1 s and 34.6 s — two of three over the old 30 s cap.

Decisions

  1. Fix at the timeout, not the fixture and not the product. The 20x is fixture IO on a hosted Windows runner; nothing in the product is slow (the read itself is ~6 ms of the 1.6 s local run). Shrinking upstream's fixture (500 → ~200 turns) would have cut the cost but weakened a contract this fork does not own, and the wall clock is not what the test asserts.
  2. Mirror upstream's own fix for the failing test (7b6c852e2de) instead of inventing a different mechanism. Upstream's maintainers reached for a per-test 120 s on exactly this test, which is the strongest available evidence about the right shape.
  3. Raise the file's other fixture-heavy test too — reads the newest turns…, which passed at 26,488 ms of its 30 s budget on the runner that failed its neighbour, and 18,920 ms of it on ubuntu-24.04. Upstream has not touched it. Left alone it is a red waiting for the next slightly slower runner, in this lane and in the nightly unit lane, which runs the same src/**/*.performance.test.* glob. A reviewer could call this scope creep; the alternative is a known 88%-of-budget flake.
  4. A reason comment above each bump, marked fork-comment-ok: rather than a plain comment. The fork's test-timeout-needs-reason ratchet refuses a per-test timeout without one — the right rule, since it is what stops a timeout bump from hiding a slow test — and the marker is the documented way to point at LOCAL-PATCHES.md without growing the comment ratchet (4764/4764 unchanged).
  5. Declare the six-line seam rather than move the test into a fork-owned module. The test cannot move: it is upstream's contract on upstream's code. Declaring it with a measured budget is what makes the divergence visible and bounded, and the budget only shrinks — after the next sync takes upstream's identical }, 120_000) and its comment, the second test costs nothing.
  6. No allowlist touched, no test skipped or quarantined, nothing disabled. Every assertion still runs on all three legs.
  7. Do not cherry-pick 7b6c852e2de. It is a bots feature (fix(bots): a thread's follow-up goes back to the thread it started in stablyai/orca#47789) touching product code; it will arrive with the next sync, bringing the byte-identical timeout line with it.
  8. Keep the perf project's 30 s default rather than raising testTimeout for all of config/vitest.performance.config.ts — that would have relaxed 30 contract files for one file's fixture cost.
  9. After merge, the health check clears on the newest run on main, and this lane's cron is every other day (15 9 */2 * *). So the post-merge step is gh workflow run fork-performance-contracts.yml --ref main rather than waiting for the clock; Fork CI health: attention #482 should close on that run's green, not on this PR's merge.

Noted, not fixed here (out of scope): pnpm check:changed is red on main for max-lines-ratchet — three rows that local/lint-known-red.json allowlists for the lint gate but the changed-checks gate reads raw.

Reviewed by claude/opus, high: R1 no blocking (1 should-fix + 3 minor + 2 nit, all fixed), R2 no blocking (1 should-fix, docs only, fixed), R3 clean (1 minor + 2 nits fixed).

@lab-agent-np

lab-agent-np Bot commented Nov 26, 2026

Copy link
Copy Markdown
Author

The gatekeeper did not merge (it never merges on a failed gate).

  • the PR conflicts with its base
  • mergeStateStatus=DIRTY: the PR has merge conflicts

… count

fork-performance-contracts reddened on main at 767c078 (run 45683322849):
the windows-latest leg timed out at 30s on
journal-domain-operation-window.performance.test.ts:377, while the other two
legs passed and the 11-23 run was green only because the file had not reached
main yet.

The contract counts rows returned, not time. Its fixture builds ten chats of up
to 500 turns in tmpdir(), which is 1.6s here and 33,065ms on windows-2022 —
Defender scans every write, so the per-turn cost is ~20x and no product code is
slow.

Two closing }) lines become }, 120_000): the failing test, which upstream fixed
the same way in 7b6c852 (stablyai#47789) after our sync base, and the file's other
fixture-heavy test, which passed by 3.5s on that runner (26,488ms of 30s on
windows-2022, 18,920ms on ubuntu-24.04) and is the slowest test in the lane.

No allowlist widened: both tests still run on all three legs and assert the
same counts. LOCAL-PATCHES.md carries the reason and the anchors.
…t demands

`pnpm check:changed` refused the two `}, 120_000)` lines: the fork's
`test-timeout-needs-reason` rule requires a reason comment directly above a
per-test timeout, and that rule is right — it is what stops a timeout bump from
hiding a slow test.

Each comment is one line marked `fork-comment-ok:`, so
`check-upstream-file-comments` stays at 4764/4764 rather than growing: the
reason belongs in LOCAL-PATCHES.md, and the marker is the documented way to put
the pointer above upstream's code.

Also corrects the entry from the review: twelve chats, not ten, and the Defender
explanation is stated as the likely cause rather than a measured one.
…ster requires

`gate-lint`'s `check-host-mesh-upstream-seams` refused the change: an
upstream-owned file the fork touches must be a declared seam with a measured
budget, so the surface a sync pays for stays visible instead of silent.

Budget 6 is what this costs today (two timeouts, two reason comments, two
replaced lines). It only shrinks: the next sync brings upstream's own
`}, 120_000)` and comment, after which our line there is identical.
…lide with

The delta review found the entry claiming the next sync "needs no decision": upstream
7b6c852 inserts its comment at exactly the spot our `fork-comment-ok:` line
occupies, so that hunk collides. The resolution is now written down: keep
upstream's comment, drop ours, keep the timeout.

The run evidence replaces the forward reference: run 45780910456 at 803bad1
is green on all three legs, the test that reddened taking 26,610 ms against
33,065 ms on the red run.
… by line

R3's minors: the entry credited only one of the two green dispatches, and the
line numbers are where the tests sat on the red run — they have moved. The
seam paragraph names the test it means instead of "the second".
main's #484 scoped `check-host-mesh-upstream-seams` to the host group's own
diffs: an undeclared upstream file is a note for any other feature, and only a
declared seam's budget fails hard either way.

This diff carries no hosts path, so the row was not required — and keeping it
would have put a hard budget on a test file that is not hosts work, so the next
branch to grow it would red the lint gate for a reason #484 exists to remove.
The register is main's file again; the entry records why, and its anchors are
the two `it(...)` titles.
…repeating them

R4's minors: the seam paragraph pointed at "the anchors below" when they sit above
it and repeated the allowlist paragraph's sentence; and the Verified paragraph
credited two of the three pre-rebase dispatches while saying three.

The run at 449bc7d — the rebased branch — is green on all three legs, the
test that reddened taking 26,170 ms.

Rebased again onto 8293fd7 (#471), which pruned the comment baseline by one:
the entry's 4764/4764 is now 4763/4763.
@lab-agent-np
lab-agent-np Bot merged commit 61e5367 into main Nov 26, 2026
16 checks passed
@lab-agent-np
lab-agent-np Bot deleted the nplez1/issue-482 branch November 26, 2026 08:44
nplez1 added a commit that referenced this pull request Nov 27, 2026
…o bound; the import above the bindings it precedes

The delta from the adversarial review of 9a0bd1b, all of it accuracy rather than behaviour:

- the static import moves up beside the other imports. Vitest hoists it either way, so this changes no
  runtime order — but leaving it below the `let` bindings it evaluates ahead of read as if it ran after
  them, and the mock factory now says why it must stay lazy.
- `testTimeout: 30_000` is the project default, so removing the `}, 20_000)` lines widens the budget to
  30s rather than removing it. The entry said the opposite twice.
- the shard's wall clock, not a claimed collect measurement: 102s against 103s on the green run before,
  which is the evidence that the 17s moved instead of vanishing.
- 4,828/4,828 fork comments in upstream files, measured, not #485's 4,763.
- test 1 covers both card styles; test 2 pins the default one.
- the warm-Mac numbers are the before-fix ones, and the six-line comment is two.

Also records the follow-up the review found unrecorded: the shard-timing overlay weighs this file at
3,894ms by a metric that excludes collection, so the next regeneration would drop it while the shard
still pays ~17s.
@nplez1 nplez1 mentioned this pull request Nov 27, 2026
@lab-agent-np lab-agent-np Bot mentioned this pull request Nov 27, 2026
lab-agent-np Bot added a commit that referenced this pull request Nov 27, 2026
* local(test): the merge-marker card test pays its module graph at load, not in a test budget

fork-main-tests reddened on main at 8308526 (run 45942815750, 2026-11-27): shard 17/24
failed `WorktreeCard.merge-marker.test.tsx` with "Test timed out in 20000ms" on the first test,
then a second, false failure 281ms later.

The cost is the card's module graph, not the assertions. The same file took 17,462ms on the same
runner the night before and passed (run 45758341047), while here it is 1.5s warm and the two tests
themselves are 20ms and 3ms. Each test did its own `await import('./workspace-card/surface/WorktreeCard')`,
so the cold transform was charged to that test's timeout: 20s against a 17.5s cost.

That is also what the second failure was. A timed-out test body is abandoned rather than cancelled,
so the first test's continuation ran during the second, left the module-level `settings` on the
experimental card style, and the metadata row the last assertion reads was never rendered — which is
why it failed in 281ms having just read the marker and the glyph as expected.

One static import moves that cost to module scope, where no per-test budget applies, and leaves both
bodies synchronous, so a body that outlives its budget cannot resume inside the next test. The
per-test timeouts go with it: nothing left in either body can await.

* local(docs): the card test's module graph, and why the 20s budget was the wrong place to pay it

Records the 2026-11-27 nightly red (run 45942815750), the 17,462ms measurement that made it a coin
flip, and the green dispatch that replaces it (run 45953273363 at 9a0bd1b, 137ms for the same two
tests).

* local(test): the review's six findings — a 30s project default, not no bound; the import above the bindings it precedes

The delta from the adversarial review of 9a0bd1b, all of it accuracy rather than behaviour:

- the static import moves up beside the other imports. Vitest hoists it either way, so this changes no
  runtime order — but leaving it below the `let` bindings it evaluates ahead of read as if it ran after
  them, and the mock factory now says why it must stay lazy.
- `testTimeout: 30_000` is the project default, so removing the `}, 20_000)` lines widens the budget to
  30s rather than removing it. The entry said the opposite twice.
- the shard's wall clock, not a claimed collect measurement: 102s against 103s on the green run before,
  which is the evidence that the 17s moved instead of vanishing.
- 4,828/4,828 fork comments in upstream files, measured, not #485's 4,763.
- test 1 covers both card styles; test 2 pins the default one.
- the warm-Mac numbers are the before-fix ones, and the six-line comment is two.

Also records the follow-up the review found unrecorded: the shard-timing overlay weighs this file at
3,894ms by a metric that excludes collection, so the next regeneration would drop it while the shard
still pays ~17s.

* local(docs): the overlay follow-up names a remedy that works

The delta review of 2afcbbd found the one thing this entry still got wrong: `--override` refuses a
file `selectEntries` already dropped (local/ci-shard-timings-overlay.mjs:302), and at 137ms this file
falls under the 2,000ms threshold — so the instruction it recorded would have aborted the next import
rather than kept the entry. The paragraph now says the weight has to be re-added by hand, or the metric
taught to count collection.

Documentation only: the test change and its green run are unchanged.

---------

Co-authored-by: Nathan Plesnicher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork CI health: attention

1 participant