Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(ls-p-16): runtime oracle for lone-surrogate U+FFFD replacement#247

Merged
avrabe merged 1 commit into
mainfrom
test/ls-p-16-lone-surrogate-runtime
Jun 13, 2026
Merged

test(ls-p-16): runtime oracle for lone-surrogate U+FFFD replacement#247
avrabe merged 1 commit into
mainfrom
test/ls-p-16-lone-surrogate-runtime

Conversation

@avrabe

@avrabe avrabe commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Closes the last open causal-factor on LS-P-16 and narrows SR-17's residual to zero runtime gaps.

What

LS-P-16's lossy U+FFFD upgrade (trap → replacement) shipped in v0.11 but was pinned only structurally (an opcode-presence test). Its own entry flagged "no regression test for UTF-16 inputs ending on a high surrogate." This adds the executing oracle, reusing the UTF-16-lowering caller landed in #246.

test_sr17_utf16_to_utf8_lone_high_surrogate_replacement: fuses a caller passing [0x0041, 0xD800] (lone trailing high surrogate) into a UTF-8 callee, runs under wasmtime, asserts output is 'A' + U+FFFD (UTF-8 EF BF BD, byte sum 684) — proving lossy replacement, not a trap or the original OOB read.

Records

  • LS-P-16 → follow-up-closed (mid-string lone surrogate recorded as a residual: only end-of-input has a defined U+FFFD path).
  • SR-17 traceability residual narrowed.

Tier-5

None — adapter_safety.rs is a test file; fact.rs untouched. Workspace 542/0, LS gate 45/45, 0 missing, clippy/fmt clean.

🤖 Generated with Claude Code

LS-P-16's structural-follow-up (trap → Canonical-ABI lossy U+FFFD
replacement) shipped in v0.11 but was only pinned structurally; the
"no regression test for UTF-16 inputs ending on a high surrogate"
causal-factor stayed open. Now closed with an executing oracle.

test_sr17_utf16_to_utf8_lone_high_surrogate_replacement fuses a
UTF-16-lowering caller passing [0x0041, 0xD800] (a lone trailing high
surrogate) into a UTF-8 callee and asserts under wasmtime that the
output is 'A' + U+FFFD (UTF-8 EF BF BD, byte sum 684) — proving lossy
replacement, not a trap or the original OOB read. Reuses
build_caller_utf16_lowering_component from #246.

LS-P-16 marked follow-up-closed (with the mid-string lone-surrogate
case recorded as a residual: only the end-of-input lone surrogate has
a defined U+FFFD path). SR-17 traceability residual narrowed
accordingly. Test-only (adapter_safety.rs is not Tier-5); fact.rs
untouched. Workspace 542/0, LS gate 45/45/0-missing, clippy/fmt clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@avrabe avrabe enabled auto-merge (squash) June 13, 2026 09:30
@github-actions

Copy link
Copy Markdown

LS-N verification gate

45/45 approved LS entries verified

count
Passed (≥1 test, all green) 45
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.

@avrabe avrabe merged commit 01f1828 into main Jun 13, 2026
14 of 17 checks passed
@avrabe avrabe deleted the test/ls-p-16-lone-surrogate-runtime branch June 13, 2026 09:37
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.

1 participant