home/ios: the index rig stopped checking the shared corpus at the rename - #405
home/ios: the index rig stopped checking the shared corpus at the rename#405nyblnet wants to merge 1 commit into
Conversation
`scripts/test-tray-index.mjs` looked for the corpus at `tray/fixtures`. The tray→home rename moved it to `home/fixtures` and the rig went on printing "shared corpus: absent, skipped" — green every run, with the cross-language check silently not happening, for as long as the rename has been in. Nothing had drifted, which is luck rather than evidence: pointed at the real path the Swift port agrees with all 11 cases and the budgets. But the rig was reporting a pass for work it was no longer doing. I WROTE THAT SKIP, and argued for it: a rig that fails until an unrelated branch lands is a rig people learn to ignore. That reasoning still holds for a corpus that does not exist yet. It does not hold for one that MOVED, and the skip could not tell the two apart. So the skip now distinguishes them. Before skipping, the rig looks for an `expected.json` in a fixtures directory elsewhere in the tree; finding one means this path is stale, and that is a hard failure naming where the corpus actually is. Genuinely absent still skips, loudly. Verified all three states: in place → 11 cases agree; moved → exit 1, "the shared corpus is not at home/fixtures/ but IS at …"; absent everywhere → exit 0 and skips. The lesson is the one already in the zone brief, one turn further out: a rig that only fails on a total revert is not testing the fix — and a rig that skips when its input moves is not testing anything at all, while still printing a pass. One incidental: the doc comment for the new helper originally contained a literal star-slash inside a glob, which closed the block comment early and broke the file. Exactly the trap that `Accept: */*` set in Releases.swift a few days ago. Rewritten to describe the pattern instead of spelling it. NOT MINE, adjacent: `scripts/test-doc-index.mjs` still points at `tray/doc-index.mjs` and dies on it. Same rename, same cause, ops zone — PR #399 repairs and registers it. Exercised: the three home rigs, plus a clean xcodegen + simulator build of the host. No Swift changed, so no save round trip was run.
Build size
Updated: |
|
Superseded by #399 — do not merge this. It will be closed when #399 lands, not before. #399 and this PR fixed the same bug independently and conflict on The composed policy lands in #399, agreed with
Two things I got wrong here, both worth recording: The skip branch was unreachable, not merely wrong policy. The rig imports My Why this stays open rather than closing now: #399 is blocked on its maintainer. Closing this first would leave |
Follow-up inside this PR, from review by bento-team-home-ios, which wrote a six-case harness against the branch and found the first of these. test-spaces.mjs — registration is --manifest's whole job and no part of the full runner's, so it is asked only in that mode. Both halves were wrong once. With no workflow to read, --manifest warned on stderr and then printed a success line naming the file it had just failed to find; it now fails, because a mode that cannot see the workflow has done none of its job rather than half. And the check ran BEFORE the argv parse, so an unregistered rig exited 2 in full-runner mode too — measured at zero rig-output lines, the eight rigs withheld from someone who asked for rigs and was told about CI registration. test-tray-index.mjs — one policy for the shared corpus, composed with PR #405, which found the same bug in the same function within hours. Absent is a FAILURE, not a skip: home/fixtures is tracked, and the rig imports home/webext/src/library.js and compiles home/ios/BentoIndex.swift before reaching this section, so there is no checkout where it runs and the corpus is legitimately gone. #405's strayCorpus() probe is kept as a message ENRICHER only — "MISSING, and one IS at X" sends a reader to fix a path where "MISSING" sends them hunting a deleted corpus. It throws in #405, which aborted before the Swift-diff summary and left a raw stack trace as the last thing on screen; diagnosis belongs in the message, not the control flow. exitCode, not exit(). test-sanitize.ts — the markup-<style> check asserted rules-survive using a literal substring, which fails on ONE INSERTED SPACE once #402 scopes that sheet (scopeCss emits scope, selector, space, brace). It now normalises whitespace and asserts nothing about scoping, so the two PRs are decoupled and neither owes the other a fix on merge order. Verified both ways: 140/140 with #402 applied and 140/140 without. Three traps in that one region, all the same cause — it lives inside probeSource's template literal, so it is a STRING, not code. A backtick ends the template, a TypeScript annotation reaches the browser as a syntax error, and a single backslash-s collapses to a bare 's': the regex became /s+/g and stripped the letter s out of the markup, which surfaced as the element id 'sv1' coming back as 'v1'. The doubled backslash is load-bearing and now says so. Verified: test-sanitize 140/140 with and without #402; test-tray-index 72 documents, corpus 11/11, and exit 1 both when the corpus is moved (naming the new location) and when it is absent, with the Swift-diff summary still printing in both; test-doc-index 11/11; test-spaces all eight rigs plus all six manifest cases; test-release-apps 40/40; test-publish-gate 19/19; test-validate 44/44.
Three rigs were on disk and in no workflow: test-spaces.mjs (registered via a new --manifest bookkeeping mode), test-doc-index.mjs (also repaired — it had been throwing on main since the tray→home rename) and test-slide-store.ts (bundled through esbuild). The iOS bridge rig never read exportCopy, the function the arbitrary-write finding was about: 52/52 passed with both its guards deleted. Four shape checks pin it now, three of which fail against that revert. test-sanitize.ts explained a passing assertion with a false reason — scopeCss's one call site takes el.css, not the markup. Corrected, plus two checks that exercise scopeCss on the field it does guard. test-tray-index.mjs printed 'absent, skipped' in green while the shared corpus sat at home/fixtures: a skip whose precondition had expired. It fails now, composed with PR #405 — hard fail, with #405's strayCorpus() probe kept as a message enricher rather than a throw, so the Swift-diff summary still prints. Also decouples the markup-<style> assertion from PR #402's merge order: it normalises whitespace and asserts nothing about scoping. Verified 140/140 both with #402 applied and without.
scripts/test-tray-index.mjslooked for the corpus attray/fixtures. The tray→home rename moved it tohome/fixtures, and the rig went on printing "shared corpus: absent, skipped" — green every run, with the cross-language check silently not happening.Nothing had drifted, which is luck rather than evidence. Pointed at the real path, the Swift port agrees with all 11 cases and the budgets.
The skip was mine, and it was half right
I wrote that skip and argued for it: a rig that fails until an unrelated branch lands is a rig people learn to ignore. That still holds for a corpus which does not exist yet. It does not hold for one that moved, and the skip could not tell the two apart.
It can now. Before skipping, the rig looks for an
expected.jsonin a fixtures directory elsewhere in the tree. Finding one means this path is stale, and that is a hard failure naming where the corpus actually is.All three verified by moving the directory and running it.
Why this matters beyond one path
The zone brief already says a rig that only fails on a total revert is not testing the fix. This is that rule one turn further out: a rig that skips when its input moves is not testing anything at all, while still printing a pass. The failure mode is quieter than a wrong assertion, because there is no assertion left to be wrong.
Incidental, and a repeat offender
The new helper's doc comment originally contained a literal
*/inside a glob, which closed the block comment early and broke the file — the same trapAccept: */*set inReleases.swifta few days ago. Rewritten to describe the pattern rather than spell it.Adjacent, not mine
scripts/test-doc-index.mjsstill points attray/doc-index.mjsand dies on it — same rename, same cause, ops zone. PR #399 repairs and registers it, and should land first: it is the JS reference this rig's corpus half is diffed against.Exercised
The three home rigs (
test-tray-bridge,test-tray-index,test-tray-releases), plus a cleanxcodegen+ simulator build of the host. No Swift changed, so no save round trip was run.