ci RED: the #1351 removal-ordering guard compares whole-file indexOf, and #1590's new uninstall-from-card leg moved the first match #1591

Closed
opened 2026-09-18 17:23:48 +00:00 by matou-build-agent · 2 comments

main is RED on ci: one vitest assertion in app/tests/e2e/fixtures/brandreach.test.ts fails deterministically at HEAD (42c2d3ba).

FAIL tests/e2e/fixtures/brandreach.test.ts
  > the removal reaches the GUEST — #1351 (the #1348 accretion / #1114 class)
  > is wired into the remove-<slug> leg ALONGSIDE expectServiceGone, not in its place
AssertionError: expected 16044 to be greater than 16554
  ❯ tests/e2e/fixtures/brandreach.test.ts:397:67
Test Files  1 failed | 139 passed (140)
      Tests  1 failed | 1686 passed (1687)

Run: https://git.matou.nz/Matou/idss/actions/runs/26748

Root cause

The #1351 guard reads provision-brands.live.spec.ts as raw text and compares
first-occurrence byte offsets to prove the guest read follows the card read
(brandreach.test.ts:396-399):

expect(spec.indexOf('expectServiceGoneFromGuest(live, svc)')).toBeGreaterThan(
  spec.indexOf('expectServiceGone(dash, svc)'),
);

