Repository navigation
Description
Parent: #266
Proven failure
Exact WebScene b5b51017ab1888ecdadbb638590afa645ee5f62a deletes the private native Service Worker control hook after bootstrap, but the product-neutral Cache and CacheStorage methods still resolve that deleted global at call time. The unchanged Code OSS v6 worker reaches cache.match() on its first streamed Markdown resource and fails natively with:
ReferenceError: __webSceneServiceWorkerGlobalControl is not defined
Chrome 153 passes the unchanged pinned Markdown resource fixture. WebScene's focused service-worker-markdown-resources gate reproduces the native failure before resource delivery.
Focused scope
- Capture and use the already-private native control closure for CacheStorage operations after the bootstrap global is removed.
- Keep the hook absent from the worker global object and inaccessible to product code.
- Prove unchanged Code v6 streamed resource caching plus the existing WPT-derived cache replacement contract, including fresh match, validator/304, replacement continuity, delete, quota/error isolation, 100 cycles, latency, memory, and teardown.
- Preserve existing origin/registration cache partitioning, admission, CSP, resource status, streaming/body bounds, filesystem/network authority, and host callbacks.
Collision boundary
Owned paths are the Service Worker cache bootstrap include, its focused native regression gate, and the existing dedicated CacheStorage contract/profile only if the browser-visible privacy assertion is missing. This child excludes nested-document #267, interaction #268, File System work #382, CSS #381/PR #384, consolidation #76, AppScene, and vscode-demo.
Acceptance
- Chrome and native pass the pinned CacheStorage replacement contract and unchanged Code v6 Markdown resource path.
- The internal control hook is absent from
globalThiswhile every exposed Cache/CacheStorage method remains callable. - Malformed/cross-origin/cross-registration data cannot acquire or widen authority; existing quota and bounded-body rejection remain fail-closed.
- The 100-cycle cache and worker replacement gates stay within 100 ms p95, <=8 MiB V8 heap growth, <=64 MiB retained RSS, and leave no live cache/fetch operations after unregister/shutdown.
Activity
wieslawsoltes commentedon Sep 18, 2026
Owned from exact main
b5b51017ab1888ecdadbb638590afa645ee5f62aonfeature/webview-resource-next-266.Reproduction: Chrome 153 passes the pinned unchanged Markdown v6 fixture in 1.894 s. Native
service-worker-markdown-resourcesfails at the first cache-backed streamed resource withReferenceError: __webSceneServiceWorkerGlobalControl is not defined. The bootstrap correctly removes this private host hook fromglobalThis, but the public Cache/CacheStorage methods later look it up by that deleted global name instead of using the captured closure.#385 owns only closure use plus a privacy regression assertion and exact unchanged-worker/cache gates. It preserves origin/registration partitioning, CSP, admission, status/range/validator semantics, quotas, stream/body bounds, and all filesystem/network authority.
Collision audit: open PR #384 owns CSS supports-rule files; #382 owns File System durable grants; #267/#268 own nested-document and interaction behavior; #76 owns compatibility docs. This slice owns
webscene_v8_runtime_service_workers.inc, its CacheStorage/unchanged-Markdown focused tests, and the existing cache replacement contract/profile only if needed. It excludes those active lanes, AppScene, consolidation, and vscode-demo.wieslawsoltes commentedon Sep 18, 2026
Completed in #387, merged as
d4dc4fc10d98edd2a8a45a2901692c614d084652.The Cache and CacheStorage methods now retain the private native control closure after bootstrap removes the temporary global hook. Product worker code cannot observe the hook, while unchanged Code OSS v6 can cache its first streamed Markdown resource and continue through replacement/validator reuse. Origin and registration partitioning, CSP, admission, quotas, range/validator behavior, stream/body bounds, and filesystem/network authority are unchanged.
Final evidence:
globalThis;No nested-document, interaction, File System, CSS, AppScene, consolidation, or vscode-demo paths changed.