protocol, transport, daemon: give the preface replies and key ids narrow types #472
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!472
Loading…
Reference in a new issue
No description provided.
Delete branch "cleanup/preface"
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?
Why
Pre-release cleanup. The daemon built its preface reply with
DaemonPreface::select()/refuse(), whose signatures return the full three-arm wire enum although each only ever builds one arm, soexchange_bootstrapdestructured the value it had just built behind twounreachable!s.named_key_to_wirehad the same shape:OptionwhoseNonemeant "an F key", re-matched by its caller behind a thirdunreachable!.What
DaemonAccept { major, minor }withselect(ClientPreface) -> Option<DaemonAccept>andDaemonRefuse { min_major, max_major }withCURRENT, eachInto<DaemonPreface>. The decode-sideDaemonPrefaceis unchanged.write_daemon_prefacetakesimpl Into<DaemonPreface>.exchange_bootstrapreads the narrow values; bothunreachable!s are gone.named_key_to_wirereturns thev1::key_id::Keyarm directly; the caller'sunreachable!is gone.DaemonRefuse::CURRENT's encoding.Wire unchanged: preface bytes and key encoding are identical (
just proto-compatgreen).Verification
cargo nextest run -p felis-protocol -p felis-daemon -p felis-transport -p felis-client-core --all-features(1476 passed), clippy-D warningsincl. felis-cli,just schemano diff,just prose-check: green.Merged with the Criterion gate red. It flagged
daemon_side/plaintext_scroll(+39 to +45%) three times, in runs that overlapped other CI jobs on the same host. A local A/B on a quiet host, with a separate target dir for each side, found no difference:a15562e8)daemon_side/shell_promptswings between about 31 µs and 64 µs within one checkout, on both sides. The daemon_side group is bimodal on this runner, and the branch only touches the preface handshake and key-id encoding, which these benches never reach.