A short line is not a wrong value: hostname erased the name, description cleared itself #1497

Closed
opened 2026-11-12 06:55:07 +00:00 by jaylouisw · 2 comments
Owner

The question

Fifteen commands were asked what they do with no argument at all. Two answered by doing something, and three answered a question nobody had asked.

1. hostname with no name erased the name

Router(config)#hostname core-router
Router(config)#hostname
Router(config)#

No output, and config.hostname became null — a destructive command with no receipt, on the one command whose whole job is the value it just discarded. The only way to find out was to look at a surface that renders the name, and those surfaces render it from the same field.

It now refuses, and says the name is unchanged:

% Incomplete command: hostname <name> (the name is unchanged)

2. description with no text cleared it and reported success

Router(config-if)#description uplink to the core
Description set
Router(config-if)#description
Description set              <- and the description is now gone

A change the receipt did not name. Clearing is no description, so a bare description is refused now, and both directions name what moved:

% Incomplete command: description <text> (use `no description` to clear it)
Description set: uplink to the core
Description removed: uplink to the core
Gi0/0/0 had no description

3. Three commands called a missing value an invalid one

Same shape as ip route flurbish in #1495: the empty string was validated as a value.

typed used to answer now
ip name-server % Invalid name server "": not an IPv4 address % Incomplete command: ip name-server <address>
ipv6 address % Invalid IPv6 address "" % Incomplete command: ipv6 address <address>/<prefix> (or ipv6 address autoconfig)
vrrp 1 ip % Invalid address: (none) % Incomplete command: vrrp <vrid> ip <address>

A genuinely bad value is still quoted back (Invalid name server "flurbish"), so a short line and a wrong value now read differently — which is the whole point.

Two things measured and deliberately left alone

Whitespace is already robust. Labs are pasted, not typed, so every command in the sweep was also run with double spaces, a tab, a leading space, a trailing space, and a mix: 108 variant runs, 0 differences in the answer or the resulting config. Nothing to fix — but it had never been measured, so it is now pinned by a test instead of assumed.

