Skip to content

Mutation gate: only the 500-line ceiling can fail the row, it fires before any per-file breakdown, and nothing waits on the row #2654

Open

Description

@easonLiangWorldedtech

Rewritten by the author on 2026-11-23 measurements; earlier heads and numbers withdrawn. Provenance: comment 7102209620.

Pull Billed lines Row
#2235 709 at 794542443c failure 2026-11-22T20:29:17Z
#2236 653 at dd032781441c failure 03:26:12Z
#2237 608 at 1701f9b13aff failure 03:53:36Z
#1311 462 at 4ee25b44eb success, 431-of-400 mutant advisory
#1321 292 + 37 = 329 at ffe19c1fb4 success, 12-minute advisory

So: three pulls print the failure sentence, two print advisories. Not asking to raise 500.

Three behaviours invisible from outside

  1. Only the line ceiling can fail the row. It throws inside buildManifest (scripts/stryker-diff.mjs:264-270),
    reached from selectFromGit (:300-313) at :847 - six lines before the per-package breakdown prints at
    :854-857. An over-cap head prints the failure sentence, exit 1, and no file list.
  2. A pull over the 400-mutant limit yields no mutation evidence at all. That ceiling throws inside the preflight
    branch (:756-761), so the run never starts and the 12-minute spawnSync timeout (:424) never arms. On
    4ee25b44eb, job 137646924013 line 1920 is the scope line and line 1921 is the row's only run-level warning:
    extension generated 431 mutants in preflight (limit 400).
  3. Nothing waits on the red row. At 794542443c mutation-diff is failure at 20:29:17Z while the PR review gate is success at 20:51:09Z: Awaiting fresh human maintainer or CODEOWNER approval.

Withdrawn: 'the base you passed is ignored'

Not a defect; my reproduction fell into the trap it describes. resolvePullRequestBase (:287-291, called at :296)
takes the head's first parent - and CI's head is never the pushed commit. mutation-testing.yml:50-56 passes
--head "$HEAD_SHA", github.sha, which for a pull_request event is GitHub's synthetic merge commit whose first
parent is the base branch tip; the checkout step prints it: HEAD is now at 2b435ca14 Merge 24558e7e4bd… into 5a05ff1af146…. CI bills the pull's own content; a main-tip projection reproduces 709, 653 and 608 without consulting
those commits' parents. The disagreeing numbers - 1137, 620, 610 - measured what a merge commit brings in: our own
merge commit passed as --head. Same script, same --base, different head.

Three asks, one I will ship myself

  1. Print the per-file breakdown before the line-ceiling throw and name the files carrying the cost in the failure
    sentence. I will open this pull myself: reorder inside buildManifest, plus the message.
  2. Say what mutation-diff is: a required context, or advisory like the mutant and duration ceilings. A red row
    nothing waits on teaches contributors to ignore it.
  3. Give the 'maintainer-reviewed narrow exclusion' the message prescribes an address: which file, approved by whom,
    valid how long, obtainable how by a fork contributor.

