Repository navigation
Skip the arch-docs shell-guard case on Windows - #1974
Conversation
The case can only observe its property by running a fake git that must be an executable script with a #! line; Windows cannot launch one and the bare name is not found on PATH, so the nightly Compatibility job would fail on ENOENT. Marked skipped there, which the log shows as skipped rather than passed; the real gate still runs on windows-latest in the same job's Lint step. No product code. Docs-not-needed: test-only platform guard; install.md's 'Tests for the gate' row still describes core/test/check-arch-docs.test.js and the gate's own behaviour is unchanged (ThinkFlowLab#1973).
|
@Birfy review request — PR #1974 at Test-only, 3 files: one case in What it does: the shell-guard case #1969 added ( The body argues, in this order: 1) why a platform guard is honest here rather than a bypass; 2) that Windows behaviour is still exercised by
Requested: the formal |
Rebased onto main 90b880e (ThinkFlowLab#1972/ThinkFlowLab#1974) — this commit only re-plays ThinkFlowLab#1975 there: the one conflict was both sides inserting tests at the same spot in core/test/remote-room.test.js, so main's ThinkFlowLab#1965 tests and this PR's ThinkFlowLab#1967 test are both kept.
Fixes #1973
Owner: Dev-2
Reviewer: Birfy
Written-by: Dev-2
Claim-Id: 29bd7aaba56f45cba058dd4fca5b7833
Branch: dev/2-arch-docs-win-guard
Base: 2dfc1c3
Tip SHA: 307a3b1
Tree: b751a4df993590b50118e8a9f385a281f6eb3e18
Verified commit
a9aa56d4c2f6340265d0e9d7690cb6ee1742819a(treeb751a4df…); the pushed head307a3b1a…was rebuilt from that same tree by the fork push, so the checks describe that tree, not that commit sha.Docs-not-needed: test-only platform guard;
install.md's "Tests for the gate" row still describescore/test/check-arch-docs.test.jsand the gate's own behaviour is unchanged (#1973).What changes
One line of the case, and its mirror:
core/test/check-arch-docs.test.js:68(base2dfc1c3a;:73in this tree, after the four comment lines added here) becomesNo other assertion, fixture, shell script, product file or patch source changes.
patches/ds-bot/files/test/check-arch-docs.test.jsis the mirrorgeneratewrites from that file, andchangelog.d/1973-arch-docs-win-guard.fixed.mdis the entry.1. Why
skip, and not a fakegitthat works on both platformsThe case asserts that the gate never hands git's argv to a shell, and that property is only observable by running the gate with a fake
gitthat records its parent process. The fake has to be an executable script with an interpreter line (:82writes#!/bin/sh,:98setsmode: 0o755,:106reads the marker it wrote). Windows cannot launch a#!script throughCreateProcess, and a file named plaingitwith no.cmd/.exeis not whatPATHlookup resolves, so on Windows the fake never runs, the marker never appears, and:106throws. There is no cross-platform form of this fixture that still observes the same property; asserting it from the source instead would no longer be this test. A platform guard on this one case is therefore honest, not a bypass.2. What still covers Windows
The guard silences one local unit case; it does not silence the platform.
nightly.yml'sweeklyjob runs onwindows-latest(:140), and itsLintstep (:162) runs the realcore/scripts/check-arch-docs.mjsthere — that is exactly the step #1954/#1969 existed for, where a^eaten by cmd.exe made every scheduled row reportcannot diff against origin/main. Windows behaviour of the gate stays observed by that step.3. What the guard costs elsewhere
Nothing new is introduced:
process.platform === 'win32'is already how this repository handles a POSIX-only assertion (core/test/state-journal.test.js:13,const posix = process.platform !== 'win32'). The option isnode:test's own second argument, so the case reports as skipped in theTestsstep rather than as passed — the log still shows the capability is not exercised on Windows, and theLintstep above is where it is. A probe confirms that shape: a case with{ skip: true }printsok 1 - … # SKIPand the summary counts# pass 0/# skipped 1.4. Evidence this is a real red today
Reproduced on this tree by dropping only the exec bit (
{ mode: 0o644 }), which is all Windows changes for this fixture:On the real job it has not been seen yet, because it could not be reached: the last nightly run
41238672148(job124647780373, 2026-10-31T20:23:36Z) stopped atLintand never ranBuild/Tests. #1969 fixed thatLintfailure, so the next weekly run (2026-11-07 17:00Z) is the first that would reachTests— which is what this PR prevents from failing.5. Red first is not available in the usual shape
The case is already green on Linux, so this change has no failing-test-first step to show: the fix is a platform guard, and the red it prevents is only reachable on Windows. The Linux run below exercises the case unchanged (it still runs there,
7tests,7pass).Ran
On the committed tree with a clean
git status, once:TZ=UTC ARCH_DOCS_BASE=2dfc1c3a90f25de8b58a6f8e968aacded101a782 npm run verify— exit 0.2371pass /0fail — the same count as base2dfc1c3a, as expected: no case is added and the guard changes nothing on Linux541(540pass,1skip) · tree127(126,1) · timeline135(134,1) · workflow336·.github/scripts563· interop37· live-e2e24, all0failOK (3 changed file(s)); lint73core +36social +9timeline +2tree +16workflow warnings,0errors; interop lint1warning (dev/interop/isolation/probe.mjs:130), live-e2e lint0warnings,0errorsnode scripts/ds-bot-patches.mjs generate→ no diff;check→ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70,10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/;canonical→generate is a no-opnode .github/scripts/changelog.mjs check→9 fragment(s) in changelog.d/ are well formedcmp core/test/check-arch-docs.test.js patches/ds-bot/files/test/check-arch-docs.test.js→ byte-identicalNot run: the Windows job itself (it cannot be dispatched from here), the CI
packagejob, typecheck and actionlint. No manual browser check was needed — this change touches no runtime code.Checkpoint
{
"pr": 1974,
"claim": "Dev-2",
"issue": 1973,
"summary": "The arch-docs shell-guard case added in #1969 can only observe its property by running a fake
gitthat must be an executable script with an interpreter line, which Windows cannot launch and whose bare name PATH does not resolve, so the weekly Compatibility job would fail it with ENOENT. It now carries node:test's { skip: process.platform === 'win32' }, so the Tests step reports it as skipped rather than passed, while the same job's Lint step still runs the real gate on windows-latest. No product code changes; the patches mirror and a changelog fragment go with it.","files": [
"core/test/check-arch-docs.test.js",
"patches/ds-bot/files/test/check-arch-docs.test.js",
"changelog.d/1973-arch-docs-win-guard.fixed.md"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=2dfc1c3a90f25de8b58a6f8e968aacded101a782 npm run verify; node scripts/ds-bot-patches.mjs check; node .github/scripts/changelog.mjs check",
"result": "green",
"at": "307a3b1ad7b1a8e6949022b6c20610ba5c67f69d"
},
"next": "none — ready for review"
}