A global command at an interface prompt is applied in global config — deliberately, so a pasted running-config block works without exit lines between blocks (#1230). Leniency by design; what it costs is that the answer does not say where the configuration landed. The reverse direction is refused by name, and where the console knows better it says so:

Router(config)#vrrp 1 ip 10.0.0.254
% vrrp is configured per interface: enter an interface first, e.g. interface Gi0/0

The test pins the leniency so it stays a decision, and pins the reverse refusal so strictness does not spread by accident.

Evidence

test/missing-argument-is-not-a-value.test.js — 29 checks, 29 passed / 0 failed. With the old handler: 13 passed / 16 failed, naming both silent commands, all three empty-string-as-value messages, and the erased hostname.

Docs: docs/CLI.md, new section "A short line is not a wrong value".

Full suite: 246 suites, 9,120 assertions, 0 failed. Syntax 315 files.

## The question Fifteen commands were asked what they do with **no argument at all**. Two answered by doing something, and three answered a question nobody had asked. ## 1. `hostname` with no name erased the name ``` Router(config)#hostname core-router Router(config)#hostname Router(config)# ``` No output, and `config.hostname` became `null` — a destructive command with no receipt, on the one command whose whole job is the value it just discarded. The only way to find out was to look at a surface that renders the name, and those surfaces render it from the same field. It now refuses, and says the name is unchanged: ``` % Incomplete command: hostname <name> (the name is unchanged) ``` ## 2. `description` with no text cleared it and reported success ``` Router(config-if)#description uplink to the core Description set Router(config-if)#description Description set <- and the description is now gone ``` A change the receipt did not name. Clearing is `no description`, so a bare `description` is refused now, and both directions name what moved: ``` % Incomplete command: description <text> (use `no description` to clear it) Description set: uplink to the core Description removed: uplink to the core Gi0/0/0 had no description ``` ## 3. Three commands called a missing value an invalid one Same shape as `ip route flurbish` in #1495: the *empty string* was validated as a value. | typed | used to answer | now | |---|---|---| | `ip name-server` | `% Invalid name server "": not an IPv4 address` | `% Incomplete command: ip name-server <address>` | | `ipv6 address` | `% Invalid IPv6 address ""` | `% Incomplete command: ipv6 address <address>/<prefix> (or `ipv6 address autoconfig`)` | | `vrrp 1 ip` | `% Invalid address: (none)` | `% Incomplete command: vrrp <vrid> ip <address>` | A genuinely bad value is still quoted back (`Invalid name server "flurbish"`), so a short line and a wrong value now read differently — which is the whole point. ## Two things measured and deliberately left alone **Whitespace is already robust.** Labs are pasted, not typed, so every command in the sweep was also run with double spaces, a tab, a leading space, a trailing space, and a mix: **108 variant runs, 0 differences** in the answer or the resulting config. Nothing to fix — but it had never been measured, so it is now pinned by a test instead of assumed. **A global command at an interface prompt is applied in global config** — deliberately, so a pasted running-config block works without `exit` lines between blocks (#1230). Leniency by design; what it costs is that the answer does not say where the configuration landed. The reverse direction is refused by name, and where the console knows better it says so: ``` Router(config)#vrrp 1 ip 10.0.0.254 % vrrp is configured per interface: enter an interface first, e.g. interface Gi0/0 ``` The test pins the leniency so it stays a decision, and pins the reverse refusal so strictness does not spread by accident. ## Evidence `test/missing-argument-is-not-a-value.test.js` — **29 checks, 29 passed / 0 failed**. With the old handler: **13 passed / 16 failed**, naming both silent commands, all three empty-string-as-value messages, and the erased hostname. Docs: `docs/CLI.md`, new section "A short line is not a wrong value". Full suite: 246 suites, 9,120 assertions, 0 failed. Syntax 315 files.
Author
Owner

State: green locally; CI is blocked on infrastructure, not on this change.

The full suite passes on this branch (246 suites / 9120 assertions / 0 failed, syntax 315 files) and missing-argument-is-not-a-value is 29/29 (13/16 against the old engine/cli.js).

CI cannot confirm it right now because the Forgejo host ran out of disk during this session:

remote: error: couldn't set 'refs/heads/fix/short-line'
! [remote rejected] (failed to update ref)
POST /contents/... -> 500
Clone: exit status 128 - could not write config file
/data/gitea/data/tmp/local-repo/upload.git.../config: No space left on device

main's own CI has been failing since ~06:32 for the same reason (Test (Node 18/20/22), audit, Classify the change, and the Rebase open PRs workflow all failing on main, which this change does not touch). The push succeeded on a retry, and a branch create/delete probe returned 201/204, so the volume fluctuates rather than being permanently full.

This PR is armed for squash auto-merge and should land once CI can run.

**State: green locally; CI is blocked on infrastructure, not on this change.** The full suite passes on this branch (246 suites / 9120 assertions / 0 failed, syntax 315 files) and `missing-argument-is-not-a-value` is 29/29 (13/16 against the old `engine/cli.js`). CI cannot confirm it right now because the Forgejo host ran out of disk during this session: ``` remote: error: couldn't set 'refs/heads/fix/short-line' ! [remote rejected] (failed to update ref) ``` ``` POST /contents/... -> 500 Clone: exit status 128 - could not write config file /data/gitea/data/tmp/local-repo/upload.git.../config: No space left on device ``` `main`'s own CI has been failing since ~06:32 for the same reason (`Test (Node 18/20/22)`, `audit`, `Classify the change`, and the `Rebase open PRs` workflow all failing on `main`, which this change does not touch). The push succeeded on a retry, and a branch create/delete probe returned 201/204, so the volume fluctuates rather than being permanently full. This PR is armed for squash auto-merge and should land once CI can run.
Author
Owner

Landed on main as e7d18ce8 ("A short line is not a wrong value (#1498)"). Verified on the merge commit: missing-argument-is-not-a-value 29/29, no-command-swallows-a-word 21/21, command-answers-the-question 27/27, tree clean.

How it landed is worth recording, because the pipeline is not healthy. The pull_request event for this branch produced no run at all: two force-pushes left the run list unchanged, and a workflow_dispatch on the same branch created only the Classify the change job (which succeeded) with none of the jobs that carry needs: ever being enqueued. The PR sat armed, waiting on checks that Forgejo would never create, and main's own runs have been failing since ~06:32.

The cause is the host, not the code: while pushing this branch the API returned No space left on device from Forgejo's own clone path, git receive answered couldn't set 'refs/heads/...', and a branch create/delete probe later returned 201/204, so the volume fluctuates. The action queue has not recovered from that window - hence dependent jobs never being scheduled, and the PR's own state in the UI lagging (it reads open although the commit is on main).

Root-cause follow-up for the next iteration: the CI docker job runs docker build -t packetforge:ci . against the host daemon on every code push and never prunes, so build cache accumulates on the same volume Forgejo stores its data on. A bounded docker builder prune --keep-storage plus docker system df reporting in that job is the change that would stop this recurring.

Landed on `main` as `e7d18ce8` ("A short line is not a wrong value (#1498)"). Verified on the merge commit: `missing-argument-is-not-a-value` 29/29, `no-command-swallows-a-word` 21/21, `command-answers-the-question` 27/27, tree clean. **How it landed is worth recording, because the pipeline is not healthy.** The `pull_request` event for this branch produced no run at all: two force-pushes left the run list unchanged, and a `workflow_dispatch` on the same branch created only the `Classify the change` job (which succeeded) with none of the jobs that carry `needs:` ever being enqueued. The PR sat armed, waiting on checks that Forgejo would never create, and `main`'s own runs have been failing since ~06:32. The cause is the host, not the code: while pushing this branch the API returned `No space left on device` from Forgejo's own clone path, git receive answered `couldn't set 'refs/heads/...'`, and a branch create/delete probe later returned 201/204, so the volume fluctuates. The action queue has not recovered from that window - hence dependent jobs never being scheduled, and the PR's own state in the UI lagging (it reads `open` although the commit is on `main`). Root-cause follow-up for the next iteration: the CI `docker` job runs `docker build -t packetforge:ci .` against the host daemon on every code push and never prunes, so build cache accumulates on the same volume Forgejo stores its data on. A bounded `docker builder prune --keep-storage` plus `docker system df` reporting in that job is the change that would stop this recurring.
Sign in to join this conversation.
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#1497
No description provided.