capabilities: retire vlan, lacp and stp, which no code read (#1526) #1635

Merged
jaylouisw merged 1 commit from fix/1116-0805 into main 2026-11-16 08:28:53 +00:00
Owner

Fixes #1526.

CAPABILITIES advertised vlan, lacp and stp as behaviour ("supports 802.1Q", "supports link aggregation", "participates in spanning tree") and no source under engine/ read any of them. VLANs, LAGs and spanning tree run on every l2-forward box, so the token answered true for 125 specs and false for the 1,143 L2 specs that behave identically.

What changed

  • engine/device.js: the three are out of CAPABILITIES (12 tokens), with the reason and the remaining three unread tokens named in the comment.
  • docs/DEVICE_SCHEMA.md: the three move from the capability table to the "kept, inert" class, alongside 802.3af/passive-poe; the 15 capabilities sample becomes 12.
  • docs/SIMULATION.md: both lists that named them are corrected.
  • test/capability-vocabulary.test.js (new, 13 assertions): every token in CAPABILITIES must have a reader (hasCap / _capabilityRefusal / capability indexOf / SERVICE_PORTS); every token any spec declares must be honoured or named as a fact; dhcp-client, firewall and wireless are listed as the pending decisions rather than passing silently; and a trunk builds with identical console output on a box that declares the three and one that does not.
  • test/import-devices-capabilities.test.js: the "switch that says 802.1Q/LACP/STP" case now asserts the #1522 regression in its post-#1526 form - the declaration is kept and named, never stripped or moved into role.

Deliberately not done: the 125 specs still declare the three tokens. Dropping a datasheet fact is exactly the data loss #1522 fixed, and gating VLANs/LAGs/STP on the token would switch them off for almost the whole catalogue. They are now descriptive facts in the importer existing unknown-token class.

Tests: node scripts/syntax-check.js 344 files OK; full npm test 274 suites, 9,831 assertions, 0 failed.

Fixes #1526. `CAPABILITIES` advertised `vlan`, `lacp` and `stp` as behaviour ("supports 802.1Q", "supports link aggregation", "participates in spanning tree") and no source under `engine/` read any of them. VLANs, LAGs and spanning tree run on every `l2-forward` box, so the token answered `true` for 125 specs and `false` for the 1,143 L2 specs that behave identically. **What changed** - `engine/device.js`: the three are out of `CAPABILITIES` (12 tokens), with the reason and the remaining three unread tokens named in the comment. - `docs/DEVICE_SCHEMA.md`: the three move from the capability table to the "kept, inert" class, alongside `802.3af`/`passive-poe`; the `15 capabilities` sample becomes `12`. - `docs/SIMULATION.md`: both lists that named them are corrected. - `test/capability-vocabulary.test.js` (new, 13 assertions): every token in `CAPABILITIES` must have a reader (hasCap / _capabilityRefusal / capability indexOf / SERVICE_PORTS); every token any spec declares must be honoured or named as a fact; `dhcp-client`, `firewall` and `wireless` are listed as the pending decisions rather than passing silently; and a trunk builds with identical console output on a box that declares the three and one that does not. - `test/import-devices-capabilities.test.js`: the "switch that says 802.1Q/LACP/STP" case now asserts the #1522 regression in its post-#1526 form - the declaration is kept and named, never stripped or moved into `role`. **Deliberately not done:** the 125 specs still declare the three tokens. Dropping a datasheet fact is exactly the data loss #1522 fixed, and gating VLANs/LAGs/STP on the token would switch them off for almost the whole catalogue. They are now descriptive facts in the importer existing unknown-token class. **Tests:** `node scripts/syntax-check.js` 344 files OK; full `npm test` 274 suites, 9,831 assertions, 0 failed.
capabilities: retire vlan, lacp and stp, which no code read (#1526)
All checks were successful
CI / Classify the change (pull_request) Successful in 15s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
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
a852afa772
CAPABILITIES advertised three tokens as behaviour - 'supports 802.1Q', 'supports
link aggregation', 'participates in spanning tree' - and no engine source read any
of them. VLANs, LAGs and STP run on every l2-forward box, so the token was true for
125 specs and false for 1,143 that behave identically; every caller that asked
hasCap('vlan') to decide whether to offer a command was taught something false.

They are now descriptive hardware facts rather than advertised capabilities: 125
specs keep declaring them verbatim (the importer names an unknown token and keeps
it, #1522) and the docs list them in that class. Gating the features on the token
instead would have switched VLANs off for almost the whole catalogue.

test/capability-vocabulary.test.js is the guard the issue asks for: every token in
CAPABILITIES must have a reader, every token a spec declares must be honoured or
named as a fact, and a trunk builds identically on a box that declares the three
and one that does not. The remaining unread tokens (dhcp-client, firewall,
wireless) are listed in the test as pending decisions rather than concealed.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 08:28:41 +00:00
jaylouisw force-pushed fix/1116-0805 from a852afa772
All checks were successful
CI / Classify the change (pull_request) Successful in 15s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
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
to 0317e39bea
All checks were successful
CI / Classify the change (pull_request) Successful in 12s
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
2026-11-16 08:28:44 +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!1635
No description provided.