protocol: refuse a mismatched correlation where the frame is encoded #218
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
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!218
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/correlation-encode-gate-196"
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?
Fixes #196.
A correlation violation was only caught at the receiver, where the driver
refuses the frame and drops the connection: the sender saw a bare EOF and the
diagnosis stayed in the daemon's log. Worse, the reachable spelling of a
subscribe —
send(&msg)with no envelope — was exactly the wrong one, so asatellite client's standing subscription died silently under a redial loop.
CheckedFramenow applies the class half of the same rule at encode time: itbounds both paths on
Directedand refuses a correlated arm handed noenvelope, an uncorrelated arm handed one, and an id of the wrong kind in either
direction. Every
FrameWriter::send*, the client's outgoing queue and thedaemon's fan-out inherit the check. It reads the arm's
CorrelationClass,never whether a message happens to carry an id (
Conn::Cancel/End/Errorname a stream in an ordinary field and stay uncorrelated). Identity — the next
unissued id, an outstanding request, a live stream — remains the driver's, so
the two ends keep one ledger.
TransportError::CorrelationmirrorsDriverError::Correlationfield for field, so one pairing renders one sentenceon both ends.
Doc cascade:
docs/reference/ipc.mdstates the encoder-side refusal beside thereceiver-side rule,
docs/explanation/architecture/ipc.mdcarries why theclass check is duplicated at the encoder while identity is not, and
docs/reference/testing.mdtracks the moved coverage.Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed
by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high
Deferred
classes by three envelope states; the four refusal shapes and the honest
pairings are each covered by a focused test, and a generator would only
restate the same
matches!arm.fe96e99b28b11050b6d5