Skip to content

fix(364): gate multiply-instantiated support to verified MultiMemory + fix SR-31 traceability#366

Open
avrabe wants to merge 1 commit into
mainfrom
fix/364-shared-dup-guard-traceability
Open

fix(364): gate multiply-instantiated support to verified MultiMemory + fix SR-31 traceability#366
avrabe wants to merge 1 commit into
mainfrom
fix/364-shared-dup-guard-traceability

Conversation

@avrabe

@avrabe avrabe commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #364 — SR-31 "multiply-instantiated detection" was marked verified
via an isolated reject test while #362 wired the normalization
unconditionally, making the reject dead code on the live path and the shipped
behavior (accept) the opposite of the certified property. Thanks @avrabe for the
sharp catch.

Root cause (confirmed)

expand_multiply_instantiated_modules was wired unconditionally into
fuse_with_stats, so DuplicateModuleInstantiation never fires on the live
(instantiate $m) path, while ls_m_5_multiply_instantiated_module_rejected
verifies it in isolation. The inc-3 execution oracle only covered MultiMemory
(independent memories); under SharedMemory the instances share one linear
memory and independence is unverified (reproduced: the 2nd instance collapses to
a single bump export, not bump+bump$0).

Fix (avrabe's option b, honestly)

  • lib.rs — gate the normalization to explicit MultiMemory, the only
    strategy the execution oracle proves keeps per-instance state independent.
    Under SharedMemory (unverified) and Auto (implicit, ADR-4) the
    normalization is skipped → the DuplicateModuleInstantiation reject fires. So
    shipped behavior == verified behavior.
  • multiply_instantiated_runtime.rs
    shared_memory_and_auto_reject_multiply_instantiated proves the reject fires
    on the live fuse path under both strategies.
  • Traceability repointed to live-path evidence (not the isolated reject):
    docs/verification-matrix.md SR-31 row, sw-verifications.yaml SWV-31,
    safety-requirements.yaml SR-31 verification-description + SR-55 scope note.

MultiMemory support (SR-55) is unchanged and still execution-verified (independent
globals + memory + data segments). Per-instance import wiring stays noted as
un-execution-tested (import-free fixtures).

Verification

Full meld-core suite green (0 failures); fmt + clippy clean; rivet validate
PASS.

Closes #364.

… fix SR-31 traceability

avrabe (#364) correctly caught that SR-31 "multiply-instantiated detection" is
marked verified via an ISOLATED reject test (ls_m_5) while #362 wired the
normalization unconditionally into fuse_with_stats — so the reject is dead code
on the live path and the shipped behavior (accept) is the OPPOSITE of the
certified property. The inc-3 execution oracle only covered MultiMemory; under
SharedMemory the instances share one linear memory and independence is
unverified (my probe: the 2nd instance collapses to a single `bump` export).

Fix (avrabe's option b, honestly):
- lib.rs: gate `expand_multiply_instantiated_modules` to explicit MultiMemory —
  the only strategy the execution oracle proves keeps per-instance state
  independent. Under SharedMemory (unverified) and Auto (implicit, ADR-4) the
  normalization is skipped and the DuplicateModuleInstantiation reject fires.
  So shipped behavior == verified behavior.
- multiply_instantiated_runtime.rs: `shared_memory_and_auto_reject_multiply_
  instantiated` proves the reject fires on the LIVE fuse path under both.
- Traceability repointed to the live-path evidence (not the isolated reject):
  docs/verification-matrix.md SR-31 row, sw-verifications.yaml SWV-31,
  safety-requirements.yaml SR-31 verification-description + SR-55 scope note.

The MultiMemory support (SR-55) is unchanged and still execution-verified
(independent globals + memory + data segments). Per-instance import wiring stays
noted as un-execution-tested (import-free fixtures).

Full meld-core suite green (0 failures); fmt + clippy clean; rivet validate PASS.

Refs #364, #362, SR-31, SR-55

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

LS-N verification gate

59/59 approved LS entries verified

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

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

(none)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant