Repository navigation
Commit 16473c0
authored
test: run core's suite on Windows and name every POSIX shape it cannot
express (#3293)
Fixes #3293
Owner: Dev
Reviewer: Reviewer
Written-by: Dev
Tip SHA: 546a6f8
Base: 5620b96
`weekly`'s Windows leg (`compat · windows-latest · Node 24 · DSH
0.2.1-rc.2`) has been red on unchanged `main` since it was added: `ℹ
fail 54` on 2026-11-21 (`job 136999263352`, head `5620b96f`, this
branch's base) and `ℹ fail 45` on 2026-11-14 (`job 132588187493`). Every
one was a POSIX assumption in a test, not a regression from a merge.
This branch gives each one the assertion its platform can make, leaves
product code untouched, and skips only the shapes Windows cannot build —
one case at a time, by name and reason.
## Review round 2 (`REQUEST_CHANGES` at `e24133e7`)
1. **The relaxed assertion is strict again.**
`core/test/diagnostics.test.js:1970` compared `stderr.filter(...)`,
which let any second stderr line through. It is the base form
(`5620b96f:1942`) verbatim again, only the code taken from
`deniedCode()`:
```js
assert.deepEqual(stderr, [`[ds-bot] diagnostics log not truncated:
${deniedCode()}`], 'one line, the code and never the folder')
```
82/82 at this tip. With one extra `console.error('… the log that would
not truncate is ' + logPath)` in `clear()`'s refusal branch, the tip's
filter form passes and this form fails with the folder in the diff — the
mutation is reverted before every run quoted here (`red.txt`). The
mirror carries the same line: `check` says the series reproduces
`core/`, `package`'s `canonical` agrees on a real checkout, and the
probe's `generate` + `git status --porcelain` came back empty.
2. **The tip had no Windows execution; it has one now** — twice: the
faithful dispatch below (`44994864729`) and a green one on the same
workflow (`44995172673`), both `3424 / 3404 / 0 / 20`. Numbers, job ids
and the skip list are in [the
comment](#3294 (comment)).
## Red → green, by class
Red is quoted per case in `red.txt` (the two scheduled Windows logs
above); on Linux every case was already green, so nothing was made green
by loosening it.
| class | red on 2026-11-21 | now green because |
| --- | --- | --- |
| 1. teardown removed the home before the index closed | 11 cases:
`chat-index-writers.test.js:94` (`EPERM … ds-bot-index-*`, 10 cases) and
`host-pairing.test.js:44` | one teardown per test stops every host
opened over the home — closing the SQLite index and the read-only window
— and removes the directory last. No `force` retry over a live writer. |
| 2. POSIX mode bits | 10 cases: `private-files.test.js:50` ×7 (`'0666'
!== '0755'`), `secrets.test.js:109` (`438 !== 384`),
`workflow-store.test.js:396` (`54 !== 0`), plus the two `#2614` folder
cases | `core/test/platform.js` adds `modeOf`/`assertMode`: the four
octal digits on POSIX, `writable`/`readonly` on win32, with a failure
message that says why `0600`/`0700` cannot be observed there. No
assertion was deleted. The two `#2614` cases that need a folder made
unlistable are win32 skips with the reason. |
| 3. `EACCES` where Windows says `EPERM` | the diagnostics report cases:
not written, last-append reason, clear-not-truncated (`'… not truncated:
EPERM'` vs `'… EACCES'`), unreadable journal | `deniedCode()` names the
code the platform answers; the product sentence is untouched and every
assertion still compares one whole line. |
| 4. a bare path handed to a child as an ESM specifier |
`resume-atomic.test.js:107/137/165` (each burned its 30 s timeout:
`ERR_UNSUPPORTED_ESM_URL_SCHEME … protocol 'd:'`),
`workflow-store.test.js:752/805`, `unread-mark-menu.test.js` (fails as a
file) | children get `.href` file URLs, and esbuild gets
`fileURLToPath(...)` instead of a URL's `pathname` (which kept the
leading slash before the drive letter). |
| 5. shapes Windows does not have | `kill -9` (3 cases), `chmod 000`
unreadable files, `chmod` unlistable folders, a permissioned child
behind a junction | each is one case gated on `win32`, with the reason
in the name and in the `skip` option. Nothing is dropped on POSIX and no
file is skipped whole. |
| 0. path spelling, pid 1, start-up race, `settle` polling |
`diagnostics.test.js:397` (`'~\\journal\\state.jsonl'` vs
`'~/journal/state.jsonl'`), `chat-anchors.test.js:97` (`0 !== 1`),
`real-dir.test.js:79` (a Windows `ENOENT` where the case wants
`ENOTDIR`), `group-work.test.js:450` (`EPERM … state.json.<pid>.tmp ->
state.json`), `group-work.test.js:495` | the `~` sentences are built
from the platform separator, the live-lock fixture names `process.ppid`
(pid 1 is never alive on Windows), `chat-anchors` waits for `rt.load()`,
`real-dir` asks for an unparseable name where Windows has no `ENOTDIR`,
and `group-work` polls the runtime's own log instead of reading
`state.json` while the host renames over it. |
Nine commits: eight, one per class plus one that regenerates
`patches/ds-bot/` (the repo's `package` gate requires `core/` to equal
`ds-bot/` + patches), and one that restores the strict diagnostics
assertion after the review.
## Windows evidence at this tip
`nightly.yml` cannot measure a branch: it duplicates the `flybot-tests`
steps but omits their `Fetch origin/main for arch-docs check` step, so a
dispatch on a branch dies in `npm run lint` before a single test
(`arch-docs: FAIL — cannot diff against origin/main`, run
`44989406764`). That gap is now its own issue, #3295; no `.github/**`
file is in this PR.
The evidence run therefore uses a scratch branch,
`probe/3293-windows-fix`: this tip plus `.github/workflows/nightly.yml`,
and nothing else — the missing fetch step (copied verbatim from
`.github/actions/flybot-tests/action.yml`) and one Linux-only step that
runs `generate` and prints `git status --porcelain`. Nothing under
`core/` or `patches/` differs from the tip. The branch is deleted after
the runs, never opened as a pull request, never merged.
Run
[44994864729](https://github.com/ThinkFlowLab/FlyBot/actions/runs/44994864729)
at `98127c10`, job
[137123632278](https://github.com/ThinkFlowLab/FlyBot/actions/runs/44994864729/job/137123632278)
(`compat · windows-latest · Node 24 · DSH 0.2.1-rc.2`):
```text
ℹ tests 3424
ℹ pass 3404
ℹ fail 0
ℹ skipped 20
ℹ duration_ms 77229.8687
```
54 → 0, at a tip that has now actually executed every win32 branch this
PR adds: `modeOf`/`assertMode`, `homePath`/`sep`, the private-files
`EPERM` refusal branch, the `real-dir` NUL path, the corrected teardown,
and the restored strict diagnostics assertion at `EPERM` (`✔ a clear
that cannot truncate the leaf still says so on one line`).
The 20 skips: 5 were already there before this branch (`bench.sh` ×2,
`the gate never runs git through a shell`, the two line-break backup
names) and 15 are the named `win32` cases of class 5 and of the two
races below, each with its reason in the report.
**That job is still red after the suite**, at `Plugin lint`, and not
because of a test: `scripts/lint-plugins.mjs` extracts a plugin tarball
with GNU `tar`, which reads the `C:\` in `-C C:\…` as a remote host, so
the plugin lint and the four plugin suites never start. Filed as #3296,
outside this diff.
```text
##[group]Run node scripts/lint-plugins.mjs
=== pack-import plugins\project ===
tar (child): Cannot connect to C: resolve failed
Error: Command failed: tar -xzf C:\Users\…\flybot-pack-…\flybot-project-0.1.0.tgz -C C:\Users\…\flybot-pack-…
at packPlugin (file:///D:/a/FlyBot/FlyBot/scripts/lint-plugins.mjs:102:3)
```
For a green job on everything this diff does touch, the same probe
workflow was dispatched once more with only those five plugin steps
gated `runner.os != 'Windows'` — no test step changed, nothing under
`core/` changed: run
[44995172673](https://github.com/ThinkFlowLab/FlyBot/actions/runs/44995172673),
job
[137124567241](https://github.com/ThinkFlowLab/FlyBot/actions/runs/44995172673/job/137124567241)
— green, same numbers (`3424 / 3404 / 0 / 20`, `duration_ms
73544.9057`).
## Two skips that name a product gap, not only a test shape
The two races are skipped on win32 because the POSIX guarantee they
prove cannot be built there — Windows refuses a `rename` onto a name
another handle holds:
- `#2724` `decisions-race.test.js` — two writers replacing one
`decisions.jsonl` at the same instant: the second `record_decision` is
refused (`EPERM`), so the case cannot run.
- `#2762` `workflow-store.test.js` — a writer saving while a second
process polls the file: the save is refused.
On both platforms the caller is told (`a decision was not written`, the
save's `ok: false`), so nothing is silently lost; but on Windows a save
or a record can be *refused* where POSIX replaces the file
unconditionally. That is a real platform difference that a test cannot
paper over — it needs a product decision (a retry, or a lock around the
replace) and is out of this issue's scope. Reported here instead of
hidden.
The memory case is the one place the test now asserts the Windows truth
instead of skipping: `chmod 0400` sets the read-only attribute there, so
the second `remember` is refused — the answer is checked to name the
code it was refused with, the file must still hold the entry it had, and
the file must still be narrow. Its POSIX half is unchanged.
## Linux evidence at the same tip
Both `ubuntu` legs of the faithful run passed (`137123632247` node 22,
`137123632343` node 24 · alpha.1): core `3424/3424`, social `758`, tree
`152`, timeline `172`, workflow `544`, all `fail 0`, `skipped 0`. The
probe loop also ran `node scripts/ds-bot-patches.mjs generate` on a real
git checkout there and printed `git status --porcelain` after it:
**empty**, i.e. the committed series is what generate writes — the same
question `canonical` asks in the `package` job.
## Ran at this tip:
```text
$ (cd core && node --import ./test/harness-resolve.mjs --test test/private-files.test.js test/decisions-race.test.js)
# tests 11 / # pass 11 / # fail 0
$ (cd core && node --import ./test/harness-resolve.mjs --test test/workflow-store.test.js)
# tests 32 / # pass 32 / # fail 0
$ (cd core && node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js) # strict stderr array restored
# tests 82 / # pass 82 / # fail 0
$ (cd core && node dev/harness/node_modules/oxlint/bin/oxlint -c .oxlintrc.json <the 13 changed test files>)
Found 0 warnings and 0 errors.
$ (cd core && node scripts/build-client.mjs --check) ; echo exit=$?
exit=0
$ node scripts/ds-bot-patches.mjs check
skipped pin (no git): the tree hash cannot be computed here
ok 10 patches apply cleanly in order
ok core/ equals ds-bot/ + patches/ds-bot/
$ node .github/scripts/changelog.mjs check
changelog: 2 fragment(s) in changelog.d/ are well formed
$ node .github/scripts/testing-layers.mjs --check
testing-layers: every test file and every workflow is classified
```
The full suite on this machine (which has node 22 only — no git, no
curl, no python3): `# tests 3424 / # pass 3420 / # fail 2 / # skipped
2`. Both failures are `check-arch-docs.test.js` and both are the missing
`git` here; the untouched `main` tarball fails the same two, which is
the control.
Not run: `npm run verify` and `npm run arch-docs` as one command (no
`git`/`origin/main` on this machine — `arch-docs` is answered by the
runs above: `arch-docs: OK (28 changed file(s))`),
`generate`/`canonical` locally (no git — answered by the empty `git
status --porcelain` on the ubuntu leg and by `package`), the smoke test
(tests only, no endpoint or start-up path), `ci:local` (no Mac), and the
plugin suites on Windows (the job stops at `lint-plugins`, #3296).
Tip `546a6f8c5679ea6ea366dd18027bff5267e846a3`, tree
`b24433c5ddab6e1f77714795a1ea76bb3965eb6c`, base
`5620b96ff7fa2ae08c6a25b48131f23235c0f1ae`. 28 files: 14 under
`core/test/` and their mirror entries under `patches/ds-bot/`; no
product file changed.
Docs-not-needed: only `core/test/**` and the generated `patches/ds-bot/`
mirror changed; no subsystem page owns these tests, no documented
behavior changed, and the one product gap this run found is reported
above rather than fixed.
## CI at this tip
`tests-ok` green (`ubuntu-latest · Node 24 · DSH 0.2.0-rc.2`), `package`
green — its `ds-bot-patches check` and `canonical` run on a real git
checkout there, so the mirror is byte for byte what `generate` writes —
`merge-gate`, `plugins (tree|social|timeline|workflow)` and
`policy-sign` green (no gate file touched at this tip). `enqueue-guard`
is red only for `no Verifier report names the tip`, which is the review,
not a defect.
## Checkpoint
<!-- flybot:checkpoint -->
{
"pr": 3294,
"claim": "Dev",
"issue": 3293,
"summary": "The core suite goes from 54 Windows failures to 0, and this
tip ran on windows-latest twice: 3424 tests, 3404 pass, 0 fail, 20 named
skips. Teardown stops the host before removing its home, mode checks go
through deniedCode and assertMode, children get file URLs, and only the
shapes Windows cannot build are skipped by name and reason. The review's
two items are answered: the strict stderr assertion is back (82/82) and
the Windows leg is measured, not read. It still stops after the suite in
scripts/lint-plugins.mjs (#3296), and that is not a test.",
"files": [
"core/test/diagnostics.test.js",
"core/test/platform.js",
"core/test/private-files.test.js",
"patches/ds-bot/0007-version-and-tooling.patch"
],
"checks": {
"ran": "nightly.yml at this tip on a scratch branch: windows-latest 3424
tests / 3404 pass / 0 fail / 20 skipped, twice (44994864729,
44995172673); diagnostics.test.js 82/82 with the strict assertion;
ds-bot-patches check ok",
"result": "green",
"at": "546a6f8c5679ea6ea366dd18027bff5267e846a3"
},
"next": "Reviewer re-review at 546a6f8; follow-ups #3295 (nightly.yml
needs the arch-docs fetch step) and #3296 (lint-plugins tar on
Windows)."
}
<!-- /flybot:checkpoint -->
1 parent 5620b96 commit 16473c0
28 files changed
Lines changed: 624 additions & 216 deletions
File tree
- core/test
- patches/ds-bot
- files/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
95 | 107 | | |
96 | 108 | | |
97 | 109 | | |
| |||
171 | 183 | | |
172 | 184 | | |
173 | 185 | | |
| 186 | + | |
174 | 187 | | |
175 | 188 | | |
176 | 189 | | |
177 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
178 | 195 | | |
179 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
180 | 199 | | |
181 | 200 | | |
182 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
0 commit comments