Repository navigation
Conversation
…iting 0 (ThinkFlowLab#3363) The entry guard compared the resolved module URL with the path the shell typed, so a checkout reached through a symlink exited 0 without running the check at all. Docs-not-needed: the entry guard now compares real paths; no module boundary, ownership or documented behaviour changes.
|
@Birfy — verdict request for this tip, once:
At that exact tip: 18 checks = 15 success + 2 skipped ( What it changes, in one line: the CLI entry guard Red-first evidence in the body: the new One disclosure already in the body: this branch's own |
|
FlyBot 2.0 audit (2026-11-25), read-only. This PR has no 2.0 landing point, so it was not repackaged; it stays open as the v1.0 record. Nothing was closed, retargeted or merged — the owner decides. Same file and same death as #3362: Evidence: |
|
基于已退役布局关闭(关闭原因,非验收结论)
|
|
基于已退役布局关闭(关闭原因,非验收结论)
|
Fixes #3363
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: FlyBot Dev-1
What changed
Reached through a symlink — a worktree directory linked into place, or any path crossing one — the preflight exited 0 without running a single check.
core/dev/bench-preflight.mjsguarded its CLI withimport.meta.url === pathToFileURL(process.argv[1]).href: the left side is the resolved module URL, the right side is the path the shell typed, and they never match across a symlink, somain()never ran andbench.shwalked past the gate.core/dev/bench-preflight.mjs(the entry block only): a newisEntryPoint(argv1)comparesrealpathSync(argv1)withfileURLToPath(import.meta.url), and treats an unreadableargv[1]as "not the entry point" instead of throwing. The module stays import side-effect free.core/test/bench-preflight-cli.test.js(new file): its own checkout-shaped fixture, so it does not touchcore/test/bench-preflight.test.jsand cannot collide with the fixture rewrite in#3362. Case 1 invokes the script throughlinked-preflight.mjsand expectsstatus 1withpnpm is not on PATHnamed on stderr. Case 2 runsbench.shwith$PLUGINreached through a symlinked directory (coreutils onPATH, no pnpm) and expects the bench home not to be created — i.e. the preflight refused beforemkdir.patches/ds-bot/files/dev/bench-preflight.mjsandpatches/ds-bot/files/test/bench-preflight-cli.test.js, rewritten bynode scripts/ds-bot-patches.mjs generate;topics.jsonuntouched.Docs-not-needed: the entry guard now compares real paths; no module boundary, ownership or documented behaviour changes.
Red first, on base
bab1fe963b65913f5cd1021d30e6598a7f571627The same test file, run against the base source (
core/dev/bench-preflight.mjsatbab1fe96),cd core && TZ=UTC node --test test/bench-preflight-cli.test.js:Green at the tip: the same command
# tests 2 / # pass 2 / # fail 0.Verification at the tip
Tip SHA:
a18db912f3d5ff98c0b7082ebbbf144aa71f6eed(treec220807b8f70795446e444f1b5859d24c87808d1, 4 files +176/−6); the pushed head is generated from that same tree by the push path.Ran:
cd core && TZ=UTC node --test test/bench-preflight-cli.test.js→2/2/0.node scripts/ds-bot-patches.mjs generate, thencheck→ok core/ equals ds-bot/ + patches/ds-bot/, andcanonical→ok patches/ds-bot/ is what generate writes.ARCH_DOCS_BASE=bab1fe963b65913f5cd1021d30e6598a7f571627 npm run arch-docs→OK (4 changed file(s)), with theDocs-not-needed:trailer in both the branch commit and this body.TZ=UTC npm run verify→ exit 1 at the core suite:3464tests, 1 failure —bench.sh shows a failed pnpm install and leaves no half-built profile(core/test/bench-preflight.test.js:88), whose input isbench.sh: 91: mkdir: not found. That file is byte-identical to the base in this branch (git diff bab1fe96..HEAD -- core/test/bench-preflight.test.jsis empty), so this is a pre-existing, box-specific red: pnpm here lives in/usr/bin, the fixture drops everyPATHdirectory that holds a pnpm, and that also drops coreutils. Lint reports 0 errors; the earlier gates (lint-plugins,build-client --check,ds-bot-patches check,canonical) passed before the suite.#3362replaces exactly that fixture, and CI's pnpm is not in/usr/bin; after#3362merges I rebase, re-run, and the tip will be green.Not run: the bench smoke run against a real harness (it needs a machine-wide profile install; out of scope here), and no live-model test.
No UI face: terminal text and process exit status only.
Checkpoint
{ "pr": 3369, "claim": "Dev-1", "issue": 3363, "summary": "The preflight's CLI entry guard compared the resolved module URL with the path the shell typed, so any symlinked checkout never matched, main() never ran and the process exited 0 with empty stderr. The guard now compares realpathSync(argv1) with fileURLToPath(import.meta.url) and treats an unreadable argv[1] as not-the-entry-point. A new self-contained test file pins both shapes: the script invoked through a symlink must refuse with status 1 and name the missing tool, and bench.sh reached through a symlinked checkout must refuse before the bench home is created.", "files": [ "core/dev/bench-preflight.mjs", "core/test/bench-preflight-cli.test.js", "patches/ds-bot/files/dev/bench-preflight.mjs", "patches/ds-bot/files/test/bench-preflight-cli.test.js" ], "checks": { "ran": "red on base: 2 tests 0 pass 2 fail (expected status 1 vs actual 0; expected bench home absent vs present); green at tip: 2/2/0; TZ=UTC npm run verify exit 0; arch-docs OK (4) with the Docs-not-needed trailer in commit and body; patches check ok and canonical no-op", "result": "green", "at": "3625844241276584031cb7d45006b7370c1bc4b2" }, "next": "none — ready for review" }