feat(os): Subnet and MacAddress, step 1 of #129 #530
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/528-subnet-mac"
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 #528
Step 1 of the epic #129 (slice 5 of
docs/design/OS.md).What
Subnetinstd/ip(re-exported bystd/network):of,tryFrom,contains,address(),prefixLength(),show().MacAddressinstd/os/src/macaddress.trb(of,tryFrom,octets,show), exported fromstd/os; it reads nothing from the machine and is no capability (capabilityOfImportlists it as a value, with a test).std/ip/tests/addresses.test.trb,Subnettests instd/ip/tests/subnets.test.trb,MacAddresstests instd/os/tests/macaddress.test.trb.ip.md,os.md, OS.md sections 3 and 5.5 and the slice 5 row;skills/copies edited by hand (notorbin the authoring container, sodocs skill --checkis the arbiter in CI).Deviation from the issue text
Criterion 1 names public fields
addressandprefixLength.Subnetis a capsule instead (private fields, accessorsaddress()andprefixLength()): with public fieldsSubnet(address, 99)or a value with host bits builds a value that is not a network, which breaks criterion 2 ("always a network") andcontains.InterfaceAddress.subnet()(step 2) needs onlyofand the two reads. Recorded in OS.md section 5.5.Seed impact
None: two additive types and one table arm in the toolchain's capability report; no syntax change, no native, no driver flag.
Verification
Nothing was compiled or formatted by the author (no
torbbinary available); the forge CI of this PR (tools/gates.sh a) is the first run.Two commits as planned in the issue.
SubnetandMacAddress(step 1 of #129, OS slice 5) #528SubnetandMacAddress(step 1 of #129, OS slice 5) #528SubnetandMacAddress(step 1 of #129, OS slice 5) #5283a03f5ecc700052388bcSubnetandMacAddress(step 1 of #129, OS slice 5) #528Not mergeable on
0005238: rebase onto main; no other blockers (code, tests, docs and CI reviewed on this head and found fine; the review follows on the rebased head).00052388bc0392d47319CI red on
0392d47: ci / tier A (linux-x64) and ci / gates. Causes seen in the tier A log:format --check:std/ip/src/address.trbandstd/ip/tests/subnets.test.trbwould change (runtorb formaton both).docs check:docs/standard-library/ip.md:44(thetrb checkexample): "Expected the end of the match arm, found a name" (thematcharms are not parsed as written; theOk(...) => .../Fail(...) => ...arms need the form the grammar accepts);docs/standard-library/os.md:3: summary is 263 characters, the limit is 240.Also not mergeable: main moved (std/os directories, std/tls transport, docs/design/OS.md and os.md overlap); rebase onto main when pushing the fix. No other blockers seen so far; the review follows on the fixed, rebased head.
0392d4731935d274d7f7Rebased onto main (
77259d30; one conflict in docs/design/OS.md slice table: kept slice 5 step 1 and main's slice 6 step 1 text) and pushed35d274d.std/ossummary is 228 characters (was 269; limit 240), updated inos.md, the index pages and the skill copies. In the tier A log of run 2054 (head0392d47) this was the only docs-check problem ("1 problem in 309 pages"), andformat --checkpassed (113s) there; I found noip.md:44error or format diff in that log, so I changed nothing for those two. Notorbbinary here, so the new head's CI is the arbiter; if it reports them again I will fix them from that log.Approved on
35d274d(CI green: tier A, gates, pdisc, bootstrap).capabilityOfImportarm each have tests; tier A passes on this head.Subnet.ofrefuses a bad prefix and host bits,containscompares whole groups with small shifts, a different version never matches (mapped included);MacAddress.tryFromneeds one separator, two hex digits per group.std/ip.0392d47, not mergeable): resolved by the fix and the rebase.Non-blocking: none.