Skip to content

feat(goip): build the netlink write path only with goip_write (FP-8b) - #298

Merged
randomizedcoder merged 6 commits into
sec/fp8a-goip-shared-helpersfrom
sec/fp8b-goip-write-tag
Nov 14, 2026
Merged

randomizedcoder merged 6 commits into
sec/fp8a-goip-shared-helpersfrom
sec/fp8b-goip-write-tag

Conversation

@randomizedcoder

@randomizedcoder randomizedcoder commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #297. xtcp2 and go-link-monitor serve goip's listings on /ip; after this PR they no longer link goip's write verbs or pkg/xtcpnl's write request builders at all. cmd/goip and cmd/goip-parity keep them behind the goip_write build tag.

  • Seam: every write arm is called through writeOps. Untagged, each field is a stub returning ErrWriteNotCompiled (an ErrWriteVerb, exit 1); write_ops_goip_write.go swaps in the real arms in init.
  • Tags: //go:build goip_write on the write-only files in internal/goip, pkg/xtcpnl (the *_write builders) and pkg/nlparity/nlparity_write.go; internal/goipparity and cmd/goip-parity are tagged whole.
  • Stays untagged: nlparity.IsWrite/ParseWriteRequests* (moved to nlparity_classify.go) and xtcpnl.IsAdmittedXfrmWrite. They classify messages and build none.
  • Tests: tests of tagged files are tagged; mixed files' write tests and their helpers move to <stem>_write_test.go. In mixed tables, write rows skip untagged on ErrWriteNotCompiled; the tagged leg runs them.
  • Guards: notag_test.go checks that every write verb of every object is ErrWriteNotCompiled with no request sent, and that writeOps is the stubs. TestWriteOpsTagged checks the reverse: no stub is left. The segment parity test now covers neigh and nexthop.
  • Nix: per-name extraTags gives goip and goip-parity the tag (their store names become goip-goip_write-*). goip_write joins optInOnlyTags, so flavor-tags fails any xtcp2 flavor that carries it. The tag is also in the three golangci tiers and govulncheck's all-tags pass. test-focused-goip runs tagged and also covers goipparity, nlparity and xtcpnl.
  • No goip_write leg in go-test-flavors: those legs test only pkg/xtcp.
  • Checked:
    • untagged + tagged go vet/go test over internal, pkg and cmd
    • -race both ways
    • nix build .#goip .#goip-parity .#xtcp2 .#go-link-monitor
    • test-focused-goip, flavor-tags, govulncheck, lint-baseline
    • go tool nm: write builders absent from xtcp2/go-link-monitor, present in tagged goip
  • goip-parity microVM (nix run .#microvm-x86_64-goip-parity -- --timeout 20000 at 8daa4c7): 1422 rows GOIP_PARITY_PASS, GOIP_PARITY_OVERALL_PASS, GOIP_PARITY_UNGATED_CLEAN.
  • Next: FP-8c adds the nm/deps/no_exec checks and the docs.

🤖 Generated with Claude Code

randomizedcoder and others added 3 commits November 12, 2026 00:32
Every runX write arm now calls through writeOps, a table of the arms
whose untagged default is a stub per arm returning ErrWriteNotCompiled
(an ErrWriteVerb). write_ops_goip_write.go fills in the real arms under
the goip_write tag. The chain arms claim exactly their segment's verbs,
so flush, restore and route's MPLS check keep their order; neigh and
nexthop gain segments for that. ioam's and sr's inline write tails
become ioamWrite and srWrite.

From here an untagged build refuses every write verb. The write files
still compile into it; the next commit tags them, their tests, and the
builds that need them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The write-only files in internal/goip, pkg/xtcpnl and
pkg/nlparity/nlparity_write.go carry //go:build goip_write, as do
internal/goipparity and cmd/goip-parity whole. Untagged, writeOps keeps
its stubs and every write verb is ErrWriteNotCompiled, exit 1.

Tests follow the code: a test of a tagged file is tagged, a mixed file's
write tests move to <stem>_write_test.go, and the helpers only tagged
tests use move with them. A mixed table's write rows skip in the untagged
build when the run is ErrWriteNotCompiled; the goip_write leg runs them.

- nlparity.IsWrite and ParseWriteRequests* move to the untagged
  nlparity_classify.go, and xtcpnl.IsAdmittedXfrmWrite to
  xtcpnl_xfrm_request.go: they classify, they build nothing.
- notag_test.go: every write verb is ErrWriteNotCompiled with no request
  sent, and writeOps is the stubs; TestWriteOpsTagged is the other half.
- The segment parity test gains neigh and nexthop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- versions.goipWriteTags; binaries.nix adds it per name (extraTagsByName)
  to goip and goip-parity only. goip_write joins optInOnlyTags, and
  flavor-tags fails a full xtcp2 that carries it.
- The three golangci tiers and govulncheck's all-tags pass take the tag.
- test-focused-goip runs with it, over internal/goipparity, pkg/nlparity
  and pkg/xtcpnl too: their write halves build only so. The untagged
  halves run in the default `go test ./...`.
- write_ops.go: initialized, for misspell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
randomizedcoder and others added 3 commits November 13, 2026 21:18
…te-tag

Main's NX10 bpf encap writes (bpf_load.go, lwt_encap_bpf_args.go and their
tests) take the goip_write tag like the other encap parsers. wsO5Spaces
moves to the untagged ws_differential_test.go: the readback tests (O9)
read it. Main's fou and O5 test updates go to the tagged files they moved
to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#282's treatment actuator (internal/goip/actuate) encodes routes and rules
with xtcpnl's typed builders, which FP-8b put behind goip_write.

- BuildWriteRequest, the route builders and the rule builders build with
  `goip_write || treatment`; link, addr, nsid, genl and xfrm writes stay
  goip_write-only.
- actuate, pkg/treatment/{local,agent}, xtcp2-treatment-agent and
  xtcp2-treatmentctl build with `treatment` (mkGoBinary already sets it for
  the full-destination builds those binaries come from).
- Boundary rules for those packages walk with the tag; the untagged daemon
  must not reach actuate.
- golangci tiers lint with `treatment`; tcp-controller quality tests and
  focused-xtcp-treatment pass it (treatmentctl added).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@randomizedcoder
randomizedcoder merged commit 53c400d into sec/fp8a-goip-shared-helpers Nov 14, 2026
randomizedcoder added a commit that referenced this pull request Nov 14, 2026
sec(FP-8): land goip_write tag and no-write-encoders check on main (#298, #299)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant