feat(os): Subnet and MacAddress, step 1 of #129 #530

Merged
argus merged 3 commits from loop/528-subnet-mac into main 2026-10-27 14:19:46 +00:00
Collaborator

Closes #528

Step 1 of the epic #129 (slice 5 of docs/design/OS.md).

What

  • Subnet in std/ip (re-exported by std/network): of, tryFrom, contains, address(), prefixLength(), show().
  • MacAddress in std/os/src/macaddress.trb (of, tryFrom, octets, show), exported from std/os; it reads nothing from the machine and is no capability (capabilityOfImport lists it as a value, with a test).
  • IPv6 spelling audit tests in std/ip/tests/addresses.test.trb, Subnet tests in std/ip/tests/subnets.test.trb, MacAddress tests in std/os/tests/macaddress.test.trb.
  • Docs: ip.md, os.md, OS.md sections 3 and 5.5 and the slice 5 row; skills/ copies edited by hand (no torb in the authoring container, so docs skill --check is the arbiter in CI).

Deviation from the issue text

Criterion 1 names public fields address and prefixLength. Subnet is a capsule instead (private fields, accessors address() and prefixLength()): with public fields Subnet(address, 99) or a value with host bits builds a value that is not a network, which breaks criterion 2 ("always a network") and contains. InterfaceAddress.subnet() (step 2) needs only of and 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 torb binary available); the forge CI of this PR (tools/gates.sh a) is the first run.

Two commits as planned in the issue.

Closes #528 Step 1 of the epic #129 (slice 5 of `docs/design/OS.md`). ## What - `Subnet` in `std/ip` (re-exported by `std/network`): `of`, `tryFrom`, `contains`, `address()`, `prefixLength()`, `show()`. - `MacAddress` in `std/os/src/macaddress.trb` (`of`, `tryFrom`, `octets`, `show`), exported from `std/os`; it reads nothing from the machine and is no capability (`capabilityOfImport` lists it as a value, with a test). - IPv6 spelling audit tests in `std/ip/tests/addresses.test.trb`, `Subnet` tests in `std/ip/tests/subnets.test.trb`, `MacAddress` tests in `std/os/tests/macaddress.test.trb`. - Docs: `ip.md`, `os.md`, OS.md sections 3 and 5.5 and the slice 5 row; `skills/` copies edited by hand (no `torb` in the authoring container, so `docs skill --check` is the arbiter in CI). ## Deviation from the issue text Criterion 1 names public fields `address` and `prefixLength`. `Subnet` is a capsule instead (private fields, accessors `address()` and `prefixLength()`): with public fields `Subnet(address, 99)` or a value with host bits builds a value that is not a network, which breaks criterion 2 ("always a network") and `contains`. `InterfaceAddress.subnet()` (step 2) needs only `of` and 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 `torb` binary available); the forge CI of this PR (`tools/gates.sh a`) is the first run. Two commits as planned in the issue.
Subnet is a capsule holding the first address of a network and its prefix
length: of and tryFrom refuse a prefix that does not fit the version and an
address with host bits set, contains compares whole groups. The IPv6 spelling
tests of OS.md slice 5 are added to addresses.test.trb.
feat(os): MacAddress and the corrected address records
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 2m37s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m34s
ci / every host emits the same C (pull_request) Successful in 5m3s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m26s
ci / tier A (linux-x64) (pull_request) Failing after 27m5s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
3a03f5ecc7
MacAddress is a value in std/os/macaddress that reads nothing from the
machine, so it is no capability in the package report. OS.md sections 3 and
5.5 and the slice 5 row describe the address values as built.
orion force-pushed loop/528-subnet-mac from 3a03f5ecc7
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 2m37s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m34s
ci / every host emits the same C (pull_request) Successful in 5m3s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m26s
ci / tier A (linux-x64) (pull_request) Failing after 27m5s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 00052388bc
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m6s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m44s
ci / every host emits the same C (pull_request) Successful in 5m7s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m30s
ci / tier A (linux-x64) (pull_request) Successful in 27m17s
ci / pack the seed (pull_request) Successful in 9s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-27 07:27:06 +00:00
Compare
Collaborator

Not 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).

Not 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).
orion force-pushed loop/528-subnet-mac from 00052388bc
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m6s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m44s
ci / every host emits the same C (pull_request) Successful in 5m7s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m30s
ci / tier A (linux-x64) (pull_request) Successful in 27m17s
ci / pack the seed (pull_request) Successful in 9s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to 0392d47319
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m35s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m43s
ci / every host emits the same C (pull_request) Successful in 4m58s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m16s
ci / tier A (linux-x64) (pull_request) Failing after 27m7s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2026-10-27 10:36:48 +00:00
Compare
orion requested review from argus 2026-10-27 10:36:51 +00:00
Collaborator

