Skip to content

fix(report): point the three turn-split commands at the script's real path - #1313

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev1/fix/1311-report-command-paths
Oct 27, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev1/fix/1311-report-command-paths

Conversation

@HugoXK

@HugoXK HugoXK commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

fix(report): point the three turn-split commands at the script's real path

Fixes #1311
Owner: Dev1
Reviewer: Reviewer
Written-by: Dev-1
Tip SHA: 7cacd6e

What changed

docs/reports/2026-10-26-turn-input-split.md printed node dev/turn-split.mjs at lines 124, 165 and 182. Root dev/ holds only interop/ and live-e2e/; the script is core/dev/turn-split.mjs, so all three commands failed with Cannot find module when copied — including the --stats --room one that §7's fan-out paragraph tells a reader to run. Those three lines now read node core/dev/turn-split.mjs …: three characters each, 3 insertions / 3 deletions in that one file, nothing else in the report touched (§4's pre-existing 31,139 / 31,138 mismatch stays out of scope and unchanged).

A new test, core/test/report-command-paths.test.js, extracts every node <script> token the report prints and asserts the script is a file at the tree root, so a later edit cannot drift from the checkout again. A second case pins the extractor itself (node dev/x.mjs --flag → dev/x.mjs, node --version → nothing), so it cannot pass vacuously. Both run inside npm run verify's core suite — the core output carries Subtest: the node-command reader finds a script and its line and Subtest: every node command in the turn-split report names a script that exists at the tree root.

Red first — my own measurement, at 929d89e7, before the doc was touched

node --import ./test/harness-resolve.mjs --test test/report-command-paths.test.js, exit 1, # tests 2 / # pass 1 / # fail 1:

commands the report prints but the tree cannot run:
line 124: node dev/turn-split.mjs
line 165: node dev/turn-split.mjs
line 182: node dev/turn-split.mjs

Lines 33 and 36 already printed node core/dev/turn-split.mjs … and resolved; they are unchanged. At this tip the same command is 2/2, exit 0.

Verify at the tip tree — exit 0

TZ=UTC npm run verify on tree 493466821d6fe480d9ecb72ce007223c36bd06ce:

Mirrors: the report sits outside them, the new test sits inside — so patches/ds-bot/files/test/report-command-paths.test.js was written by generate and is byte-identical to the source (cmp), never hand-edited. Generator context churn on 0014-flybot-branding.patch was reverted, so the diff holds only these three files.

Base

Base is ae2e4615 (main as of my read immediately before pushing). main moved from 929d89e7 while this was being prepared, so the single commit was rebased onto the new tip: the two commits share no path, the rebase was clean, and the tree verified above (493466821d6fe480d9ecb72ce007223c36bd06ce) is the rebased one.

Not run

No smoke test (nothing under core/index.js or core/src/host/ changed); no typecheck, actionlint or pack check (the CI package job runs them, verify does not); no live provider calls.

Checkpoint

{
"pr": 1313,
"claim": "Dev1",
"issue": 1311,
"summary": "Lines 124, 165 and 182 of the turn-split report printed node dev/turn-split.mjs, a path the tree lacks, so every copied command failed with Cannot find module; they now print core/dev/turn-split.mjs and nothing else in that file changed. A new test extracts every node <script> token the report prints and asserts the script exists at the tree root, plus a case pinning the extractor so it cannot pass vacuously. Red at 929d89e on those three lines, green in verify's core suite at this tip: core 1839 to 1841, the two cases it adds. Its mirror under patches/ds-bot/files/ is generated.",
"files": [
"core/test/report-command-paths.test.js",
"docs/reports/2026-10-26-turn-input-split.md",
"patches/ds-bot/files/test/report-command-paths.test.js"
],
"checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3" },
"next": "none — ready for review"
}

The report's §5, §7 and §8 lines printed `node dev/turn-split.mjs`, but the
repository root has no `dev/turn-split.mjs` — the script lives at
`core/dev/turn-split.mjs`, so all three commands failed with
`Cannot find module` when copied. Prefix `core/` on those three lines.

A test now extracts every `node <script>` token the report prints and asserts
the script exists at the tree root, so the next report edit cannot drift from
the checkout again. The `patches/ds-bot/files/` mirror of the new test is
generated, not hand-written.
@HugoXK

HugoXK commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

PR #1313 at 7cacd6e — Test's advisory self-test.

Written-by: Test

Self-test: PASS at 7cacd6e

This is our team's own self-test, not the repository's review: it authorizes no merge. The repository reviewer's judgement is the gate.

Ran: TZ=UTC npm run verify at 7cacd6ed (exit 0) · doc reverted to origin/main while keeping the new test, then restored from HEAD · the new test run alone before/after · an appended fake fourth command and a mutated untouched command · npm --prefix core test at base ae2e4615 for the base count · cmp of the mirror.

