[v0.1/P1] Validate drained uniform payloads before dropping them #305
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#305
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
ConnectionDriver::admit_drainedhas a fast path for uniform uncorrelatedGrid,Image, andPushtraffic. It checks kind columns, envelope status, and correlation, but deliberately does not decode the protobuf body before dropping it.This contradicts the IPC contract that an undecodable body is corruption. A malformed or non-protobuf body can therefore be accepted and discarded when the receiving role does not consume that family, while the same frame would fail when decoded by a window client.
The current code comment also says the frame is untrustworthy but still returns
Ok(()), which makes the actual corruption policy ambiguous.Proposed resolution
Choose and document one policy before the wire freeze:
The preferred option is a validation-only decode on the non-hot discard path, with tests for malformed protobuf, unknown oneof arms, and invalid row/image payloads.
Acceptance criteria
docs/reference/ipc.mdagree on whether drained payload bodies are validated.Sources
crates/felis-transport/src/driver.rs(admit_drained)docs/reference/ipc.md(corruption and frame validation)crates/felis-transport/src/driver/tests.rsDirection agreed 2026-09-21 after three
soldesign-review rounds (final verdict PASS). Full plan and batch order: see the comment on #12.(Grid/Image/Push) runs a validation-only protobuf decode before discarding,
so an undecodable body is corruption on every role. What the drain path
cannot check is stated, not hidden:
packed_cellsis opaque tofelis-protocolandfelis-transportdepends only onfelis-protocol, sorow-codec contents, coordinates relative to shadow dimensions, and image
transfer sequencing are semantic invariants that only a consuming shadow can
judge.
docs/reference/ipc.mdnames the two tiers: wire-level validation(protobuf structure, unknown arms, stateless limits) on every path; semantic
validation (
ShadowError, image state) on consumers. The uniform fast-pathdecision in
docs/explanation/architecture/ipc.mdis rewritten in place.Tests cover malformed protobuf and unknown arms on the drain path, and a
malformed opaque row is shown to be a consumer-tier failure.