poe: the budget audit can be asked, and it has a word for power that arrived upstream #2501

Merged
jaylouisw merged 2 commits from catalogue/1124-0022 into main 2026-11-24 01:09:46 +00:00
Owner

No open device-request issue remains � the queue is drained (#130 closed 2026-11-23 against the UDW tab, and PR #2495 is in flight for the UACC-LR-Endpoint outlet). So this run takes the next item the PoE audit cannot answer, which is the blocker its own plan names: docs/plans/poe-budget-variants.md step 1, "make the audit askable, and give it the fifth state".

Why this, and not a device

scripts/audit-poe-budget.js reports 3 of 408 PSE boxes that source power and cannot say how much: ubiquiti/UDB-Pro, ubiquiti/F-POE-G2, ubiquiti/UACC-LR-Endpoint. All three are passthrough boxes � the watts leave the box from a supply that arrived from upstream � and the audit had no word for that, so they printed as "silent" forever. Ubiquiti prints no outlet ceiling for any of them (checked this run for the F-POE-G2: tech specs, datasheet PDF text layer, and store page; the datasheet's whole spec table has no output-watt or output-current row at all), so a budgetW would be a subtraction nobody published.

Marking the three is step 2 and needs step 1 first, otherwise poe.passthrough is a key nothing reads. This PR is step 1 (and step 4, the suite that proves it).

What changed

  • auditPoeBudget(cat) is exported and main() is guarded behind require.main === module, so a suite can call the census. The printout and exit codes are unchanged.
  • New cohort passthrough (spec.poe.passthrough === true): printed on its own line, counted, excluded from silent and from the --strict failure count.
  • New cohort misdeclared, which the plan did not name but its own risk list demands: a passthrough flag beside a budgetW is the file answering one question twice, and a flag on a box with no PSE port claims a socket that is not there. Both fail --strict like a silent one, so the fifth state cannot be used to buy a quiet audit line.
  • test/poe-budget-gate.test.js (18 assertions): silent fixtures still fail, budgetUnknown passes, passthrough passes and is counted, both misdeclared shapes fail, no device in two cohorts on the real catalogue, and --strict's exit code agrees with the cohorts --json prints.

Gate output

  • node scripts/audit-poe-budget.js � 2,352 models, 408 sourcing, silent 3, unknown 26, passthrough 0, misdeclared 0 (unchanged until step 2 marks the boxes); --strict exits 1, which is why step 3 is not taken here � a gate that is red on arrival teaches people to ignore it.
  • node test/poe-budget-gate.test.js � 18 passed, 0 failed
  • node scripts/syntax-check.js � 556 files (548 JS, 8 TS): all OK
  • node scripts/audit-port-types.js � gated: 0 contradicting their declared type
  • node scripts/audit-devices.js � gated: 0 hard defects
  • node test/hardware-invariants.test.js � 26 passed, 0 failed
  • node scripts/run-tests.js --concurrency=4 � 472 of 473 suites green; test/canonical-urls.test.js failed under the runner's concurrency (the README-mutation race this same stream hit in #2495) and passes standalone: 88 passed, 0 failed, tree clean afterwards.

Next passes: step 2 one vendor at a time � Ubiquiti F-POE-G2 and UDB-Pro get poe.passthrough: true with the documents read; then step 3 can put --strict into package.json, step 5 documents the field.

No open `device-request` issue remains � the queue is drained (#130 closed 2026-11-23 against the UDW tab, and PR #2495 is in flight for the UACC-LR-Endpoint outlet). So this run takes the next item the PoE audit cannot answer, which is the blocker its own plan names: `docs/plans/poe-budget-variants.md` step 1, "make the audit askable, and give it the fifth state". ## Why this, and not a device `scripts/audit-poe-budget.js` reports **3 of 408** PSE boxes that source power and cannot say how much: `ubiquiti/UDB-Pro`, `ubiquiti/F-POE-G2`, `ubiquiti/UACC-LR-Endpoint`. All three are **passthrough** boxes � the watts leave the box from a supply that arrived from upstream � and the audit had no word for that, so they printed as "silent" forever. Ubiquiti prints no outlet ceiling for any of them (checked this run for the F-POE-G2: tech specs, datasheet PDF text layer, and store page; the datasheet's whole spec table has no output-watt or output-current row at all), so a `budgetW` would be a subtraction nobody published. Marking the three is step 2 and needs step 1 first, otherwise `poe.passthrough` is a key nothing reads. This PR is step 1 (and step 4, the suite that proves it). ## What changed - `auditPoeBudget(cat)` is exported and `main()` is guarded behind `require.main === module`, so a suite can call the census. The printout and exit codes are unchanged. - New cohort **`passthrough`** (`spec.poe.passthrough === true`): printed on its own line, counted, excluded from `silent` and from the `--strict` failure count. - New cohort **`misdeclared`**, which the plan did not name but its own risk list demands: a `passthrough` flag beside a `budgetW` is the file answering one question twice, and a flag on a box with no PSE port claims a socket that is not there. Both fail `--strict` like a silent one, so the fifth state cannot be used to buy a quiet audit line. - `test/poe-budget-gate.test.js` (18 assertions): silent fixtures still fail, `budgetUnknown` passes, `passthrough` passes and is counted, both misdeclared shapes fail, no device in two cohorts on the real catalogue, and `--strict`'s exit code agrees with the cohorts `--json` prints. ## Gate output - `node scripts/audit-poe-budget.js` � 2,352 models, 408 sourcing, silent **3**, unknown 26, passthrough **0**, misdeclared **0** (unchanged until step 2 marks the boxes); `--strict` exits **1**, which is why step 3 is not taken here � a gate that is red on arrival teaches people to ignore it. - `node test/poe-budget-gate.test.js` � 18 passed, 0 failed - `node scripts/syntax-check.js` � 556 files (548 JS, 8 TS): all OK - `node scripts/audit-port-types.js` � gated: 0 contradicting their declared type - `node scripts/audit-devices.js` � gated: 0 hard defects - `node test/hardware-invariants.test.js` � 26 passed, 0 failed - `node scripts/run-tests.js --concurrency=4` � 472 of 473 suites green; `test/canonical-urls.test.js` failed under the runner's concurrency (the README-mutation race this same stream hit in #2495) and passes standalone: **88 passed, 0 failed**, tree clean afterwards. Next passes: step 2 one vendor at a time � Ubiquiti F-POE-G2 and UDB-Pro get `poe.passthrough: true` with the documents read; then step 3 can put `--strict` into `package.json`, step 5 documents the field.
poe: the budget audit can be asked, and it has a word for power that arrived upstream
Some checks failed
CI / Server smoke and Docker build (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Failing after 1m9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 8s
CI / Typecheck (pull_request) Successful in 15s
CI / Test (Node 24) (pull_request) Successful in 47s
CI / Arm auto-merge (pull_request) Successful in 5s
3451a240cc
scripts/audit-poe-budget.js was a bare process.exit(main()): no export, no
require.main guard, so no suite could ask it what it counted and nothing ran it.
It also had no cohort for the three boxes whose PoE ceiling belongs to the supply
they are plugged into, which is why they kept printing as 'silent' with no way to
answer them honestly (docs/plans/poe-budget-variants.md step 1).

- auditPoeBudget(cat) is exported; main() keeps the printout and the exit code
- poe.passthrough: true routes a device to its own cohort, counted and printed,
  excluded from silent and from the --strict failure count
- misdeclared: a passthrough flag beside a budgetW, or on a box with no PSE port,
  is a flag describing nothing - it fails --strict like a silent one, so the new
  state cannot be used to buy a quiet audit line
- test/poe-budget-gate.test.js pins all five shapes, one-cohort-per-device on the
  real catalogue, and that --strict's exit code agrees with the cohorts printed
ci: re-run the matrix — the Node 22 leg lost a suite to the host, not to this diff
All checks were successful
CI / Typecheck (pull_request) Successful in 30s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 11s
CI / Server smoke and Docker build (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 1m4s
CI / Test (Node 24) (pull_request) Successful in 1m8s
CI / Arm auto-merge (pull_request) Successful in 6s
9104d36ed4
The whole tree passes on Node 22.23.5 locally: 473 suites, 15,938 assertions, 0 failed,
73.4 s at 12-way concurrency, the same width CI gives that leg. The Node 24 leg
and every other check on this branch are green. No code changes.
Author
Owner

The Node 22 leg came back red on 3451a240 while Node 24, Typecheck, the Docker/smoke job and both automation jobs were green.

Re-run against the same tree on this host, with the same runtime CI gives that leg:

  • Node 22.23.5, node scripts/run-tests.js --concurrency=12 - 473 suites, 15,938 assertions, 0 failed, 73.4 s (the same assertion total Node 26 reports, so no suite was skipped)
  • Node 22.23.5, node test/poe-budget-gate.test.js - 18 passed, 0 failed
  • Node 26.13.1, the same full run at 12-way - 473 suites, 15,938 assertions, 0 failed, 72.7 s

So the diff is not the difference between the legs: the red is the host losing one suite at 12-way concurrency, the race ci.yml re-runs for. test/canonical-urls.test.js is the suite in this tree that mutates README.md, and it also failed once at 4-way here before passing 88/88 alone. The run logs on this instance are behind a login, so I cannot name the suite from the leg itself; the empty commit is only to give the matrix a fresh pull_request event. No code changed.

The Node 22 leg came back red on 3451a240 while Node 24, Typecheck, the Docker/smoke job and both automation jobs were green. Re-run against the same tree on this host, with the same runtime CI gives that leg: - Node 22.23.5, `node scripts/run-tests.js --concurrency=12` - 473 suites, 15,938 assertions, 0 failed, 73.4 s (the same assertion total Node 26 reports, so no suite was skipped) - Node 22.23.5, `node test/poe-budget-gate.test.js` - 18 passed, 0 failed - Node 26.13.1, the same full run at 12-way - 473 suites, 15,938 assertions, 0 failed, 72.7 s So the diff is not the difference between the legs: the red is the host losing one suite at 12-way concurrency, the race ci.yml re-runs for. `test/canonical-urls.test.js` is the suite in this tree that mutates README.md, and it also failed once at 4-way here before passing 88/88 alone. The run logs on this instance are behind a login, so I cannot name the suite from the leg itself; the empty commit is only to give the matrix a fresh pull_request event. No code changed.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-24 01:06:20 +00:00
jaylouisw deleted branch catalogue/1124-0022 2026-11-24 01:09:48 +00:00
Sign in to join this conversation.
No description provided.