cli: converge at <ms> answers the question it prints (#1726) #1728

Merged
jaylouisw merged 1 commit from fix/1116-2035 into main 2026-11-16 20:46:02 +00:00
Owner

Fixes #1726

help has advertised converge [at <ms>] since the command existed, and _converge() read
Number(tokens[0]) and nothing else. The advertised form was not refused — it was answered as if no instant had
been named: Number('at') is NaN, a NaN instant fails the per-row e.readyAtMs > atMs test, so every
(pending) mark vanished and the console reported a converged lab at an instant before it converged.

What changed

  • engine/cli.js — _converge() parses at <ms> the way link <up|down> <id> at <ms> has since #1049, so both
    spellings are one command with one answer. The leftover argument is refused by name rather than dropped, which
    is the rule ping follows since #1379: converge 1000 wibble →
    % Unrecognized "wibble" (converge [<ms> | at <ms>]), and converge at, converge wibble, converge at wibble
    and converge -5 are each % Invalid instant: … instead of silently meaning "converged" (or, for -5, an
    instant no row can have reached).
  • engine/cli.js — the help line now reads converge [<ms> | at <ms>], the syntax both paths accept, aligned
    with the link line beside it.
  • docs/CLI.md — the paragraph that admitted the discrepancy ("the fix belongs in the parser; until it lands,
    this line names the spelling that works") now describes the parser that exists, and the usage block matches.
  • test/converge-instant.test.js — new, 17 assertions: both spellings produce the identical table, past the last
    process neither marks a row pending, every malformed instant is refused with a message that names the mistake,
    the stray word is named with the syntax that works, and whatever the index advertises is typed straight back
    into the session that printed it (the pasteability rule).

Gates

gate result
node scripts/syntax-check.js 361 files, all OK
npm test 290 suites / 10,336 assertions / 0 failed
test/converge-instant.test.js 17 passed, 0 failed (9 of them fail on main)
test/help-completeness.test.js 8 passed — the advertised list still holds, converge at <ms> included
test/convergence-timing.test.js, test/link-instant.test.js, test/control-plane-instant.test.js, test/configure-abbreviation.test.js, test/command-word-abbreviation.test.js 64 / 37 / 12 / 41 / 74 passed
node scripts/check-doc-citations.js exit 0, no new suspects (the CLI.md:1824 suspect is gone with the paragraph)
Fixes #1726 `help` has advertised `converge [at <ms>]` since the command existed, and `_converge()` read `Number(tokens[0])` and nothing else. The advertised form was not refused — it was answered as if no instant had been named: `Number('at')` is `NaN`, a `NaN` instant fails the per-row `e.readyAtMs > atMs` test, so every `(pending)` mark vanished and the console reported a converged lab at an instant **before** it converged. ## What changed * `engine/cli.js` — `_converge()` parses `at <ms>` the way `link <up|down> <id> at <ms>` has since #1049, so both spellings are one command with one answer. The leftover argument is refused by name rather than dropped, which is the rule `ping` follows since #1379: `converge 1000 wibble` → `% Unrecognized "wibble" (converge [<ms> | at <ms>])`, and `converge at`, `converge wibble`, `converge at wibble` and `converge -5` are each `% Invalid instant: …` instead of silently meaning "converged" (or, for `-5`, an instant no row can have reached). * `engine/cli.js` — the `help` line now reads `converge [<ms> | at <ms>]`, the syntax both paths accept, aligned with the `link` line beside it. * `docs/CLI.md` — the paragraph that admitted the discrepancy ("the fix belongs in the parser; until it lands, this line names the spelling that works") now describes the parser that exists, and the usage block matches. * `test/converge-instant.test.js` — new, 17 assertions: both spellings produce the identical table, past the last process neither marks a row pending, every malformed instant is refused with a message that names the mistake, the stray word is named with the syntax that works, and whatever the index advertises is typed straight back into the session that printed it (the pasteability rule). ## Gates | gate | result | |---|---| | `node scripts/syntax-check.js` | 361 files, all OK | | `npm test` | **290 suites / 10,336 assertions / 0 failed** | | `test/converge-instant.test.js` | 17 passed, 0 failed (9 of them fail on `main`) | | `test/help-completeness.test.js` | 8 passed — the advertised list still holds, `converge at <ms>` included | | `test/convergence-timing.test.js`, `test/link-instant.test.js`, `test/control-plane-instant.test.js`, `test/configure-abbreviation.test.js`, `test/command-word-abbreviation.test.js` | 64 / 37 / 12 / 41 / 74 passed | | `node scripts/check-doc-citations.js` | exit 0, no new suspects (the `CLI.md:1824` suspect is gone with the paragraph) |
cli: converge at <ms> answers the question it prints (#1726)
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 18s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Docker build (pull_request) Successful in 29s
CI / Test (Node 18) (pull_request) Successful in 58s
CI / Test (Node 22) (pull_request) Successful in 58s
ae2ff4b9c7
`help` has advertised `converge [at <ms>]` since the command existed and `_converge()` read
`Number(tokens[0])` and nothing else. The advertised form was therefore not refused - it was answered as
if no instant had been named, because `Number('at')` is `NaN` and a `NaN` instant fails the per-row
`e.readyAtMs > atMs` test. Every `(pending)` mark vanished and the console reported a converged lab at an
instant before it converged, which is the whole output of the command.

`at` is now parsed the way `link <up|down> <id> at <ms>` has parsed it since #1049, so the spelling the
box prints and the bare `converge 10000` are one command with one answer. What is left over is refused by
name rather than dropped, the rule `ping` follows since #1379: `converge 1000 wibble` is
`% Unrecognized "wibble" (converge [<ms> | at <ms>])`, and `converge at`, `converge wibble`,
`converge at wibble`, `converge -5` are each `% Invalid instant: ...` instead of silently meaning
"converged" (or, for -5, an instant no row can have reached).

test/converge-instant.test.js: 17 assertions over both spellings being identical, every malformed
instant, the stray word, and the pasteability of whatever the index advertises.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 20:45:46 +00:00
jaylouisw force-pushed fix/1116-2035 from ae2ff4b9c7
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 18s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Docker build (pull_request) Successful in 29s
CI / Test (Node 18) (pull_request) Successful in 58s
CI / Test (Node 22) (pull_request) Successful in 58s
to e31103720b
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Test (Node 18) (pull_request) Has been skipped
CI / Test (Node 20) (pull_request) Has been skipped
CI / Test (Node 22) (pull_request) Has been skipped
CI / Server smoke test (pull_request) Has been skipped
CI / Docker build (pull_request) Has been skipped
CI / Arm auto-merge (pull_request) Has been skipped
2026-11-16 20:45:50 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1728
No description provided.