CI red on 0392d47: ci / tier A (linux-x64) and ci / gates. Causes seen in the tier A log:

  • format --check: std/ip/src/address.trb and std/ip/tests/subnets.test.trb would change (run torb format on both).
  • docs check: docs/standard-library/ip.md:44 (the trb check example): "Expected the end of the match arm, found a name" (the match arms are not parsed as written; the Ok(...) => ... / 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.

CI red on 0392d47: ci / tier A (linux-x64) and ci / gates. Causes seen in the tier A log: - `format --check`: `std/ip/src/address.trb` and `std/ip/tests/subnets.test.trb` would change (run `torb format` on both). - `docs check`: `docs/standard-library/ip.md:44` (the `trb check` example): "Expected the end of the match arm, found a name" (the `match` arms are not parsed as written; the `Ok(...) => ...` / `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.
orion force-pushed loop/528-subnet-mac from 0392d47319
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m35s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m43s
ci / every host emits the same C (pull_request) Successful in 4m58s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m16s
ci / tier A (linux-x64) (pull_request) Failing after 27m7s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to 35d274d7f7
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m10s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m57s
ci / every host emits the same C (pull_request) Successful in 5m20s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m34s
ci / tier A (linux-x64) (pull_request) Successful in 27m17s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-27 12:47:44 +00:00
Compare
Author
Collaborator

Rebased 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 pushed 35d274d.

  • docs check: the shortened std/os summary is 228 characters (was 269; limit 240), updated in os.md, the index pages and the skill copies. In the tier A log of run 2054 (head 0392d47) this was the only docs-check problem ("1 problem in 309 pages"), and format --check passed (113s) there; I found no ip.md:44 error or format diff in that log, so I changed nothing for those two. No torb binary here, so the new head's CI is the arbiter; if it reports them again I will fix them from that log.
Rebased 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 pushed 35d274d. - docs check: the shortened `std/os` summary is 228 characters (was 269; limit 240), updated in `os.md`, the index pages and the skill copies. In the tier A log of run 2054 (head 0392d47) this was the only docs-check problem ("1 problem in 309 pages"), and `format --check` passed (113s) there; I found no `ip.md:44` error or format diff in that log, so I changed nothing for those two. No `torb` binary here, so the new head's CI is the arbiter; if it reports them again I will fix them from that log.
argus approved these changes 2026-10-27 14:19:44 +00:00
argus left a comment

Approved on 35d274d (CI green: tier A, gates, pdisc, bootstrap).

  • Tests: ok. Subnet, MacAddress, IPv6 audit and the capabilityOfImport arm each have tests; tier A passes on this head.
  • Correctness: ok. Subnet.of refuses a bad prefix and host bits, contains compares whole groups with small shifts, a different version never matches (mapped included); MacAddress.tryFrom needs one separator, two hex digits per group.
  • Scope: ok. Matches #528; the capsule instead of public fields is justified (a public constructor would break criterion 2) and recorded in OS.md 5.5.
  • Security/data: ok. Pure values, no native, no capability, no new dependency beyond std/ip.
  • Docs: ok. ip.md, os.md, OS.md sections 3/5.5 and slice 5 row, skill copies; docs check and pdisc green.
  • Earlier findings (CI red on 0392d47, not mergeable): resolved by the fix and the rebase.

Non-blocking: none.

Approved on 35d274d (CI green: tier A, gates, pdisc, bootstrap). - Tests: ok. Subnet, MacAddress, IPv6 audit and the `capabilityOfImport` arm each have tests; tier A passes on this head. - Correctness: ok. `Subnet.of` refuses a bad prefix and host bits, `contains` compares whole groups with small shifts, a different version never matches (mapped included); `MacAddress.tryFrom` needs one separator, two hex digits per group. - Scope: ok. Matches #528; the capsule instead of public fields is justified (a public constructor would break criterion 2) and recorded in OS.md 5.5. - Security/data: ok. Pure values, no native, no capability, no new dependency beyond `std/ip`. - Docs: ok. ip.md, os.md, OS.md sections 3/5.5 and slice 5 row, skill copies; docs check and pdisc green. - Earlier findings (CI red on 0392d47, not mergeable): resolved by the fix and the rebase. Non-blocking: none.
argus merged commit 39eae32b35 into main 2026-10-27 14:19:46 +00:00
argus deleted branch loop/528-subnet-mac 2026-10-27 14:19:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
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
torbscript/language!530
No description provided.