Skip to content

runtime: fix component-model audit findings - #317

Merged
lannbot merged 1 commit into
mainfrom
fix/component-model-audit
Sep 8, 2026
Merged

runtime: fix component-model audit findings#317
lannbot merged 1 commit into
mainfrom
fix/component-model-audit

Conversation

@lannbot

@lannbot lannbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the ten outstanding correctness findings from the Component Model audit, plus the related borrow-to-own guard:

  • Enforce guest resource type identity and ownership before consuming host wrappers; retain overlapping host borrows and defer disposal until the final borrower releases.
  • Run guest destructors through fresh synchronous tasks/threads without disturbing the dropping activation's context or host driver state.
  • Retire removed stream/future endpoints when validation traps, preserve the original error, and always notify drop observers.
  • Make synchronous subtask cancellation wait for resolution rather than a STARTED progress event.
  • Correct the pinned FACT generator's source string byte limit before guest realloc, using a checked adapter-only immediate rewrite with pin/pattern guards and no new dependency.
  • Separate host future read/write busy state; cancel the whole writeAll operation; release untaken owned stream elements and preserve producer/cleanup error attribution.
  • Only accept structured validation errors as conformance invalid-component verdicts.

Regression coverage includes translated components for resource identity/lifetimes, destructor context, future round trips, stream ownership, and all string encoding/tag combinations. Other tests cover cancellation state transitions, byte-buffer retirement, failure cleanup, and harness classification.

Based on current main including #315 and #316. #315 already fixed the audit's delayed task.return finding; its behavior is preserved. Existing documented feature exclusions and named spec divergences are unchanged. No protocol, golden transcript, dependency lock, or package version changes.

Verification

  • Runtime: 827 passed, 0 failed, 3 existing deferred tests.
  • Seeded runtime: 824 passed for each of seeds 1 and 4242, with 6 existing skips each.
  • Conformance: 1,285 passing commands, 126 existing xfails, 95 pending, 5 unsupported directives; no new exclusions.
  • All 32 host-ABI convention tests pass with byte-identical golden transcripts.
  • Independent reviews approved all six tracks after cleanup-error revisions.
  • Full just gates < /dev/null: passed, including packaging/npm, pinned shell lanes, Chromium/Firefox page and worker realms, OPFS, and TLS/C0 consumer smokes. Redirecting stdin matches CI's non-TTY environment for the WASI terminal test.
  • Consumer worktrees retain their pre-gate status. WAT fixtures regenerate byte-identically.

@lannbot
lannbot enabled auto-merge September 8, 2026 03:22
@lannbot
lannbot merged commit a989060 into main Sep 8, 2026
4 checks passed
@lannbot
lannbot deleted the fix/component-model-audit branch September 8, 2026 03:26
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.

2 participants