Skip to content

P3 async — static stream validation at build time (#94 sub-B) #142

@avrabe

Description

@avrabe

Sub-issue of #94 — outstanding deliverable B from the audit.

Four build-time checks the umbrella calls for. None are implemented today.

Scope

Check What it catches
(i) Stream type compatibility Source `stream` connected to sink `stream` where A ≠ B — currently silently mis-types at runtime.
(ii) Bounded-channel capacity Components that opt into bounded channels but don't declare capacity — currently UB.
(iii) Circular stream dependencies Two streams whose endpoints form a closed cycle — would deadlock at runtime. Note: `resolver.rs` has module-level cycle detection (`test_topological_sort_circular_fallback`) but not stream-level.
(iv) Resource lifetime across async boundaries An `own` handle escaping into a `stream` then dropped while still referenced — Mythos-class hazard.

Deliverables

  • `resolver.rs` additions: stream graph build (analogous to existing resource graph), cycle detection on the stream subgraph, type-compatibility pass.
  • New error variants in `Error::ValidationError` for each of (i)–(iv).
  • Regression tests + Kani harness for cycle detection.
  • LS-N entries: each of (i)–(iv) gets its own approved loss scenario.

Dependencies

Rivet artifact

  • New requirement SR-34 — "Static `stream` validation (type / capacity / cycle / lifetime)".

Milestone

v0.9.0 (target — slips to v0.10.0 if sub-A doesn't land in time)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions