From b29e3b467679f73e677fb597f57aad0e31193fbb Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Thu, 6 Aug 2026 21:08:14 -0500 Subject: [PATCH] Judge the baselines against the PREVIOUS release, not the newest tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cutting 1.9.31 turned a green tree red, and the failing assertion named a baseline rather than the tag that caused it. "Shipped source" was resolved as the newest v* tag. That is wrong at exactly one moment, and it is a moment that arrives at every release: on the release commit the newest tag IS HEAD, so shipped source becomes the working tree, every biconditional inverts, and the build demands BASELINE.web gain audio.volume — for displays that cannot have the fix until this very release reaches them. Tagging a release should not be able to change what the release is allowed to contain. A baseline describes an UN-UPDATED display, so the source it is judged against is the release BEFORE the one being cut. Skip any tag pointing at HEAD and use its predecessor: v1.9.30 here, and the newest tag as before during ordinary development. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_014skWYXJUWhF73EvNPgB2AS --- server/test/player-parity-baselines.test.js | 39 ++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/server/test/player-parity-baselines.test.js b/server/test/player-parity-baselines.test.js index d48b4ee..3997692 100644 --- a/server/test/player-parity-baselines.test.js +++ b/server/test/player-parity-baselines.test.js @@ -49,16 +49,37 @@ const read = (p) => fs.readFileSync(path.join(ROOT, p), 'utf8'); * Green locally, red in CI, for a reason visible nowhere in the diff. A skipped assertion announces * itself; a wrong one does not. (ci.yml now checks out with fetch-depth: 0 so this stays a backstop.) */ -let shippedFromTag = false; +/* + * "Shipped" means the newest release that is NOT the one being cut. Taking the newest tag outright + * is wrong at exactly one moment, and it is a moment that happens every time: on the release commit + * the newest tag IS HEAD, so shipped source becomes the working tree, every biconditional inverts, + * and the build demands a baseline claim a capability that no fielded display can have until this + * release reaches it. Found by cutting 1.9.31 — the tag turned a green tree red. + * + * A baseline entry moves when the fix reaches displays, which is the release AFTER the one carrying + * it. So skip any tag pointing at HEAD and judge against its predecessor. + */ +function previousReleaseTag() { + const head = execSync('git rev-parse HEAD', { cwd: ROOT, encoding: 'utf8' }).trim(); + const tags = execSync("git tag --list 'v*' --sort=-v:refname", { cwd: ROOT, encoding: 'utf8' }) + .split('\n').map((t) => t.trim()).filter(Boolean); + for (const t of tags) { + const at = execSync(`git rev-list -n1 ${t}`, { cwd: ROOT, encoding: 'utf8' }).trim(); + if (at !== head) return t; + } + return null; +} + +let SHIPPED_TAG = null; +try { SHIPPED_TAG = previousReleaseTag(); } catch (e) { /* no git, or no tags */ } +const shippedFromTag = !!SHIPPED_TAG; + function readShipped(rel) { - try { - const tag = execSync("git tag --list 'v*' --sort=-v:refname | head -1", { cwd: ROOT, encoding: 'utf8' }).trim(); - if (tag) { - const src = execSync(`git show ${tag}:${rel}`, { cwd: ROOT, encoding: 'utf8', maxBuffer: 1 << 26 }); - shippedFromTag = true; - return src; - } - } catch (e) { /* no tags, or the path did not exist in that release */ } + if (SHIPPED_TAG) { + try { + return execSync(`git show ${SHIPPED_TAG}:${rel}`, { cwd: ROOT, encoding: 'utf8', maxBuffer: 1 << 26 }); + } catch (e) { /* the path did not exist in that release — fall through */ } + } return read(rel); }