help listed neither of the two features landed yesterday, nor the DHCP pool sub-mode #1491
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1491
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The symptom
helpis the console's own index — the thing an operator types to find out what the box can do. Two features landed yesterday. I typedhelpon a 2811 and neither was there:No
traceroute. Noclock rate. Both are documented indocs/CLI.md, both are accepted at the console, both were unlisted in the one place a person in a lab actually looks.Asking the parser instead of the documentation turned up more. Extracting every token the dispatcher compares against
headinengine/cli.js— the console's whole vocabulary, in the console's own spelling — and diffing that against_help()gave 24 absent verbs, and the missing ones were not trivia:helptraceroute,tracertclock rate(andspeed,duplex,description— never listed either)network,range,default-router,lease,host,excluded-address,dns-server— the index knew onlyno ip dhcp pool <name>scion <isd-as>,no scionSo you could create a DHCP pool and the index never told you what to type inside it; you could clock a serial link and the index never mentioned the command; you could traceroute and the index had never heard of it. The forward direction — everything
helpadvertises is accepted — was already a test. The direction that mattered had been left to memory.What changed
The index gains the fourteen commands it was missing, in the same shape as their neighbours:
The duplicate
pingrow went too: the index had two, one of them the older and less complete.test/help-completeness.test.jsnow checks the direction that used to be memory. It reads the dispatcher's vocabulary out ofengine/cli.js— everyhead === '…'token — drops the keypresses (?,exit,quit,logout,end,help, and the abbreviationsconf,en,int), and requires every remaining verb to be named in the index. Fifty tokens, forty-one requiring a line.Evidence
test/help-completeness.test.js— 8 checks, 8 passed / 0 failed. With the old index and the new check: 5 passed / 3 failed, naming all fifteen missing verbs (clock, default-router, description, dns-server, duplex, excluded, excluded-address, host, lease, network, range, scion, speed, traceroute, tracert).The opposite direction stays a hand-written list on purpose, and now carries fourteen new rows — each typed at a real device, each required to be accepted:
traceroute,tracert,clock rate,no clock rate,speed,duplex,description,network,range,default-router,lease,host,excluded-address,dns-server. 98 advertised commands, all accepted.Why a hand list there and a derived one here: the forward direction has to describe modes as well as words (
['clock rate <bps>', 'iface', ROUTER]), and recovering modes from the index's prose would mean writing a prose parser. The reverse direction has no such problem — the parser's own tokens are the console's vocabulary — which is exactly why it is worth deriving, and why the gap survived two features.Docs:
docs/CLI.md, new section "helpis an index, and a test reads it out of the parser", with the table of what was missing and why the two directions are checked differently.Full suite: 243 suites, 9,042 assertions, 0 failed. Syntax 312 files.
Landed as #1492 (
2961f42e). Post-merge onmain:help-completeness8/8,cable-legend-covers-every-medium16/16, tree clean, 0 open PRs.The check that found this is the one worth keeping: not reading
helpand guessing what should be in it, but pulling the dispatcher's vocabulary out ofengine/cli.jsand diffing.helphad been checked in one direction only — everything it advertises is accepted — and a list is only as complete as the memory of whoever last edited it.addandremove#1822