Repository navigation
fix(statechart): resolve the mise ceiling folder and run the TLC tests on macOS - #314
Conversation
0d3967f to
91f2467
Compare
|
Verdict: FAIL Root verdict from a full swarm. All three lanes ran at Live lane: PASS.
Audit lanes:
Findings sent back (in scope; real callers reach them):
Notes (non-blocking):
|
|
On a macOS host with mise, 18 of 150 statechart tests failed, and under a symlinked TMPDIR Not covered. CI still skips 92 of the 151 statechart tests, the TLC ones among them. There, only the fake-mise Details for reviewersRisk. Low. The one production change is the resolved ceiling folder and the Base Start here. Then.
Proof. lint run on the head, where the fake-mise These pointers are a start, not the review. Read the whole diff, because a defect can sit in a file this recap ranks low. |
|
Verdict: PASS+NOTES Root verdict for round 2. One trail reviewer (sonnet@xhigh, stepped down from the opus work model) checked it, because the round is a minor fix: +31 -1 across two files, the new test and PORTING.md, with
Notes, non-blocking:
|
…acOS On a macOS host with TLC, 17 of the 18 failing statechart tests failed for two reasons in the test file, not in the scripts. The test folders came from an unresolved TMPDIR under /var, while a run's cwd resolves to /private/var. The scripts then printed the kept work folder as an absolute path where the tests expect one relative to the cwd, and TLC printed module paths under /private/var. The test file now resolves TMPDIR once, before any folder is made. macOS ignores LD_PRELOAD, so the rename shim never loaded and four tests saw renames succeed. A fifth passed without exercising anything. On darwin the shim now loads through DYLD_INSERT_LIBRARIES, which Node's signature allows. It replaces mkdir and rename through __interpose entries, and it calls libc's functions directly, because dlsym(RTLD_NEXT) returns the replacement there and recursed. Refs #308
…ling test findTlc runs mise in an empty temp folder and names that folder in MISE_CEILING_PATHS. mise compares the ceiling with its resolved cwd, so a temp folder named through a symlink does not stop the search, and mise reads the untrusted mise.toml above it. The test now reaches TMPDIR through a symlink, so it fails on any platform until the ceiling is a resolved path. Before the test file resolved TMPDIR, the /var link on macOS hit the same failure. Refs #308
findTlc named its empty temp folder in MISE_CEILING_PATHS as os.tmpdir() spelled it. mise compares the ceiling with its resolved cwd, so when TMPDIR runs through a symlink, as /var does on macOS, mise climbed past the folder and failed on an untrusted mise.toml above it. findTlc now resolves the folder first. The install command that the error prints had the same fault, because the shell's $PWD keeps the symlink. It now uses $(pwd -P). PORTING.md records these and the test-file edits as port edits, so the next upstream sync keeps them. Closes #308
The entry left out the installCommand helper and the spread call sites of failingRenames, so a sync that took upstream's test file whole would break tests against the ported script.
…runs it The real-mise ceiling test skips in CI, which has no mise, so a regression in the resolved MISE_CEILING_PATHS would pass there. This test runs findTlc with the fake mise under a mise.toml that sets locked = true, above a TMPDIR reached through a symlink. With the unresolved ceiling, mise reads that file and install fails in --locked mode.
A sync keeps only the edits the entry lists. It missed two older ones: the imports and scripts constant that point back into skills/ since #297 moved the file to tests/, and the /srv/u fixture path that check-personal-paths.py needs since #304. It also cited a test-location rule by a name PORTING.md never defines, so it now names the entry that states the rule. The count covers the new fake-mise findTlc test.
0fdd6f1 to
86280d0
Compare

Why
On a macOS host with mise, 18 of the 150 statechart tests failed, so the statechart tier of
tools/gate-check.sh testwas red. Three causes produced the 18 failures. Two were in the test file. The third was a real bug infindTlc: under a symlinked TMPDIR, mise read an untrustedmise.tomlabove the temp folder.Closes #308
What changed
findTlcresolves its empty temp folder before it names it inMISE_CEILING_PATHS, because mise compares the ceiling with its resolved cwd. The install command in the error message uses$(pwd -P)in place of$PWD.DYLD_INSERT_LIBRARIESand replacesmkdirandrenamethrough__interposeentries, because macOS ignoresLD_PRELOAD. The real-mise test reaches TMPDIR through a symlink, so on a host with mise it fails without the ceiling fix on any platform.findTlcwith the fake mise under alocked = truemise.tomlabove a TMPDIR reached through a symlink. It needs no mise or TLC, so CI runs it and guards the ceiling fix there.statechart.test.mjshas beyond upstream, so the next sync from cursor/plugins keeps them. Two of them predate this PR and were missing: the imports that point back intoskills/and the/srv/ufixture path.Scope
.github/workflows/**, which the gate protects. It also adds about 5 minutes and a 305 MB Java and TLC install to the requiredskillsjob, and it brings mise into CI as a new pinned tool fortools/test_repository_hardening.pyto admit. That cost belongs in its own PR.Tradeoffs
The shim keeps upstream's C body and adds
#ifdef __APPLE__blocks before and after it, so the next sync can carry upstream's edits to that body unchanged. On darwin,dlsym(RTLD_NEXT)returns the interposed replacement and recursed, so a macro sends the shim's lookups to libc's own functions.Blast Radius
The production change touches only how
findTlcruns mise. A resolved path names the same folder, so Linux hosts without symlinks behave as before. CI still skips the TLC tests and now runs one more test, the fake-misefindTlctest.Verification
node --test tests/skills/statechart/scripts/test/*.test.mjswent from 18 failed to 151 tests with 147 passed, 0 failed, 4 skipped. The real-mise ceiling test fails on its own commit before the fix and passes after it.findTlctest fails on the basetlc-tools.mjswithNo lockfile URL found for java@temurin-25 (--locked mode), and it fails the same way when only therealpathSyncline is reverted. It passes at head.node:24, no mise, no Java, like CI): the new test fails on the basetlc-tools.mjsand passes at head. The suite gives 151 tests with 58 passed, 0 failed, 93 skipped.node:24, mise 2026.10.19,java@temurin-25, TLC 1.7.4): head gives 151 tests with 147 passed, 0 failed, 4 skipped, with all 5 rename tests running throughLD_PRELOAD.tools/gate-check.sh lintandtools/gate-check.sh testpass every check on this macOS host at the head commit, including the statechart tier that statechart: 18 TLC-backed tests fail on macOS and never run in CI #308 reported as FAIL.✅ Low: The production edit is one realpathSync call plus a
$(pwd -P)hint. The test edits are bounded: a global TMPDIR resolve, a symlinked-TMPDIR guard that runs against the fake mise (which, like real mise, walks up from the resolved cwd), and a darwin-only interpose block in the rename shim that Linux compiles out. PORTING.md accounts for all seven test-file edits.Updates from git push no-mistakes