Skip to content

feat(p3_stream): LS-R-11 layer-2 per-edge precise type-mismatch#196

Merged
avrabe merged 1 commit into
mainfrom
feat/v0.15.0-tier5-and-ls-r-11
May 27, 2026
Merged

feat(p3_stream): LS-R-11 layer-2 per-edge precise type-mismatch#196
avrabe merged 1 commit into
mainfrom
feat/v0.15.0-tier5-and-ls-r-11

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 27, 2026

Summary

Promotes the v0.13.0 stream-typed-import heuristic to a per-edge precise check for the common path. New `export_stream_elements` walks `comp.component_func_defs[export.index]` to resolve a `Func` export to its underlying type:

  • `ComponentFuncDef::Import` reuses the importer-side typeref walker
  • `ComponentFuncDef::Lift` looks up `CanonicalEntry::Lift`'s `type_index` and walks the function signature directly
  • `ComponentFuncDef::InstanceExportAlias` is deferred → falls back to the layer-1 heuristic (LS-R-11 limits block updated)

For each resolved import edge where BOTH endpoints resolve to non-empty stream-element lists, multisets are compared directly; mismatches emit `TypeMismatch` keyed to the exact `(producer_component=exporter, consumer_component=importer)` pair with the real element types from each side's signature.

Layer-1 still fires for connections not precisely checked; the v0.13.0 heuristic remains the safety net.

Scope change

Originally bundled with a Tier-5 registration of `provenance.rs` in `.github/workflows/mythos-auto.yml`. Split out to a follow-up PR after CI revealed that `anthropics/claude-code-action` requires the workflow file to be byte-identical to main for PR runs (workflow self-reference breaks the AI scan auth flow even though the edit doesn't touch the action's logic). The Tier-5 registration will ship as a tiny separate PR after this merges.

4 new regression tests

  • `export_stream_elements_walks_lift_function_signature`
  • `export_stream_elements_returns_empty_for_alias_export`
  • `ls_r_11_per_edge_lift_export_mismatch_raises`
  • `per_edge_matching_lift_export_does_not_raise`

Test plan

  • 285 lib + 22 p3_stream tests pass
  • `cargo clippy --all-targets -- -D warnings` clean
  • Pre-commit hooks pass
  • CI green (now expected since workflow self-reference is gone)
  • Mythos AI scan on p3_stream.rs succeeds

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

Mythos delta-pass required

This PR modifies one or more Tier-5 source files (per
scripts/mythos/rank.md):

meld-core/src/p3_stream.rs

