A saved board is not the lab: 322 devices reload with different ports (combo cages forgotten, a console port gains a gigabit, declared PoE looks guessed) #1321

Closed
opened 2026-11-10 02:45:44 +00:00 by jaylouisw · 0 comments
Owner

Found by asking the question the last two iterations taught me to ask: where is a guard comparing a subset
when the contract is the whole thing? Here the answer was worse than a weak guard — nothing compared a device
across a save at all.

Topology.fromJSON() rebuilt every port from four keys:

return { name: i.name, type: i.type, speed: i.speed, cage: i.cage };

and re-derived the rest. Measured over the catalogue: 322 of 2,015 devices come back different from the ones that
were saved.

lost or changed on reload ports what it does
comboWith, comboRole 84 a combo pair stops knowing it shares one cage
hardware.maxSpeedMbps 1,028 a 115.2 kbps console reloads as a 1 Gbps port
hardware.poeOutDeclared 1,499 a port that declared its own PoE reloads looking like the engine guessed

It is not cosmetic — three behaviours change

A combo cage stops being one cage. Cabling a half while its sibling is in use is refused (cannot share physical combo cage with Gi0/0/0-sfp, which is already in use). After a reload the sibling is null, so the
refusal stops happening and a second cable goes into an occupied cage:

fresh:    refused
reloaded: accepted - a second cable went into an occupied cage

A console port gains a gigabit and invents a warning. maxSpeedMbps feeds W_SPEED_DOWNGRADE:

before reload: [] 
after reload:  ["Link ... serial1 <-> ... serial1 runs at 0M, below the 1G of serial1 and the 1G of serial1."]

A reloaded lab can no longer answer whether the engine guessed its PoE. poeOutDeclared is exactly that
question, and after a reload it answers "guessed" for 1,499 ports that said otherwise in the datasheet.

Why nothing caught it

The saved file was assumed to be the lab. The serializer writes ~23 fields per port, the reader read four, and no
test compared a device before and after — the persistence tests checked that a board came back, not that the
board did.

What must be true instead

  • every field of every port survives a save and reload, for every model in the catalogue — tested, not assumed;
  • the reader passes the whole port document through, and the hardware derivation honours what the file states
    (maxSpeedMbps, poeOutDeclared, maxRangeM, comboWith, comboRole) instead of recomputing a default;
  • the behaviours follow: a reloaded combo cage still refuses the second cable, a console port keeps its rate and
    invents no warning, and a declared PoE port still says it was declared;
  • a board written before any of this still loads, with its hardware derived the way it always was;
  • and optional fields are written only when they hold something — a board does not grow a null line per port for
    facts it does not have.
Found by asking the question the last two iterations taught me to ask: where is a guard comparing a *subset* when the contract is the whole thing? Here the answer was worse than a weak guard — nothing compared a device across a save at all. `Topology.fromJSON()` rebuilt every port from four keys: ```js return { name: i.name, type: i.type, speed: i.speed, cage: i.cage }; ``` and re-derived the rest. Measured over the catalogue: **322 of 2,015 devices come back different from the ones that were saved.** | lost or changed on reload | ports | what it does | |---|---|---| | `comboWith`, `comboRole` | 84 | a combo pair stops knowing it shares one cage | | `hardware.maxSpeedMbps` | 1,028 | a 115.2 kbps console reloads as a **1 Gbps** port | | `hardware.poeOutDeclared` | 1,499 | a port that declared its own PoE reloads looking like the engine guessed | ## It is not cosmetic — three behaviours change **A combo cage stops being one cage.** Cabling a half while its sibling is in use is refused (`cannot share physical combo cage with Gi0/0/0-sfp, which is already in use`). After a reload the sibling is `null`, so the refusal stops happening and a second cable goes into an occupied cage: ``` fresh: refused reloaded: accepted - a second cable went into an occupied cage ``` **A console port gains a gigabit and invents a warning.** `maxSpeedMbps` feeds `W_SPEED_DOWNGRADE`: ``` before reload: [] after reload: ["Link ... serial1 <-> ... serial1 runs at 0M, below the 1G of serial1 and the 1G of serial1."] ``` **A reloaded lab can no longer answer whether the engine guessed its PoE.** `poeOutDeclared` is exactly that question, and after a reload it answers "guessed" for 1,499 ports that said otherwise in the datasheet. ## Why nothing caught it The saved file was assumed to be the lab. The serializer writes ~23 fields per port, the reader read four, and no test compared a device before and after — the persistence tests checked that *a* board came back, not that *the* board did. ## What must be true instead * every field of every port survives a save and reload, for every model in the catalogue — tested, not assumed; * the reader passes the whole port document through, and the hardware derivation honours what the file states (`maxSpeedMbps`, `poeOutDeclared`, `maxRangeM`, `comboWith`, `comboRole`) instead of recomputing a default; * the behaviours follow: a reloaded combo cage still refuses the second cable, a console port keeps its rate and invents no warning, and a declared PoE port still says it was declared; * a board written before any of this still loads, with its hardware derived the way it always was; * and optional fields are written only when they hold something — a board does not grow a `null` line per port for facts it does not have.
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#1321
No description provided.