protocol: carry arm routing in the descriptor, not in comments #324
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!324
Loading…
Reference in a new issue
No description provided.
Delete branch "arm-options"
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?
The routing row of every
oneofarm now rides the protobuf descriptor as a(felis.v1.arm)field option instead of an// arm:comment. A client generatedfrom
felis.protoreads direction, correlation class, admitting connection modes,phases and introducing minor from the descriptor its
protoc-gen-*already builds,so nothing about routing has to be transcribed out of Rust or out of prose.
Shape
felis.protogainsmessage ArmRouting(nestedDirection,Correlation,Mode,Phaseenums, plussince) andextend google.protobuf.FieldOptions { ArmRouting arm = 50001; }, 50001 sittingin protobuf's private extension range. All 86
// arm:comment lines are gone;each arm carries the option instead, in the layout
buf formatcanonicalizes(one text-format entry per line, closed by
}];).buf breakingcannot see it.ArmMeta::declaration()emits the option body (entries joined by spaces) insteadof the comment line, deriving the
DIRECTION_/CORRELATION_/MODE_/PHASE_prefixes from the existing tokens so there is no second token table.ModeSet::tokens/PhaseSet::tokenskeep their lowercase spelling, which thedriver's phase diagnostics use.
the_schema_declares_the_same_arm_tableandthe_schema_spells_no_arm_into_the_prefaceparse the option block rather thanthe comment. Both were checked against a deliberately broken schema: dropping a
modes:entry fails the table comparison, and deleting an arm's whole optionfails with "ConnMsg arm carries no
(felis.v1.arm)option".just proto: prost ignores extensions, so the generated diff is theArmRoutingmessage and its nested enums, plus the loss of the arm doc comments the deleted
// arm:lines used to produce. No message shape, field number, or wire bytechanges.
Rejected
overview already turns down for the wire constants: a second committed file to
keep in step, holding what the descriptor carries anyway.
ArmMetafrom the schema. One statement of the row leaves thedriver's table nothing to disagree with, and the comparison of two independent
statements is the check.
ConnectionModeformodes. That enum is wire vocabulary a major mayrenumber; a routing row is not a message field, so
ArmRouting.Modeis its own.The cost of keeping two statements is the gate:
buf breakingcompares fieldnumbers, names and types and never reads options, so the Rust test is the only check
a wrong routing row fails. That is recorded in
docs/reference/ipc.md"The armtable", the
buf breakingrow ofdocs/reference/testing.md"Wire compatibilitygates",
docs/explanation/architecture/ipc.md(with the rejected alternatives),docs/explanation/architecture/overview.md"Wire constants",docs/reference/workspace.md"Cross-language wire contract", and theextend-ipcskill.
Gates
cargo clippy --workspace --all-targets --all-features: clean.cargo nextest run -p felis-protocol -p felis-daemon -p felis-client-core -p felis-cli:1611 passed.
-p felis-transport(the othertokens()consumer): 154 passed.just proto-compat: wire-compatible with the base.just docs-links: 0 errors.python3 tools/prose_check.py --range origin/main...HEAD: 0 hits.buf breakingincluded, and passed. NoSKIP=wasneeded: the option change is invisible to it, which is the point the docs now make.
Closes #303