[v0.1/P1] Make operation defaults and attach targets explicit oneof arms #334
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#334
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?
Problem
Several operation choices use an unset protobuf
oneofor independent sibling fields as a valid command. This makes malformed input indistinguishable from an intentional choice and gives unknown future arms unsafe downgrade behavior.Current cases:
RetargetTarget.carriermeansDefaultLocal.OpsStop.modemeansIfEmpty.SessionAttach.idandid_prefixare independent fields; conversion manually rejects both-set and neither-set.For carrier and stop mode, an older decoder drops an unknown future oneof arm and sees
None. The current conversion then executes a real default operation instead of rejecting a command it cannot understand. For attach, the schema admits two impossible combinations that the domain layer must repair.Proposed resolution
Represent every operation choice explicitly in
felis.proto:default_localarm to the retarget carrier union;if_emptyarm to the stop-mode union;idandid_prefixin aoneof target, retaining their existing field numbers.Unset unions must decode as
MissingOneof. Unknown future arms then also fail closed on an older decoder instead of being reinterpreted as an existing operation.This applies to operation/default semantics, not ordinary optional state. A field whose absence means “state is unavailable” need not become an empty-message arm.
Acceptance criteria
idandid_prefixfield numbers.Evidence
crates/felis-protocol/proto/felis.proto(RetargetTarget,OpsStop,SessionAttach)crates/felis-protocol/src/convert/conn.rscrates/felis-protocol/src/convert/ops.rscrates/felis-protocol/src/convert/session.rsdocs/reference/ipc.mdRelated: #115, #313.
Duplicate of #327, which already owns the same SessionAttach, RetargetTarget, and OpsStop oneof changes and also covers reset spellings.