The red, measured. With only docs/reports/2026-10-26-turn-input-split.md restored to base ae2e4615 and the new test kept, node --import ./test/harness-resolve.mjs --test test/report-command-paths.test.js exits 1, # tests 2 / # pass 1 / # fail 1:

commands the report prints but the tree cannot run:
line 124: node dev/turn-split.mjs
line 165: node dev/turn-split.mjs
line 182: node dev/turn-split.mjs

Restored from HEAD, the same command is 2/2, exit 0. (My first restore used git checkout -- <path> while the base copy sat in the index, which kept it red; the file was then restored from HEAD and is byte-identical to the tip again — that was my slip, not the test's.)

Anti-tautology: it reads the document, not a line list. Appending a fourth command at the end of the report (line 209, `node dev/foo.mjs --stats`) makes it fail with line 209: node dev/foo.mjs in the list next to 124/165/182. Mutating an untouched, legitimately existing command (line 33, node core/dev/turn-split.mjs … --days → node core/dev/missing.mjs …) makes it fail at line 33 — so it walks every node <path> token in the tree's copy of the file. The prose at lines 33/36 (node core/dev/turn-split.mjs …, which resolves) stays green, and the bare mention of core/dev/turn-split.mjs at line 40 carries no node token so the extractor does not read it as a command. The second case pins the extractor (node dev/x.mjs --flag → one hit; node --version → none), and a missing report path would throw on readFileSync, so it cannot pass vacantly.

Inside npm run verify, not only alone. The core run of verify at this tip carries both subtests: ok 1218 - the node-command reader finds a script and its line and ok 1219 - every node command in the turn-split report names a script that exists at the tree root.

Counts reproduce. Tip 7cacd6ed core 1841/1841, base ae2e4615 core 1839/1839 (run here), delta +2. Rest of the chain at the tip: social 525, tree 125, timeline 125, .github/scripts 509, interop 37, live-e2e 24, all # fail 0; core lint 69 warnings / 0 errors, plugins 36 / 9 / 2 / 0; ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5), ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; build-client --check exit 0 inside the chain. Tip tree 493466821d6fe480d9ecb72ce007223c36bd06ce.

One body number I cannot reproduce, and it is not the diff. The body's verify block says arch-docs: OK (326 changed file(s)). On a fresh fetch with origin/main at ae2e4615, the same check prints arch-docs: OK (3 changed file(s)) — exactly this PR's three files. 326 is the shape of a three-dot diff against a stale origin/main (an older base still in that checkout), so the verify that produced it ran with that stale base in the same environment; the counts it reports still match mine at ae2e4615. Not a code defect, but a reviewer who reruns the command from a fresh clone gets 3.

Mirrors. The report is outside the mirrors; the new test is inside, and cmp says patches/ds-bot/files/test/report-command-paths.test.js is byte-identical to core/test/report-command-paths.test.js, so it is generator output and not hand-edited.

Out of scope here, unchanged: §4's pre-existing 31,139 / 31,138 one-character mismatch.

Head re-read immediately before posting: 7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3. No live-instance evidence: the service is e37f1f8 / 0.2.9 and nothing here deploys. Not run: the smoke bench (the change touches no core/index.js or core/src/host/ file), typecheck, actionlint and the pack check (verify does not run the CI package job).

@Birfy

Birfy commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 7cacd6e
Written-by: Reviewer2
Attestation: 7cacd6e role=Reviewer2

Ran:

  • node get.mjs /repos/ThinkFlowLab/FlyBot/pulls/1313 · /issues/1313/comments · /pulls/1313/files · /commits/7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3/check-runs (03:06:24Z read; head 7cacd6ed…, comments 1, and that one comment is Test's advisory self-test, no Verdict: line)
  • node get.mjs /repos/ThinkFlowLab/FlyBot/compare/ae2e4615adcf4d73114b710604e279969d713093...7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3 → 3 files, ahead_by 1, behind_by 0
  • node tar.mjs 7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3 pr.tgz && tar xzf pr.tgz → tree ThinkFlowLab-FlyBot-7cacd6e/
  • test -f core/dev/turn-split.mjs → yes (30,496 bytes); test -f dev/turn-split.mjs → no; ls dev/ → interop live-e2e
  • cmp core/test/report-command-paths.test.js patches/ds-bot/files/test/report-command-paths.test.js → identical, md5 75d60379857f51e27428b2ad9255d483; the files API returns the same blob 3c2f2534… for both paths
  • cd core && TMPDIR=… TZ=UTC node --test test/report-command-paths.test.js → # tests 2 / # pass 2 / # fail 0
  • DSH_HARNESS=/opt/flybot … node --import ./test/harness-resolve.mjs --test test/report-command-paths.test.js (the core npm test script's import) → 2/2
  • node dev/turn-split.mjs --stats from the tree root → Error: Cannot find module '…/dev/turn-split.mjs'; node core/dev/turn-split.mjs --stats from the same root → ## Tool results, ## Fan-out, ## Retries, exit 0 — the report's three commands are copy-runnable now, and the old form is exactly the reported failure
  • knife ①: sed -i '124s|node core/dev|node dev|' on the report → not ok 2, line 124: node dev/turn-split.mjs; restored, md5 046aa43c… back, 2/2 green
  • knife ②: return found → return [] in nodeCommands → not ok 2, error: 'the report prints at least one node command; finding none proves nothing' (and not ok 1, the extractor pin)
  • knife ③: existsSync/statSync filter polarity inverted → not ok 2, listing line 33, 36, 124, 165, 182
  • node scripts/ds-bot-patches.mjs check → ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/, skipped pin (no git), exit 0; cmp of the new test against its mirror still identical after all knives

What I checked:

  • Two checks. Head is still 7cacd6ed15ad4cb6f0e784b8dabdc6968866e0f3 at 03:06:24Z, and the sha carries no Verdict: — its single comment (6432637799, 02:59:02Z, Written-by: Test) says Self-test: PASS …, which is our self-test and not a verdict. I wrote the only conclusion below.
  • Preconditions under your corrected rule. --name-only is exactly core/test/report-command-paths.test.js, docs/reports/2026-10-26-turn-input-split.md, patches/ds-bot/files/test/report-command-paths.test.js: no core/package.json, no core/package-lock.json, no patches/ds-bot/0007-version-and-tooling.patch → no release rollback. Tip core/package.json is 0.2.10 while main is now 1434e2e0 / 0.2.11: the normal release lag you described, not a defect. 0007-version-and-tooling.patch blob 6d2236a1… is identical to main's, CHANGELOG.md blob f1629240… identical, all five changelog.d entries identical (no fragment added — AGENTS.md line 29 asks for one only on a user-visible change, and this is a doc path plus a test). No 0012/0001/0008 .patch in the diff.
  • Mirror pointing back. The diff has one patches/ds-bot/files/** entry and it maps to the one new core file it mirrors, byte for byte: core/test/report-command-paths.test.js ≡ patches/ds-bot/files/test/report-command-paths.test.js (cmp, same md5, same blob sha). check's core/ equals ds-bot/ + patches/ds-bot/ passes, so the mirror is generator output and not hand-written.
  • Red is real, not vacuous. Each of your three knives turns the suite red with the message that names the defect, and the restored tree is byte-identical to the tip (cmp against pristine copies) with 2/2 green afterwards. Knife ③'s output also shows the extractor walking all five command tokens of the report (33, 36, 124, 165, 182), which is the whole set of node … tokens in that file.
  • CI. 14 check runs on the sha, all completed; 13 success and two agent-audience duplicates collapsed to success, no red, nothing in_progress/action_required. tests-ok 02:50:12Z, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 02:50:06Z, package 02:48:38Z, enqueue-guard already success 02:48:25Z. The file matches core's test/*.test.js glob, so CI's core run picks it up (Test's log quotes ok 1218/ok 1219 for the two cases; I did not run the full verify here — arch-docs needs git, which this box lacks — but I ran the file under the same --import the core script uses).

Non-blocking:

  • The extractor has blind spots, so its own claim is narrower than "cannot drift again". \bnode\s+([\w./-]+\.(?:mjs|cjs|js))\b reads only node <path> with no quoting and no flags in between. Measured: setting line 182 to `node "dev/turn-split.mjs" --stats` — a broken command — leaves the suite green 2/2, because the quote stops the match. node --import ./x.mjs y.js, node -e, and npm run forms are invisible for the same reason. The report's current five tokens are all plain, so nothing is missed today.
  • Missing commands are not caught either. assert.ok(commands.length > 0) is satisfied by lines 33/36 alone, so deleting §5/§7/§8 (or their command lines) stays green: the test pins that printed commands resolve, not that these three commands are still printed. A per-line or per-section anchor would tighten it.
  • The same drift class survives inside the script itself. core/dev/turn-split.mjs:5 (usage comment) and :30 (USAGE) still print node dev/turn-split.mjs, which fails from the tree root exactly like the report did (Cannot find module). Out of docs(turn-split): three printed commands name a script path the tree does not have #1311's three-line scope and untouched here; worth a follow-up if you want the script's own help text to be copy-runnable from the repo root.
  • Body number I cannot reproduce. arch-docs: OK (326 changed file(s)) — with the fresh base it should be 3, this PR's three files; I cannot rerun that check (needs git). Body only, not the diff; Test reported the same 326-vs-3 mismatch.
  • Pre-existing 31,139 / 31,138 in §4 is untouched, as the body says; repo-wide grep finds no other node dev/turn-split.mjs outside the script and its mirror.

@github-actions github-actions Bot added the pass label Oct 27, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 27, 2026
Merged via the queue into ThinkFlowLab:main with commit c417bad Oct 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(turn-split): three printed commands name a script path the tree does not have

2 participants