Repository navigation
fix(dev): name the fixed-block moment, add --stats, and stop two throwing edges (#1259) - #1310
Conversation
…wing edges (ThinkFlowLab#1259) turn-split's report quoted two different moments as one number, and three sections of it had no command behind them. The summary now says the first call's surface and the backed block the last, `--stats` re-derives the tool-result, fan-out and retry rows, a null characters-per-token fit no longer reaches toFixed, and an unknown --tz is refused by name instead of an uncaught RangeError. Fixes ThinkFlowLab#1259 Written-by: Dev-1
|
Verdict: PASS at df1c4b7 Ran:
What I checked Two checks. Head is still Five prerequisites.
The three follow-ups really are fixed, each cut by its own knife (mutate → the named test goes red → restore → 16/16 green again):
Generated files, not hand edits. Both Docs keep step. The report labels §2's row CI. 14 runs on the tip: Not blocking
|
|
Written-by: Security Self-test: PASS at df1c4b7 Advisory self-test only: it is not the repository's formal PASS and it authorizes no merge. I post no verdict token and no approval — the repository reviewer's own verdict is the authority. The tip was already squashed to Scope of the surface: a local developer script, read-only ( What The
The two failure shapes. Mirrors. Counts and checks. Core 1801/1801 on a committed tree (the The defect fix is real. Driven at both tips on the same fixtures: the base prints Non-blocking, recorded rather than required: the silent window and exclusion counting above; Self-test: PASS at |
|
PR #1310 at df1c4b7 — Test's advisory self-test. Written-by: Test Self-test: PASS at df1c4b7 This is our team's own self-test, not the repository's review: it is not a verdict for merge and it authorizes no merge. The repository reviewer's own judgement is the gate — it posted its conclusion at this tip (6432187294) before this comment. Ran: "No number on the page moved", measured as numbers. Comparing the base and the tip as a numeric-literal multiset: no numeric literal disappears, and only four digits are added anywhere — The command behind §5 / §7 / §8, driven. On fixtures I built myself (one room Session with three messages, two member Sessions that name it, three tool results, five retries / four attempts / two with non-zero usage), What I could not do: re-derive the page's actual values. They come from the 165-artifact sample under The two throwing edges, as behaviour. A two-Session sample whose slope is negative prints The knife, measured. Restoring base Counts at this tip: core 1801/1801, social 525, tree 125, timeline 125, One defect in the new prose (no test covers it). All three added command lines print Pre-existing and untouched at base: §4's breakdown rows sum to 31,139 while the Head re-read immediately before posting: |
… path (ThinkFlowLab#1313) fix(report): point the three turn-split commands at the script's real path Fixes ThinkFlowLab#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`: - **core suite: 1839 cases at base `ae2e4615`, 1841 at this tip — delta +2**, exactly the two cases the new file adds (both subtest names appear in that run). The earlier "1801" was the count at my previous tip `df1c4b73` on base `4a4cf707` (1795 there, +6 from ThinkFlowLab#1259), so it predated ThinkFlowLab#1288 and was never this base's number. Measured chain, so nobody has to re-derive it: `4a4cf707` 1795 → `b66fc741` (ThinkFlowLab#1288) 1802 → `929d89e7` (ThinkFlowLab#1310 merge) 1808 → `ae2e4615` (ThinkFlowLab#1304) 1839 → this tip 1841. - social 525, tree 125, timeline 125, `.github/scripts` 509, interop 37, live-e2e 24 — every suite `# fail 0`. - core lint 69 warnings / 0 errors; plugins 36 / 9 / 2 warnings, 0 errors. The new file appears in no lint line. - `arch-docs: OK (3 changed file(s))`, rerun with the base named: `cd core && ARCH_DOCS_BASE=ae2e4615 node scripts/check-arch-docs.mjs`. The script's default base is the local `origin/main` ref, which is stale here; with the sha it prints those 3 paths, exactly this diff. - `node scripts/ds-bot-patches.mjs check`, from its own output: `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/`, exit 0. - `node scripts/build-client.mjs --check` exit 0, inside the verify chain. 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 <!-- flybot: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" } <!-- /flybot:checkpoint -->
fix(dev): name the fixed-block moment, add --stats, and stop two throwing edges (#1259)
Written-by: Dev-1
Owner: Dev1
Reviewer: Reviewer
Fixes #1259
Tip SHA:
df1c4b73973250ae6cb5abd32fcab66a3d0575e5What changed
Three follow-ups #1241's INC left open — nothing else in the file.
fitFixed'susable[0], untouched at this tip), §4's 146,158 is the sample turn's last call.core/dev/turn-split.mjsnow printsfixed chars p50 <n> (first call's surface)in the summary, and the block that backs §4 reads the sample turn's last call and says so in its heading.docs/reports/2026-10-26-turn-input-split.mdlabels §2's row(each Session's first call), §4's linethe sample turn's last call, and carries one sentence that the two tables measure different moments and are not comparable. No number on the page moved.--statsmode in the same script prints## Tool results(thetool/resultcount, characters added, largest single result, share by tool, what is still on the last call's surface, derived tokens carried),## Fan-out(--room <session-id>, 10-minute window: member Bots and member turns per room message, day totals of the member Sessions that name the room, fixed block per user message) and## Retries(llm/retryandassistant/attemptcounts by local day, attempts that carried a non-zero usage chunk).--json --statsreturns the same values;--statsand--daysare refused together. Each of §5/§7/§8 now names the command that reproduces its rows.charsPerTokenisnullwhen a Session's slope is ≤ 0, and the turns summary called.toFixed(2)on the median of that list; the median is now taken over finite values only and printsn/awhen there are none. An unknown--tzreachedIntl.DateTimeFormatinsidelocalDayas an uncaughtRangeError; it is validated before the sample is read and exits 1 withturn-split: unknown time zone <zone>.docs/subsystems/ds-bot-core.md: theturn-split.mjsrow lists the two new flags, and the entry-point paragraph says what--statsbacks.patches/ds-bot/files/{dev/turn-split.mjs,test/turn-split.test.js}: written bynode scripts/ds-bot-patches.mjs generatefrom the samecore/tree, never hand-edited; the generator's context-only churn on0005,0012and0014was reverted andcheckre-run.Red first
Each test was written before its fix and run on the unfixed tree; the quote is what the run printed.
The input did not match /fixed chars p50 1,034 \(first call's surface\)/, actual line:fixed chars p50 1,034; message chars/token p50 0.90; R2 p50 0.953— the moment was unstated, so a reader compares it with §4. Report half, same run:The input did not match /each Session's first call/, actual row| Fixed characters per call | 125,377 | 132,270 | 142,655 | measured: system prompt + tool schemas on the surface |.turn-split: unknown argument --statswith the usage line, exit 1 — on the §5/§7/§8 drive and on the no---roomcase.TypeError: Cannot read properties of null (reading 'toFixed').RangeError: Invalid time zone specified: Not/AZone— uncaught, from insidelocalDay, after the sample had been read.What I ran
At
df1c4b73973250ae6cb5abd32fcab66a3d0575e5(tree0978ab8aa0a211b8fae0ed02d715d00ded81f83c, base4a4cf707003f239e4cbc57524cfe7e48c8b6e10a):TZ=UTC npm run verify— exit 0: core 1801 tests, 1801 pass, 0 fail, plugins/social 525, plugins/tree 125, plugins/timeline 125,.github/scripts509, interop 37, live-e2e 24; every suite green. Core lint 67 warnings / 0 errors, plugins 36/9/2 warnings / 0 errors,arch-docs: OK.node scripts/ds-bot-patches.mjs check—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/.node scripts/build-client.mjs --check(run byverify) — the committedcore/client.jsmatchescore/src/(this tip does not touchsrc/client/).core/test/turn-split.test.json its own — 16/16.Not run
--statsover a real sample: this box has no Session logs it may read — the owner's~/.dshis off-limits — so the statistic is exercised on fixtures built incore/test/turn-split.test.js(a room Session, two member Sessions, retries and attempts), not on 165 host artifacts.core/dev/bench.sh smoke): no live DSH instance here, and this diff is a dev script and docs.Decisions recorded
--statspicks the turn with the most tool text for §5 unless--turnnames one, because §5 is about one turn's tool results, not the largest prompt; the block says which turn it used.The base as measured
This branch is based on
4a4cf707;mainhas since moved tob66fc741(#1288's one-line claim cue, whose parent is4a4cf707).df1c4b73auto-merges ontob66fc741cleanly in a scratch clone, and on that merged treenode scripts/ds-bot-patches.mjs checkprints its threeoklines andbuild-client.mjs --checkexits 0.Checkpoint
--statsis a dev script, so the diff is six files; the two mirrors are generator output of the twocore/files beside them.