The canvas draws a refused cable as refused (#1305) #1306

Merged
jaylouisw merged 1 commit from fix/canvas-cable-verdict into main 2026-11-10 00:34:45 +00:00
Owner

The canvas draws a refused cable as refused.

Fixes #1305.

The gap

#1304 gave every state payload a verdict per cable (state.verdicts, filed under the cable that caused it) and
taught the cable inspector to print it. The canvas was the last surface still drawing on its own opinion: an
impossible cable — copper terminated in a fibre cage, an optic the port cannot seat — came out as the same 2 px
line as a good one.

link-down already existed for a cut cable, and it is not the same fault: a cut is a state, an impossible
cable is up and simply cannot be what it claims. Different fixes, so different pictures.

After

what the engine says the line
error (copper in a fibre cage, an optic that will not seat) dotted red, link-invalid
warning (a run longer than the medium's reach — it links, it will not carry) amber, link-caveat
state: down (a cut cable) dashed red, link-down (unchanged)
nothing wrong unchanged, data-link-valid="true"

Every cable line carries data-link-valid (true / warn / false / unchecked), data-link-issue (the code)
and data-link-issue-text (the sentence), plus a <title> so the message is there on hover without a click.
unchecked means the payload carried no verdict — the drawing claims nothing rather than implying the cable is
fine, the same rule as #1299 and #1301.

Two things the test forced, both real

  • the verdict is filed per cable, so one bad run does not redden the lab — asserted with two cables, one
    refused;
  • a malformed issue entry must be filtered, not thrown on. My first version called .filter() straight off the
    list, so a null entry threw, the per-link try/catch swallowed it, and the refused cable vanished from the
    canvas entirely
    — worse than drawing it as good. The test's "a malformed issue does not throw" case found it.

Evidence

test/canvas-cable-verdict.test.js — 26 checks against the real web/canvas.js in a recording stub DOM:
refused, clean, caveat, down-only, down-and-refused, no verdict at all, a verdict object that says it could not
check, two cables where one is bad, and the malformed-issue case. With web/canvas.js reverted, 17 of the 26
fail
.

docs/CONNECTORS.md: the drawing rules, and why a caveat is not a refusal.

Suite: 168 suites, 6,843 assertions, 0 failed.

The canvas draws a refused cable as refused. Fixes #1305. ## The gap #1304 gave every state payload a verdict per cable (`state.verdicts`, filed under the cable that caused it) and taught the cable inspector to print it. The canvas was the last surface still drawing on its own opinion: an impossible cable — copper terminated in a fibre cage, an optic the port cannot seat — came out as the same 2 px line as a good one. `link-down` already existed for a cut cable, and it is **not the same fault**: a cut is a state, an impossible cable is *up* and simply cannot be what it claims. Different fixes, so different pictures. ## After | what the engine says | the line | |---|---| | error (copper in a fibre cage, an optic that will not seat) | dotted red, `link-invalid` | | warning (a run longer than the medium's reach — it links, it will not carry) | amber, `link-caveat` | | `state: down` (a cut cable) | dashed red, `link-down` (unchanged) | | nothing wrong | unchanged, `data-link-valid="true"` | Every cable line carries `data-link-valid` (`true` / `warn` / `false` / `unchecked`), `data-link-issue` (the code) and `data-link-issue-text` (the sentence), plus a `<title>` so the message is there on hover without a click. `unchecked` means the payload carried no verdict — the drawing claims nothing rather than implying the cable is fine, the same rule as #1299 and #1301. ## Two things the test forced, both real * the verdict is filed **per cable**, so one bad run does not redden the lab — asserted with two cables, one refused; * a malformed issue entry must be **filtered, not thrown on**. My first version called `.filter()` straight off the list, so a `null` entry threw, the per-link `try/catch` swallowed it, and the refused cable **vanished from the canvas entirely** — worse than drawing it as good. The test's "a malformed issue does not throw" case found it. ## Evidence `test/canvas-cable-verdict.test.js` — 26 checks against the real `web/canvas.js` in a recording stub DOM: refused, clean, caveat, down-only, down-and-refused, no verdict at all, a verdict object that says it could not check, two cables where one is bad, and the malformed-issue case. With `web/canvas.js` reverted, **17 of the 26 fail**. `docs/CONNECTORS.md`: the drawing rules, and why a caveat is not a refusal. Suite: 168 suites, 6,843 assertions, 0 failed.
The canvas draws a refused cable as refused (#1305)
Some checks failed
CI / Classify the change (pull_request) Successful in 19s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 21s
CI / Test (Node 18) (pull_request) Failing after 2m30s
CI / Test (Node 20) (pull_request) Successful in 2m30s
CI / Server smoke test (pull_request) Successful in 37s
CI / Docker build (pull_request) Successful in 51s
CI / Test (Node 22) (pull_request) Successful in 2m7s
49a80bc0ab
#1304 gave every state payload a verdict per cable and taught the inspector to print it. The canvas was the last
surface drawing on its own opinion: an impossible cable - copper terminated in a fibre cage, an optic the port
cannot seat - came out as the same 2 px line as a good one. link-down already existed for a cut cable, and it is
not the same fault: a cut is a state, an impossible cable is up and simply cannot be what it claims. Different
fixes, so different pictures.

  what the engine says                                          the line
  error (copper in a fibre cage, an optic that will not seat)    dotted red,  link-invalid
  warning (a run longer than the medium's reach)                 amber,       link-caveat
  state: down (a cut cable)                                      dashed red,  link-down  (unchanged)
  nothing wrong                                                  unchanged,   data-link-valid="true"

Every cable line carries data-link-valid (true / warn / false / unchecked), data-link-issue (the code) and
data-link-issue-text (the sentence), plus a <title> so the message is there on hover without a click. "unchecked"
means the payload carried no verdict, so the drawing claims nothing rather than implying the cable is fine - the
same rule as #1299 and #1301.

Two things the test forced, and both were real:

  * the verdict is filed per cable, so one bad run does not redden the lab - asserted with two cables, one
    refused;
  * a malformed issue entry must be filtered, not thrown on. My first version called .filter() straight off the
    list, so a null entry threw, the per-link try/catch swallowed it, and the refused cable vanished from the
    canvas entirely - worse than drawing it as good. The test's "a malformed issue does not throw" case found it.

test/canvas-cable-verdict.test.js: 26 checks against the real web/canvas.js in a recording stub DOM - refused,
clean, caveat, down-only, down-and-refused, no verdict at all, a verdict object that says it could not check, two
cables where one is bad, and the malformed-issue case. With web/canvas.js reverted, 17 of the 26 fail.

docs/CONNECTORS.md: the drawing rules, and why a caveat is not a refusal.

Suite: 168 suites, 6,843 assertions, 0 failed.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-10 00:34:40 +00:00
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!1306
No description provided.