Repository navigation
feat(events-export): EXP - the proto, the generation, the conversion (V404) - #393
Merged
Merged
Conversation
…(V404) Tier EXP of the events export plan: proto/xtcp_netlink_events/v1/ - the five family messages (link, addr, route, neigh, rule) in the 2100-2500 blocks, continuing the record proto's field-number plan; the NetlinkEvent wrapper (the nlmsghdr, the timestamp, the netns provenance, the derived action enum, the oneof) and the Envelope batch container, the record path's own ProtobufList wire shape. The house style, applied: kernel member spelling (ifi_index, ndm_state), attributes as the lowercased enum constant (ifla_operstate, the inet_diag_tos precedent), presence as an explicit has_ bool beside the value - the parser structs' own Has* pairs, load-bearing for the events' render semantics - and a kernel-source comment on every field with the attribute number read from the kernel headers (if_link.h, if_addr.h, rtnetlink.h, neighbour.h, fib_rules.h). The blocks sit above 2047 (3-byte tags); 14 assigns the numbers and EXM's measured low volume is what makes the cost immaterial. The v1 surface: the header structs and the scalar attributes; the nested payloads (the forty per-kind link nests, RTA_MULTIPATH, RTA_METRICS, the stats blocks) are presence bits - each a later block, never an epoch bump. XtcpNetlinkEventsSchemaVersion = 1 lands beside the record's epoch constant with its own history block. Generated by nix run .#regen-protos into all five gen/ targets (the events proto imports nothing, so the regen's buf.lock re-resolve is reverted - the outputs are lock-independent). The conversion (pkg/xtcp/events_export_convert.go) is a pure function per family plus the ConvertNetlinkEvent wrapper, any other payload an error rather than a silent drop. The gate: TestEventsExportConvertRoundTrip walks the 71 committed event pcaps and the 15 crafted .nl files - parse, convert, marshal, unmarshal, proto.Equal - 458 link, 165 addr, 303 route, 107 neigh, 10 rule, the totals pinned. TestEventsExportConvertSpotPins compares the struct's own values against the converted fields for one corpus event per family: the round trip alone cannot catch a swapped mapping, both directions would carry the same wrong field. Groundwork for EXC, recorded in the ledger: the committed clickhouse_protolist artifacts pin the ProtobufList framing - insert4294967295.proto.bin is [varint][Record bytes] while insert1_and_4294967295.bin is [varint][Envelope] - and the record's kafka table names the ROW type. Which schema name the events' engine table names, and how the oneof maps to columns, is EXC-T01's probe. Gates: both full suites, vet both modes, gofmt, lint-baseline, test-goip-docs, netlink-audit, nix-fmt, test-goip-monitorfile, buf lint (STANDARD, clean). Next free evidence: V405. 🤖 Generated with [pi](https://github.com/badlogic/pi-mono)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Tier EXP of the events export plan (PR #391): the proto —
proto/xtcp_netlink_events/v1/— the five family messages, the wrapper, the envelope; the generation into all fivegen/targets; the conversion; and the round-trip gate.The proto
LinkEvent— ifinfomsg + the scalar IFLA_* attributesAddrEvent— ifaddrmsg + IFA_*RouteEvent— rtmsg + RTA_*NeighEvent— ndmsg + NDA_*RuleEvent— fib_rule_hdr + FRA_* (the family §14 predates)The house style, applied: kernel member spelling; attributes as the lowercased enum constant (the
inet_diag_tosprecedent); presence as an explicithas_bool beside the value (the structs' ownHas*pairs — load-bearing for the events' render semantics); and a kernel-source comment on every field with the attribute number read from the kernel headers. The blocks sit above 2047 (3-byte tags) — §14 assigns the numbers, EXM's measured low volume makes the cost immaterial.The v1 surface: the header structs and the scalar attributes; the nested payloads (the forty per-kind link nests,
RTA_MULTIPATH, the stats blocks) are presence bits — each a later block, never an epoch bump.XtcpNetlinkEventsSchemaVersion = 1lands beside the record's epoch constant with its own history block.The gate
TestEventsExportConvertRoundTrip: the 71 committed event pcaps + the 15 crafted.nlfiles — parse, convert, marshal, unmarshal,proto.Equal— 458 link, 165 addr, 303 route, 107 neigh, 10 rule, the totals pinned.TestEventsExportConvertSpotPins: the struct's own values against the converted fields, one corpus event per family — the round trip alone cannot catch a swapped mapping (both directions would carry the same wrong field).Groundwork for EXC (recorded in the ledger)
The committed
clickhouse_protolistartifacts pin the ProtobufList framing:insert4294967295.proto.binis[varint][Record bytes]whileinsert1_and_4294967295.binis[varint][Envelope]— and the record's kafka table names the ROW type ("ClickHouse's ProtobufList handles the envelope framing internally"). Which schema name the events' engine table names, and how the oneof maps to columns, is EXC-T01's container probe.Notes
stats_is64, notstats_is_64: the digits split their own word in the generated Go name (StatsIs_64) — the rename fixes the generator's naming in the field, not around it.buf.lockre-resolve (a newer protovalidate commit) is reverted: the events proto imports nothing, so the outputs are lock-independent. The drift is the regen path's own behavior, noted for the next arc that regenerates.Gates
Both full suites, vet both modes, gofmt,
lint-baseline,test-goip-docs,netlink-audit,nix-fmt,test-goip-monitorfile,buf lint(STANDARD, clean) — green.🤖 Generated with pi