Commit 42c2d3ba (#1590, the Services-tab Uninstall door) added the new
uninstall-from-card-<slug> leg above the remove-<slug> leg, and that leg
carries the same guest proof (provision-brands.live.spec.ts:357). So
indexOf now resolves expectServiceGoneFromGuest(live, svc) to offset 16044
(the uninstall leg) instead of 16554+ (the remove leg), and the comparison
inverts. Verified in the workdir:

$ grep -n expectServiceGone app/tests/e2e/provision-brands.live.spec.ts
357:  await expectServiceGoneFromGuest(live, svc);   # uninstall-from-card leg (#1590, NEW)
370:  await expectServiceGone(dash, svc);            # remove-<slug> leg
371:  await expectServiceGoneFromGuest(live, svc);   # remove-<slug> leg

The production intent is intact — inside the remove-<slug> leg the guest
read still follows the card read (370 → 371). The assertion technique is what
broke: a whole-file indexOf cannot express "within the remove leg".

What to do

Re-scope the #1351 ordering guard to the remove-<slug> leg body rather than
the whole file — e.g. slice the source from the `remove-${svc.slug}` leg
marker to the end of that runRecordedLeg call (the same shape
expectServiceGoneFromGuestBody() already uses at brandreach.test.ts:404-418)
and run the two indexOfs inside that slice. While there, consider adding the
sibling guard the new door now needs: the uninstall-from-card-<slug> leg must
also carry expectServiceGoneFromGuest (GOTCHAS #207 — the card returning to
Install alone has greened a removal that never left the box).

Do not "fix" this by reordering provision-brands.live.spec.ts — the live
spec is correct as written.

Filed by the swarm healer (heal run heal-Matou-idss-1789752139-2513425,
signature b415a3f75995).

`main` is RED on `ci`: one vitest assertion in `app/tests/e2e/fixtures/brandreach.test.ts` fails deterministically at HEAD (`42c2d3ba`). ``` FAIL tests/e2e/fixtures/brandreach.test.ts > the removal reaches the GUEST — #1351 (the #1348 accretion / #1114 class) > is wired into the remove-<slug> leg ALONGSIDE expectServiceGone, not in its place AssertionError: expected 16044 to be greater than 16554 ❯ tests/e2e/fixtures/brandreach.test.ts:397:67 Test Files 1 failed | 139 passed (140) Tests 1 failed | 1686 passed (1687) ``` Run: https://git.matou.nz/Matou/idss/actions/runs/26748 ## Root cause The #1351 guard reads `provision-brands.live.spec.ts` as raw text and compares **first-occurrence byte offsets** to prove the guest read follows the card read (`brandreach.test.ts:396-399`): ```ts expect(spec.indexOf('expectServiceGoneFromGuest(live, svc)')).toBeGreaterThan( spec.indexOf('expectServiceGone(dash, svc)'), ); ``` Commit `42c2d3ba` (#1590, the Services-tab Uninstall door) added the new `uninstall-from-card-<slug>` leg **above** the `remove-<slug>` leg, and that leg carries the same guest proof (`provision-brands.live.spec.ts:357`). So `indexOf` now resolves `expectServiceGoneFromGuest(live, svc)` to offset 16044 (the uninstall leg) instead of 16554+ (the remove leg), and the comparison inverts. Verified in the workdir: ``` $ grep -n expectServiceGone app/tests/e2e/provision-brands.live.spec.ts 357: await expectServiceGoneFromGuest(live, svc); # uninstall-from-card leg (#1590, NEW) 370: await expectServiceGone(dash, svc); # remove-<slug> leg 371: await expectServiceGoneFromGuest(live, svc); # remove-<slug> leg ``` **The production intent is intact** — inside the `remove-<slug>` leg the guest read still follows the card read (370 → 371). The *assertion technique* is what broke: a whole-file `indexOf` cannot express "within the remove leg". ## What to do Re-scope the #1351 ordering guard to the `remove-<slug>` leg body rather than the whole file — e.g. slice the source from the `` `remove-${svc.slug}` `` leg marker to the end of that `runRecordedLeg` call (the same shape `expectServiceGoneFromGuestBody()` already uses at `brandreach.test.ts:404-418`) and run the two `indexOf`s inside that slice. While there, consider adding the sibling guard the new door now needs: the `uninstall-from-card-<slug>` leg must also carry `expectServiceGoneFromGuest` (GOTCHAS #207 — the card returning to Install alone has greened a removal that never left the box). Do **not** "fix" this by reordering `provision-brands.live.spec.ts` — the live spec is correct as written. *Filed by the swarm healer (heal run `heal-Matou-idss-1789752139-2513425`, signature `b415a3f75995`).*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=26656
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=26656 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1591 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1591,
  "status": "success",
  "commits": [
    "5d04d69e"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/brandreach.test.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/brandreach.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/e2e/fixtures/",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/eslint .",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The #1351 ordering guard is re-scoped to the remove-<slug> leg body, not the whole file": "brandreach.test.ts: new liveSpecLegBody('remove-${svc.slug}') slices ONE runRecordedLeg body; the two indexOfs run inside that slice (commit 5d04d69e)",
    "provision-brands.live.spec.ts is NOT reordered (correct as written)": "changed_files does not include provision-brands.live.spec.ts; only the test-technique file changed",
    "The whole-file indexOf inversion no longer reds ci": "brandreach.test.ts 41 pass (was 1 fail); the assertion now compares within the remove leg where guest read (line 371) follows card read (line 370)",
    "The new uninstall-from-card-<slug> leg also carries expectServiceGoneFromGuest (GOTCHAS #207)": "new sibling test 'the uninstall-from-card-<slug> leg ALSO reaches the guest' asserts uninstallServiceFromCard then expectServiceGoneFromGuest ordering within that leg body"
  },
  "summary": "Re-scoped the #1351 removal-ordering guard to the remove-<slug> leg body so #1590's new uninstall leg no longer inverts a whole-file indexOf, restoring ci to green; added the sibling GOTCHAS #207 guard for the new door.",
  "blockers": []
}
**close-report** for #1591 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1591, "status": "success", "commits": [ "5d04d69e" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/brandreach.test.ts" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/brandreach.test.ts", "exit_code": 0 }, { "command": "npx vitest run tests/e2e/fixtures/", "exit_code": 0 }, { "command": "node_modules/.bin/eslint .", "exit_code": 0 } ], "criteria": { "The #1351 ordering guard is re-scoped to the remove-<slug> leg body, not the whole file": "brandreach.test.ts: new liveSpecLegBody('remove-${svc.slug}') slices ONE runRecordedLeg body; the two indexOfs run inside that slice (commit 5d04d69e)", "provision-brands.live.spec.ts is NOT reordered (correct as written)": "changed_files does not include provision-brands.live.spec.ts; only the test-technique file changed", "The whole-file indexOf inversion no longer reds ci": "brandreach.test.ts 41 pass (was 1 fail); the assertion now compares within the remove leg where guest read (line 371) follows card read (line 370)", "The new uninstall-from-card-<slug> leg also carries expectServiceGoneFromGuest (GOTCHAS #207)": "new sibling test 'the uninstall-from-card-<slug> leg ALSO reaches the guest' asserts uninstallServiceFromCard then expectServiceGoneFromGuest ordering within that leg body" }, "summary": "Re-scoped the #1351 removal-ordering guard to the remove-<slug> leg body so #1590's new uninstall leg no longer inverts a whole-file indexOf, restoring ci to green; added the sibling GOTCHAS #207 guard for the new door.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1591
No description provided.