feat(p3_stream): LS-R-11 precise stream type-mismatch + fuzz layer-2 fix#191
Conversation
…t filter Restores check (i) from #142 after the role-list heuristic was withdrawn from PR #188 (Mythos delta-pass finding). Walks each fusion connection's resolved_imports; if at least one edge declares stream<T> in its ComponentTypeRef signature (Func params/results, Type aliases, Instance exports — recursing through ComponentValType composites), applies the role-list pair check. Sync-only connections with unrelated streams are correctly skipped. 5 new regression tests including the Mythos finding's former false positive and the true-positive case. Bundles fuzz workflow layer-2: CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu defeats the second #168 drift mode where libfuzzer-sys built.rs invokes x86_64-linux-musl-g++ on runners with [build] target = musl cached. LS-R-11: open → approved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
LS-N verification gate
Approved Failed LS entries(none) Missing regression tests
Updated automatically by |
Mythos delta-pass (auto)✅ NO FINDINGS across 2 Tier-5 file(s)
Auto-run via |
LS-R-11 precise stream type-mismatch detection via stream-typed-import filter (#191) — closes #142 (i) follow-up that was withdrawn from v0.12 after the Mythos delta-pass auto-scan correctly identified a false positive in the role-list heuristic. Bundled fuzz workflow layer-2 defense (CARGO_BUILD_TARGET) for the second #168 drift mode. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Closes the LS-R-11 follow-up from v0.12.0. Restores check (i) of #142 that was withdrawn from PR #188 after the Mythos delta-pass auto-scan correctly identified a false-positive path in the role-list heuristic.
LS-R-11: precise stream type-mismatch via stream-typed-import filter
Walks each fusion connection's `resolved_imports`; if at least one edge declares a `stream` reference in its component-level `ComponentTypeRef` signature (Func params/results, Type aliases, or Instance exports — recursing through `ComponentValType::List`, `Option`, `Result`, `Record`, `Variant`, `Tuple`, `FixedSizeList`), the role-list pair check is applied. Sync-only connections with unrelated streams on each side are now correctly skipped — the exact false positive the Mythos auto-scan caught.
New `StreamValidationIssue::TypeMismatch` enum variant, routed into the same `Error::StreamValidation` batched reporting added in v0.12.0.
5 new regression tests:
`safety/stpa/loss-scenarios.yaml`: LS-R-11 flipped from `open` to `approved` with the fix block documenting both the two-stage approach and the precision boundary.
Bundled: fuzz workflow layer-2 against #168
Adds `CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu` to the fuzz workflow env. v0.12.0's RUSTFLAGS fix (#189) closed the sanitizer-vs-crt-static path, but PR #188 follow-up CI surfaced a second drift mode: drifted runners have `[build] target = "x86_64-unknown-linux-musl"` in their cargo config, so libfuzzer-sys's build.rs tried to invoke `x86_64-linux-musl-g++` and failed with `ToolNotFound`. Workflow-env precedence overrides the config-derived default; harmless no-op on clean runners.
Precision boundary (documented)
The filter knows a connection carries SOME stream but the mismatch decision still uses the role-list multiset — a fully precise per-edge implementation needs export-side type-graph walking via `component_func_defs`, which is kept on the backlog. A `stream` hidden inside an aliased composite type via `ComponentValType::Type(idx)` is also not chased. Both limits documented in:
Test plan
🤖 Generated with Claude Code