protocol: FrameWriter::new defaults to this build's own PROTOCOL_MINOR #176
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
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#176
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What
FrameWriter::new(crates/felis-protocol/src/framing.rs) initializeseffective_minor: PROTOCOL_MINOR—this build's own maximum minor — rather than an unnegotiated/baseline value. Only an explicit
.at_minor(effective)call narrows it. So the plain public constructor plus
send()will happily emit every addition this build knowsabout even though no peer has agreed to any of them, which contradicts #50's acceptance criterion that a caller
"cannot emit an unauthorized addition through the ordinary API".
Where
crates/felis-protocol/src/framing.rs—FrameWriter::new,FrameWriter::at_minor,FrameWriter::sendWhy it was deferred from #50
The gap was raised in an earlier review round on #50 and deliberately deferred there: all four production call
sites do set
.at_minorcorrectly, so the shipped risk is mitigated, and closing the hole in the public APImeans rewriting roughly forty mostly self-talking test-harness call sites — outside #50's size budget.
Suggested correction
Make the effective minor mandatory at construction (take it as a
newparameter), or make an unnegotiatedwriter refuse every non-baseline arm, instead of defaulting to the build's own ceiling. Test-harness call sites
can take a baseline-or-max helper constructor so the default stops being the permissive one.
Split from #50.