Skip to content

NFR-052: network-hermetic mount — disable Blockly workspace sounds - #18

Merged
Evgenus merged 2 commits into
mainfrom
fix-hermetic-mount
Jul 18, 2026
Merged

NFR-052: network-hermetic mount — disable Blockly workspace sounds#18
Evgenus merged 2 commits into
mainfrom
fix-hermetic-mount

Conversation

@Evgenus

@Evgenus Evgenus commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Problem

agentic-checks / tests has been red on the last two main pushes (post-#16 and post-#17 merges) with 8 unhandled fetch failed / ETIMEDOUT rejections — while the same commits passed their PR runs and every test passes locally.

Root cause: mountBlockly passes no media/sounds option, so Blockly falls back to its default media path and WorkspaceAudio preloads four UI sounds from https://static.blockly.com/media/ on every workspace inject (the jsdom geometry/density corpus harnesses mount repeatedly). The failing IPs (104.21.58.119 / 172.67.159.107) resolve to exactly static.blockly.com; reproduced locally with a --require fetch logger (click/delete/disconnect/drop.mp3). On the runners the CDN timed out, the rejections landed after tests completed, and Vitest fails the run on unhandled errors. PR runs were green only because the CDN happened to respond.

Change (SPEC-first)

  • NFR-052 appended to §8.8: mounting the canvas is network-hermetic — no external request on inject; static.blockly.com never fetched; workspace sounds disabled (the audio preload is the media path's only consumer in our surface). Beyond CI, an embeddable component (NFR-043) must not silently call a third-party CDN from the host page.
  • sounds: false in mountBlockly's inject options (mount.ts) — one line plus rationale comment.
  • id-ledger +NFR-052; traceability row added in the same change.

Tests

Red-first: packages/editor-ui/test/hermetic-mount.test.ts mounts with a rejecting fetch spy — pre-fix it failed with the exact CI signature (1 failed test + 4 unhandled sound-fetch errors); post-fix zero fetch calls and workspace.options.hasSounds === false.

Verification

  • Fetch-logger sweep over geometry-corpus + density-corpus (the suites Vitest attributed the CI rejections to): zero network calls.
  • Full workspace suite green (13 turbo tasks); traceability / append-only-ids / links gates clean.
  • Display-only: no codec/artifact diff; density/geometry baselines untouched (sounds don't affect layout).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Blockly workspaces no longer preload external media/sounds when mounted.
    • Editor mounting is now network-hermetic, avoiding fetch failures in offline and test environments.
  • Tests

    • Added a dedicated suite validating zero network fetches during mount and that workspace sounds are disabled.
    • Increased UI corpus test timeouts to improve CI reliability.
  • Documentation

    • Updated non-functional requirement records and traceability/spec notes for the network-hermetic mount behavior and its verification.

main's agentic-checks/tests job failed on the last two merge pushes with 8
unhandled "fetch failed" rejections. Root cause: mountBlockly passed no
media/sounds option, so Blockly's WorkspaceAudio preloaded its four UI sounds
from the DEFAULT media path — https://static.blockly.com/media/ — on every
jsdom mount (geometry/density corpus harnesses). The CI error's IPs resolve
to exactly that domain; on the runners the CDN timed out, and Vitest treats
the late rejections as a failed run. PR runs passed only because the CDN
happened to respond.

Beyond CI, an embeddable component must not silently call a third-party CDN
from the host page. SPEC-first: NFR-052 appended to §8.8 (network-hermetic
mount, sounds disabled — the audio preload is the media path's only consumer
in our surface); id-ledger +1; traceability row.

Red-first: packages/editor-ui/test/hermetic-mount.test.ts mounts with a
rejecting fetch spy — pre-fix it failed with the exact CI signature (4
unhandled sound fetches); post-fix zero fetches and hasSounds === false.
Fix: sounds: false in mountBlockly's inject options. Verified with a fetch
logger across the geometry + density corpus suites: zero network calls.

Refs: NFR-052

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0bcdcd2a-4fb5-4af8-9048-2a2f6e6a0781

📥 Commits

Reviewing files that changed from the base of the PR and between 7da7b18 and c83e402.

📒 Files selected for processing (2)
  • test/engine-node-adapter/test/ui/density-corpus.test.ts
  • test/engine-node-adapter/test/ui/geometry-corpus.test.ts

Walkthrough

mountBlockly now disables Blockly sound loading to prevent external media requests during workspace injection. NFR-052 documentation, traceability, ID bookkeeping, and a hermetic-mount test record and verify this behavior. Corpus test timeouts are also increased.

Changes

Network-Hermetic Blockly Mount

Layer / File(s) Summary
Mount behavior and NFR-052 verification
packages/editor-ui/src/blockly/mount.ts, packages/editor-ui/test/hermetic-mount.test.ts, docs/SPEC.md, docs/traceability.md, docs/current-state.md, docs/id-ledger.json
mountBlockly passes sounds: false to Blockly.inject; the test asserts disabled sounds and zero fetches, while project records define and trace NFR-052.

Corpus Test Timing

Layer / File(s) Summary
Corpus timeout headroom
test/engine-node-adapter/test/ui/density-corpus.test.ts, test/engine-node-adapter/test/ui/geometry-corpus.test.ts
Density and geometry corpus test timeouts increase from 120_000 to 240_000 milliseconds, with updated timing comments.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant HermeticMountTest
  participant mountBlockly
  participant BlocklyInject
  participant FetchSpy
  HermeticMountTest->>mountBlockly: mount workspace
  mountBlockly->>BlocklyInject: inject with sounds false
  BlocklyInject-->>FetchSpy: no external fetch request
  HermeticMountTest->>BlocklyInject: assert hasSounds is false
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making the Blockly mount network-hermetic by disabling workspace sounds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-hermetic-mount

Comment @coderabbitai help to get the list of available commands.

The RFC-008 re-pin grew the docs corpus 121 → 163 examples; the NFR-049/050
corpus sweeps now measure 98–120s on CI runners (main 98.6s, PR#17 112.3s,
PR#18 120.3s — the last hit the 120s per-test ceiling exactly, on runner
variance alone). Headroom over the measured band, not license to slow down:
local runs stay ~13s and the empty-palette mount keeps the per-run cost.

Refs: NFR-049 NFR-050

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.46%. Comparing base (a136ffe) to head (c83e402).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   78.45%   78.46%           
=======================================
  Files          38       38           
  Lines        2906     2907    +1     
  Branches      464      464           
=======================================
+ Hits         2280     2281    +1     
  Misses        598      598           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Evgenus
Evgenus merged commit 21921e2 into main Jul 18, 2026
7 checks passed
@Evgenus
Evgenus deleted the fix-hermetic-mount branch July 18, 2026 18:17
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