Repository navigation
ci: the Node record refresh takes each leg's slowdown out and rewrites only new and far-off entries - #11910
Conversation
…s only new and far-off entries The refresh regenerated the record with the plain recorder, so every file a run reached took that run's raw time, a slow runner raised every entry and a fast one lowered them. Now each leg's times are divided by that leg's own slowdown (the drift check's leg factor, never below 1); a file the record lacks takes its time, and a recorded file takes it only when it is 1.5 times off its entry, either way, and at least 5 s away.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 173.5 | 173.5 | 0 |
| Runner pool, runner-minutes a day | 51,781 | 51,781 | 0 (0%) |
| Average concurrent jobs | 36 | 36 | 0 |
| Time to green (median → this run) | 27.8 min | 19.6 min | −8.3 min |
| Runs a day | 298 | 298 | 0 |
Other workflows: node-record-refresh.yml changed: runs on workflow_run, schedule (41 */6 * * *), workflow_dispatch; standard runners; its minutes are not measured here
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/node-record-refresh.mjs, .github/scripts/node-record-refresh.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes for one fix in the new regenerate command.
regeneratein.github/scripts/node-record-refresh.mjs(lines 299-316) exits 0 when the run log yields no Node leg times, where thevitest-shard-sequencer.mjs recordcall it replaces exits 1, so a refresh that is due because coverage fell under nine in ten can finish green with no pull request; return 1 with the recorder's message in that case and add a test for it.
The per-leg division and the 1.5× / 5 s gate behave as described, and the new cases fail against main's script and pass here. Non-blocking: the printed re-timed count includes swizzle-proof slices whose entry the merge keeps unchanged (see the inline note).
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the current refresh regenerates with the plain recorder, so every reached file takes that run's raw time. Verified: the workflow step on
mainand the recorder's merge inscripts/vitest-shard-sequencer.mjs. - Claim:
regenerategroups the log by Node leg and divides by that leg's slowdown factor, the median, never below 1. Verified:node-record-refresh.mjs:137-155,node-time-drift.mjs:65-77. - Claim: a new file takes its time; a recorded file only when 1.5× off either way and at least 5 s away; a lower time only after the division. Verified:
node-record-refresh.mjs:144-150. - Claim: every other entry keeps its value and deleted files drop out. Verified:
scripts/lib/duration-split.mjs:162-175. - Claim: the workflow's regenerate step calls the new command and when the refresh runs is unchanged. Verified:
node-record-refresh.yml:89; triggers untouched. - Claim: the refresh pull request's body says how the times were taken. Verified:
node-record-refresh.mjs:205,:210. - Claim: the coverage and drift checks, branch, pull request, plain recorder and Node legs are unchanged. Verified: the diff only extracts the leg grouping the drift check already used.
- Claim: it applies an earlier hand re-record's rule (per-leg factor; new files plus entries far off either way). Verified against that pull request's description.
- Claim: new cases cover a slow leg, the 1.5× / 5 s gate, a lower time after division, the factor floor, and the workflow call keeping the file's other fields. Verified:
node-record-refresh.test.mjs. - Claim: 109 tests pass across the four named suites, and the six new cases fail with
main's script and workflow. Verified: 109 pass here; with this test file onmain's code, 6 fail and 20 pass. - Claim: actionlint and prettier pass. Prettier verified; actionlint not verified (Lint has not run on this draft).
- Claim: no CI impact on pull requests, and the refresh pull request carries fewer, steadier changes. Verified: no pull-request job changes; a run at record pace rewrites 0 entries where the plain recorder rewrites 493.
- Claim: the CI spec's FR22 regeneration clause stays true and no record text changes. Verified.
- Claim: no open pull request changes these files, and a companion pull request edits other functions. Not verified: a title and body search found none; not checked file by file.
- File
.github/scripts/node-record-refresh.mjs: blocking finding above; non-blocking re-timed count. - File
.github/scripts/node-record-refresh.test.mjs: clear, apart from the missing case for a log with no Node times. - File
.github/workflows/node-record-refresh.yml: clear.
…what the merge changed As the recorder does, a log with no Node leg time exits 1 and leaves the record as it was, so a refresh that is due never ends green without one. The printed count compares the merged record with the old one, so a swizzle-proof slice the merge keeps at its largest time is not counted.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Both points from the last review are fixed: regenerate now exits 1 and leaves the record untouched when the run log has no Node leg time, with a test for it, and its summary line counts only what the merge changed. The per-leg division and the 1.5× / 5 s rule behave as described, and the new case fails on the previous revision and passes here.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claim: the current refresh regenerates with the plain recorder, so every reached file takes that run's raw time. Verified: the base workflow's regenerate step and the recorder's merge (
scripts/lib/duration-split.mjs:162-175). - Claim:
regenerategroups the log by Node leg and divides by that leg's slowdown factor, the median, never below 1. Verified:node-record-refresh.mjs:137-155,node-time-drift.mjs:65-77. - Claim: a new file takes its time; a recorded file only when 1.5× off either way and at least 5 s away; a lower time only after the division. Verified:
node-record-refresh.mjs:143-150. - Claim: every other entry keeps its value and deleted files drop out. Verified:
scripts/lib/duration-split.mjs:162-175and a probe at this head. - Claim: the workflow's regenerate step calls the new command and when the refresh runs is unchanged. Verified:
node-record-refresh.yml:89; triggers untouched. - Claim: the refresh pull request's body says how the times were taken. Verified:
node-record-refresh.mjs:205,:210. - Claim: the coverage and drift checks, branch, pull request, plain recorder and Node legs are unchanged. Verified: the diff only extracts the leg grouping the drift check already used.
- Claim: it applies an earlier hand re-record's rule (per-leg factor; new files plus entries far off either way). Verified against that pull request's description.
- Claim: new cases cover a slow leg, the 1.5× / 5 s gate, a lower time after division, the factor floor, and the workflow call keeping the file's other fields. Verified:
node-record-refresh.test.mjs:161,:257on. - Claim: a log with no Node leg time fails the command with exit 1 and leaves the record as it was. Verified:
node-record-refresh.mjs:309-312,node-record-refresh.test.mjs:215-255, and a probe. - Claim: the printed count is what the merge changed. Verified:
node-record-refresh.mjs:317-322and a probe with an idle swizzle-proof slice. - Claim: 109 tests passed across the four named suites at the first revision, and the six new cases fail with
main's script and workflow. Verified by the last review on that revision. - Claim: after the fix, the refresh and drift suites pass 50 of 50 and the new case fails on the previous revision. Verified: 27 and 23 pass here; on the previous revision with this test file, 1 fails and 26 pass.
- Claim: actionlint and prettier pass. Prettier verified; actionlint not verified (Lint has not run on this draft).
- Claim: no CI impact on pull requests, and the refresh pull request carries fewer, steadier changes. Verified: no pull-request job changes; a run at record pace rewrites 0 entries where the plain recorder rewrites 493.
- Claim: the CI spec's FR22 regeneration clause stays true and no record text changes. Verified.
- Claim: only the companion early-warning pull request also changes these files, with textual conflicts only. Partly verified: it changes all three files; other open pull requests were checked by text search, not file by file, and the conflict resolution was not checked.
- Claim: notes on who owns and lands the change. Context, not checked.
- File
.github/scripts/node-record-refresh.mjs: clear; both earlier findings fixed. - File
.github/scripts/node-record-refresh.test.mjs: clear. - File
.github/workflows/node-record-refresh.yml: clear.
|
/approve-spec 7c05403 |
There was a problem hiding this comment.
Approved. CI and Lint pass on this head.
regenerate divides each Node leg's times by that leg's own slowdown and rewrites only new and far-off entries, as described; it exits 1 and leaves the record untouched when the log has no Node leg time, and the seven new or changed cases fail against main's script and workflow and pass here. A fast runner still lowers large entries because the factor is clamped at 1, as the description says.
- Non-blocking: the overlap check could also name #12760, a draft that changes
coverageandopenOrRefreshin the same script; it merges cleanly with this branch.
Claims and files checked
Review mode: same-head; reason: none
- Claim: the refresh regenerated the record with the plain recorder, so every reached file took that run's raw time — verified (the base workflow's regenerate step; the recorder merges every measured time,
vitest-shard-sequencer.mjs:262-288). - Claim: a slow runner raises every entry and a fast one lowers them — verified (simulated runs over the head's record).
- Claim:
regenerate --loggroups the log by Node leg and divides each leg's times by the drift check's leg factor, never below 1 — verified (node-record-refresh.mjs:124-128;node-time-drift.mjs:65-77). - Claim: a file the record lacks takes its time — verified (
node-record-refresh.mjs:134). - Claim: a recorded file is re-timed only when 1.5× off either way and at least 5 s away, and a lower time only after the division — verified (
node-record-refresh.mjs:130-133; tests atnode-record-refresh.test.mjs:386and:402). - Claim: every other entry keeps its value and files that no longer exist drop out — verified (
node-record-refresh.mjs:333-335). - Claim: the workflow's regenerate step calls it and when the refresh runs is unchanged — verified (
node-record-refresh.yml:105; triggers unchanged). - Claim: the refresh pull request's body says how the times were taken — verified (
node-record-refresh.mjs:208,:213). - Claim: the coverage and drift checks, the fixed branch, the pull request it opens, the plain recorder and the Node legs are unchanged — verified (no change to those functions or files).
- Claim: this applies the earlier by-hand re-record's rule (per-leg factor, new files, entries far off either way) — verified against #11644's description.
- Claim: the listed new test cases exist and cover each behaviour, and the printed count is what the merge changed — verified (
node-record-refresh.test.mjs:208,:271,:326,:374,:386,:402,:413; count atnode-record-refresh.mjs:339-345). - Claim: 109 tests passed at the first head and the 6 new cases failed with
main's script — describes an earlier head; at this head 118 pass across the four named suites and the 7 new or changed cases fail on the base. - Claim: after the no-Node-time fix two suites passed 50 of 50 and its new case failed on the previous head — describes an earlier head; at this head those suites pass 56 of 56 and that case fails on the base.
- Claim: actionlint and prettier pass — verified (the Lint workflow at this head, its actionlint and formatting steps included).
- Claim: no CI impact on pull requests — verified (the workflow runs only after Main's run, on a schedule and by hand).
- Claim: the refresh pull request carries fewer, steadier changes — verified in simulation (0 rewritten entries on slow or at-pace runs, against 835 to 1,072).
- Claim: the spec's "regenerates the record from that run's Node legs" stays true and no record text changes — verified.
- Claim: merged with
mainafter the two log-reading fixes, andregeneratereads legs through the sharednodeLegLogs— verified (node-record-refresh.mjs:124; both fixes are in the base). - Claim: the only overlapping open pull request is the early-warning one (#11921), with textual conflicts — the conflicts are verified in all three files; out of date: #12760, opened later, also changes
node-record-refresh.mjsand merges cleanly. - File
.github/scripts/node-record-refresh.mjs: clear. - File
.github/scripts/node-record-refresh.test.mjs: clear. - File
.github/workflows/node-record-refresh.yml: clear; consistent with the script and pinned by the test.
Who this helps
Authors waiting on CI. The Node legs balance by
scripts/vitest-node-durations.json, and #11900's refresh keeps that record current frommain's full unit runs. When it refreshes, it regenerates the record with the plain recorder (vitest-shard-sequencer.mjs record), so every file that run reached takes that run's raw time. A run on a slow runner raises every entry it reached, and one on a fast runner lowers them, so the record moves with the runner rather than with the tests, and a lowered entry under-books its leg on the next slower run.What changes
.github/scripts/node-record-refresh.mjs: aregenerate --log <run log>command. It groups the run's lines by Node leg and divides each leg's times by that leg's own slowdown: the drift check'slegFactor(the median measured ÷ recorded over the leg's recorded files, never below 1). Then:RATIO), either way, and at least 5 s away (RETIME_MIN_S); a lower time is taken only after that division;.github/workflows/node-record-refresh.yml: the regenerate step calls it instead of the plain recorder. When the refresh runs is unchanged.This is #11644's rule (each leg divided by its own factor; new files, plus entries far off either way), applied by the refresh.
Evidence
node-record-refresh.test.mjs, new cases:node-record-refresh,node-time-drift,vitest-shard-sequencerandci-tooling-routingat the first head; withmain's script and workflow, the 6 new cases fail. After the no-Node-time fix,node-record-refreshandnode-time-driftpass 50 of 50, and its new case fails on the previous head.actionlintandprettierpass.CI impact: none on pull requests. The refresh pull request carries fewer, steadier changes.
Specs
spec:AST-030FR22: "it regenerates the record from that run's Node legs" stays true: the regeneration still comes from that run's Node legs, now with each leg's slowdown taken out. No record text changes here.Overlap check
Merged with
mainafter #12657 (the refresh reads each leg's whole log and stops on a leg that misses files) and #12687 (colour codes kept; a log with no Node legs stops). Both change how the refresh reads the log; neither changes which entriesregeneraterewrites or takes a leg's slowdown out, so this is not redundant with them.regeneratenow groups the lines throughmain'snodeLegLogs.No open pull request changes
node-record-refresh.mjs, its test or its workflow (also checked file by file on the open pull requests with more than 100 files), except our own #11921 (the early warning). The two change different behavior in the same script but conflict textually where both add lines in the same places: the file header's@input/@outputlines, the import lists, the new functions inserted beforerefreshReasons, and the workflow's header comment. Each conflict resolves by keeping both sides; whichever lands second mergesmainand does that.Overlap checked: #11921 (our own: the early warning in the same refresh; textual conflicts only, each resolved by keeping both sides)
Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard.