Drakan WorkerLink release Promise repair
Repaired the release wrapper published in 6fc4d59ca94ceec263b7855c5d3a483295223c4c. Evidence is in scratch/runs/20261108-drakan-release-promise-2127/. This is synthetic qualification through the production Worker, WorkerLink and GuestThreadHost; no Chrome, game, original, input injection, remote resource or additional worker agent was used.
The actual GuestThreadHost reproduction reported releasePromiseSettledBeforePhysical:true for delayed success and delayed rejection. Rejection left Controller.releaseError null and produced unhandledRejection: Error: delayed physical release rejection. Both results are retained in reproduce-before.log.gz. The same reproduction after repair reports false, records the rejection in releaseError, and observes no unhandled rejection (reproduce-after.log.gz).
WorkerLink.observeDrakanActor now invokes the external callback once and caches its Promise for every duplicate invocation. Native Promise identity is preserved; other results are normalized with Promise.resolve. A synchronous throw becomes a cached rejected Promise, so it cannot replace the original setup error or bypass the existing Controller rejection handler. An immediate rejection handler also covers the independent setup timer before a Controller exists. The Controller still clears its shared action to down=false/UNKNOWN before release initiation. That state is not a receipt that physical input was released.
Controller release settlement follows the existing API: await controller.releasePromise, then inspect controller.releaseError. The Promise handles rejection and fulfills after recording it. Setup errors now expose the same interface as error.releasePromise and a live error.releaseError getter, even when construction failed and no Controller was retained. The original setup error remains the thrown failure. onStop remains an immediate notification; its initial error snapshot can precede asynchronous release failure, so callers must join the live release result. No Worker or retirement method awaits physical input I/O.
Dependency loading remains inside the original action deadline. Setup cannot create a new Controller after release initiation or WorkerLink retirement. The independent release cap remains at most 2000 ms; controller deadlines retain the original action start. Completion, owner, pin, freshness and enclosing-return requirements are unchanged. There is no down injection, second action, rearm or replay in the repair.
Validation:
WINE_DRAKAN_BROWSER_SETUP=1 node --experimental-vm-modules test/test-drakan-observer-worker.js: 59 PASS. Production Node Workers run the complete pinned WASM, brokered GetDeviceData and synthetic x86. The matrix covers delayed success/rejection and synchronous throw during explicit stop, deadline, retirement, Worker start-command failure, expired setup, unavailable setup and constructor failure; duplicate stops reuse the same result. Refused duplicate Worker starts leave down=false and never replay release.- Four dependency-loading cases execute the unchanged browser WorkerLink method in a Node VM against a live production WorkerLink. Imports are deliberately delayed; the real independent setup timer initiates release at 59.5–59.9 ms from the original action start (60 ms limit). No Controller is created afterward. One rejection occurs during loading, before the outer setup catch attaches; it remains handled and observable. This is not Chrome qualification.
- The busy production WASM slice control initiates release at 37.662 ms, before that slice returns. The original controller deadline is retained in the added lifecycle checks.
- Passive adapter suite: 56 PASS, including the two disabled architectural/policy comparisons against the unchanged retained
6cf120d0…fda1c0module. Worker import checks: 11 PASS.flock /tmp/wine-build.lock bash tools/build.sh: PASS. Only the exact host-file census entry was refreshed; broader ownership remains pending.
The first regression failed on the dropped original Promise. Two subsequent test-only failures exposed a null/undefined assertion and a cross-realm instanceof Promise assertion; their logs remain alongside the final passing run. No failed result is treated as acceptance. Early command watchdogs were armed immediately after spawning their child; the final runner arms its independent parent deadline before spawning. All retained logs were gzip from first byte, with original SHA256, size and CRC checked by independent decompression. Every regular evidence file, including commands and patches, is inventoried. Source recovery uses Git SHA plus a small owned binary diff with reverse-check; modules and media are referenced by existing path/hash, without copies or archives.
Canonical 4b45bda53a90b665896cf3b85d9a157b7c3703563c88b6666e4ee2e4b346bcc3 (2,184,500 bytes) and compat c3a4a1d9cd6cd6a630f6145c472d3a7d1ab6c2818dba618f2a1b82d8292d7f5a (2,187,146 bytes) remain unchanged. Retained 6cf evidence and the accepted cc6a14236 separate-drain ascent remain separate and unchanged.
Physical callback completion can exceed the initiation deadline or never settle; this repair does not cancel or fabricate an input acknowledgment. Real host callbacks must return their actual completion Promise for this interface to observe it. JavaScript timers still require the controller event loop to run. No original gameplay or physical input release was qualified. Full27, original parity, audio, FPS, worldZ and sustained controlled flight remain open. Next work is a separately authorized original qualification using the existing observer and the repaired release-result contract.
Box: NONE / NOT_CREATED, expiry NULL, stop receipt NA. No deployment, private guest operation, configuration/backend/binding/clock/seed edit, RAM gate, old run deletion or peer WIP capture. Disk checks stayed above 1,500,000,000 bytes at sampled points; no continuous-floor claim.