A no that names one thing must not remove another #1502

Merged
jaylouisw merged 1 commit from fix/no-form-names-what-it-removes into main 2026-11-15 19:57:56 +00:00
Owner

Closes #1501

What happened

no is the only undo a technician has. Three of them answered something other than what was asked, and one of them destroyed a setting the command never named.

1. no spanning-tree portfast cleared the bridge priority

The set form of spanning-tree was taught to read its verb before its value in #1493. The no form never read the word at all:

} else if (head === 'no' && tokens[1] === 'spanning-tree') {
  const dev = this.device;
  if (!dev.config.stpPriority && dev.config.stpPriority !== 0) { /* "No bridge priority set" */ }
  dev.config.stpPriority = null;      // whatever the third word said

On a switch with spanning-tree priority 4096:

typed answered
no spanning-tree portfast Bridge priority cleared (was 4096), back to the default 32768
no spanning-tree cost Bridge priority cleared (was 4096), back to the default 32768
no spanning-tree bpduguard Bridge priority cleared (was 4096), back to the default 32768
no spanning-tree flurbish Bridge priority cleared (was 4096), back to the default 32768

Four different questions, one answer, and the answer removed a setting none of them named. The root election is decided by exactly this number, so a lab reconverges to a different root after an operator tried to remove portfast — and no spanning-tree flurbish (a word that exists nowhere) does it too.

2. help promised a speed forced <mbps> form the parser refuses

Router(config-if)#speed forced 100
% Invalid rate "forced" - give a number of Mbps or auto

_speed() has never had a forced keyword: it parses auto or a rate (100, 1000, 1G), and its own usage line said speed auto | <mbps>. Only help promised the other spelling. A documented form the parser refuses is worse than a missing one, because the help is the first thing trusted.

3. no ip access-group answered with a sentence that was not one

% No an access list applied in or out on Gi0/0

No grammar, no subject, and phrased as though it had removed something.

What changes

  • engine/cli.js: the no spanning-tree branch reads the verb. portfast, cost, bpduguard, bpdufilter, edge, guard, loopguard, root, mst, mode, link-type, backbonefast, uplinkfast are named as not modelled, so there is nothing to remove; an unknown word is quoted back. Only no spanning-tree and no spanning-tree priority touch the priority. The list is hoisted to STP_UNMODELLED, shared with the set form, so the two cannot drift apart.
  • help: the row is now speed auto|<mbps> … e.g. \speed 100`, `speed 1G``.
  • no ip access-group: % No access list 101 applied in on Gi0/0 / % No access list applied in or out on Gi0/0 — the shape the sibling refusals already use (No hostname set, No DHCP pool named nope). My first attempt read better (Access list 101 is not applied in …) and failed test/config-undo.test.js, which had already pinned the house shape; the neighbours won.

Verification

test/no-command-touches-only-what-it-names.test.js — 7 checks:

  • the four destructive forms leave config.stpPriority at 4096, say nothing about clearing, name the word that was asked, name the tunable that does exist — and are checked through two more doors (show spanning-tree and show running-config);
  • portfast is refused as unmodelled, not as an unknown word;
  • no spanning-tree and no spanning-tree priority still clear, and say cleared (was 8192);
  • no spanning-tree with nothing set still says No bridge priority set;
  • help no longer contains speed auto|forced and does contain speed auto|<mbps>;
  • speed 100, speed auto accepted; speed forced 100 refused by naming what it takes;
  • both access-group sentences, plus the case that does remove something (unapplied in, binding actually gone).

With the old handler: 3 passed / 4 failed. With this change: 7/7.

Full suite 248 suites / 9135 assertions / 0 failed; syntax 318 files; canonical URLs 2857 files; config-undo 48/48, help-completeness 8/8, no-command-swallows-a-word 21/21, command-answers-the-question 27/27, stp-priority 41/41, skip-audit 15/15.

Not claimed

The stale no spanning-tree <verb> behaviour for sub-commands this console does not model is refused, not implemented: portfast still does not exist as a feature, and this change does not add it.

Closes #1501 ## What happened `no` is the only undo a technician has. Three of them answered something other than what was asked, and one of them destroyed a setting the command never named. ### 1. `no spanning-tree portfast` cleared the bridge priority The set form of `spanning-tree` was taught to read its verb before its value in #1493. The `no` form never read the word at all: ```js } else if (head === 'no' && tokens[1] === 'spanning-tree') { const dev = this.device; if (!dev.config.stpPriority && dev.config.stpPriority !== 0) { /* "No bridge priority set" */ } dev.config.stpPriority = null; // whatever the third word said ``` On a switch with `spanning-tree priority 4096`: | typed | answered | |---|---| | `no spanning-tree portfast` | `Bridge priority cleared (was 4096), back to the default 32768` | | `no spanning-tree cost` | `Bridge priority cleared (was 4096), back to the default 32768` | | `no spanning-tree bpduguard` | `Bridge priority cleared (was 4096), back to the default 32768` | | `no spanning-tree flurbish` | `Bridge priority cleared (was 4096), back to the default 32768` | Four different questions, one answer, and the answer removed a setting none of them named. The root election is decided by exactly this number, so a lab reconverges to a different root after an operator tried to remove portfast — and `no spanning-tree flurbish` (a word that exists nowhere) does it too. ### 2. `help` promised a `speed forced <mbps>` form the parser refuses ``` Router(config-if)#speed forced 100 % Invalid rate "forced" - give a number of Mbps or auto ``` `_speed()` has never had a `forced` keyword: it parses `auto` or a rate (`100`, `1000`, `1G`), and its own usage line said `speed auto | <mbps>`. Only `help` promised the other spelling. A documented form the parser refuses is worse than a missing one, because the help is the first thing trusted. ### 3. `no ip access-group` answered with a sentence that was not one ``` % No an access list applied in or out on Gi0/0 ``` No grammar, no subject, and phrased as though it had removed something. ## What changes - `engine/cli.js`: the `no spanning-tree` branch reads the verb. `portfast`, `cost`, `bpduguard`, `bpdufilter`, `edge`, `guard`, `loopguard`, `root`, `mst`, `mode`, `link-type`, `backbonefast`, `uplinkfast` are named as *not modelled, so there is nothing to remove*; an unknown word is quoted back. Only `no spanning-tree` and `no spanning-tree priority` touch the priority. The list is hoisted to `STP_UNMODELLED`, shared with the set form, so the two cannot drift apart. - `help`: the row is now `speed auto|<mbps> … e.g. \`speed 100\`, \`speed 1G\``. - `no ip access-group`: `% No access list 101 applied in on Gi0/0` / `% No access list applied in or out on Gi0/0` — the shape the sibling refusals already use (`No hostname set`, `No DHCP pool named nope`). My first attempt read better (`Access list 101 is not applied in …`) and failed `test/config-undo.test.js`, which had already pinned the house shape; the neighbours won. ## Verification `test/no-command-touches-only-what-it-names.test.js` — 7 checks: - the four destructive forms leave `config.stpPriority` at 4096, say nothing about clearing, name the word that was asked, name the tunable that does exist — and are checked through two more doors (`show spanning-tree` and `show running-config`); - `portfast` is refused as *unmodelled*, not as an unknown word; - `no spanning-tree` and `no spanning-tree priority` still clear, and say `cleared (was 8192)`; - `no spanning-tree` with nothing set still says `No bridge priority set`; - `help` no longer contains `speed auto|forced` and does contain `speed auto|<mbps>`; - `speed 100`, `speed auto` accepted; `speed forced 100` refused by naming what it takes; - both access-group sentences, plus the case that does remove something (`unapplied in`, binding actually gone). With the old handler: **3 passed / 4 failed**. With this change: 7/7. Full suite **248 suites / 9135 assertions / 0 failed**; syntax 318 files; canonical URLs 2857 files; `config-undo` 48/48, `help-completeness` 8/8, `no-command-swallows-a-word` 21/21, `command-answers-the-question` 27/27, `stp-priority` 41/41, `skip-audit` 15/15. ## Not claimed The stale `no spanning-tree <verb>` behaviour for sub-commands this console does not model is *refused*, not implemented: `portfast` still does not exist as a feature, and this change does not add it.
A no that names one thing must not remove another
Some checks failed
CI / Test (Node 18) (pull_request) Blocked by required conditions
CI / Test (Node 20) (pull_request) Blocked by required conditions
CI / Test (Node 22) (pull_request) Blocked by required conditions
CI / Server smoke test (pull_request) Blocked by required conditions
CI / Docker build (pull_request) Blocked by required conditions
CI / Classify the change (pull_request) Failing after 16s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Failing after 11m51s
b4c8014460
`no spanning-tree portfast` cleared the bridge priority. The `no` branch never read
the word after `spanning-tree`: it cleared config.stpPriority for every
`no spanning-tree <anything>`, so a port-level command with no priority in it wiped
a setting the operator had made - and `no spanning-tree flurbish`, a word that exists
nowhere, did the same. The set form was taught to read its verb in #1493; this is the
same defect pointing the other way, and it is destructive.

The verb is now read, via STP_UNMODELLED hoisted out of the set branch so the two
cannot drift: unmodelled sub-commands are refused as "not modelled, so there is
nothing to remove", an unknown word is quoted back, and only `no spanning-tree` and
`no spanning-tree priority` touch the priority.

Two smaller untruths found by typing rather than reading:

- `help` promised `speed auto|forced <mbps>`; _speed() has never had a `forced`
  keyword (it parses `auto` or a rate, and its own usage line says so). The row now
  shows the forms that work, and a test types all three.
- `no ip access-group` answered "% No an access list applied in or out on Gi0/0".
  It now uses the shape the sibling refusals already had.

test/no-command-touches-only-what-it-names.test.js: 7 checks, 3 passed / 4 failed
against the old handler.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-12 08:07:55 +00:00
jaylouisw canceled auto merging this pull request when all checks succeed 2026-11-12 08:09:45 +00:00
Author
Owner

The auto-rebase job failed. This is a problem with the automation, not with this change.

the rebase job itself failed before it could report a reason - check the runner.

The run is at http://10.0.10.20:3000/jaylouisw/packetforge/actions/runs/2974. Nothing was pushed, so the branch is exactly as you wrote it.

**The auto-rebase job failed.** This is a problem with the automation, not with this change. ``` the rebase job itself failed before it could report a reason - check the runner. ``` The run is at http://10.0.10.20:3000/jaylouisw/packetforge/actions/runs/2974. Nothing was pushed, so the branch is exactly as you wrote it.
Author
Owner

Ready, and blocked on the host's disk - not on this change.

The tree is verified: 248 suites / 9135 assertions / 0 failed, syntax 318 files, canonical URLs 2857, config-undo 48/48, help-completeness 8/8, no-command-swallows-a-word 21/21, command-answers-the-question 27/27, stp-priority 41/41, skip-audit 15/15, and the new suite 7/7 (3 passed / 4 failed against the old handler).

Every route to main is closed at the moment, all of them by No space left on device:

route result
create this PR 500 - could not write config file .../pull.git4033333395/.git/config: No space left on device (succeeded on a retry 30 s later)
arm auto-merge 201, then Classify the change failed
cancel + squash merge 500 ENOSPC, then 405 Please try again later on fourteen consecutive attempts
close and reopen the PR, then merge still 405, mergeable=False
push the squashed tree to main directly ! [remote rejected] main -> main (pre-receive hook declined)

A merge needs a temporary clone to compute mergeability, and that clone cannot be written, so mergeable reads false and the endpoint answers 405 instead of saying why. The same thing happened on #1498 and #1500 earlier today; both landed once a free window appeared.

Nothing to fix here. This will land on the first attempt that finds space. The space itself needs the host: docker system df then docker builder prune - my #1500 change stops the next fill, it cannot reclaim what is already gone.

**Ready, and blocked on the host's disk - not on this change.** The tree is verified: **248 suites / 9135 assertions / 0 failed**, syntax 318 files, canonical URLs 2857, `config-undo` 48/48, `help-completeness` 8/8, `no-command-swallows-a-word` 21/21, `command-answers-the-question` 27/27, `stp-priority` 41/41, `skip-audit` 15/15, and the new suite 7/7 (3 passed / 4 failed against the old handler). Every route to `main` is closed at the moment, all of them by `No space left on device`: | route | result | |---|---| | create this PR | `500` - `could not write config file .../pull.git4033333395/.git/config: No space left on device` (succeeded on a retry 30 s later) | | arm auto-merge | `201`, then `Classify the change` **failed** | | cancel + squash merge | `500` ENOSPC, then `405 Please try again later` on fourteen consecutive attempts | | close and reopen the PR, then merge | still `405`, `mergeable=False` | | push the squashed tree to `main` directly | `! [remote rejected] main -> main (pre-receive hook declined)` | A merge needs a temporary clone to compute mergeability, and that clone cannot be written, so `mergeable` reads `false` and the endpoint answers 405 instead of saying why. The same thing happened on #1498 and #1500 earlier today; both landed once a free window appeared. Nothing to fix here. This will land on the first attempt that finds space. The space itself needs the host: `docker system df` then `docker builder prune` - my #1500 change stops the *next* fill, it cannot reclaim what is already gone.
Author
Owner

Amended: this PR now also records what it cost to discover, in docs/FORGE_TROUBLESHOOTING.md (§ When the volume is full, every retry leaves another half-clone).

The three defects are unchanged and still verified (suite 248 / 9135 / 0, syntax 318, no-command-touches-only-what-it-names 7/7). The addition is the operational half:

  • the four symptoms of a full volume, side by side, because they look unrelated — a rejected ref, a 500 from the clone path, a 405 Please try again later on merge with "mergeable": false, and a pull request whose needs: jobs are never created;
  • a merge is computed by cloning, so each failed attempt leaves a pull.git<random> half-clone under data/tmp/local-repo/. My own retry loop yesterday made the outage worse: a dozen attempts against a 48 MB repository is a few hundred megabytes of garbage. The page now says: one attempt tells you the answer, the tenth only lengthens the wait;
  • the host commands that actually reclaim (df, du -sh data/tmp/local-repo/*, docker system df, docker builder prune), and the reminder that the action queue does not recover without a restart.

docs/CI.md now points at that section from the docker-job rule, and the two _help() citations in docs/BGP-POLICY.md are repinned to cli.js:4305 (the hoisted STP_UNMODELLED list moved them). check:doc-citations reports only the known test/bgp.test.js:452 false positive.

Still cannot land: one merge attempt after this push returned 405, mergeable still false. Per the lesson above I am not retrying it in a loop; it will go on the first attempt that finds space.

**Amended: this PR now also records what it cost to discover, in `docs/FORGE_TROUBLESHOOTING.md` (§ *When the volume is full, every retry leaves another half-clone*).** The three defects are unchanged and still verified (suite **248 / 9135 / 0**, syntax 318, `no-command-touches-only-what-it-names` 7/7). The addition is the operational half: - the four symptoms of a full volume, side by side, because they look unrelated — a rejected ref, a `500` from the clone path, a `405 Please try again later` on merge with `"mergeable": false`, and a pull request whose `needs:` jobs are never created; - **a merge is computed by cloning**, so each failed attempt leaves a `pull.git<random>` half-clone under `data/tmp/local-repo/`. My own retry loop yesterday made the outage worse: a dozen attempts against a 48 MB repository is a few hundred megabytes of garbage. The page now says: one attempt tells you the answer, the tenth only lengthens the wait; - the host commands that actually reclaim (`df`, `du -sh data/tmp/local-repo/*`, `docker system df`, `docker builder prune`), and the reminder that the action queue does not recover without a restart. `docs/CI.md` now points at that section from the docker-job rule, and the two `_help()` citations in `docs/BGP-POLICY.md` are repinned to `cli.js:4305` (the hoisted `STP_UNMODELLED` list moved them). `check:doc-citations` reports only the known `test/bgp.test.js:452` false positive. Still cannot land: one merge attempt after this push returned `405`, `mergeable` still `false`. Per the lesson above I am not retrying it in a loop; it will go on the first attempt that finds space.
Author
Owner

Rebased onto current main (1b1e1287) locally — the only conflict was docs/CLI.md, where both branches appended a section; both are kept, #1501's first and #1503's second. With the rebase: full suite 249 suites / 9144 assertions / 0 failed, no-command-touches-only-what-it-names 7/7, help-key-works-in-every-prompt 9/9, syntax 319 files, citations clean apart from the known test/bgp.test.js:452 false positive.

The rebased head could not be pushed. Two attempts 35 s apart both answered ! [remote rejected] fix/no-form-names-what-it-removes -> fix/no-form-names-what-it-removes (failed to update ref) — a loose ref cannot be written, which is the full volume again (the same class of failure as couldn't set 'refs/heads/...'). The remote branch is therefore still at 11306943, and mergeable reads false.

Nothing to change in the branch. It will go as soon as the volume has room for a ref and a clone; I am not retrying in a loop, for the reason recorded in docs/FORGE_TROUBLESHOOTING.md — every failed attempt leaves a half-clone and lengthens the wait.

Rebased onto current `main` (`1b1e1287`) locally — the only conflict was `docs/CLI.md`, where both branches appended a section; both are kept, #1501's first and #1503's second. With the rebase: full suite **249 suites / 9144 assertions / 0 failed**, `no-command-touches-only-what-it-names` 7/7, `help-key-works-in-every-prompt` 9/9, syntax 319 files, citations clean apart from the known `test/bgp.test.js:452` false positive. **The rebased head could not be pushed.** Two attempts 35 s apart both answered `! [remote rejected] fix/no-form-names-what-it-removes -> fix/no-form-names-what-it-removes (failed to update ref)` — a loose ref cannot be written, which is the full volume again (the same class of failure as `couldn't set 'refs/heads/...'`). The remote branch is therefore still at `11306943`, and `mergeable` reads `false`. Nothing to change in the branch. It will go as soon as the volume has room for a ref and a clone; I am not retrying in a loop, for the reason recorded in `docs/FORGE_TROUBLESHOOTING.md` — every failed attempt leaves a half-clone and lengthens the wait.
jaylouisw force-pushed fix/no-form-names-what-it-removes from 1130694360 to 0a3a99d43a
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 19s
CI / Test (Node 18) (pull_request) Successful in 3m30s
CI / Test (Node 20) (pull_request) Successful in 3m16s
CI / Server smoke test (pull_request) Successful in 30s
CI / Docker build (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 3m12s
2026-11-15 19:56:03 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-15 19:57:42 +00:00
jaylouisw force-pushed fix/no-form-names-what-it-removes from 0a3a99d43a
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 19s
CI / Test (Node 18) (pull_request) Successful in 3m30s
CI / Test (Node 20) (pull_request) Successful in 3m16s
CI / Server smoke test (pull_request) Successful in 30s
CI / Docker build (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 3m12s
to f2802f9aa5
All checks were successful
CI / Classify the change (pull_request) Successful in 21s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 3m21s
CI / Test (Node 18) (pull_request) Successful in 3m38s
CI / Server smoke test (pull_request) Successful in 34s
CI / Docker build (pull_request) Successful in 53s
CI / Test (Node 22) (pull_request) Successful in 3m8s
2026-11-15 19:57:46 +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!1502
No description provided.