Skip to content

fix: reject unstampable payloads before shared routing - #56

Closed
albertovincenzi wants to merge 1 commit into
fix/enforce-applicable-scoped-budgetsfrom
fix/reject-unstampable-shared-routing
Closed

fix: reject unstampable payloads before shared routing#56
albertovincenzi wants to merge 1 commit into
fix/enforce-applicable-scoped-budgetsfrom
fix/reject-unstampable-shared-routing

Conversation

@albertovincenzi

Copy link
Copy Markdown
Collaborator

Problem

Gate uses the reserved _gate.path field to decide which path group owns a frame on a shared interior queue. JSON scalars and arrays cannot carry that field. The relay nevertheless forwarded them, so the compiler-selected unstamped owner could charge and route every copy as the wrong path after a convergence.

This is data-plane corruption rather than a presentation issue: the payload may leave through the wrong continuation and its traffic is attributed to the wrong path.

Fix

  • Mark only destinations whose queue has multiple path readers as requiring a path stamp.
  • Dead-letter an unstampable payload at the last unambiguous upstream stage before such a destination.
  • Preserve scalar and array payloads on linear routes and terminal pushes, where path ownership is not needed.
  • Expose requiresPathStamp in the topology response so the compiled constraint is inspectable.

Verification

  • Compiler test distinguishes a shared convergence destination from an unrelated fan-out branch and from a linear hop.
  • Relay unit test covers rejection, object acceptance, and scalar compatibility on a non-shared route.
  • Broker-backed live test puts a scalar ahead of valid work and verifies that only the scalar is dead-lettered and the valid object crosses exactly once.
  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check

Review / dependency

This PR is intentionally stacked on #25 because it extends the message-classification path introduced there. Review commit 6994cd2 relative to fix/enforce-applicable-scoped-budgets. Merge order: #10, then #25, then this PR.

@alice-viola

Copy link
Copy Markdown
Contributor

Landed on master via #67 (merge commit 944ee9b) as part of the 62-PR integration — this PR's head commit 6994cd2 is an ancestor of master. GitHub could not mark it merged automatically because its base is fix/enforce-applicable-scoped-budgets, not master. Closing as landed.

@alice-viola alice-viola closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants