A reopened lab forgot what its hardware was made of #1460
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1460
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/spec-survives-load"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1459
A document states a device's identity, its ports and its configuration.
Topology.fromJSONrebuilt the device spec from a hand-picked handful of keys and dropped everything else, so a reopened lab forgot what its hardware was made of:spec.splitRatio/spec.ponClass— a 1:32 splitter came back splitting nothing, and the 60 km run stopped being refused;isPassiveTap()readsspec.passive— a passive tap came back as a box that learns MAC addresses.The change
Device.serialize()writes the spec minus the keys the document already carries elsewhere (interfacesare saved port by port;description,notes,sourceUrlare catalogue prose that does not belong in a lab), andfromJSONmerges that record underneath the document's own identity and ports.After the change the same document reports the identical sentence the connect door refuses with —
E_OPTICAL_BUDGET, severity error, 31.3 dB against a 28 dB budget, naming the splitter's 17.5 dB — and a new 60 km run drawn on the reopened board is refused again, because the ratio is no longer forgotten.Deliberately unchanged
spec, nothing to report, no wrong facts invented;interfacesinsidespec, no prose.Evidence
test/spec-survives-load.test.js, 32 checks: the splitter keepssplitRatio/insertionLossDb; a CWDM mux keeps itschannelCount/channelPlan; a passive tap still answersisPassiveTap(); the over-budget document is reported as an error with the door's own numbers and clears the board'sok; a within-budget board stays clean; the door refuses a fresh over-budget run on the reopened topology and makes no cable; old documents (spec stripped) restore every device, port and cable with noloadIssues; and the savedspeccarries neither ports nor prose.Reverting
engine/device.js+engine/topology.jsfails 14/32.Neighbours green:
pon-splitter33,hybrid-cord-use64,cable-length22,flows-survive-save-load16,state-payload-complete16,port-roundtrip32,config-roundtrip46,engine12,acl-data21.Docs:
docs/ARCHITECTURE.md§ "A reopened lab forgot what its hardware was made of".s1# (drawn on the board) % OLT/gpon0/1 <-> PON Splitter 1:32/uplink: downstream at 1490 nm Path loss 31.3 dB exceeds the B+ budget of 28 dB by 3.3 dB. splitting costs 17.5 dB, fibre costs 13.2 dB save, set lengthM = 60000 in the file, reopen -> validateTopology: ok true, 0 errors A document states a device's identity, its ports and its configuration. Topology.fromJSON rebuilt the device spec - the physical facts it was built from - from a hand-picked handful of keys and dropped everything else, so a reopened lab forgot what its hardware was made of: * the optical budget reads spec.splitRatio and spec.ponClass, so a 1:32 splitter came back splitting nothing and the 60 km run stopped being refused - the door was only shut by the ratio; * isPassiveTap() reads spec.passive, so a passive tap came back as a box that learns MAC addresses. Device.serialize() now writes the spec facts the rules read - not the keys the document already carries elsewhere (interfaces are saved port by port) and not catalogue prose - and fromJSON merges that record underneath the document's own identity and ports. Documents written before this rule still open: they have no ratio to read, and nothing is invented for them. Evidence: test/spec-survives-load.test.js, 32 checks; reverting engine/device.js and engine/topology.js fails 14. Suite 230 suites, 8629 assertions, 0 failed.