Before merge, run the Mythos discover protocol on the
modified Tier-5 files:

  1. Follow scripts/mythos/discover.md
    — one fresh agent session per touched Tier-5 file.
  2. For each finding, the agent must produce both a Kani
    harness and a failing PoC test (per the protocol's
    "if you cannot produce both, do not report" rule).
  3. Attach a comment on this PR with either the findings
    (formatted per discover.md's output schema) or
    NO FINDINGS.
  4. Add the mythos-pass-done label to this PR.

Why this gate exists: LS-A-10
(CABI alignment padding in async-lift retptr writeback) was
found by the v0.8.0 pre-release Mythos pass — but it had
lived in the callback emitter since #128, across six
releases. A PR-time gate would have caught it at review
time instead of at the release boundary.

The gate check on this PR will pass once the label is
applied.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

LS-N verification gate

⚠️ 35/37 verified — 2 missing regression tests

count
Passed (≥1 test, all green) 35
Failed (≥1 test failure) 0
Missing (no ls_*_NN_* test found) 2

Approved loss-scenarios.yaml entries are expected to have a
regression test named ls_<letter>_<num>_* (e.g. LS-A-11
ls_a_11_*). The gate runs each prefix via cargo test --lib --no-fail-fast and aggregates pass/fail/missing.

Failed LS entries

(none)

Missing regression tests
  • LS-R-13
  • LS-M-6

Updated automatically by tools/post_verification_comment.py.
Source of truth: safety/stpa/loss-scenarios.yaml.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

Mythos delta-pass (auto)

NO FINDINGS across 1 Tier-5 file(s)

File Verdict Hypothesis
`` ✅ NO FINDINGS

Auto-run via anthropics/claude-code-action@v1
(SHA-pinned) on the touched Tier-5 files, using the
maintainer's Max-plan OAuth token. See
.github/workflows/mythos-auto.yml and
scripts/mythos/discover.md.

Promotes the v0.13.0 stream-typed-import heuristic to a per-edge
precise check for the common path.

New `export_stream_elements` walks
`comp.component_func_defs[export.index]` to resolve a Func export
to its underlying type:

  - `Import` reuses the importer-side typeref walker
  - `Lift` looks up CanonicalEntry::Lift's type_index and walks the
    function signature directly
  - `InstanceExportAlias` is deferred → falls back to the layer-1
    heuristic (LS-R-11 limits block updated)

For each resolved import edge where both endpoints resolve to non-
empty stream-element lists, multisets are compared directly;
mismatches emit TypeMismatch keyed to the exact
(producer_component=exporter, consumer_component=importer) pair
with real element types from each side's signature.

Layer-1 still fires for connections not precisely checked; the
v0.13.0 heuristic remains the safety net.

4 new regression tests:
  - export_stream_elements_walks_lift_function_signature
  - export_stream_elements_returns_empty_for_alias_export
  - ls_r_11_per_edge_lift_export_mismatch_raises
  - per_edge_matching_lift_export_does_not_raise

Tier-5 registration of provenance.rs split out to a follow-up PR
because anthropics/claude-code-action requires
.github/workflows/mythos-auto.yml to be byte-identical to main for
PR runs (workflow self-reference would break the AI scan auth flow
even though my edit doesn't touch its logic).

Tests: 285 lib + 22 p3_stream tests all green. Clippy clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@avrabe avrabe force-pushed the feat/v0.15.0-tier5-and-ls-r-11 branch from af3de77 to 87e86b8 Compare May 27, 2026 18:05
@avrabe avrabe changed the title feat(v0.15.0): LS-R-11 layer-2 per-edge precise + Tier-5 register provenance.rs feat(p3_stream): LS-R-11 layer-2 per-edge precise type-mismatch May 27, 2026
@github-actions github-actions Bot added the mythos-pass-done Mythos delta-pass completed on Tier-5 file changes; findings (or NO FINDINGS) attached to PR label May 27, 2026
@avrabe avrabe merged commit 45b0a69 into main May 27, 2026
9 of 14 checks passed
@avrabe avrabe deleted the feat/v0.15.0-tier5-and-ls-r-11 branch May 27, 2026 18:57
avrabe added a commit that referenced this pull request May 28, 2026
v0.14.0's component-provenance section emitter (meld-core/src/provenance.rs)
shipped but wasn't in the Mythos auto-scan registry. Future changes to the
section format, the origin-tuple plumbing, or the fused_func_idx arithmetic
now get the AI-driven delta-pass scan on PR.

Split from PR #196 (LS-R-11 layer-2) because anthropics/claude-code-action
requires this workflow file to be byte-identical to main for PR runs — a
workflow self-reference breaks the action's auth flow. This PR touches no
Tier-5 source, so its own scan is a no-op and the identity check passes.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@avrabe avrabe mentioned this pull request May 28, 2026
4 tasks
avrabe added a commit that referenced this pull request May 28, 2026
LS-R-11 layer-2 per-edge precise stream type-mismatch (#196) — promotes
the v0.13.0 heuristic to a per-edge precise check via export-side
type-graph resolution through component_func_defs. Plus provenance.rs
registered as Tier-5 in the Mythos auto-scan registry (#197).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mythos-pass-done Mythos delta-pass completed on Tier-5 file changes; findings (or NO FINDINGS) attached to PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant