Summary
KNOWN_ALIAS_SEGMENTS in src/link-cliref.ts is a global, unscoped
allowlist: a segment on the list may be dropped from any source_path. Five of
its nineteen entries — acl, controller, poe, qos, route — are real
CLI menu segments published elsewhere in the very same CLI Reference source.
Result: three cliref_entry_schema_links rows link a published entry to a
different command. The failure is silent, because the alias branch only runs
when the exact path is missing from schema_nodes — which is precisely the
hardware-gated class where nobody has a device to notice.
The bad links
Simulating the current algorithm (exact → single-drop alias → manual-only)
against four typed inspect trees (restraml, extra-packages, x86 + arm64,
7.10.2 → 7.24rc2), 23 alias links fire. Three are wrong:
| Published entry |
Linked to |
Should be |
interface/ethernet/poe/monitor |
/interface/ethernet/monitor |
manual-only |
interface/ethernet/switch/qos/port |
/interface/ethernet/switch/port |
manual-only |
interface/ethernet/switch/qos/port/reset-counters |
/interface/ethernet/switch/port/reset-counters |
manual-only |
These are demonstrably different commands, provable from the publication alone —
their field sets are disjoint:
interface/ethernet/poe/monitor name poe-out poe-voltage poe-out-status poe-out-voltage
poe-out-current poe-out-power poe-out-power-pair
power-cycle-host-alive power-cycle-after
interface/ethernet/monitor name status auto-negotiation rate full-duplex
tx-flow-control rx-flow-control fec supported
sfp-* (35 more) phy-regs eeprom ...
interface/ethernet/switch/qos/port publishes ~140 fields (per-queue caps, PFC
thresholds); interface/ethernet/switch/port publishes 15 (vlan-mode,
mirror-*, rates). No overlap beyond name/switch.
Live confirmation that these are gated, not phantom: on CHR 7.23.3 stable and
7.24rc3 testing, /interface/ethernet/poe and /interface/ethernet/switch/qos
are absent over /console/inspect, REST and the native API — consistent with
their published gates (syscap: (poe or poe-in), syscap: multiswitch /
crs_prestera). They are real menus on hardware rosetta has never inspected.
Root cause and fix
The allowlist encodes "this word is an internal module name" as a global
property. It is not global — it is positional. A segment that is itself a
published entry at that point in the path is a real menu, not a doc-internal
module.
Derivable rule, no device needed: never drop segment S at position i
when the prefix ending at S is itself a cliref_entries.source_path.
Applied to the current list:
| Segment |
Prefix published as |
Verdict |
poe |
interface/ethernet/poe = Directory |
real menu — reject the drop |
qos |
interface/ethernet/switch/qos = Directory |
real menu — reject the drop |
acl |
interface/ethernet/switch/acl = Directory |
real menu — reject the drop |
controller |
zerotier/controller = Directory |
real menu — reject the drop |
route |
ip/route, routing/route = Directory |
real menu — reject the drop |
cfg chancfg dpathcfg ifaceactual ratescfg remoteap seccfg sta rule easymesh serial-interface ddns ifaces queues |
— |
internal module — safe |
acl, controller and route currently produce correct links by luck (they
fire only in caps-man/… and routing/route/rule, different subtrees), so the
rule costs three links and buys a guarantee.
Suggested implementation:
- Add the prefix-scoping check to the alias branch.
- Add a field-set-overlap sanity check as a second gate: refuse an alias
link whose published fields are disjoint from the target's inspect args. This
would have caught all three independently.
- Keep the segment allowlist — it still stops arbitrary normalization; the two
new checks are additive, and the cli-reference-links.tsv drift gate makes
the −3 visible for review.
Why this is worth fixing even though it is only three rows
interface/ethernet/poe/monitor is a command real users run on real hardware.
Anything reading cliref_entry_schema_links — routeros_explain_command,
the command-prose join, the export dataset — currently attributes PoE monitoring
fields to the SFP/ethernet monitor command. Wrong provenance on hardware-only
surfaces is exactly the class nobody can catch from a CHR.
src/extract-cliref.ts itself is not implicated: source_path is the heading
verbatim, it is honestly named source, and an independent re-implementation
reproduced its output byte-for-byte. The defect is confined to the crosswalk.
Found while evaluating CLI Reference as offline evidence for centrs explain:
tikoci/centrs#228 (comment) (§7).
Summary
KNOWN_ALIAS_SEGMENTSinsrc/link-cliref.tsis a global, unscopedallowlist: a segment on the list may be dropped from any
source_path. Five ofits nineteen entries —
acl,controller,poe,qos,route— are realCLI menu segments published elsewhere in the very same CLI Reference source.
Result: three
cliref_entry_schema_linksrows link a published entry to adifferent command. The failure is silent, because the alias branch only runs
when the exact path is missing from
schema_nodes— which is precisely thehardware-gated class where nobody has a device to notice.
The bad links
Simulating the current algorithm (exact → single-drop alias → manual-only)
against four typed inspect trees (restraml, extra-packages, x86 + arm64,
7.10.2 → 7.24rc2), 23 alias links fire. Three are wrong:
interface/ethernet/poe/monitor/interface/ethernet/monitorinterface/ethernet/switch/qos/port/interface/ethernet/switch/portinterface/ethernet/switch/qos/port/reset-counters/interface/ethernet/switch/port/reset-countersThese are demonstrably different commands, provable from the publication alone —
their field sets are disjoint:
interface/ethernet/switch/qos/portpublishes ~140 fields (per-queue caps, PFCthresholds);
interface/ethernet/switch/portpublishes 15 (vlan-mode,mirror-*, rates). No overlap beyond
name/switch.Live confirmation that these are gated, not phantom: on CHR 7.23.3 stable and
7.24rc3 testing,
/interface/ethernet/poeand/interface/ethernet/switch/qosare absent over
/console/inspect, REST and the native API — consistent withtheir published gates (
syscap: (poe or poe-in),syscap: multiswitch/crs_prestera). They are real menus on hardware rosetta has never inspected.Root cause and fix
The allowlist encodes "this word is an internal module name" as a global
property. It is not global — it is positional. A segment that is itself a
published entry at that point in the path is a real menu, not a doc-internal
module.
Derivable rule, no device needed: never drop segment
Sat positioniwhen the prefix ending at
Sis itself acliref_entries.source_path.Applied to the current list:
poeinterface/ethernet/poe= Directoryqosinterface/ethernet/switch/qos= Directoryaclinterface/ethernet/switch/acl= Directorycontrollerzerotier/controller= Directoryrouteip/route,routing/route= Directorycfgchancfgdpathcfgifaceactualratescfgremoteapseccfgstaruleeasymeshserial-interfaceddnsifacesqueuesacl,controllerandroutecurrently produce correct links by luck (theyfire only in
caps-man/…androuting/route/rule, different subtrees), so therule costs three links and buys a guarantee.
Suggested implementation:
link whose published fields are disjoint from the target's inspect args. This
would have caught all three independently.
new checks are additive, and the
cli-reference-links.tsvdrift gate makesthe −3 visible for review.
Why this is worth fixing even though it is only three rows
interface/ethernet/poe/monitoris a command real users run on real hardware.Anything reading
cliref_entry_schema_links—routeros_explain_command,the command-prose join, the export dataset — currently attributes PoE monitoring
fields to the SFP/ethernet monitor command. Wrong provenance on hardware-only
surfaces is exactly the class nobody can catch from a CHR.
src/extract-cliref.tsitself is not implicated:source_pathis the headingverbatim, it is honestly named source, and an independent re-implementation
reproduced its output byte-for-byte. The defect is confined to the crosswalk.
Found while evaluating CLI Reference as offline evidence for centrs
explain:tikoci/centrs#228 (comment) (§7).