Activity

  1. changed the title [-]Mutation gate's 500 changed-line budget counts test-only deltas, so six open PRs cannot pass it[/-] [+]Mutation gate: the 500-line budget blocks six open PRs, and on a merged head it reports a number that is not the PR's delta[/+] on Nov 22, 2026
  2. easonLiangWorldedtech commented on Nov 22, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    At dd55e679de (#2236) the only mutation-diff run (job 137307965659, 18:25:38Z) says, verbatim: "Mutation gate failed: extension has 635 changed executable lines (limit 500)." 1,137 is not in that log: in this issue body it is the number measured at #2235 25ce2c8b under three bases, all ignored. So this pair is cross-head - 1,137 is #2235 on an event-time base, 635 is #2236 on CI base.

    The pinned-base half is the lead measurement, on local scratch commits: control faa55b1a77514395eab718680fc1c16aef1fb066, unit df9754010956beb3911490dc40409832af3c43c8, trees asserted by rev-parse scratch^{tree} plus head-side write-tree equality. Neither sha resolves upstream or on the fork (404, 21:35Z): local objects, not clickable.

    With resolvePullRequestBase bypassed and the base pinned to main 2a082ce5a4, the function reports 635 in the extension package and 658 total for the unit. That gap is attribution, not a counting rule.

    (逐字副本 evidence/relocated/tierA-2654-ic-7086256171-v0.md,原文 1992 cp,本帖裁去 1041 cp,全在副本)

  3. easonLiangWorldedtech commented on Nov 22, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    ENOENT half, root cause, observed by the pre-reviewer (not my run): its advisory printed "extension Stryker preflight could not start: spawnSync C:\work\Zoo-Code-fork\wt-prescan-2489\node_modules.bin\stryker ENOENT", and attempt 1's row reads "extension | 70 | 0 0 0 0 0 | Advisory incomplete", blocking 0 advisories 1.

    Script read at main 2a082ce5a4: wording from :447; spawn at :421 is path.join(repoRoot, "node_modules/.bin/stryker"), no shell option. On Windows spawnSync reports ENOENT for the extensionless shim without shell: true. Not the body's :302 readFileSync ENOENT.

  4. easonLiangWorldedtech commented on Nov 22, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Third call site, from CI. Job 137378360468 (#2236 mutation-diff, failure 22:26:31Z), step Test mutation gate logic, verbatim log lines 1077 and 1080:

    # ::warning title=Mutation test advisory::core Stryker preflight could not start: spawnSync /tmp/stryker-launch-IGNOIi/node_modules/.bin/stryker ENOENT
    # ::warning title=Mutation test advisory::Could not write the job summary: EISDIR: illegal operation on a directory, open '/tmp/stryker-summary-XlCKmj'

    Same extensionless .bin/stryker tail as the Windows local spawn, different launch dir (/tmp/stryker-launch-<random>, package id core); the summary write opens a directory. Two call sites, not one.

  5. easonLiangWorldedtech commented on Nov 22, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Same code, two merge bases. Old head dd55e679de against its own first parent 4df6444d475e counted 1,137 changed executable lines (pre-reviewer's local run - not a CI row). The refreshed merge result 44f7c5aa7809 against main's tip 2a082ce5a42b counts 650 (CI, job 137378360468). At dd55e679de CI printed 635 (job 137307965659).

    Ask: the red row should report the merge base its count came from. 1,137 has only ever been a local number; CI has printed 635 and 650.

    Mechanism, in the script at main: :290 returns parents[0] for a head with two parents, so the supplied base is ignored; :297 takes merge-base; :298 diffs mergeBase...head. CI's own log, line 871 of job 137378360468: "HEAD is now at 44f7c5a Merge 37a55e2 into 2a082ce".

    (逐字副本 evidence/relocated/tierA-2654-ic-7086999527-v0.md,原文 2680 cp,本帖裁去 1841 cp,全在副本)

  6. easonLiangWorldedtech commented on Nov 22, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Boundary of the pairing in my merge-base comment (7086999527): same script path, no swing.

    #2237 reads the same on both geometries: 608 changed executable lines for the extension entry, 616 including the packages/types entry, measured by pre-reviewer with content pinned on both sides - head 0413d9160def against base f2b4d1c0d240 (= merge-base 2a082ce5a4 0413d9160d), content write-tree 3ba98d04e1; and the same patch against main tip 2a082ce5a42b at the merged tree 9eed4371cc (commit 67dbff25fd, with a scratch commit-tree 9eed4371cc -p 2a082ce5a4 -p 0413d9160d = c6030f7c6acf that puts main as first parent). Carried in review-2237-refresh.md sections 7 and 10. My git says why they cannot differ: the merge-base above is already the stack base - main carries none of that branch's content - and the two ranges hit the same 18 paths, +4,062/-215 against +4,061/-214.

    (逐字副本 evidence/relocated/tierA-2654-ic-7087188397-v0.md,原文 2240 cp,本帖裁去 1333 cp,全在副本)

  7. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Provenance for the correction in my merge-base comment (7086999527): for each number there, its head, its merge base, the tree that pins the content, and the file that carries it. All five were measured by pre-reviewer with the worktree content pinned to the head being counted (git checkout -f <head>, then git write-tree == that commit's tree), because selectFromGit reads line numbers from the commit and file content from the working tree. I did not run the counter; these are its measurements, transcribed.

    (逐字副本 evidence/relocated/tierA-2654-ic-7088584420-v0.md,原文 3316 cp,本帖裁去 2448 cp,全在副本)

  8. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Three open pull requests are failing the 500-line ceiling right now, on the same sentence, and the ceiling is not one
    of the contexts the merge gate waits for. Measured from the job logs and from the gate script itself.

    The sentence, verbatim, and where it comes from. Mutation gate failed: extension has 653 changed executable lines (limit 500). Split the PR or obtain a maintainer-reviewed narrow exclusion. then ##[error]Process completed with exit code 1. — job 137466925700, #2236 at dd032781441c, completed 2026-11-23T03:26:12Z. The same sentence with 709 at
    job 137344144898 (#2235 at 794542443c, completed 2026-11-22T20:29:17Z) and with 608 at job 137475245368 (#2237 at
    1701f9b13aff, completed 03:53:36Z; the two earlier rows 137472021248 and 137473986727 are the same job re-run,
    because the workflow's concurrency has cancel-in-progress: true).

    (逐字副本 evidence/relocated/tierA-2654-ic-7101312283-v0.md,原文 2531 cp,本帖裁去 1650 cp,全在副本)

  9. changed the title [-]Mutation gate: the 500-line budget blocks six open PRs, and on a merged head it reports a number that is not the PR's delta[/-] [+]Mutation gate: only the 500-line ceiling can fail the row, it fires before any per-file breakdown, and nothing waits on the row[/+] on Nov 23, 2026
  10. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Body rewritten by the author; here is what moved and why, so the change is auditable rather than silent.

    (逐字副本 evidence/relocated/tierA-2654-ic-7102209620-v0.md,原文 3721 cp,本帖裁去 2802 cp,全在副本)

  11. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Empirical confirmation of the head geometry, at a pull whose pushed head is itself a merge commit. Worth putting
    here because the tempting dodge - merge main in, and the row bills only what the merge brought - was tested on a real
    pull today and it does not work. #1311 was pushed a refresh merge: head b1928725daaac561ae44ebe2143f6b5d94dbeea3, two parents (4ee25b44eb…, the
    branch, and 5a05ff1af146…, upstream main), tree d4ed2557bec0…, main's side 42 files +181/-156 against the
    branch's own 29 files +4,621/-246. Run the script against that commit and the first-parent rule wins, exactly as
    described here: base becomes 4ee25b44eb and the bill is 1 line, src/core/webview/ClineProvider.ts, which is
    main's own content (its latestAnnouncementId string moves v3.98.1-… to v3.98.2-…). Run it against the tree at
    main's tip and the bill is 462 lines, the pull's own work. CI did the second. Row 137717792771, 13:14:39Z to 13:20:44Z, success, one annotation.

    (逐字副本 evidence/relocated/tierA-2654-ic-7102522076-v0.md,原文 3215 cp,本帖裁去 2201 cp,全在副本)

  12. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Addendum to ask 3 (the narrow exclusion) - measured after that ask was written.

    1. The premise moved. Ask 3 presented the five ClineProvider pulls as too big to cut below the per-package ceiling, which made the exclusion the only route. Pre-reviewer has since cut in-file hunk boundaries on two of them - fix(webview): send stable view-state id on launch and re-pin per-view state #1552 (whole-file bill 1,194 lines) and fix(core/webview): merge view-local state into getState for per-view overrides #1550 (1,316), both single-file src/core/webview/ClineProvider.ts cases against base 050c49ef8269 - and every block bills under the 500-line cap (scripts/stryker-diff.mjs:11). 2. Block bills, with the collisions. fix(webview): send stable view-state id on launch and re-pin per-view state #1552 cuts into four blocks billing 434, 296, 452 and 154; its two middle blocks measured together bill 770, over the cap. fix(core/webview): merge view-local state into getState for per-view overrides #1550 cuts into 373, 449, 370 and 197; its last two blocks measured together bill 595, also over. Each cut carries a byte-for-byte negative control. Per-block commits, blob and line anchors: logs/hunk-groups-1552-1550.json.

    (逐字副本 evidence/relocated/tierA-2654-ic-7107928306-v0.md,原文 2610 cp,本帖裁去 1643 cp,全在副本)

  13. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Measured: what the merge button on main actually requires — and the mutation gate is not in it.

    Read with a fork-contributor classic PAT at 2026-11-23T17:56Z against main = 050c49ef8269. The classic
    protection endpoints answer 404 (/branches/main/protection, /branches/main/protection/required_status_checks),
    which is why this has been hard to pin down, but the rulesets route is readable with this token:
    GET /repos/Zoo-Code-Org/Zoo-Code/rulesets returns 200 with two rulesets — 15494382 Protect Main, enforcement
    active, and 16993159 Protect Release Tags — and GET /rulesets/15494382 returns 200 with a 1,776-byte
    document.

    Its required_status_checks rule names exactly six contexts, every one with integration_id: 15368:
    check-translations, platform-unit-test (ubuntu-latest), platform-unit-test (windows-latest), compile,
    knip, e2e-mock. The string mutation appears nowhere in that document.

    (逐字副本 evidence/relocated/tierA-2654-ic-7109455467-v0.md,原文 2445 cp,本帖裁去 1485 cp,全在副本)

  14. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Three more measurements from the same evening, all against the current main tip, that change how a mutation row
    should be read.

    1. A quiet row can mean the package was never tested. The preflight mutant-count throw (:756, limit
    MAX_MUTANTS = 400 at :12) sits inside the per-package try (:746, caught :806), so it becomes an
    Advisory incomplete row (:822) and that package does not run at all — and a package that never runs emits
    zero survivor advisories. Observed on green rows: extension generated 560 mutants in preflight (limit 400)
    (#1404, 493 lines) and 519 (#1406, 468 lines), both with survivors listed only for types/webview. By the
    same two measured ratios (1.109–1.136 mutants per line) a 378-line delta projects 419–429 mutants, so it crosses
    the line too; the crossing band sits near 352–361 changed lines. A green gate therefore verifies the
    changed-line billing, the merge base and the merge geometry — not that the billed package was mutated.

    **2.

    (逐字副本 evidence/relocated/tierA-2654-ic-7111366543-v0.md,原文 2410 cp,本帖裁去 1383 cp,全在副本)

  15. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Addendum to ask 3 (the narrow exclusion) - measured after that ask was written.

    1. The premise moved. Ask 3 presented the five ClineProvider pulls as too big to cut below the per-package ceiling, which made the exclusion the only route. Pre-reviewer has since cut in-file hunk boundaries on two of them - fix(webview): send stable view-state id on launch and re-pin per-view state #1552 (whole-file bill 1,194 lines) and fix(core/webview): merge view-local state into getState for per-view overrides #1550 (1,316), both single-file src/core/webview/ClineProvider.ts cases against base 050c49ef8269 - and every block bills under the 500-line cap (blob 7dfe0006d2d5 of scripts/stryker-diff.mjs, line 11). 2. Block bills, with the collisions. fix(webview): send stable view-state id on launch and re-pin per-view state #1552 cuts into four blocks billing 434, 296, 452 and 154; its two middle blocks measured together bill 770, over the cap. fix(core/webview): merge view-local state into getState for per-view overrides #1550 cuts into 373, 449, 370 and 197; its last two blocks measured together bill 595, also over. Each cut carries a byte-for-byte negative control. Per-block commits, blob and line anchors: …/.dsh/workflow/20261122-1551/logs/hunk-groups-1552-1550.json (run directory, uncommitted).

    (逐字副本 evidence/relocated/tierA-2654-ic-7115309754-v0.md,原文 3360 cp,本帖裁去 2304 cp,全在副本)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions