15 Commits
Author SHA1 Message Date
Jason fbc265b526 Adaptive Music v0.8.3 multiplayer and floating music controls
Validate and generate manual release / package (push) Waiting to run
2026-12-05 20:29:27 -05:00
CheddahBoxMB acc8cbafc6 Upload files to "/" 2026-12-05 13:39:54 -05:00
Jason 357c904d1b Adaptive Music v0.8.1 combat automation fixes
Validate and generate manual release / package (push) Waiting to run
2026-12-05 13:37:05 -05:00
Jason 95b0427aa1 Adaptive Music v0.8.0 release candidate
Validate and generate manual release / package (push) Waiting to run
2026-12-05 09:40:14 -05:00
Jason 8c07a468a4 Synchronize Gitea manifest upload 2026-12-04 11:15:28 -05:00
CheddahBoxMB 4f3fac5f1c Upload files to "/" 2026-12-04 11:13:48 -05:00
Jason 398749210a Release v0.7.2 - Redesigned interface and persistent account settings
Validate and generate manual release / package (push) Canceled after 0s
2026-12-04 11:08:09 -05:00
Jason 1d894f59fb Reconcile Gitea uploads before v0.7.2 2026-12-04 11:07:31 -05:00
CheddahBoxMB 0b1607cd20 Upload files to "/" 2026-12-04 09:00:20 -05:00
Jason 1ed30567fb Release v0.7.0 - Automatic pairing and validated MA audio playback
Validate and generate manual release / package (push) Canceled after 0s
2026-12-04 08:58:47 -05:00
CheddahBoxMB 83d168f5a1 Upload files to "/" 2026-12-03 20:16:23 -05:00
Jason eb9536f903 Release v0.6.0 - Music Assistant wizard and automatic listener connections
Validate and generate manual release / package (push) Canceled after 0s
2026-12-03 20:11:10 -05:00
CheddahBoxMB 5319177c58 Upload files to "/" 2026-12-03 16:20:06 -05:00
Jason f9f891d779 Merge remote-tracking branch 'origin/main'
Validate and generate manual release / package (push) Canceled after 0s
2026-12-03 16:15:54 -05:00
Jason 14f0d8c26b Initial Adaptive Music v0.5.0 release 2026-12-03 16:11:47 -05:00
162 changed files with 18330 additions and 1 deletions

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
name: Validate and generate manual release
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
package:
# Map this existing runner label to a host/shell executor, not a Docker image.
runs-on: [self-hosted, linux, adaptive-music-release]
steps:
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Validate and generate offline artifacts
env:
RELEASE_REPOSITORY: ${{ vars.RELEASE_REPOSITORY }}
run: |
node --version
node --test tests/js/*.test.mjs
python3 -m unittest discover -s tests -v
python3 scripts/audit_repository.py
python3 scripts/ci_release.py
# Gitea's artifact protocol varies by instance version; this pinned v3 action
# is for compatible existing instances. Manual local generation needs no CI.
- uses: https://github.com/actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf
with:
name: adaptive-music-manual-release
path: dist/releases/
if-no-files-found: error
+29
View File
@@ -0,0 +1,29 @@
name: Validate and generate manual release
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
jobs:
package:
# Existing shell runner only; this workflow provisions no VM/container/service.
runs-on: [self-hosted, linux, adaptive-music-release]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Validate and generate offline artifacts
env:
RELEASE_REPOSITORY: ${{ vars.RELEASE_REPOSITORY }}
run: |
node --version
node --test tests/js/*.test.mjs
python3 -m unittest discover -s tests -v
python3 scripts/audit_repository.py
python3 scripts/ci_release.py
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: adaptive-music-manual-release
path: dist/releases/
if-no-files-found: error
+12
View File
@@ -0,0 +1,12 @@
.local/
.env
.env.*
!.env.example
node_modules/
dist/
coverage/
__pycache__/
*.pyc
*.pem
*.key
*.log
+31
View File
@@ -0,0 +1,31 @@
# Adaptive Music contributor instructions
Adaptive Music is an independent open-source project by CheddahBoxMB targeting
Foundry VTT v14.371 and Music Assistant (MA) 2.10.6. It is system-independent.
- Read ARCHITECTURE.md, SECURITY.md, TESTING.md and PROGRESS.md before changes.
- Milestone 1 is research and repository scaffolding. No installable module or
working gateway exists yet. Never label design, source inspection, mocks or
offline checks as verified live integration.
- Require no other Foundry modules. Do not import ATLAS, system-specific actor
schemas, proprietary source, subscription services or telemetry.
- Do not alter production Foundry, MA, Sonos, Nginx, firewall or service versions.
Ask before credential use or production changes. Never request unrestricted root.
- Keep endpoints, credentials, campaign/player mappings and deployment files under
ignored .local/ (directory mode 0700, secret files 0600). Never place MA tokens in
Foundry settings, browser bundles, flags, URLs or logs. Examples use placeholders.
- MA access belongs on the gateway; browsers receive campaign-scoped capabilities.
Never implement an unrestricted MA HTTP/WebSocket/Sendspin proxy.
- Only a campaign-owned dedicated audio target is eligible for control. Do not
discover-and-select household players, transfer queues, group speakers or issue
global stops. Native sound effects and AmbientSound documents are out of scope.
- Serialize transitions under a fenced authority lease; snapshots and commands
carry campaign, session and generation. Reject stale events and restores.
- Preserve upstream notices for reused source. Record exact versions, commits,
licenses and dependencies before adding code. Do not run upstream install hooks
merely to inspect source. Lock and audit dependencies before distribution.
- Run `python3 -m unittest discover -s tests -v` and
`python3 scripts/audit_repository.py` before a commit. Run
`python3 scripts/verify_upstream.py` when local research checkouts are available.
- Update evidence and verification status with every meaningful implementation.
Do not invent Gitea remotes, release URLs, Foundry verification or test results.
+147
View File
@@ -0,0 +1,147 @@
# Adaptive Music architecture — 0.8.3
Adaptive Music is an independent project by CheddahBoxMB for Foundry v14.371 and
MA 2.10.6, with no system dependency or additional required process. The expanded
operator authorization selects direct trusted-GM browser access and GM-local
credential handling for the standalone module; it supersedes the older gateway-only
scaffolding rule. Optional historical gateway source is not required or deployed.
## Setup and receiver ownership
The Connection tab validates the server, token and optional Advanced network fields
before authentication. The Connect gesture starts the GM audio context before
authentication, receiver provisioning and catalog loading. Playback reads the
dedicated MA queue and submits controls on the same controller as scene transitions.
The GM supplies the private trusted HTTPS MA origin and access token. Authentication
reads account-authorized music providers. The official pinned Sendspin SDK generates
one X25519 identity for the campaign, GM user and MA origin. Its identity, pairing
storage, catalog key and name are encrypted in local IndexedDB with a non-extractable
AES-GCM key. The key is stored in the same browser; this does not protect against
trusted-origin scripts or theft of the complete browser profile. A GM can opt in
to a separate encrypted device record with the MA token, address, receiver name
and reconnect preference. Receiver records exclude credentials. Both records are
scoped to the Foundry origin, world and user. Without opt-in, failed attempts
retain private input in tab memory. A different MA origin uses separate credentials
and receiver identity.
The logged-in GM account can retain an AES-GCM envelope containing the last
successfully connected MA address and receiver name in a Foundry User Setting.
The MA token supplied for a connection unlocks the envelope. Its key is derived
with a separate purpose label and bound to the Foundry origin, world and user.
Foundry persists the encrypted record across devices and server restarts.
Connect audio first authenticates the `/ws` API session, then authenticates
`/sendspin` using that token and the SDK-generated client ID. MA 2.10.6 associates
this new web receiver with already-authenticated API sessions for the token. The
same API session must therefore survive pairing, catalog reads and playback.
MA 2.10.6 associates all API sessions carrying the same restricted token with the
last Sendspin browser receiver to connect using it. Concurrent receivers need
separate tokens. Loss of receiver access stops automation without retargeting.
`sendspin/pair_web_player` pairs only this identity to the calling account. Noise
activation and clock synchronization precede exact ID/name/provider/topology checks.
During startup, a successful null queue lookup is retried briefly on the same
authenticated API session because MA can expose the player before registering its
queue. Playback requires the receiver’s own active queue.
There is no household player list or arbitrary target selector.
The receiver uses SDK software volume. Fresh receivers do not report volume before
capabilities are advertised, so volume cannot be a preconnection requirement. Static
account-authorized playlist tracks become opaque HMAC references bound to the stored
catalog key and campaign. New references use a separate key derived from the MA
token, MA origin and campaign so the same authorized catalog resolves on another
browser. A browser with its original receiver vault still resolves legacy IDs.
Saving that scene again writes the new reference. Scene and world flags hold opaque references. The active GM browser and its audio
context host the live connection. Disconnect ends that session and pauses automatic
reconnection.
## Audio and listeners
The pinned official SDK negotiates PCM, performs Noise and time synchronization,
and decodes audio. A bounded Web Audio timeline anchors a packet run to the local
audio clock and advances it by each rendered chunk’s length. The browser converts
sample rates from each AudioBuffer’s input rate. A 120 ms startup cushion and
bounded 0.1% rate correction absorb jitter and drift. The queue allows eight
seconds of server lead, up to 768 active nodes and 8 MiB of decoded audio. It
counts source timestamp gaps and overlaps separately from late drops and local
underruns. Timestamped partial clears trim only invalid audio. Separate
transition and volume gains feed the GM output and one MediaStreamDestination
track for listener distribution.
User document public keys authenticate ephemeral ECDH/AES-GCM invitation delivery.
Private keys stay in memory. Invitations are bound to world, sender, recipient,
epochs and expiry. Each player receives only its own WebRTC capability. Bounded
AES-GCM envelopes carry SDP over Foundry’s module socket; audio uses DTLS-SRTP,
never PCM over that socket. Firefox’s session-level SDP direction default is
correctly overridden by the sole audio media direction. Offers remain recvonly;
answers remain sendonly. Video, data and injected sender media are rejected.
Up to eight listeners negotiate automatically. A signaling invitation expires
after 30 minutes. Established DTLS-SRTP media continues while its listener and GM
remain authorized. Failed negotiation times out after 20 seconds and a disconnected
peer is dropped after 10 seconds. The reconciliation loop can invite the listener
again. Foundry's connection and User document events reconcile listeners
without replacing the GM transport. One user gesture unlocks browser audio when
required. A stable HTMLAudioElement and optional activated Web Audio path play
the incoming track. Each listener's local output applies their saved mute and
volume settings downstream of WebRTC. Default ICE uses no public STUN/TURN service.
The GM's personal monitor gain sits on the local output branch after the split
to the listener stream. Campaign volume remains upstream of that split.
## Transitions and recovery
Manual override/silence > combatant boss override > designated encounter boss cue
> started combat in the active scene > ambient > world default > silence.
An explicit combat scene takes precedence. An unlinked encounter with
scene-bound combatants applies to their scenes. An unlinked encounter with no
scene-bound combatants is global. Begun, active encounters are resolved through
post-operation combat and combatant hooks. No system actor schemas are used. The existing
serialized controller checks campaign/session/generation and current authority.
Authority requires one active full Gamemaster. Foundry's Assistant GM role is
eligible for listener audio. A Web Lock excludes common duplicate tabs. Queue
commands retain their existing session and generation fences.
Every queue mutation verifies the exact dedicated target, standalone topology and
its own active queue. Signed snapshots retain ordered duplicates, index, repeat,
whole-second position and state, scoped to campaign/session/fence/generation for up
to 12 hours. An interrupted ambient snapshot can survive an excursion while its
scene's encounter remains live and the ambient reference still matches.
Ambiguous writes latch closed and stop automation; they are not retried.
MA Sendspin lacks native pause in 2.10.6, so pause retains a logical stopped-queue
snapshot and resume explicitly seeks its item. A paused restore rebuilds without
briefly playing. A finished static queue can be interrupted and rebuilt in an
idle state for replay. The Playback panel can set MA's dedicated queue repeat
mode. Logical pause state is memory-only.
The floating bar's campaign pause holds the serialized controller. The
dedicated MA queue pauses in place, and an active owned native fallback uses
its snapshot and stop operations. Play resumes the original position when the
cue still applies. A different current cue takes precedence, and the prior
cue's pre-pause snapshot remains available under normal restoration rules.
The hold belongs to the active GM runtime and ends if that session is disposed.
Reconnecting to a remembered receiver can preserve its existing queue. When the
trusted device auto-reconnects with a populated queue, the next music intent
or explicit return to scene music takes control. Crash or reload can lose the
ambient interruption stack and logical pause. Adaptive Music provides sequential
fade-out and fade-in using its one MA queue. True overlap between arbitrary
scene playlists would require two independently managed streams at once.
Scene Configuration and the Playlists sidebar use Foundry render hooks. The
director displays virtual catalog items for assignment and saves only opaque
references into scene flags. The GM's native Combat Tracker stores the encounter
designation on the Combat document and reflects the current playback mode.
No Foundry Playlist document is created for an MA
item. The module cedes a scene with a configured native soundtrack to Foundry.
Only explicitly owned native fallback playlists can be managed by Adaptive Music.
Positional audio and other native effects stay under Foundry’s control.
## Verification boundary
The installed v0.7.0 module was tested in a logged-in Foundry v14.371 development
world through the private Nginx route. The v0.8.0 browser preview used validated
ZIP assets with the real development world, MA and two listeners. It exercised
Foundry module-socket signaling, scene and combat hooks, ordered ambient
restoration, real playback controls and User document permissions. The operator
later verified installed v0.8.0 audio in Chrome on macOS and at a remote WAN
listener. macOS Firefox connectivity remains unresolved. See [TESTING.md](TESTING.md).
+151
View File
@@ -0,0 +1,151 @@
# Changelog
## 0.8.3 — floating music controls
- Add a draggable, collapsible Adaptive Music bar for players and the GM.
Personal mute and volume share the existing listening preferences.
- Give the GM separate campaign volume, track skip, and one-click access to
playback and overrides. The GM's personal listening level affects only their
own Music Assistant output.
- Add **Pause all music** and **Play all music** for Adaptive Music. The
campaign pause holds scene and combat automation until Play is selected.
## 0.8.2 — multiplayer continuity and player listening
- Use Foundry's full Gamemaster role for Music Assistant controller authority.
Player, Trusted Player and Assistant GM connections leave the existing host
session and catalog running.
- Reconcile listener connections on Foundry login, logout and User updates.
Late listeners join the existing WebRTC stream, using browser audio activation
where required.
- Add **Campaign audio** to the player Playlists sidebar. The existing listening
window now shows status and offers personal mute and volume, saved per Foundry user.
## 0.8.1 — Combat Tracker cues and Firefox diagnostics
- Follow the combatants' token scenes when Foundry creates an unlinked
encounter through its native token HUD. Switch after combat starts, keep
the cue across initiative changes, and restore ambient when combat ends.
- Add **Boss encounter** to the GM's native Combat Tracker. Beginning a
designated encounter uses the scene's default boss cue. The tracker and
Playback panel show the current music mode and expose a way back to
automation while a manual override is active.
- Retain an interrupted ambient position across a scene excursion while
the original encounter remains active.
- Record the last failed Connect action's timestamp, error code and known setup
stage in the copyable connection report.
- Record each unauthenticated WebSocket probe's duration and the site permission
state observed after that route completes. Keep opaque upgrade failures
distinct from a confirmed CSP block.
- Record installed v0.8.0 macOS operator acceptance and the Firefox connectivity
failure. The macOS Firefox fix is still awaiting diagnosis.
## 0.8.0 — playback stability and native Foundry controls
- Keep Sendspin PCM packet boundaries contiguous in Web Audio. Track source gaps,
overlaps, late packets, buffer overruns and underruns separately.
- Separate API and Sendspin connection failures, distinguish local network
permission hints from transport failures, and identify loss of dedicated queue
rights when Music Assistant reassigns a restricted token’s browser receiver.
- Remember a revocable Music Assistant token on an opted-in trusted GM browser.
Reconnect on world entry, support a deliberate disconnect, and forget the saved
device credential independently of the encrypted Foundry account address.
- Assign ambient, combat and boss music in native Scene Configuration. The
Playlists sidebar shows a draggable Music Assistant catalog for GM assignments.
- Open the live transport controls from the token toolbar or Playlists sidebar.
Use volume, pause/resume, seek, skip, stop, repeat, manual override and return to scene
music. Music Assistant playlist changes use sequential fade-out and fade-in.
- Coalesce duplicate hook updates, continue shared playlists across scene changes,
and keep connected listener media running when its initial signaling invite expires.
- Refresh the open Playlists sidebar after connecting, preserve its expanded state,
and keep an ambient snapshot when the same playlist also serves as a combat cue.
Restore a finished static queue without briefly restarting playback.
- Include the Mac acceptance checklist and handoff in the release bundle. Record
whether the packaged source came from a clean checkout or includes working-tree
changes, and validate the complete module ZIP inventory and SDK provenance.
## 0.7.2 — account-scoped connection setup
- Remember the Music Assistant address and receiver name in an encrypted Foundry User Setting. Enter the MA token to unlock the saved address and connect in a new browser session.
- Make newly saved catalog assignments readable across browsers that use the same MA token, server and Foundry world. Preserve legacy reference resolution in the browser that created it.
## 0.7.1 — AM-006 setup usability
- Give the resizable GM window three tabs for Connection, Scene Music and Playback.
- Connect with one action that validates the inputs, authenticates, provisions the
dedicated receiver and loads playlists. Keep listener networking under Advanced.
- Show the current track, position, volume, automation state and connected listener
count. Queue pause, resume, seek and stop through the existing playback authority.
## 0.7.0 — integrated campaign receiver
- Replace receiver JSON import with authenticated automatic dedicated web-receiver
provisioning and account-bound pairing. Remember the receiver privately in the
GM browser; retain the MA token only in tab memory.
- Keep one authenticated API session established before Sendspin so restricted MA
accounts retain the receiver’s session permissions. Wait briefly for MA to
register the dedicated queue during setup. Use SDK software volume.
- Fix Firefox SDP direction inheritance, PCM stream-ahead scheduling and timestamped
partial clears. Add transport, authentication, pairing, clock, audio and listener
diagnostics in the interface. Fix narrow ApplicationV2 layout.
- Preserve inputs across failures, retain receiver identity across reloads, and allow
reconnection to the owned queue without replacing it. Pause automation on uncertain
writes; do not retry queue mutations blindly. Bound failed listener negotiation.
- Emulate pause for MA 2.10.6 Sendspin using stopped queue plus saved index/position;
restore paused queues without briefly playing them. Keep active-session interruption
snapshots for up to 12 hours rather than five minutes.
- Exercise actual MA catalog audio, two browser listeners, combat transitions and queue
restoration in Firefox and Chromium. Preserve the failing queue command in
diagnostics and skip rollback on uncertain writes.
- Preserve existing Gitea manifest/update URLs and manual publication bundles.
Crossfade and durable crash restoration remain unsupported.
## 0.6.0 — GM connection interface
- Add a GM Music Assistant connection wizard: private server/token entry, existing
receiver backup import, dedicated target verification, catalog loading, audio
connection and actionable diagnostics. Credentials remain in GM tab memory.
- Enable explicitly authorized catalog playlist playback through the existing guarded
provider. Keep native ownership, ambient/combat/boss assignments and fallback.
- Automatically deliver encrypted listener invitations using ephemeral ECDH keys
bound to Foundry User documents; players normally need only Enable Audio.
- Hide optional companion and synthetic/manual test controls behind a client-scoped
advanced development setting. Simplify the primary setup and listener windows.
- Document trusted HTTPS/WSS, logging, identity/pairing, browser activation and ICE
requirements without bypasses or additional mandatory infrastructure.
- User reports v0.5.0 published/installed/activated on Foundry v14.371 and D&D 5e
6.1.2 with both windows rendering. v0.6.0 live Foundry/MA audio remains unverified.
## 0.5.0 — local release candidate
- Prepare one standard Foundry module ZIP and offline manual-upload release bundle
for the planned Gitea destination, with configurable GitHub/Gitea URL generation,
stable update manifest, immutable versioned download and SHA256 checksums.
- Preserve validated native playback, scene/world assignments, combat/boss/manual
policy, catalog, guarded MA transport and queue restoration. Share the same
transport/provider implementation between the optional companion and trusted GM
browser using Web Crypto.
- Add pinned official Sendspin JS 5.0.0 PCM-only bundle with dependency lock, audit,
full notices and recorded modification (optional Opus fallback omitted).
- Add experimental GM-local SDK decoding/Web Audio and encrypted, per-listener
capability-signaled WebRTC audio. Module sockets carry no continuous raw audio.
- Keep the companion as an optional, undeployed co-located fallback; no container,
VM/LXC, OS-service installer, core patch or sandbox runtime dependency.
- Remote MA audio is not yet verified: existing DEV private identity, secure browser
reachability, synthetic ingestion and real NAT/browser/Foundry gates remain.
Crossfade, simultaneous ambient layers and seamless GM handover remain unsupported.
## 0.4.0-dev
- Connected GM setup, scene ambient/combat/boss defaults and native fallback with the
private companion and MA catalog. Measured connected read-only MA catalog locally;
added synthetic PCM browser sink and loopback integration tests.
## 0.3.0-dev
- Added guarded MA playback provider, durable catalog identifiers, signed ordered
queue snapshots/restoration and isolated native Foundry development package.
- Live idle queue control tests restored original state. Synthetic ingestion failed;
no nonempty MA queue or real playlist playback was verified.
+316
View File
@@ -0,0 +1,316 @@
# Adaptive Music v0.8.3 handoff
## Floating music controls
The music bar mounts at Foundry ready for the full GM and authorized
listeners. It shares saved listening preferences with Campaign audio and uses
a separate client setting for position and collapse. The GM monitor gain is
local. Campaign pause uses the fenced controller and blocks scene transitions
until Play. The new controls are packaged under `dist/releases/v0.8.3/` from
the `v0.8.3-music-bar` branch in `.local/v080-release-checkout`.
The development world was inactive during this change. Repeat the new rows in
[USER-ACCEPTANCE.md](USER-ACCEPTANCE.md) in an installed world with the GM and
at least one player connected. The private browser attempt is recorded under
`.local/v083-bar-live.log`.
## Multiplayer release blocker
The operator passed the v0.8.1 combat corrections and reported a late-join
failure that stopped GM playback and emptied the catalog. In the development
world, GUI logins as Player and Trusted Player left v0.8.1 playback running.
An Assistant GM join reproduced the loss. Foundry's `isGM` counted both that user
and the full Gamemaster. The old single-GM guard closed the MA API and Sendspin
sockets when it saw both. The Foundry socket stayed connected.
v0.8.2 distinguishes the full Gamemaster role from listeners, reconciles
roster changes on `userConnected` and User updates, and keeps the player's
output controls in the existing Campaign audio window. The sound level is
local to the listener. Foundry User Settings retain only mute and volume.
See [TESTING.md](TESTING.md) and [USER-ACCEPTANCE.md](USER-ACCEPTANCE.md).
The sanitized report is [evidence/v0.8.2-live.json](evidence/v0.8.2-live.json).
The private test runner and raw evidence are under `.local/v082-multiplayer-*`
and `.local/v082-run-mixed.py`. The world server reported v0.8.1 during the
v0.8.2 runtime preview. The final package fingerprint matches the tested preview.
Three Chrome/Firefox listeners and the GM passed 30 audio checks over six
minutes. The remembered GM credential restored the receiver and connected
listeners after reload. The test removed its fixtures and restored development
world settings. Verify the installed candidate with the operator's
party and capture the separate unresolved macOS Firefox private-route failure
using the acceptance checklist.
## Repository state
The original workspace's Git metadata is read-only. Before v0.8.1 changes,
its 157 tracked and untracked source files matched the clean local release
commit `1ed6b4c` byte for byte. The original HEAD `987122f` is that commit's
parent. The remote-free `.local/v080-release-checkout` has the prior candidate
on `v0.8.2-multiplayer` and the floating controls on `v0.8.3-music-bar`.
Its `main` branch retains `1ed6b4c`.
The operator reported Gitea published v0.8.0 from `95b0427`. That object
is absent in both local Git databases. The published commit's ancestry
can be checked if its Git object is supplied offline.
A read-only check of the authorized private Foundry route confirmed the
installed manifest was v0.8.0 and all 28 runtime files matched `1ed6b4c`.
A later check matched all 28 installed v0.8.1 runtime files to `251a019`.
The v0.8.2 archive is built from a clean checkout and its source is compared
against its local commit. Read its exact commit in
`dist/releases/v0.8.2/release.json`. Gitea access and production deployment
are outside this work.
## Installed v0.8.0 macOS acceptance
- **Operator pass:** Chrome connectivity, credentials after quitting and
reopening Chrome, automatic scene playlist activation, background-tab audio,
remote player audio over WAN, and smooth transitions. The operator heard no
stuttering or crackling during their session.
- **Operator fail:** macOS Firefox connectivity.
- **Combat follow-up:** assigned battle music worked when used as ambient,
while normal combat left ambient playing. The operator could not find
the boss designation. The operator passed combat, restoration, boss and
manual controls with the corrected v0.8.1 candidate.
## v0.8.1 native combat correction
The native token HUD created an unlinked encounter on Foundry 14.371 and D&D 5e
6.1.2. Installed v0.8.0 ignored it even after the native tracker started round 1.
Use the Combatant token scene when the encounter has no explicit scene. The
tracker now has a GM-only **Boss encounter** option and shows the playback mode
and **Return to automation** for a manual override. The same combat and boss
assignment can change mode without restarting the queue. Use distinct playlists
to verify the audible changes.
The authorized GUI run and its hook trace live under ignored
`.local/v081-combat-gui-*`. See [TESTING.md](TESTING.md) and
[USER-ACCEPTANCE.md](USER-ACCEPTANCE.md) for the reproduced lifecycle and steps.
The Chromium browser preview used three distinct cues and restored ambient at
30, 33 and 46 seconds across normal, boss and manual-override encounters.
It verified turn and round continuity, End Combat cancellation, scene changes,
and returning from the manual hold. The server still reported v0.8.0 during
the previews. Headed Firefox repeated the normal combat lifecycle against the
same runtime and restored ambient at 9 seconds.
## v0.8.1 Firefox investigation
- The two WSS routes opened with HTTP 101 in Mozilla Firefox 161.0.1 on Ubuntu
from the anonymous Foundry origin and the MA origin using the native
WebSocket. Trusted TLS and the authorized private route were retained.
- The isolated stock-Firefox policy test reproduced enforced CSP, report-only
CSP, a server-side Origin rejection and a mismatched TLS certificate. Browser
script saw Origin rejection and TLS rejection as opaque upgrade failures.
- The candidate improves the token-free report with manual Connect failure
stage and time, per-route duration and post-probe permission states.
Audio, credential storage and the authenticated transport are outside the
change. The original macOS failure needs the browser-side capture described
in [USER-ACCEPTANCE.md](USER-ACCEPTANCE.md#capture-the-firefox-failure).
- The private stock browser, scripts and raw reports under `.local/v081-*`
are test-only. See [sanitized v0.8.1 evidence](evidence/v0.8.1-live.json).
## Historical v0.8.0 audit checkpoint
- The development world keeps **Christmas — Adaptive Music demo** active with
Christmas music assigned. **Dûr-Khazrak — Adaptive Music demo** has distinct
ambient, combat and boss cues and a prepared, unstarted encounter with the
Dûr-Khazrak Champion. Its ambient uses a development playlist as a stand-in.
The authorized catalog contained no identifiable dwarven soundtrack.
- The preview host reported v0.7.2 during the automated audit. The operator
subsequently installed v0.8.0 and carried out the checks above.
- Automated release regressions passed with 110 JavaScript and 17 Python
tests. The dependency, repository and upstream provenance checks passed.
The updated Chromium, Firefox and Linux WebKit credential fixture closed
and reopened persistent browser profiles and tested rejection by a synthetic
MA auth endpoint after simulated revocation. The real preview verified
same-receiver auto-attachment after a page reload, Disconnect and Forget.
- MA-side revocation with a disposable token and Mac sleep/wake still need
operator acceptance. The focused Ubuntu Firefox background check measured
listener audio before switching tabs and could not establish that the GM
page became hidden.
The package targets Foundry VTT 14.371 and MA 2.10.6. It uses the pinned Sendspin
SDK and browser-hosted audio. The user authorized the existing test accounts and
dedicated MA token for the private development-world acceptance runs on
December 4. See [the evidence](evidence/v0.8.0-live.json),
[the verification guide](TESTING.md) and [the contributor rules](AGENTS.md).
| Work | Candidate implementation |
| --- | --- |
| AM-005 browser compatibility | Staged, token-free transport diagnostics. Live Chromium and Firefox use the private development route. Linux WebKit provides an engine check. |
| AM-007 audio continuity | A bounded sample-contiguous PCM timeline and persistent established WebRTC media across signaling expiry. Live measurements count silent render blocks, verify rate and reject prolonged silence. |
| AM-008 trusted-device credentials | Explicit browser-local AES-GCM retention with reconnect, Disconnect and Forget Credentials. Account address and portable references retain their v0.7.2 formats. |
| AM-009 native Foundry integration | Native Scene Configuration fields, draggable MA catalog, world/boss defaults and real scene/combat hooks. Native soundtracks remain under Foundry's controller. |
| AM-010 gameplay controls | Token toolbar and sidebar launch points, transport, volume, repeat, manual override and return to scene music. The one dedicated MA queue uses sequential fades. |
## Results and open acceptance
- The original Firefox report is preserved under
`.local/v080-original-firefox-soak.json`. It recorded 1,800 wall-clock
measurement seconds and successful ambient restoration at 37 seconds.
Both listeners then recorded about 763 seconds of continuous terminal
silence and the Stop/Enable check failed. The first ZIP preview passed initial
ambient playback but timed out selecting Repeat. The repeat field now has an
explicit accessible name for Firefox and for the harness.
- The first Chromium GUI review connected to MA, then timed out in the sidebar
and scene configuration workflow. The refreshed sidebar updates an existing
render and preserves its expanded state. The review now reports individual
stages, verifies the pointer drag and measures both listeners. Current raw
reports and logs are in `.local/foundry-v080-review-chromium.json`,
`.local/v080-audit-chromium-review.log` and
`.local/v080-audit-firefox-soak.log`. Match the UTC start time and ZIP hash
before attributing results to a given run.
- Chromium's headless run exercised the real Foundry native UI, including
pointer drag, two scene assignments, both controls launch points, combat,
a boss override and ambient restoration. A first combat choice was rejected
during playlist preparation. For a reproducible review, set
`AM_REVIEW_PLAYLIST_INDEXES` to the three comma-separated zero-based catalog
entries that passed preparation in `.local/v080-catalog-readiness.json`.
- The corrected Firefox continuity run started at 00:29 UTC on December 5 and
passed 1,800 measured seconds, including ordered restoration at 37 seconds,
listener Stop/Enable and reload. The development-world cleanup passed. The
Chromium review uses the same tested ZIP and runtime asset hash. See the
sanitized JSON for phase measurements and the raw report under `.local/`.
- The Chromium review passed native scene assignment and pointer drag, both
playback launchers, combat and boss cues, ambient restoration at 10 seconds,
manual override and return, pause, resume, seek, skip and stop. It reconnected
the same receiver after reload without replacing its queue. Disconnect and
Forget Credentials both prevented automatic reconnection after another reload.
The final headed review disabled Playwright focus emulation in a private test
tool copy. A real cover tab hid the GM document for 12 seconds. Its audio clock
advanced, the GM output analyser measured audio, and both listeners continued
receiving audio. Earlier trials with focus emulation kept the page visible.
See `.local/v080-normal-visibility-playwright/focus-fixture.json` for the tool
modification and hashes.
- The isolated WebRTC fixture passed signaling expiry and revocation in
Chromium and Firefox. Linux WebKit's default ICE did not connect. Forced
relay via local coturn passed audio and expiry/revocation without microphone
access. The extracted binary and signed-package hashes are in
`.local/v080-turn-fixture/`. Future runs can set `AM_LOOPBACK_TURN_CONFIG`
to a private fixture grant and use `--webkit-only`.
- These v0.8.0 automated browser previews exercised real Foundry and MA with
archive assets while the server reported v0.7.2. See the separate installed
v0.8.0 manual results above.
The bundle is locally staged under
`dist/releases/v0.8.0/`. The install ZIP is `adaptive-music.zip` and the
outer archive also includes complete source, checksums, licenses and evidence.
The prior review restored the development world's active scene, automation
setting and account connection and removed temporary combats. The final audit
prepared the two demo scenes and activated Christmas for the operator.
The prior hostname override was restored from its saved backup. The focused
Firefox check used a process-local DNS mapping with normal TLS validation.
## Findings and source map
- MA 2.10.6 assigns all authenticated API sessions using a restricted token to
the newest Sendspin browser receiver using the same token. This was directly
reproduced when the native MA reference player and the Foundry receiver shared
the test token. Foundry kept receiving audio but `players/get` returned
`InsufficientPermissions` (22), preventing combat control. Run those tests
serially, or use separately authorized tokens. The matching upstream code is
`set_sendspin_player_for_token` in MA's tagged webserver controller. Adaptive
Music keeps its original API session and reports queue-rights loss in
`src/audio/gm-host.mjs`, `src/providers/ma/websocket.mjs` and
`src/foundry/connection-wizard.mjs`. This explains the reproduced permission
failure. The cause of the Mac Firefox failure remains open.
- The v0.7.2 per-packet time mapping causes edge gaps and overlaps when Web Audio
time advances in render quanta. The rendered-tone fixture detected 86–97
short dropouts per seven-second measurement across the tested rate pairs and
engines. The new scheduler detected zero in the same fixture. A prior
two-minute live Firefox interval also detected zero short digital dropouts at
the GM and both players. See `src/audio/pcm-timeline.mjs`,
`src/audio/gm-host.mjs`, `src/audio/peer-audio.mjs` and
`scripts/browser-continuity-worklet.mjs`. Natural track silence, an intentional
transition, a network concealment event and a scheduler gap are different signals.
- A headed installed-baseline Chromium attempt authenticated and paired but timed
out waiting for a newly registered MA queue. Retain that result alongside the
operator’s working Mac baseline. Setup already retries a successful null queue
lookup briefly. Check `src/providers/ma/client.mjs` and `src/audio/gm-host.mjs`
if it recurs.
- Credential lifecycle and auto-reconnect are in `src/foundry/receiver-vault.mjs`,
`src/foundry/account-connection.mjs`, `src/foundry/module.mjs` and
`src/foundry/connection-wizard.mjs`. The browser profile and enabled same-origin
modules are trusted. The token cannot follow a GM account to a different
browser without that GM entering it there. Token rotation can require
reassigning older token-derived playlist references.
- Native UI and automation are in `src/foundry/configuration.mjs`,
`src/foundry/music-editor.mjs`, `src/foundry/runtime.mjs`,
`src/core/scene-music.mjs` and `src/core/controller.mjs`. Playback UI is in
`src/foundry/playback-panel.mjs` and `src/foundry/setup.mjs`. True simultaneous
crossfade between arbitrary playlists would require both streams to be
independently available at the same time. MA track-to-track crossfade within
one queue is separate. GM logout or closing the last GM tab ends live playback.
## Environment and commands
Use Ubuntu, Python 3, Node 24.23.0 or newer within the supported release line,
and the existing Playwright tools. System `node` on this machine is Node 18.
The development browser tools and browser binaries are ignored local paths.
The headless tests exercise isolated browser APIs. The headed tests use Xvfb with
software GL for the actual Foundry graphical workflows.
```sh
export PATH="/home/ubuntu/.nvm/versions/node/v24.23.0/bin:$PATH"
export PLAYWRIGHT_BROWSERS_PATH="$PWD/.local/browsers"
npm test
python3 -m unittest discover -s tests -v
python3 scripts/audit_repository.py
python3 scripts/verify_upstream.py
npm audit --json
node scripts/check_setup_browser.mjs
export AM_PLAYWRIGHT_MODULE="$PWD/.local/dev-browser-tools/node_modules/playwright/index.mjs"
export LIBGL_ALWAYS_SOFTWARE=1
xvfb-run -a node scripts/check_pcm_continuity.mjs --headed --webkit
node scripts/check_device_credentials_browser.mjs --webkit
# Run the desktop review after any background playback test has exited.
umask 077
AM_PLAYWRIGHT_MODULE="$PWD/.local/v080-normal-visibility-playwright/node_modules/playwright/index.mjs" \
xvfb-run -a -s '-screen 0 1600x1050x24 +extension GLX' \
node scripts/check_foundry_private_route.mjs --headed --playback --package-preview dist/releases/v0.8.0/adaptive-music.zip --review \
> .local/v080-candidate-chromium-review.log 2>&1
# Start another soak when changes require a retest.
xvfb-run -a -s '-screen 0 1600x1050x24 +extension GLX' \
node scripts/check_foundry_private_route.mjs --headed --firefox --playback --package-preview dist/releases/v0.8.0/adaptive-music.zip --continuity \
> .local/v080-candidate-firefox-soak.log 2>&1
# Build the current candidate from the clean local release checkout.
python3 .local/v080-release-checkout/scripts/release.py --output "$PWD/dist/releases/v0.8.3"
python3 scripts/release.py --validate dist/releases/v0.8.3/adaptive-music.zip
(cd dist/releases/v0.8.3 && sha256sum -c SHA256SUMS && sha256sum -c adaptive-music-release-v0.8.3.zip.sha256)
```
The headed browser tests use the authorized private Nginx HTTPS route and retain
normal TLS validation. Firefox and WebKit used a temporary Ubuntu hostname
override which has been restored. After an authorized future test, restore an
identical temporary override with
`cmp -s /etc/hosts .local/v080-hosts.new && sudo -n install -m 0644 -o root -g root .local/v080-hosts.before /etc/hosts`.
If the comparison fails, preserve subsequent edits and remove only the test
change marked `adaptive-music-test-v080` using the backup as a reference.
## Authorization and private configuration
- Use the dedicated Foundry development world and the three test accounts listed
in the ignored development-world configuration. The runner checks whether the
GM account is available before joining.
- Use only the authorized private HTTPS proxy and the dedicated MA test credential
and receivers. GM authorization covers isolated development scenes, test
combatants, playlists, diagnostics, receiver creation and playback. Leave
production campaigns, core, other modules, network infrastructure and
household MA/Sonos targets untouched.
- `.local/live-environment.json` contains the private HTTPS origins and proxy
address. `.local/foundry-development.json` holds the test-world/account mapping.
`.local/ma-token` holds the dedicated token. The private runners read them
directly and load the token through `loadMAToken('.local')` from
`gateway/private-config.mjs`. Pass the directory or file path to tools and
retain the value in process memory. Avoid printing configuration values or raw
auth frames. Do not paste them into an Ollama prompt, transcript or issue.
- Keep `.local/` mode 0700 and private input files mode 0600. Use sanitized
aggregate evidence in Git. Local browser profiles, raw reports, screenshots
and route backups belong under `.local/`. Run the repository audit before
staging or committing anything newly generated.
- Keep source commits and bundles local. Do not access, fetch from, push to,
or publish a release on the Gitea repository.
+153
View File
@@ -0,0 +1,153 @@
# Install and connect — 0.8.3 candidate
## Normal setup
1. Install or update **Adaptive Music** using the existing Foundry manifest URL.
For the staged acceptance build, extract `adaptive-music.zip` into the existing
Foundry user-data `Data/modules/` directory and reload the isolated test world.
The ZIP contains one `adaptive-music/` directory. Do not install the outer release
bundle or source archive as the module.
2. As the single active full Gamemaster, open Settings → Adaptive Music setup. In **Connection**,
enter the private **HTTPS Music Assistant server address** and a dedicated
long-lived token from MA → Settings → Profile. On a trusted browser, check
**Remember credentials and reconnect on this trusted device**. Select
**Connect** to authenticate, provision the receiver and load the catalog.
3. Open a scene’s native **Configure Scene** window. Assign music under
**Adaptive Music** and select **Save assignments**. The Playlists sidebar
also lists draggable MA catalog entries for the scene’s playlist fields.
Use static playlists with available tracks. MA can list an entry whose
tracks are unavailable when Adaptive Music prepares it for playback.
Use the setup window’s **Scene Music** tab for world defaults and optional
combatant-specific boss overrides. For a boss encounter, check **Boss
encounter** in the native Combat Tracker before clicking **Start Combat**
to use the scene’s default boss music.
4. Open **Adaptive Music controls** from the token toolbar or Playlists sidebar.
Enable automation once. The controls show the current track, active playlist
when known, volume, position and listeners. Skip, pause, resume, stop and
repeat control the dedicated queue. The Playback panel and Combat Tracker
show the current music mode. Select **Return to automation** in the tracker
or **Return to scene music** in Playback to clear a manual override.
5. Players, Trusted Players and Assistant GMs can open **Campaign audio** in the
Playlists sidebar. Select **Enable Audio** if the browser requires activation.
Mute and listening volume affect only that user's sound. Foundry saves those
preferences for the user. The GM can use **Enable GM audio** in Playback after
an automatic connection.
The opted-in browser can reconnect on world entry. **Disconnect** ends its live
session and pauses automatic reconnection until you connect again.
**Forget Credentials** also removes the stored token. Reload without retention
requires the token again. The Foundry account remembers an encrypted address and
receiver name. On a different browser, use the same token to unlock the account
record and choose whether that browser may remember it. For a replacement
token, enter the server address again. Revoke obsolete tokens in MA’s Profile
settings. **Advanced → Forget saved connection** clears the encrypted account
record in addition to the device credential.
MA 2.10.6 assigns a restricted token’s API sessions to its most recently connected
web receiver. Use a different token for a simultaneously running native MA web
player. New MA playlist assignments are portable across browsers with the same
token, origin and Foundry world. A legacy reference can be migrated by saving
its assignment again in the browser that created it. Another browser can reselect
the playlist. A replaced token can require reassigning the old references.
Keep the GM tab open while serving audio. The setup window is independent of
playback. Automatic reattachment preserves a populated queue until the next
scene or combat music cue. You can also select **Return to scene music** to take
control immediately. If you use Adaptive Music for a scene, leave the scene’s
native soundtrack playlist unset. Foundry still controls sound effects and
AmbientSound documents. Sequential fades use one dedicated queue, and pause
remembers the position for the active GM session.
## Connection diagnostics
Connection shows authentication, receiver setup and catalog progress. **Check browser
connection** tests both WebSocket routes from the actual Foundry page without sending
an MA authentication frame. Normal browser cookies can accompany the handshake.
**Copy connection diagnostics** supplies a report without address, token, receiver
keys or playlist titles. No browser developer console is required.
| Result | Action |
| --- | --- |
| Enforced CSP block | Have the host administrator review an exact trusted WSS-origin allowance in the existing connect-src policy. Do not remove CSP or allow all origins. |
| Socket fails before opening | Compare this browser’s MA page, private DNS/routing and local-network site permission. Browser APIs conceal the precise HTTP/TLS failure. |
| API auth denied | Enter a valid token; the remembered receiver is retained. |
| Sendspin auth/pair/sync fails | Check the separate authenticated /sendspin route and the account’s web-player control permission. |
| Dedicated queue unavailable after pairing | Retry connecting the remembered receiver after MA has registered its queue. |
| Frames arrive but audio is suspended | Select Enable GM audio or the player’s Enable Audio once. |
| Listener fails negotiation | Check its diagnostics and existing network/ICE route. It is automatically retried after timeout. |
| MA error 2 on playlist startup | MA could not find playable media even if catalog metadata exists. Check that content/provider in MA; this is separate from a WebSocket upgrade failure. |
| Receiver queue access withdrawn | Ensure another web receiver is not using the same MA token. Review dedicated receiver access before reconnecting. |
| Unknown queue write | Review the dedicated queue, then deliberately reconnect; no blind retry occurs. |
Use trusted HTTPS for Foundry and private HTTPS/WSS for both MA `/ws` and `/sendspin`.
Keep Nginx access restrictions, Origin, certificate validation and browser protections.
Keep MA raw-frame VERBOSE logging disabled. No public API/proxy, core modification,
additional container, service, VM or LXC is required by this module. A direct HTTP MA
address cannot be used from HTTPS Foundry. Default ICE does not use a public relay;
remote players still need a viable existing WebRTC path.
If your listeners need an existing private relay, enter it under Connection →
Advanced. Relay credentials expire and stay in the active GM tab. Enter a fresh
relay credential after reloading the GM tab.
See [TESTING.md](TESTING.md) for private-route evidence and
[USER-ACCEPTANCE.md](USER-ACCEPTANCE.md) for the Mac checklist.
## Install the candidate on an isolated development instance
Foundry loads modules from its instance-wide user-data directory. Use only a
development-only data directory. If the existing world shares an instance with
production worlds, use an isolated development instance and a development-world
copy. The multiplayer baseline was v0.8.1.
Unzip the complete release bundle on the development host and run these
commands as the Foundry data owner. Set the first two variables to the existing
development-only `Data` directory and the extracted release directory.
Stop the development instance with its normal service controls before swapping
the module directory.
```sh
(
set -eu
FOUNDRY_DEV_DATA='/absolute/path/to/development-only/Data'
AM_RELEASE_DIR='/absolute/path/to/extracted/v0.8.3'
cd "$AM_RELEASE_DIR"
grep ' adaptive-music.zip$' SHA256SUMS | sha256sum -c -
test -d "$FOUNDRY_DEV_DATA/modules"
AM_STAGE=$(mktemp -d "$FOUNDRY_DEV_DATA/adaptive-music-v083.XXXXXX")
unzip -q adaptive-music.zip -d "$AM_STAGE"
test -f "$AM_STAGE/adaptive-music/module.json"
if [ -d "$FOUNDRY_DEV_DATA/modules/adaptive-music" ]; then
mv "$FOUNDRY_DEV_DATA/modules/adaptive-music" "$AM_STAGE/previous-adaptive-music"
fi
if ! mv "$AM_STAGE/adaptive-music" "$FOUNDRY_DEV_DATA/modules/adaptive-music"; then
if [ -d "$AM_STAGE/previous-adaptive-music" ]; then
mv "$AM_STAGE/previous-adaptive-music" "$FOUNDRY_DEV_DATA/modules/adaptive-music"
fi
exit 1
fi
printf 'Rollback directory: %s\n' "$AM_STAGE"
)
```
Restart the development instance, launch the development world and confirm
**Manage Modules** reports **0.8.3**. Enable the module if needed, then sign in as
**CodexDEV** and follow the acceptance checklist. For rollback, shut down the
development instance, move the candidate module out of `Data/modules` and move
`previous-adaptive-music` from the printed rollback directory back to
`Data/modules/adaptive-music`.
## Manual Gitea publication
The existing stable manifest and versioned download mechanism is preserved:
- Manifest: `https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/raw/branch/main/module.json`
- v0.8.3 asset: `https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/releases/download/v0.8.3/adaptive-music.zip`
These are the established repository’s URLs; this work never contacted Gitea or
verified public asset availability. After acceptance, manually publish the included
source to your existing repository, create tag/release `v0.8.3`, attach
`adaptive-music.zip` and the included manifest/checksums, and update the branch
manifest only after its versioned asset exists. The outer bundle includes full
source, docs, licenses, metadata and SHA256SUMS. Keep the previous immutable release
assets for rollback. To roll back, restore the prior branch manifest/module ZIP;
MA queues and remembered browser identities are not automatically deleted.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 CheddahBoxMB
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+200
View File
@@ -0,0 +1,200 @@
# Adaptive Music progress — 0.8.3 music bar
## v0.8.3 floating controls
The floating bar gives players a direct route to activation, local volume and
mute. The GM has independent local listening controls, shared campaign volume,
track skip and a shortcut to the detailed Playback window. Campaign pause
holds automated music cues and preserves the active queue's position. Play
selects the current cue when it changed during the hold.
Development-world acceptance is pending. The test route returned Foundry's
no-active-game message. See [TESTING.md](TESTING.md) for the automated scope
and [USER-ACCEPTANCE.md](USER-ACCEPTANCE.md) for the installed checks.
## v0.8.2 release-blocking regression
The operator passed v0.8.1 combat, initiative, boss, restoration, manual controls
and audio quality. They then reported that a late join stopped the host and
emptied the catalog. Development GUI tests kept audio running for Player and
Trusted Player, and reproduced the failure with an Assistant GM while the
original GM's Foundry socket stayed connected. The v0.8.1 host predicate used
the broader Foundry `isGM` flag for exclusive Music Assistant authority.
The v0.8.2 predicate considers the full Gamemaster role and treats the
Assistant GM as a listener for this module. Join and logout reconciliation
uses Foundry's connection event as well as User updates. Campaign audio
offers per-user mute, volume and status through one existing listening window.
Independent Chrome and Firefox sessions in the development world passed late
and simultaneous joins. All three regular listeners received decoded audio, and
the Assistant GM's join and departure kept the host playing. Player-side mute
and volume affected only that player and persisted across logout and login.
Combat, Boss, Ambient restoration, scene changes and manual playback passed
with three listeners connected. Across six minutes of playback the GM and
all listeners had measurable audio at 30 of 30 checks. The GM's remembered
credential reopened the same receiver with the queue intact, and all three
listeners recovered. The v0.8.2 bundle is staged under `dist/releases/v0.8.2/`.
See [TESTING.md](TESTING.md) for scope and [USER-ACCEPTANCE.md](USER-ACCEPTANCE.md)
for the exact installed build. The separate macOS Firefox connection failure
still needs the operator's private-route diagnostics.
## Installed v0.8.0 manual acceptance
The operator confirmed on macOS that Chrome connected and retained credentials
after a full quit and reopen. Automatic scene playlist activation, background-tab
audio, WAN player audio and smooth transitions passed. The operator reported
that stuttering and crackling were resolved in their testing. Firefox
connectivity failed. A follow-up confirmed the battle playlist played when
assigned to ambient, while tracked combat left ambient unchanged. The operator
could not find boss designation. The operator subsequently passed the corrected
workflow in v0.8.1.
## v0.8.1 combat correction
The installed v0.8.0 reproduction used the native token HUD and Combat Tracker
on Foundry 14.371 and D&D 5e 6.1.2. Start Combat committed round 1 and turn 0
for an unlinked encounter with a token in the active scene. The module required
an explicit encounter scene and kept its ambient queue. The correction considers
the unlinked encounter's combatant scenes and reconciles from the committed
lifecycle. The Combat Tracker now lets the GM mark a boss encounter and return
to automation. Both the tracker and Playback panel identify the current cue.
The Chromium candidate preview verified the native tracker workflow with three
distinct playlists. Turn and round changes kept the combat cue, canceled End
Combat kept the encounter running, and confirmed end restored ambient after
normal, boss, and manual-override encounters. The scene excursion preserved the
interrupted ambient position. The manual override was visible in the tracker and
released to Combat through **Return to automation**.
The headed Firefox preview repeated the normal tracker lifecycle and restored
ambient at 9 seconds. The operator passed the v0.8.1 combat acceptance.
## v0.8.1 status
The clean local v0.8.0 release commit was reconciled against the original
workspace and the installed runtime. The original Git metadata is read-only
and the operator's published commit `95b0427` is absent locally. Both local
trees had identical source before v0.8.1 work. The installed v0.8.0 manifest
and all 28 runtime files matched the local release baseline.
Stock Firefox 161.0.1 on Ubuntu opened both private WSS routes from the
anonymous Foundry page and the MA origin. The isolated policy fixture
distinguished enforced CSP and kept Origin and certificate failures opaque.
The v0.8.1 diagnostic candidate records route timing, permissions after
the probe and the failed Connect stage without copying arbitrary error text.
The source change is confined to the connection diagnostics and their UI.
The macOS failure remains open pending the
[Firefox capture](USER-ACCEPTANCE.md#capture-the-firefox-failure).
The v0.8.1 regressions passed 115 JavaScript and 17 Python tests, plus the
Chromium, Firefox and Linux WebKit setup fixtures. Repository and upstream
verification passed. npm audit reported zero vulnerabilities. The complete
diagnostic candidate bundle is staged locally under `dist/releases/v0.8.1/`.
## Historical v0.8.0 automated audit
The operator confirmed that installed v0.7.2 plays MA audio in Chrome on a Mac.
The v0.8.0 work uses that baseline and retains the dedicated receiver architecture.
The release bundle is generated locally using the existing manifest mechanism.
The independent audit reproduced the three-engine PCM, credential and setup fixtures.
The original Firefox soak restored the ambient queue at index 0 and 37 seconds,
then ended with roughly 763 seconds of continuous listener silence. Its
listener re-enable step failed. The revised test enables repeat on the dedicated
queue and fails an interval when digital silence exceeds four seconds, rendered
frames stall or a playback meter disappears. A 30-minute timer alone never
satisfies continuity acceptance.
The corrected headed Firefox run passed 1,800 seconds in the actual development
world using runtime assets served from the validated ZIP. It restored the queue
order, track index and 37-second position. The GM and both listeners rendered
throughout the measured phases. Listener Stop/Enable and reload recovered audio.
The GM recorded zero scheduler underruns and both listener meters counted 608
near-zero runs of 0.75–80 ms in restored ambient. Their longest digital silence
was 449 ms. RTP concealment stayed flat during the measured phases.
The audit fixed catalog updates in an already rendered Playlists sidebar,
preserved the playback position when ambient and combat share a playlist,
allowed finished static queues to survive interruptions without briefly
playing on restore, and tightened receiver permission and credential recovery.
The release validator checks the complete ZIP inventory and the pinned SDK
provenance. The browser harness can serve runtime assets from that ZIP while
Foundry continues to report its server-installed version.
Chromium verified native scene assignment and dragging, both playback launchers,
combat and boss rules, ambient restoration, manual override and transport.
It reconnected the same receiver with the device credential after reload and
preserved the dedicated queue. Disconnect and Forget Credentials prevented
automatic reconnection.
The headed Chromium review verified continued audio for the hidden GM tab and
both listeners over a 12-second measurement.
The Firefox follow-up measured live listener audio before switching tabs. The
GM document continued reporting visible under automation. Firefox hidden-tab
continuity remains open.
The final audit configured **Christmas — Adaptive Music demo** and
**Dûr-Khazrak — Adaptive Music demo** as the two existing demo scenes. Christmas
is active with its seasonal MA playlist. Dûr-Khazrak has distinct ambient,
combat and boss cues and an unstarted encounter. Its ambient cue uses a
development playlist as a stand-in for a dwarven soundtrack.
The pre-commit release regressions passed 110 JavaScript and 17 Python tests.
Repository privacy and attribution, pinned upstream provenance and both npm
audit scopes passed. A three-engine Linux browser fixture verified full profile
restarts, remembered credentials, forgetting and denial after synthetic-token
revocation. Live MA-side token revocation and actual Mac browser tests remain
open.
## Defects
| Defect | Implemented and tested | Remaining acceptance |
| --- | --- | --- |
| AM-001 layout | Actual Foundry v14.371 ApplicationV2 at 380/640px; Chromium fixture at 380/640/1000px | Operator’s logged-in-world theme |
| AM-002 provisioning | SDK-created identity, authenticated dedicated web-receiver pairing, no normal JSON import; real MA tests | Normal installed-world flow on Mac |
| AM-003 diagnostics | Per-route upgrade/CSP checks, staged auth/pair/sync errors, output counters and copyable GM connection report | Original Mac failure report if it persists |
| AM-004 retry retention | Tab-private draft; encrypted receiver vault; token/identity origin binding; Firefox and Chromium reattached after transport loss and reload without replacing the queue | Mac reload/retry/network lifecycle |
| AM-005 cross-origin | Both WSS routes open through private Nginx in Ubuntu Chromium and Firefox, including stock Firefox 161.0.1. Chromium authenticated and paired in the earlier installed-world run. The MA front end’s unauthenticated Sendspin interceptor explains the failing historical control probe. | Mac Firefox connectivity fails. The current failure stage awaits browser capture. |
| AM-006 setup usability | The three browser engines passed the narrow setup fixture. The v0.8.0 ZIP preview exercised real connection, scene assignment and transport. | Exact v0.8.1 installed-world acceptance |
| AM-007 continuity | Firefox ZIP preview passed 30 minutes across real combat and restoration. Three-engine renders at 44.1 and 48 kHz passed the PCM comparison. The operator confirmed macOS background audio, physical output during testing and WAN audio. | Firefox hidden tab and suspend/wake |
| AM-008 credentials | Three-engine encrypted device storage across browser restarts and synthetic auth denial. Real Chromium token-free reload, Disconnect and Forget Credentials. | Separate Mac profiles, live disposable-token revocation and token rotation |
| AM-009 native integration | The Chromium ZIP preview saved native scene assignments with a pointer drag and exercised scene, combat and boss transitions. The operator confirmed scene auto-activation in v0.8.0. | Manual combat, boss and ambient restoration |
| AM-010 controls | Token-toolbar and playlist-sidebar launch points, transport, manual override, return to scene and fades through the dedicated MA queue. | True overlapping playlist crossfade |
| MA catalog playback | The installed module delivered audio to two real Foundry players during ambient, combat and restoration to a seven-second offset. Stop/Enable and reload were exercised. | Physical devices, invitation renewal and WAN acceptance |
## Technical findings
- The operator’s scoped firewall exception enabled TCP 443 and trusted TLS to the
private Nginx proxy. The test verified the proxy peer before signing in on the
normal Foundry hostname. The signed-in page had no enforced CSP header or meta
policy and both MA WebSocket upgrades returned HTTP 101.
- Browser playback analysers measured audio on both real Foundry listeners even
while Chromium’s inbound RTP energy statistic reported zero. The integration
test uses the rendered playback signal. No module runtime change was required.
- MA grants a new browser receiver access through API sessions authenticated before
Sendspin auth. Replacing the API socket breaks a restricted account’s access.
- Firefox reached an available paired receiver before MA returned its queue. Setup
now waits briefly for a missing queue on the same session. The regression fixture
exercises the delayed reply; the live follow-up received the queue immediately.
- A new receiver’s volume is initially null. SDK software volume avoids that startup
dependency and provides campaign volume without controlling unrelated players.
- Firefox adds a session sendrecv default after ICE gathering. Correct SDP validation
honors the audio media recvonly override and still rejects sender/video/data offers.
- MA sends PCM roughly four seconds ahead. The old two-second scheduler cutoff dropped
most real audio; bounded six-second scheduling and timestamped clears address it.
- MA 2.10.6 Sendspin has no native pause. Logical stop-plus-position pause is implemented
and tested, including paused restoration without briefly playing.
- Five-minute snapshot expiry was too short for combat. Signed active-session snapshots
now last up to 12 hours and remain campaign/session/fence/generation-bound.
The live follow-up records real PCM and two listener signals, emulated pause, seek,
resume, volume, and queue restoration in Firefox and Chromium. Earlier catalog
startup failed with MA `MediaNotFoundError` in both engines. The cause of those
failures remains unconfirmed. The controller preserves the failed command and skips
rollback after an uncertain write. See `evidence/v0.7.0-live-follow-up.json`.
The earlier server-installed evidence is in `evidence/v0.7.0-foundry-private.json`.
The installed v0.8.0 manual results and remaining checklist are in
[USER-ACCEPTANCE.md](USER-ACCEPTANCE.md). See [TESTING.md](TESTING.md)
for the v0.8.1 fixture results and investigation.
The single queue supports sequential
fades. Durable crash restoration, seamless handover and WAN synchronization remain
unsupported.
+37 -1
View File
@@ -1,2 +1,38 @@
# adaptive-music # Adaptive Music — 0.8.3 candidate
Independent open-source Foundry VTT music automation by **CheddahBoxMB**, targeting
Foundry v14.371 and Music Assistant 2.10.6. The module runs independently of the game
system and uses a single installable Foundry ZIP.
In **Connection**, enter your private HTTPS Music Assistant address and a revocable
Music Assistant token. On a trusted GM device, opt in to **Remember credentials and
reconnect on this trusted device**. Assign ambient, combat and boss playlists in
native **Scene Configuration**. Enable automation once. Open **Adaptive Music
controls** from the token toolbar or the Playlists sidebar during play. The setup
window can close.
The active scene starts its assigned music. Starting an encounter in the Combat
Tracker interrupts ambient and ending it restores the saved track and position.
Check **Boss encounter** before starting to use the scene's default boss cue.
The tracker and playback controls show Ambient, Combat, Boss or Manual Override.
GMs can pause, resume,
skip, stop, set repeat, adjust volume, apply a manual playlist and return to scene music.
Players can open **Campaign audio** from the Playlists sidebar to check their
connection, enable sound, mute, or adjust their own volume. Audio comes from the
full GM's browser. Personal listening preferences are saved to the Foundry account.
The floating **Adaptive Music** bar opens on world entry. Drag its title to
move it or select **Hide** to collapse it. **My volume** and **Mute** control
the current browser's Adaptive Music stream. The GM also gets **Campaign
volume**, **Skip track**, and one-click access to the full **Playback controls**.
**Pause all music** pauses the campaign for every listener and holds automatic
cues. **Play all music** resumes the saved position or plays the cue that now
applies if the scene or combat changed while paused.
The GM browser hosts Music Assistant playback and player WebRTC connections. Keep
that tab open. The encrypted device credential stays in the browser profile where
the GM opted in. An additional device can unlock the Foundry account’s remembered
address with the same token and choose its own retention preference.
See [INSTALL.md](INSTALL.md) for setup, [SECURITY.md](SECURITY.md) for credential
scope, and [TESTING.md](TESTING.md) for measured behavior and remaining acceptance.
+86
View File
@@ -0,0 +1,86 @@
# Adaptive Music security — 0.8.3
## Credentials and browser trust
By default the MA access token remains in the GM tab’s memory. A GM can opt in
to an encrypted IndexedDB record for this trusted browser profile. A separate,
non-extractable AES-GCM key and random nonce protect the record, which is bound to
the Foundry origin, world and user. Use a dedicated, high-entropy, revocable token
from Music Assistant’s Profile settings. Tokens are excluded from Foundry
settings, flags, sockets, URLs, diagnostic output and release archives.
Local encryption protects against casual inspection of plaintext storage. Same-origin
scripts, enabled modules and the browser profile owner can use the retained key.
The device credential does not travel to another browser with a Foundry login.
Use a separate browser profile for accounts that should never share local trust.
Disconnect ends playback and disables automatic reconnect until the GM connects
again. Forget Credentials removes the device credential and ends the connection.
More extensive cleanup is available under Advanced → Forget saved connection.
Foundry’s user-scoped address record still holds only a version, nonce and
ciphertext. It can be unlocked on another device with the same token. Rotating the
token requires entering the MA address again. MA catalog references created with
the former token can need reassignment. Receiver private material has its own
encrypted browser record, paired to the dedicated target.
Private development endpoints, tokens, identities, account/catalog results and
snapshots remain under ignored .local/ (0700; secret files 0600). MA raw WebSocket
frames can include credentials at VERBOSE logging. Keep raw-frame logging disabled;
the module does not change production log settings. Expanded operator authorization
covers the dedicated live development tests; no production infrastructure was changed.
The release audit checks nested archives for private test inputs and keeps the
development-world account mapping in its ignored configuration file.
## Network and authority
Trusted HTTPS Foundry and private HTTPS/WSS MA are required. TLS validation, browser
security, Origin and private access controls remain enabled. No public MA endpoint,
Origin forgery, CORS wildcard change or unrestricted proxy is introduced. Both `/ws`
and `/sendspin` must reach their authenticated MA routes. Token-free diagnostics
send no explicit MA auth frame; browsers may still send their normal ambient cookies.
The copyable report adds route timing and an allowlisted setup failure code and
stage. Arbitrary error strings and connection inputs stay out of those fields.
Browser APIs do not expose arbitrary HTTP/TLS errors and diagnostics do not invent
those causes.
Only the SDK-generated and locally remembered campaign receiver is paired or
controlled. The account-bound pairing API is used after the API session is bound
by Sendspin authentication. Exact identity/name/provider, enabled/available state,
standalone topology and own active queue are checked before writes. No household
selection, grouping, transfer or global stop is offered. Unknown writes latch closed.
Queue snapshots are signed and campaign/session/fence/generation-bound; later
sessions reject them. Browser authority cannot replace a distributed server fence.
Player, Trusted Player and Assistant GM sessions receive scoped, expiring audio
capabilities. The module grants Music Assistant controller authority only to the
sole active full Gamemaster. The listener interface can change the current
Foundry user's local output settings. This uses a separate User Setting with
only volume and mute values. The GM's personal volume and mute use the local
monitor branch. The campaign pause uses the existing authorized queue commands
and the explicitly owned native fallback when active.
Foundry still enforces the world's document permissions. The Assistant GM role
can carry world administration privileges independently of Adaptive Music's
controller role.
Public ephemeral keys on permission-controlled User documents authenticate invitation
delivery. Both ordinary test players were denied a write to the GM’s User flags in
the installed development world. SDP is encrypted, bounded, replay protected and validated for a single audio
direction with media-level inheritance. Expiry ends the signaling capability.
An established media stream remains tied to the authorized listener and active
GM session. No microphone, video or data channel is requested. Audio uses DTLS-SRTP.
Recipients can record audio or disclose their own capability. Direct peers can
learn network addresses. No public STUN/TURN is silently configured. Optional existing ICE URLs and short-lived TURN credentials are entered in the GM interface, kept in tab memory, and delivered only inside the encrypted per-player invitation.
## Recovery and distribution
API/Sendspin loss stops automation and listener forwarding. Retained tab inputs
support deliberate reconnect. A trusted device can also reauthenticate after a
transport outage. Attachment preserves an owned nonempty queue. Unknown writes
and loss of dedicated queue permission require review before restoring automation. Logical pause
and interruption snapshots do not survive a reload. Native fallback cannot silently
resolve an uncertain remote queue.
The release builder is offline, preserves the existing Gitea update mechanism,
checks import/assets closure, SDK hash, licenses, privacy patterns and checksums,
and includes complete source. No new distributed dependency, runtime CDN, upstream
install hook, telemetry, core patch or mandatory companion service was added. The
pinned SDK and noble notices remain intact. No Git host was contacted.
+1
View File
@@ -0,0 +1 @@
1ed6b4c8ccd35e1187b83003379fe05d3cbeed8a
+423
View File
@@ -0,0 +1,423 @@
# Adaptive Music verification — 0.8.3
## Executed evidence
The source archive includes sanitized evidence separately from private .local inputs.
### v0.8.3 floating music bar
The JavaScript regression suite covers cue changes while paused, same-queue
resume, native ambient position, failed transitions and canceled authority.
The GM audio graph test checks that the local monitor and the listener output
are on separate branches. Chromium, Firefox and WebKit DOM fixtures exercise
player and GM controls, personal and campaign volume, pause and play, and the
bar's collapse and drag controls. All 122 JavaScript and 17 Python tests passed.
Repository and upstream checks passed, and npm audit reported zero vulnerabilities.
The development server reported no active game session at the join screen, so
live v0.8.3 acceptance remains pending.
### Installed v0.8.1 operator follow-up
The operator confirmed combat automation, initiative advancement, boss music,
ambient restoration, manual controls and audio quality. The multiplayer report
was a separate failure. When another user joined, playback stopped and Scene
Music lost its catalog until that user left.
### v0.8.2 multiplayer reproduction
With v0.8.1, the GM started audio and had a populated catalog before any other
account joined. Independent GUI logins as Player and Trusted Player kept the
GM catalog and each listener received audio. Joining as Assistant GM reproduced
the reported audio and catalog failure. Foundry reported one active full
Gamemaster and two active `isGM` users. The GM's two MA sockets closed while the
Foundry socket remained connected. The previous authority check counted
`isGM` users and its User update handler closed the GM audio host and emptied
the catalog when the count rose above one.
Earlier multiplayer runs joined the GM and two ordinary players before starting
music. Those runs exercised real audio and permissions, and missed both the
late join during active playback and Foundry's Assistant GM role distinction.
v0.8.2 uses the full Gamemaster role for the exclusive controller and uses the
documented connection hook to reconcile listener joins and departures.
The role of the account in the operator's original report was unspecified.
[Foundry User API](https://foundryvtt.com/api/v14/classes/foundry.documents.User.html),
[role constants](https://foundryvtt.com/api/variables/CONST.USER_ROLES.html),
and [userConnected hook](https://foundryvtt.com/api/functions/hookEvents.userConnected.html).
### v0.8.2 live multiplayer candidate
The authorized Foundry 14.371 development world ran the package's runtime via
browser preview on Ubuntu using Chrome for Testing and Firefox. Foundry still
reported the server-installed v0.8.1, which independently matched all 28 files
from the local v0.8.1 runtime. The preview used normal browser TLS checks and
real Foundry accounts. It measured the host output and decoded listener audio.
The GM started music alone. A Chrome Player joined first, then a Firefox
Trusted Player and Chrome Player joined together. An additional Assistant GM
joined and left in Firefox. The GM kept its receiver, both MA sockets and all
13 catalog choices. A Player's 25% volume yielded about one quarter of its
input RMS. Mute brought that player's local output to zero while it continued
receiving audio, and the GM and other listeners kept hearing audio. A fresh
login retained the Player's mute and volume. Both Player and Trusted Player
were denied changes to shared automation and a test scene's music flags.
The world used distinct ambient, combat and boss playlists. All three listeners
followed the native tracker cues, ambient restoration, scene activation and
manual playback. The normal encounter used an unstarted Foundry fixture after
the automation pointer missed the token HUD. The boss encounter used the
native token HUD. Both used the native Combat Tracker to roll initiative,
start and end combat. Ambient restored to track index 0 at 41 and 66 seconds.
Over 360 seconds, the GM catalog and sockets stayed stable. The GM and all
three listeners had a measurable signal at 30 of 30 checks, and each listener's
received bytes and audio samples advanced at every interval. The remembered GM
credential reattached to the same receiver after reload, kept the queue and
restored audio to all three listeners. Player sessions made zero requests to
MA. The test restored the development world, and all MA queue writes targeted
the dedicated receiver.
The automated suite passed 117 JavaScript and 17 Python tests. The Chromium,
Firefox and WebKit setup and credential fixtures passed, including browser
restart and fixture revocation. Repository and upstream audits passed. npm
audit reported zero vulnerabilities. Measurements and scope are recorded in the
[sanitized v0.8.2 evidence](evidence/v0.8.2-live.json).
### Installed v0.8.0 manual macOS acceptance
The operator confirmed Chrome connectivity, retention after a full Chrome quit
and reopen, automatic scene playlist activation, background-tab audio, WAN
player audio and smooth transitions. Stuttering and crackling were resolved
during testing. Firefox connectivity failed. In the combat follow-up, the
operator reported that a battle playlist played when assigned to ambient,
while native combat use left the ambient cue playing. They could not find
the boss designation. The operator later passed the corrected combat flow and
manual playback controls in v0.8.1.
### v0.8.1 native Combat Tracker investigation
Tested Foundry **14.371** and D&D 5e **6.1.2** in the authorized development
world. The baseline used installed v0.8.0 and the GM entered a token into
combat through its native HUD. The tracker created an active, unlinked
encounter with one combatant belonging to the active scene. On **Start Combat**,
`combatStart` arrived at round 0 with `started=false`. The subsequent
`updateCombat` and `combatTurnChange` reported round 1, turn 0 and
`started=true`. The baseline made no dedicated queue transition, reproducing
the failure without calling a module API or injecting encounter state.
Foundry v14's `Combat.scene` is optional in practice and its unlinked encounters
are visible across scenes. `Combatant.sceneId` identifies the token's scene.
D&D 5e's `Combat5e` at `75750bf1b8bd79f8448af40495c8bb5c99f49551`
delegates start, end and update/delete processing to Foundry core and adds
system-specific resource and token behavior. Adaptive Music uses
the committed document hooks and accepts explicit scene links or the token
scenes in an unlinked encounter. A turn or round change leaves the cue intact.
The Chromium package preview used three distinct playlists. A native token HUD
and native tracker controls verified adding combatants, rolling initiative,
starting an encounter, advancing turns and rounds, and canceling or confirming
End Combat. Neither preparation nor canceled End Combat changed the cue.
Confirmed End Combat restored the ordered ambient queue at track index 0 and
30 seconds. The **Boss encounter** checkbox selected the scene's default boss
cue on the next encounter. A scene excursion using Foundry's scene activation
operation played the other scene's ambient, then selected Boss on return.
Ending the boss restored the original ambient at 33 seconds. A manual silence
override displayed an explicit warning during the next encounter. **Return to
automation** selected Combat, and End Combat restored ambient at 46 seconds.
The test measured GM output and restored the development world afterward.
Headed Ubuntu Firefox 159 repeated the native token HUD, initiative, start,
turn and round, canceled end, and confirmed end checks against the same
candidate runtime. It measured GM output and restored ambient at index 0
and 9 seconds. Both candidate previews ran on Foundry 14.371 and D&D 5e 6.1.2
with server-installed metadata reporting v0.8.0.
[Foundry Combat Tracker guide](https://foundryvtt.com/article/combat/),
[combatStart hook](https://foundryvtt.com/api/v14/functions/hookEvents.combatStart.html),
[Combatant API](https://foundryvtt.com/api/v14/classes/foundry.documents.Combatant.html),
and [D&D 5e 6.1.2 Combat implementation](https://raw.githubusercontent.com/foundryvtt/dnd5e/75750bf1b8bd79f8448af40495c8bb5c99f49551/module/documents/combat.mjs).
### v0.8.1 Firefox transport investigation
The downloaded Mozilla Firefox 161.0.1 Linux archive matched Mozilla's SHA-512
listing. Real stock Firefox over the authorized private route opened native
`/ws` and `/sendspin` WebSockets with HTTP 101 from the anonymous Foundry
page and the MA origin. The test used a process-local mapping to the authorized
private proxy and normal certificate verification. No credentials were entered.
The MA page replaces its WebSocket constructor, so its control used the
native constructor retained before page script execution.
Separate live runs with stock Firefox 161.0.1 on Ubuntu also signed into the
development world, authenticated to MA and measured scene audio at the GM and
a second Foundry login. Those runs covered installed v0.8.0 and the earlier
diagnostics-only v0.8.1 browser preview.
Seven isolated stock-Firefox policy cases covered trusted cross-origin and
same-origin upgrades, enforced and report-only CSP, server-side Origin
rejection and a mismatched WSS certificate. Origin and TLS failures remained
opaque to page script. The permission API reported `prompt` even on a private
route that worked, so that reported state does not determine the cause.
Firefox's site-level local network permission and the macOS app-level permission
are separate. Record whether MA's normal HTTPS page works in the failing Firefox
profile. If it fails, verify the displayed error and compare the profile's
existing DNS and proxy settings. If MA loads, compare the two Foundry WSS routes
and look for local-network or CSP console messages. A reverse proxy's
timestamped path and response status can distinguish a received handshake
from a failure before it reached the proxy. The pinned MA 2.10.6 handlers
authenticate after upgrade. Ordinary HTTP CORS settings do not establish
authorization for a WebSocket Origin. Keep browser, TLS and proxy policy in place.
See [the Firefox capture instructions](USER-ACCEPTANCE.md#capture-the-firefox-failure),
[Mozilla local-network permissions](https://support.mozilla.org/en-US/kb/control-personal-device-local-network-permissions-firefox)
and [MDN's CSP connect-src reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/connect-src).
### v0.8.0 handoff checkpoint
The v0.8.0 browser preview reached the actual Foundry development world through
the private HTTPS proxy. Earlier native MA reference playback reproduced a
restricted-token receiver reassignment during the Firefox test. The handoff
soak restored the ambient order and the saved position at 37 seconds, but both
listeners recorded about 763 seconds of terminal digital silence and Stop/Enable
could not verify renewed audio. The original result fails the continuity gate.
The updated soak enables repeat on its dedicated playlist and measures GM and
listener output, including silent render blocks. Each phase requires at least
95% of the expected output frames and no digital silence longer than four
seconds. See [HANDOFF.md](HANDOFF.md) and `evidence/v0.8.0-live.json`.
The corrected Firefox 159 run passed in the real development world with one GM
and two players. The validated archive supplied the v0.8.0 runtime assets. The
continuity phases totaled 1,800 measured seconds. Across the full session,
the GM scheduled 74,261 PCM chunks with zero late or early drops, source gaps,
overlaps, overruns or underruns. Ambient order and
index 0 at 37 seconds were restored after combat. Listener Stop/Enable and reload
recovered audio. RTP concealment stayed flat within the measured phases. Both
listener meters counted 608 near-zero runs of 0.75–80 ms in restored ambient,
with a longest digital silence of 449 ms. The test measured the digital playback
graphs in the browser.
The Chromium package preview passed native scene rendering and saved assignments
in two scenes, including a pointer drag from the Playlists sidebar. Both the
sidebar and token toolbar opened the controls. Real scene, combat and boss cues
reached both players and restored the saved ambient track and offset. A prior
review stopped at preparation for an unsupported catalog entry before writing the
queue. The review uses three prepared static playlists from the dedicated
catalog. Chromium also passed token-free reload to the same receiver, preserved
the queue, and verified Disconnect and Forget Credentials across reloads.
In headed Chromium the GM page was actually hidden behind another tab for
12 seconds. The GM audio clock advanced and its output analyser measured audio
while both listeners continued playing. This check disabled Playwright's
automatic focus emulation. The longer AudioWorklet measurements were collected
in Firefox.
The focused Firefox background follow-up measured real GM-to-listener audio
before changing tabs. The automation still reported the GM document visible
after a desktop tab switch. Firefox hidden-tab continuity therefore remains an
open acceptance check. The development world's state was restored.
The review restored the development world's settings and active scene. The
final audit configured the Christmas and Dûr-Khazrak demo scenes and activated
Christmas for handoff. The Dûr-Khazrak ambient cue uses an existing development
playlist as a stand-in for a dwarven soundtrack.
[Playwright focus emulation details](https://github.com/microsoft/playwright/issues/31890).
Independently repeated OfflineAudioContext renders in Chromium, Firefox and Linux WebKit
detected gaps with the v0.7.2 packet timing and none in the corresponding
v0.8.0 runs at 44.1 and 48 kHz. Browser IndexedDB and Web Crypto fixtures
verified per-user/world lookup, forgetting, and retained authentication across
full persistent-profile browser restarts in all three engines. The real
WebSocket client rejected the previously saved synthetic token after fixture
revocation. The real MA server was not modified for this check.
The later installed v0.8.0 Mac results are recorded above. Mac Firefox and
native Safari still require device-specific acceptance.
In the loopback WebRTC fixture, Chromium and Firefox both rendered audio across
signaling expiry and closed the sender after listener revocation. Linux WebKit
completed offer/answer with default ICE and timed out before the connection
opened. With a process-local coturn relay and ephemeral credentials it rendered
audio before and after expiry, then closed on revocation. The relay test covers
the existing optional TURN configuration in a local fixture. Native Safari and
the actual WAN route need separate verification.
[Playwright browser coverage](https://playwright.dev/docs/browsers) and
[WebKit ICE candidate considerations](https://webkit.org/blog/7763/a-closer-look-into-webrtc/).
For the live package preview, pass `--package-preview dist/releases/v0.8.0/adaptive-music.zip`
to the private-route runner. It validates and extracts the archive locally,
serves its module assets to the test browsers and records the ZIP SHA-256.
The server's module metadata still reflects the installed version. The preview
exercises the packaged assets and the logged-in development world.
The release metadata also carries an installed asset SHA-256 across `src/`,
`styles/` and `vendor/` so results can be matched across documentation updates.
### Account persistence and v0.7.0 GUI review
The installed v0.7.0 was exercised again through Foundry’s Settings and Adaptive
Music menus. Playwright filled the server address and access token and pressed
Authenticate and Connect audio. The run used the private proxy route with normal
TLS validation and did not replace module assets. The GM saved ambient and combat
assignments on a review scene and confirmed the GM decoder received live audio.
The scene was left in the development world. In the same world, a browser-supplied
v0.7.2 candidate saved an encrypted Foundry User Setting. A new browser session
logged into the same GM account and connected with the token alone. The server
continued serving v0.7.0 during both tests. Closing the GM audio tab ends the
browser-hosted connection. See `evidence/v0.7.2-live.json`.
### AM-006 live graphical workflow
The v0.7.1 interface ran inside the actual Foundry v14.371 development world with
module assets supplied to the test browser by Playwright. The graphical window
passed sizing, horizontal fit, scroll containment, keyboard navigation, Advanced
visibility and input validation at 380 and 760 pixels. Through the private route,
one Connect action authenticated, provisioned the receiver and loaded the catalog.
The GM saved scene assignments and enabled automation through the tabs. Both
listeners measured audio during real combat and ambient restoration to eight seconds.
The Playback tab showed the track and both listeners. Volume, pause, resume and stop
worked through the graphical controls. Listener Stop/Enable and reload also passed.
The earlier private-route timeout and an ambient startup attempt without a queue
write are recorded alongside the passing rerun in `evidence/v0.7.1-live.json`.
Verification of the v0.7.1 ZIP installed on the server is pending.
### Installed development world over private Nginx
- Chromium 159 signed into Foundry v14.371 as the GM and both players. The installed
v0.7.0 module authenticated to MA and paired a dedicated Sendspin receiver. Both
WebSocket routes returned HTTP 101 from the signed-in page, which exposed no
enforced CSP header or meta policy.
- Both players received encrypted invitations through the real Foundry module socket.
Foundry denied both ordinary players’ attempts to update a flag on the GM’s User
document. Both players measured signal in their actual playback graphs during
ambient, combat and restored ambient. The original queue order and seven-second
offset were restored. Audio also returned after Stop/Enable and a player reload.
Chromium’s inbound RTP energy counter stayed at zero while the playback graphs
showed audio, so the test uses the playback signal.
- The MA control page replaces `window.WebSocket` and intercepts Sendspin. Its
unauthenticated interceptor failed the bare `/sendspin` probe. The native browser
constructor opened the same URL from the same page in Chromium and Firefox.
The original Mac-specific AM-005 failure did not reproduce on this Ubuntu route.
The Ubuntu Firefox build completed transport checks. Its Foundry join UI failed
to render in this environment, which could not create a WebGL context.
See `evidence/v0.7.0-foundry-private.json` for the installed-world results.
### Earlier browser and source-overlay checks
- Ubuntu Firefox 159.0 and Chromium 159.0.8154.6
authenticated from Foundry’s origin and MA’s origin and retrieved seven providers.
The unauthenticated Foundry page returned no enforced CSP header or meta policy.
- Both browsers paired a dedicated MA web receiver, completed Noise and clock sync,
and loaded eleven catalog playlists.
- Firefox 159 and Chromium 159 delivered real MA audio to two WebRTC listeners
after one activation click each. Both listeners measured audio during ambient,
combat and restored ambient. The runs exercised emulated pause, seek, resume,
volume, ordered track/offset restoration and final queue restoration.
- Both browsers reconnected the same receiver after an induced Sendspin disconnect
and browser reload. Reattachment preserved the idle nonempty queue without
writes, retained the identity without the token and rejected a stale snapshot.
- One Firefox startup received an available player but no queue. Startup now waits
briefly for that queue to register. The delayed reply is covered by a regression
fixture. The passing live playback follow-up received the queue on the first read.
- The browser source assets were supplied locally by Playwright under the deployed
Foundry origin. Controller inputs were explicit scene/combat states and signaling
used an encrypted-envelope relay through the test runner. This was not an installed,
logged-in Foundry world or real Foundry socket/user-permission test.
- Actual deployed Foundry v14.371 ApplicationV2 rendered the setup at 380/640px with
in-memory sample documents. Real IndexedDB receiver vault reopen, user isolation,
token exclusion and forgetting passed. No world documents were changed.
- Real browser signaling exposed Firefox’s session-default SDP inheritance; its fix
was retested in Firefox 144.0.2 and Chromium 143.0.7499.4.
Trusted local-CA HTTPS/WSS policy tests cover
allowed cross-origin, enforced/report-only CSP and server Origin rejection.
See `evidence/v0.7.0-live-follow-up.json`, `evidence/v0.7.0-live.json`,
`evidence/foundry-application-v070.json` and `evidence/v0.7.0-checks.txt` in the source
archive. Earlier Firefox and Chromium runs received MA `MediaNotFoundError` (code 2)
during playlist startup despite playable track metadata. Its cause remains
unconfirmed. Those failures are retained alongside the passing follow-up. The live
runs used dedicated MA development receivers exclusively.
## One consolidated Mac / logged-in-world acceptance
Use [USER-ACCEPTANCE.md](USER-ACCEPTANCE.md) for the step-by-step Firefox and
Chrome checks against the prepared demo scenes. The following procedure records
the broader installed-world and WAN acceptance scope.
Run this in an isolated test world with the actual Foundry v14.371 host and existing
private HTTPS MA endpoint. It needs no developer console or diagnostic shell commands.
1. Install the staged module ZIP, reload, and log in as the sole active GM from your
Mac. Open setup at normal and narrow window sizes. Enter the HTTPS MA address and
dedicated token, then select **Connect**. The receiver should be provisioned
and playlists should load without a backup file. If MA reports media error 2 after connection, verify the same content in MA’s own dedicated web player before treating it as a browser transport failure. If connection fails, select Check
browser connection and Copy connection diagnostics once, and report that single
report with browser/version and whether MA’s own page works in that same browser.
2. In **Scene Music**, choose two authorized static playlists for an active scene’s
ambient/combat music and save. In **Playback**, enable automation. Check the GM
hears ambient and decoded frames increase.
Only the campaign receiver may be controlled. Native fallback remains optional.
3. Log in as two ordinary players using separate browser profiles/devices. They should
receive audio automatically, needing at most one Enable Audio click. Check late login,
Stop/Enable and one player reload. An unrelated user must not receive another user’s
invitation; verify Foundry still prevents players from editing other User keys/roles.
4. Note the ambient track/offset in MA. Start an actual Foundry combat in this scene,
then end/delete it. Both players should hear combat then ambient at the saved offset,
rather than restarting ambient. Repeat a rapid start/end and confirm no duplicate queue.
5. Close/reopen setup and retry one failed login with a replacement token. The private
draft/receiver should remain; after a browser reload only the token needs reentry.
Reconnect the same owned receiver and confirm its queue is not replaced. Apply the
automation setting explicitly if a nonempty queue was retained.
6. Continue listening for at least 30 minutes across signaling invitation expiry. Exercise one
brief network interruption, reconnect, and one background/suspend cycle. Report
failures with Copy connection diagnostics. Repeat on the actual WAN player route;
loopback/LAN signal does not establish NAT/TURN reachability or synchronization.
The development-world runs covered real Foundry hooks, socket delivery and User
permissions. The v0.8.0 preview verified continued playback through the
signaling lifetime and listener reconnection. For v0.8.1, verify the exact
installed candidate and prioritize the unresolved Mac Firefox connection.
For AM-005, correlate the reported browser stage and timestamp
with the private proxy’s request and upstream status or TCP counters. The procedure
and temporary VM-to-proxy access rollback are in ignored .local/PRIVATE-ROUTE-REQUEST.md.
## Reproduce development checks
Use the existing pinned Node 24.23.0, Python standard library and Playwright 1.57.0.
No upstream installation hook is required.
For private-route diagnostics, run `node scripts/check_foundry_private_route.mjs`
with the existing browser path settings. The probe verifies the HTTPS peer address
for both origins and compares WSS upgrades from Foundry and Music Assistant. It
captures handshake status and browser policy metadata. Add `--logged-in` after the
private route is reachable and the dedicated development world is active. That
mode verifies the installed module version, signs in with the three configured
test accounts in separate browser contexts, and adds the authenticated Foundry
page as a comparison. `--playback` also exercises actual MA audio, Foundry combat,
listener recovery, and cleanup with temporary development-world documents and a
dedicated integration receiver. Configuration and results remain under ignored
`.local/`.
```sh
npm test
python3 -m unittest discover -s tests -v
python3 scripts/audit_repository.py
python3 scripts/verify_upstream.py
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/check_setup_browser.mjs
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/check_foundry_application.mjs
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/check_browser_signaling.mjs
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/live_browser_preflight.mjs
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/live_receiver_browser.mjs
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/live_receiver_browser.mjs --chromium
python3 scripts/release.py
```
Live scripts require authorized private configuration/token in ignored .local/ and
must only operate on their generated `Adaptive Music integration …` receivers.
`--fresh` exercises module provisioning directly and keeps the generated receiver
identity and reports in a separate private directory under .local/.
Browser transport evidence includes no TLS bypass. Headless Chromium’s local test
launcher uses --no-sandbox for this development environment; the shipped module sets
no browser flags. No new distributed dependency was introduced. Supplemental Playwright 1.65.2 and Chromium/Firefox 159 builds are isolated under .local/dev-browser-tools; AM_PLAYWRIGHT_MODULE selects that pinned development package. Its provenance is in evidence/v0.7.0-browser-tools.json. The repository dependency lock remains unchanged apart from the application version.
## Limits
Mac/Safari behavior, physical audibility, WAN relay, long-run skew/drift, seamless
GM handover, crash restore and crossfade remain unverified or unsupported. The
upstream single queue provides one playback stream. Pause is emulated and its
saved position lasts for the active GM session.
+51
View File
@@ -0,0 +1,51 @@
Adaptive Music — independent open-source project by CheddahBoxMB.
Not an official Foundry VTT, Music Assistant, Sendspin or VGM product.
Milestone 1 records research; the subsequent source prototype adapts VGM per-sound
stop and pausedTime restoration in src/providers/native/provider.mjs. The controller
and Foundry bootstrap are new implementations informed by the audited VGM behavior.
The browser SDK and cryptographic dependencies listed below are now bundled.
Preserve this attribution and the full licenses supplied alongside the module.
Video Game Music (VGM)
https://github.com/Sayshal/vgmusic
Release release-1.4.5; commit eba07a08c9925f31b9c8adb72faf95de11ae705c
Authors named by manifest: Furyspark and Tyler (Sayshal).
Copyright (c) 2025 3 Death Saves
MIT License. Full copyright, grant and disclaimer: licenses/VGM-MIT.txt.
The notice and permission text must accompany copies/substantial portions.
Music Assistant server
https://github.com/music-assistant/server
2.10.6; commit c24866405bd2068c25a60e1014e5ef8c3f6445bb
Music Assistant frontend
https://github.com/music-assistant/frontend
2.17.297; commit e779b9d359e47cd210c2801f16a0ce6263571903
Sendspin JS — Sendspin Protocol Authors / Open Home Foundation
https://github.com/Sendspin/sendspin-js
5.0.0; commit 7d103075138dda5c8909045647bb42b33c2d44fc
6.1.0; commit 7ee7ca35ac29ae3ef5f2eeeeaac1e24751a8790b (comparison)
aiosendspin — Sendspin Protocol Authors
https://pypi.org/project/aiosendspin/9.1.1/
These inspected sources declare Apache-2.0. Full license: licenses/Apache-2.0.txt.
Bundled browser runtime (vendor/sendspin-5.0.0.mjs):
- @sendspin/sendspin-js 5.0.0, Apache-2.0; licenses/vendor/-sendspin-sendspin-js.txt.
- @noble/ciphers 1.3.0, MIT; licenses/vendor/-noble-ciphers.txt.
- @noble/curves 1.9.7, MIT; licenses/vendor/-noble-curves.txt.
- @noble/hashes 1.8.0, MIT; licenses/vendor/-noble-hashes.txt.
Exact registry integrity hashes, build inputs and bundle SHA256 are recorded in
vendor/provenance.json and evidence/sdk-adoption.json. Modified distribution:
bundled/minified exports, PCM-only; optional Opus decoder imports are replaced by
explicit unsupported-codec stubs. No Opus/WASM decoder or codec binaries ship.
No upstream NOTICE file was present in the inspected SDK package. Full upstream
copyright/license texts accompany this modified distribution. No runtime CDN.
Build/test dependencies (not required by the installed module): esbuild 0.27.1
(MIT), Playwright 1.57.0 (Apache-2.0), exact transitive pins in package-lock.json.
Their installed source/binaries are not included. opus-encdec 0.1.1 is installed
as an SDK dependency for reproducible inspection but excluded from the browser
bundle; its MIT and embedded libopus/Speex BSD licenses were reviewed. See
evidence/sdk-adoption.json for the distribution boundary and audit results.
Foundry VTT public documentation is a reference only. Foundry software is not
redistributed. No third-party music assets are included; browser tests generate original tones. No upstream source has been relicensed.
+86
View File
@@ -0,0 +1,86 @@
# Adaptive Music Mac acceptance
## Installed v0.8.1 operator results
The operator confirmed automatic combat, initiative progression, boss music,
ambient restoration, manual controls, and audio quality. They also reported
that joining the world during playback stopped the GM audio and left Scene
Music without a catalog. Playback recovered after logout. Multiplayer
acceptance remains the v0.8.2 release gate.
## Installed v0.8.0 operator results
These results are user-confirmed manual testing on macOS. See
[TESTING.md](TESTING.md) for automated browser and development-world evidence.
| Result | Scope |
| --- | --- |
| Pass | Chrome connectivity, Chrome credentials after a full quit and reopen, automatic scene playlist activation, background-tab audio, remote player audio over WAN, and smooth transitions. The operator heard no stuttering or crackling during testing. |
| Fail | Firefox connectivity on macOS. The operator also reported that the assigned battle playlist played when used as ambient, while normal Combat Tracker use left the ambient cue playing. |
| Usability finding | The operator could not find a way to designate a boss. Their normal combat and default boss assignments used the same playlist. |
| Passed in v0.8.1 | Combat start and end, ambient restoration, boss designation, and manual playback controls. |
## Capture the Firefox failure
1. Note the Firefox and macOS versions. In the same Firefox profile and network,
open the normal MA HTTPS page and record whether it loads or shows a
certificate or connection error.
2. Return to the Foundry world. Open **Adaptive Music setup → Connection** and
reproduce **Connect** once. Note the exact error and the time with timezone.
Run **Check browser connection**, then select **Copy connection diagnostics**.
3. If either route fails, record the Foundry site's local network permission
from Firefox's site permissions or **Settings → Privacy & Security →
Permissions → Local network devices**. Also record the Firefox entry under
**System Settings → Privacy & Security → Local Network** on macOS. Leave
these settings as they are for the initial capture.
4. If available, copy the relevant Web Console line for `/ws` or `/sendspin`
using **⌘⌥K**, especially a Local Network Access, CSP or certificate error.
Share the result privately with the copied module diagnostics. Omit tokens,
cookies, raw WebSocket frames and full network exports.
See [Mozilla’s Firefox local-network permission guide](https://support.mozilla.org/en-US/kb/control-personal-device-local-network-permissions-firefox)
and [Apple’s macOS Local Network settings guide](https://support.apple.com/guide/mac-help/mchla4f49138/mac).
## Candidate checklist
Run the relevant checks against the exact candidate being accepted. Use the
private development world and sign in as **CodexDEV**, with one GM browser
connected at a time. Use the same approved development MA token in both
browsers so the existing scene assignments resolve. Put on headphones and
record your browser and macOS versions.
Before starting a v0.8.3 run, confirm **Manage Modules** shows Adaptive Music
**0.8.3**. Use the [local ZIP install procedure](INSTALL.md#install-the-candidate-on-an-isolated-development-instance).
Only use the dedicated development receiver.
| Check | Action | Expected result |
| --- | --- | --- |
| ☐ Connect | Open **Settings → Adaptive Music setup → Connection**. Enter the approved private MA address and token. On a trusted profile, select **Remember credentials and reconnect on this trusted device** and click **Connect**. | The catalog loads and the dedicated receiver connects. Once connected, the token field is empty. Click **Enable GM audio** if prompted. |
| ☐ Christmas ambience | Activate **Christmas — Adaptive Music demo**. Open **Adaptive Music controls** from the token toolbar and enable automation if needed. | Christmas music starts. The controls show the currently playing track and its position. |
| ☐ Native assignment | Open **Configure Scene** on the Christmas scene. In **Playlists → Adaptive Music**, drag its current Christmas playlist onto **Ambient playlist** and click **Save assignments**. Reopen Configure Scene. | The dropped value survives saving and reopening. The scene's native soundtrack remains unset. |
| ☐ Combat | Activate **Dûr-Khazrak — Adaptive Music demo** or another scene with three distinct ambient, combat, and boss playlists. Note the ambient track and position. Add tokens with **Enter Combat**, roll initiative, then click **Start Combat** in the Combat Tracker. Click **Next Turn** and **Next Round**. | Adding combatants and rolling initiative leave ambient playing. Starting the encounter switches to **Combat**. Advancing turns and rounds continues the cue without a restart. |
| ☐ Boss | In a fresh encounter, check **Boss encounter** in the Combat Tracker before clicking **Start Combat**. | The scene's default boss cue starts and the tracker and Playback panel show **Boss**. A scene with the same combat and boss playlist can change mode while the music continues. |
| ☐ Cancel and restore | Open **End Combat** and cancel the confirmation, then open it again and confirm. Repeat with a second encounter. | Cancel keeps the encounter and its music running. Confirm restores the ambient queue order, track and approximate saved position. A later encounter captures a fresh position. |
| ☐ Switch scenes during combat | During an active encounter, activate another scene with its own ambient cue and no participants in that encounter. Reactivate the original scene and end the encounter. | The other scene uses its own ambient. The encounter cue returns on reactivation. Ending the encounter restores the original scene's interrupted ambient position. |
| ☐ Manual controls | Open **Music controls** from the Playlists sidebar and apply a **Manual playlist override**. Start combat and use **Return to automation** in the Combat Tracker. Also try pause, resume, seek, skip, volume, repeat, and stop. | The tracker and Playback panel show **Manual Override** while automatic cues are on hold. Return to automation takes up the currently applicable cue. Transport controls affect the dedicated receiver. |
| ☐ Late and simultaneous joins | Start music with the GM alone. Join as a Player, then join two more sessions together, including a Trusted Player. Use Chrome and Firefox. Repeat with an Assistant Gamemaster if that role is used in your world. | The GM keeps the same cue, receiver and catalog. Each player hears current audio after any needed browser activation. A Foundry account is sufficient for listening. |
| ☐ Personal listening controls | In the Playlists sidebar open **Campaign audio**. Change one listener to 25% and toggle **Mute**. Log out and back in as that user, then unmute. | Only that user changes level. The user's mute and volume survive reentry. The GM and the other listeners continue playing. |
| ☐ Floating music bar | As a player, drag the bar and select **Hide**, then **Show**. Set **My volume** and mute. As the GM, mute your own output and change **Campaign volume**. | The bar stays available on the map. Personal controls affect only the current browser, and Campaign volume affects the shared Music Assistant stream. |
| ☐ Pause and play all | As the GM, pause and play once on the same cue. Pause again and activate a scene with a different playlist before selecting Play. | The group hears silence while paused. The first Play resumes at the saved position. The second Play starts the new scene's cue. Native effects continue under Foundry's own controls. |
| ☐ Multiplayer cues | Keep the group connected through combat, boss, End Combat, a scene change and a manual override. | All listeners hear the same cue changes while retaining their own volume settings. |
| ☐ Continuity | Listen on GM and player output through steady playback, cue changes and at least one track boundary. Cover each Foundry tab with another tab for at least one minute. Include one 30-minute play session and a Mac sleep/wake test across the two browsers. | Steady audio has no audible pops, crackle or unexpected gaps. Cue changes use a short sequential fade. Track/position continue while the tab is hidden. Record what happens during and after sleep. |
| ☐ Restart and reconnect | Quit the browser fully, reopen the same profile and return to the development world. With a working session, briefly drop and restore the test device's network. | The remembered receiver reconnects without token entry. A populated queue is preserved on attachment. Select **Return to scene music** to resume scene cues immediately if needed. |
| ☐ Disconnect and forget | Click **Disconnect**, restart the browser and verify it stays disconnected. Reconnect intentionally, click **Forget Credentials**, then restart again. | Disconnect pauses automatic reconnect. Forgetting removes the stored device token. The next connection requires token entry. |
| ☐ MA revocation | If testing revocation, use a disposable development token. At the end of that test, revoke only that token in MA Profile and retry from the same browser. | The revoked token cannot authenticate and the setup reports auth denial. Re-enter the approved token and private address before using the prepared scenes again. |
If a check fails, record local time with timezone, the browser and OS version,
the scene and cue, and whether the GM, a player or both were affected. For a
join failure, note the Foundry role that joined, the join order and whether
Scene Music lost its catalog. For an audio artifact, note the track position,
duration and whether the tab was
hidden, reconnecting or changing cues. Copy **Connection → Copy connection
diagnostics** for the GM and record the status shown in **Campaign audio**
for each affected listener. For connection issues, run **Check browser connection**
before copying diagnostics and note whether the normal MA page loads in the
same browser. Share the copied reports privately and keep tokens, raw WebSocket
logs and browser profiles out of the report.
+104
View File
@@ -0,0 +1,104 @@
# v0.6.0 connection investigation — 2026-12-03
Historical report. The expanded authorization and v0.7.0 implementation supersede
its pending-credential and provisioning status. See v0.7.0-live.json and current
PROGRESS.md for the actual live results and unresolved private-route/MA-media checks.
Status: working-tree remediation; **not a release and not live acceptance**.
No production credentials, services, routes, players or queues were used/changed.
The pre-existing uncommitted v0.6.0 work has been preserved.
## Reported deployment evidence
The operator reports trusted Let's Encrypt HTTPS, Nginx WebSocket HTTP 101,
responding MA 2.10.6, functioning private access restrictions, and Firefox success
from MA's origin but failure from Foundry's origin. VPN removal, DNS clearing and
local-network permission did not resolve it. This supersedes the old assumption
that missing TLS is the remaining infrastructure problem. These facts are operator
reports, not independently observed request/response captures.
## What is established
Pinned MA 2.10.6 commit c24866405bd2068c25a60e1014e5ef8c3f6445bb has no explicit
Origin allowlist in its inspected API WebSocket and authenticated Sendspin proxy
handlers. The API authenticates a correlated `auth` command after upgrade; the
Sendspin proxy authenticates a first text frame, then Noise/Sendspin follows.
Neither a homepage response nor a separate client's HTTP 101 establishes that the
Foundry-origin browser reaches either authenticated stage. HTTP CORS headers are
not a WebSocket Origin authorization fix.
Real Firefox 144.0.2 exercised two distinct HTTPS origins (localhost and 127.0.0.1,
separate ports) and WSS, with a local CA trusted only in an isolated browser profile.
No ignore-certificate setting, security-disabled flag or production endpoint was
used. `cross-origin-browser.json` records the six passing scenarios:
| Scenario | Browser observation |
| --- | --- |
| Trusted cross-origin WSS, policy allows target | Both routes open |
| Enforced connect-src self | Both blocked; no server upgrade |
| MA same-origin control | Both open |
| Report-only connect-src self | Both open |
| Server rejects the Foundry Origin | Both fail opaquely |
| Same-origin under that Origin restriction | Both open |
The local server implements a real RFC 6455 upgrade and close, **not MA's API,
Noise or audio**. This is evidence about browser enforcement and diagnostics, not
MA/Foundry integration. It exposed a synchronous SecurityError/asynchronous CSP
event ordering issue that mocks missed; diagnostics now allow time for that event.
Browser WebSocket APIs conceal HTTP status, TLS errors and arbitrary close causes.
An opaque failure cannot be truthfully labeled an Origin rejection or TLS problem.
## Defect status
| Defect | Change/evidence | Still required |
| --- | --- | --- |
| AM-001 | Scoped ApplicationV2 label/input/button sizing, narrow-window overflow and hidden-step checks at 380/640/1000px | Actual Foundry v14 theme/window verification |
| AM-002 | Corrected research: public `sendspin/pair_web_player` exists and binds pairing to an account | Implement and validate dedicated creation/pairing; backup import remains required |
| AM-003 | Credential-free in-interface checks for each route; enforced CSP identification; separate API upgrade/auth denial/auth timeout/disconnect/command and Sendspin auth/sync messages | Deployed failures and Noise errors must be observed; opaque transport errors stay explicitly uncertain |
| AM-004 | Draft persists in closure memory across failed tests and setup rerenders; retry regression; explicit forget; no token reuse across origin changes; concurrent tests rejected | Actual Foundry window lifecycle check; reload intentionally clears secrets |
| AM-005 | Real HTTPS Firefox reproductions and actionable stage diagnostics | Exact deployed root cause, correction and live regression are **unresolved** |
## Provisioning correction and blockers
The earlier SENDSPIN-PROVISIONING research considered virtual players but missed
`providers/sendspin/provider.py:894` and command registration at :1048.
`sendspin/pair_web_player(pairing_token)` requires PLAYERS_CONTROL, waits for the
connected registered browser client, checks `is_web_player`, and pairs using the
calling account as owner. The SDK exposes `pairingToken` and generates a stable
identity with its supplied storage. This offers a source-supported route to
integrated provisioning without grouping, household enumeration or another service.
It is not implemented here. A correct flow must explicitly create only a new
campaign-owned identity, connect the Sendspin transport before target lookup,
submit only that identity's pairing token, await completed Noise activation and
clock sync, verify exact identity/name/provider/standalone topology, retain the
updated SDK storage in memory, and offer a private backup export. Disconnect,
failed pairing, receiver persistence and restart semantics need real MA testing.
The current flow instead looks up an existing identity before connecting it.
Merely removing the backup requirement would fail or create an unpaired target.
No broad players list or queue control should be added to solve this.
AGENTS.md also places MA access on a gateway, while the inherited v0.6.0 browser
host puts credentials in the GM tab. This existing architectural conflict is not
resolved by a WebSocket patch. Adding an unrestricted same-origin MA reverse proxy
would violate the stated boundary and is not an adopted solution. An actual
server-side gateway cannot be installed by Foundry's browser-only module API.
No new mandatory service is proposed.
## Next acceptance decision
Obtain the current Foundry and trusted MA origins and explicit read-only credential
permission (requested in chat; not received during these checks). Inspect the
actual page's enforced response/meta CSP and test both routes from that page in
Firefox. Compare the same browser's MA-origin result, not curl or a synthetic page.
If CSP is confirmed, prepare an exact-origin connect-src amendment to the existing
policy for operator review. If the handshake reaches the proxy and is rejected,
inspect the exact Origin against private route policy. Never strip/forge Origin,
allow every origin, disable browser security or expose an unrestricted MA proxy.
Any production configuration amendment requires separate approval before applying.
Only after the observed blocker is corrected should authentication, owned receiver
creation/pairing, catalog load, interrupted retry and approved audio/restore testing
be accepted. Credential approval for read-only tests does not authorize provisioning
or playback. The existing Gitea URL/update mechanism is unchanged. Do not publish a
new version or replace the existing v0.6.0 immutable artifact on this evidence.
+37
View File
@@ -0,0 +1,37 @@
# Sendspin provisioning research — 2026-12-03
Evidence class: source inspection only. MA 2.10.6, commit
`c24866405bd2068c25a60e1014e5ef8c3f6445bb`; new inspected file hashes recorded in
`upstream.json`. No upstream code copied, dependency installed or provisioning run.
`providers/sendspin/provider.py:656` defines `create_virtual_player(owner_instance_id,
display_name, player_id=None)`. This is an in-server Python provider API, not a
registered external HTTP command. It requires a loaded provider owner, checks
ownership/collisions, prefixes stable IDs, registers the client and queue, and
persists the owner marker. Removal deletes configuration; unloading the owner
removes its targets. Restart requires the owner to recreate the anchor. See the
same directory's README, “Virtual Players”, and `_register_virtual_player_client`.
This anchor discards its own audio. Its documented delivery mechanism attaches
member players through standard grouping. That mechanism does not meet Adaptive
Music's no-grouping boundary and is not an adopted gateway audio source. Creating
an anchor alone would not terminate audio at the gateway.
`player.py:_refresh_client_info` recognizes web/app clients from device information
and makes them standalone/private. A future isolated gateway Sendspin client with
an operator-assigned stable identity could be researched as a dedicated receiver,
but needs protocol/Noise/codec and reconnect tests, licensing/dependency review,
explicit target creation approval, and an operator update of the nonempty account
player filter. An arbitrary new identity must never be automatically selected.
No public automatic provisioning path suitable for the current external gateway
was established. Existing Adaptive Music DEV remains the only authorized target.
Decision: retain the manually provisioned development target. Do not add an MA
plugin, use grouping, create resources, or change production settings in this milestone.
## Follow-up correction
The virtual-player conclusion above does not rule out browser receiver provisioning.
Pinned MA 2.10.6 registers `sendspin/pair_web_player` with account-bound pairing.
See [the later investigation](CROSS-ORIGIN-INVESTIGATION.md) for the exact path,
required handshake sequence and unverified implementation/acceptance gates.
+46
View File
@@ -0,0 +1,46 @@
# Dedicated gateway receiver — public-interface investigation
Checked 2026-12-03. Evidence class: official public protocol/SDK documentation and
pinned source inspection, not a running receiver or a live MA handshake.
Official references:
- [Client implementation guide](https://www.sendspin-audio.com/build/guide/client/)
- [Protocol specification](https://www.sendspin-audio.com/build/spec/)
- [aiosendspin SDK](https://github.com/Sendspin/aiosendspin)
A separate player-role client is the supported public interface. Persist its X25519
identity and pairing records privately; advertise only player capability, use Noise
transport, pin the intended server identity, and never advertise controller/source
roles or forward MA traffic. The public protocol supports client-initiated discovery
and connection as well as server-initiated connections. Prefer an operator-configured
private MA peer with no broad household discovery. Read the exact pinned SDK
behavior rather than assuming today's mutable specification matches every field.
Inspected aiosendspin 9.1.1 source distribution (already recorded archive SHA256):
`client/client.py:SendspinClient` takes identity, pairing store, roles and player
support; `connect(url, expected_server_id=...)` supplies a public connection path;
`add_audio_chunk_listener` exposes decoded PCM, negotiated format and server
presentation timestamps. Its time mapping methods convert presentation time.
These methods avoid MA provider internals and virtual-player provisioning.
This makes a gateway-owned receiver feasible as a source-derived design. A worker
can terminate Noise/codec state locally, validate PCM format/timestamps, and feed a
campaign-specific bounded ring. Neither upstream control frames, pairing messages,
MA credentials nor client-selected identities may reach listeners. The new strict
WAV-to-PCM fixture pipeline exercises only local PCM validation/distribution, not
that handshake or time mapping.
No SDK dependency has been installed, copied, adopted or bundled. The distribution
is Apache-2.0 and its declared client dependencies include aiohttp, cpace,
cryptography, mashumaro, noiseprotocol, orjson and zeroconf; a locked transitive and
codec review is still required before adoption. The SDK's own README calls its
client a test/reference client. No compatibility claim follows from API inspection.
Infrastructure needed for a live receiver experiment: isolated non-root worker,
private writable identity/trust storage (0700/0600), operator-approved persistent
receiver identity, explicit pairing to the pinned MA server, and an operator update
to the account's nonempty player filter/target binding after verifying the new
identity. The current authorization covers only Adaptive Music DEV, so no additional
receiver identity was registered or selected. No mDNS advertisement, MA source edit,
internal virtual-player API, grouping or production configuration was used.
+127
View File
@@ -0,0 +1,127 @@
# Upstream source audit
Inspected 2026-12-03 using GitHub release metadata, shallow tagged Git checkouts and
PyPI source distribution. Full commits and selected file SHA-256 values are in
[upstream.json](upstream.json). Checkouts are ignored under .local/upstream; no
install hooks or upstream application code executed. Hashes establish reproducibility,
not signature verification or a security audit. Release selection excludes drafts
and prereleases; package version placeholders are not reliable release identifiers.
| Component | Inspected release | Role | License |
| --- | --- | --- | --- |
| Sayshal/vgmusic | release-1.4.5 | Latest stable observed; behavioral reference | MIT |
| music-assistant/server | 2.10.6 | Deployment target source | Apache-2.0 |
| music-assistant/frontend | 2.17.297 | Exact server dependency | Apache-2.0 |
| sendspin/sendspin-js | 5.0.0 | Exact pinned frontend dependency | Apache-2.0 |
| sendspin/sendspin-js | 6.1.0 | Latest stable observed; comparison only | Apache-2.0 |
| aiosendspin | 9.1.1 | Exact server Sendspin dependency; PyPI sdist | Apache-2.0 |
Latest frontend release observed was 2.17.388 at commit
e19509049634795d69abd4dec417f1281201deb8, pinning Sendspin JS 6.1.0. It was inspected
for comparison before checking out the server-pinned frontend. Latest MA stable
observed was 2.10.15. Neither is a recommendation to upgrade production.
## VGM findings
[Release source](https://github.com/Sayshal/vgmusic/tree/eba07a08c9925f31b9c8adb72faf95de11ae705c)
contains module.json declaring Foundry minimum/verified 14 and **requires 3ds-atlas**.
`package.json` has no runtime npm dependencies; development dependencies include
Rollup, Terser, ESLint/JSDoc, Prettier, Stylelint, lint-staged, copy and PostCSS
plugins. Its package-lock has 396 non-root package entries. At the initial source audit, no npm vulnerability
scan or install was run because Node/npm were absent. The later prototype uses no
third-party packages and has not installed or audited VGM development dependencies. This is an inventory, not a
finding that dependencies are safe. Manifest version/download are build placeholders
and package.json says 1.0.0; GitHub stable release tag is the version evidence.
`scripts/music-controller.mjs` uses ATLAS primary-GM arbitration/logging, resolves
scene/combat/token/actor contexts, pauses/restores track offsets via document flags,
and stops per-playlist sounds to avoid reseeding shuffle. `scripts/hooks.mjs` listens
to core combat, scene, token and actor hooks; other source includes optional
Calendaria and Minstrel interaction. These integrations are not required by this
project. Snapshot concept is useful, but no MA provider, secure gateway, campaign
isolation or demonstrated full queue restoration was found. MIT permits reuse with
the copyright and permission notice; see THIRD-PARTY-NOTICES.
## Music Assistant API findings (2.10.6 source)
All paths below are within
[the pinned server](https://github.com/music-assistant/server/tree/c24866405bd2068c25a60e1014e5ef8c3f6445bb).
- `music_assistant/controllers/webserver/controller.py`: GET `/info`, GET `/ws`,
POST `/api`, generated `/api-docs/commands.json`, schemas and OpenAPI routes.
Source identifies these routes; only `/` and `/info` were probed live: initially timed out, now both HTTP 200
with `/info` reporting 2.10.6. No authenticated API command has been sent.
- `websocket_client.py`: server info on connect, command envelopes parsed as
CommandMessage (`message_id`, `command`, `args` as used by frontend), special
`auth` command with token; authenticated event subscriptions. Not a generic
arbitrary JSON-RPC-over-WebSocket assumption. HTTP API has separate JSON-RPC handler.
- `auth.py` and `helpers/auth_middleware.py`: built-in credential and token paths,
`auth/login`, `auth/token/create`, `auth/token/revoke`, scopes, player/provider
filters and Bearer-header support. No credentials used, account created or token
minted. Effective least-privilege scopes must be checked in an authorized test.
- `player_queues/controller.py`: `all/get/items` (items default limit 500 and offset),
`play_media`, `play_index`, `seek`, `pause/resume`, `shuffle/repeat`, `transfer`.
`play_media` accepts queue_id, media, option, start_item and shuffle among others.
Seek rejects no-duration or out-of-range media. Queue read/control scopes are
declared, but do not assume all handlers enforce identical resource filters.
`_check_player_permission` permits an own-client exception and tests a *nonempty*
player filter; empty filters are not restrictive. Gateway must independently
validate all resources, methods, arguments and returned metadata.
- No public atomic full queue snapshot/restore pair found in the inspected controller.
Rebuilding requires ordered items, duplicate occurrence/index, position, mode and
state; shuffled future order and dynamic playlists remain PoC questions.
- `providers/sendspin/manifest.json`: builtin beta-stage provider;
`aiosendspin[server]==9.1.1`, `av==16.1.0`. Server pyproject requires Python >=3.14
and frontend==2.17.297; sandbox Python 3.12 cannot run this MA server version.
## Sendspin findings
[Pinned frontend](https://github.com/music-assistant/frontend/tree/e779b9d359e47cd210c2801f16a0ce6263571903)
`package.json` pins Sendspin JS **5.0.0**. `src/plugins/sendspin-connection.ts` wraps
WebSocket authentication `{type:"auth", token, client_id}` and provides alternate
remote DataChannel handling. We will not enable MA remote mode.
MA `controllers/webserver/sendspin_proxy.py` authenticates the first message then
forwards bidirectionally, optionally registering the chosen client ID with that
session. Authentication is not demonstrated campaign-level authorization. No claim
that forwarding this socket safely restricts listeners is justified.
[Sendspin JS 5.0.0 source](https://github.com/Sendspin/sendspin-js/tree/7d103075138dda5c8909045647bb42b33c2d44fc)
uses Noise transport and advertises `player@v1`, `controller@v1`, `metadata@v1` in
`src/core/protocol-handler.ts`. Codec type includes PCM, FLAC and Opus; browser code
uses AudioContext/WebCodecs and an opus-encdec fallback. Comments identify Firefox
Opus limitations; those are upstream claims, not tested here. Both inspected JS
versions depend on @noble/ciphers, @noble/curves, @noble/hashes and opus-encdec.
5.0.0 and 6.1.0 package version fields are 0.1.0 build placeholders. Both require
Node >=20.19.0. Pin release tags/commits and verify published package before adoption.
aiosendspin 9.1.1 sdist SHA-256 matches PyPI metadata. It requires Python >=3.12 and
has client/server implementations with protocol version 1, Noise, legacy transport
handling, pairing and role machinery. Runtime dependencies: aiohttp, cpace,
cryptography, mashumaro, noiseprotocol, orjson, zeroconf; optional server adds av,
numpy and pillow. Source was extracted safely and inspected, not installed or run.
It is a plausible gateway-worker candidate, not a verified compatible solution.
All transitive licenses (especially bundled codec/WASM assets), distribution NOTICE
files and vulnerability results must be reviewed before packaging dependencies.
No runtime dependency has been adopted by Adaptive Music at this milestone.
## Foundry public API evidence
Official [v14 Playlist API](https://foundryvtt.com/api/classes/foundry.documents.Playlist.html)
and [PlaylistSound API](https://foundryvtt.com/api/classes/foundry.documents.PlaylistSound.html)
were inspected. Public Playlist playback and document update APIs are the native
adapter boundary. A v14 API reference and VGM's v14 manifest do not verify behavior
on build 14.371. No Foundry binaries or proprietary source were obtained.
## Implementation follow-through — 2026-12-03
Selected pins and hashes still pass `verify_upstream.py`. The native prototype
adapts the VGM per-sound update/pausedTime pattern with its 2025 3 Death Saves MIT
notice. Core policy and local GM/settings/hooks are new code; ATLAS and optional
integrations were not copied. No upstream runtime dependency was installed.
The official v14 Playlist/PlaylistSound public API pages were rechecked; they remain
API references, not build 14.371 playback evidence. Native document tests are mocks.
MA PoC uses the source-inspected HTTP envelope (raw response, not a JSON-RPC result
wrapper). Account-role/token limitations are recorded in gateway/README.md.
+31
View File
@@ -0,0 +1,31 @@
{
"checked_at": "2026-12-03T20:37:24.512Z",
"evidence_class": "real Chromium localhost SDK PCM decoder/WebAudio/WebRTC; synthetic input; socket relay shim, not Foundry or MA",
"browser": "143.0.7499.4",
"listeners": 2,
"first_all_listeners_signal_ms": 1757,
"observation_seconds": 4.766,
"sdk_decoded_frames": 255,
"listeners_measured": [
{
"rms": 0.05391,
"peak_hz": 445.3125
},
{
"rms": 0.05396,
"peak_hz": 445.3125
}
],
"gm_rtp_bytes_sent": 25198,
"aggregate_media_kbps": 42.3,
"signaling_messages": 4,
"max_signal_bytes": 2078,
"socket_payloads_are_encrypted_control_only": true,
"turn_used": false,
"public_network_test": false,
"ma_handshake_test": false,
"ma_audio_playback": false,
"interlistener_skew_measured": false,
"autoplay_gesture": "actual page click",
"sandbox_note": "headless browser only used --no-sandbox; not a deployment setting"
}
+22
View File
@@ -0,0 +1,22 @@
{
"checked_at": "2026-12-03T20:42:10.993912+00:00",
"source": "official GitHub Git-ref API; no planned Gitea access",
"actions": [
{
"repository": "actions/checkout",
"version": "v4.2.2",
"commit": "11bd71901bbe5b1630ceea73d27597364c9af683"
},
{
"repository": "actions/upload-artifact",
"version": "v4.6.2",
"commit": "ea165f8d65b6e75b540449e92b4886f43607fa02"
},
{
"repository": "actions/upload-artifact",
"version": "v3.2.2",
"commit": "c6a366c94c3e0affe28c06c8df20a878f24da3cf"
}
],
"execution": "not run on either hosting platform; Gitea artifact protocol needs instance compatibility check"
}
+12
View File
@@ -0,0 +1,12 @@
{
"checked_at": "2026-12-03T19:56:36.693Z",
"evidence_class": "live MA reads through local companion and browser-safe client; no real Foundry browser",
"target": "verified",
"playlists": 11,
"radios": 1,
"browser_payloads_private": true,
"playback_enabled": false,
"mutations_sent": 0,
"foundry_verified": false,
"tls_verified": false
}
+16
View File
@@ -0,0 +1,16 @@
2026-12-03, unreleased working-tree follow-up
Node v24.23.0: npm test — 96 passed, 0 failed.
python3 -m unittest discover -s tests -v — 15 passed.
python3 scripts/audit_repository.py — PASS.
python3 scripts/verify_upstream.py — PASS.
Chromium 143.0.7499.4 setup DOM fixture — PASS, no page errors;
layout 380/640/1000px, hidden steps, catalog and scene persistence, listener UI.
Firefox 144.0.2 isolated trusted HTTPS/WSS cross-origin matrix — PASS, six cases.
Full results: evidence/cross-origin-browser.json.
Local CA confined to disposable profile; no TLS bypass.
No actual Foundry server, real MA authentication/Noise/pairing/audio, production
credential use, production configuration change or new release. Python release
regressions built disposable test archives; no new publication artifact is approved.
AM-002 and AM-005 remain open; see CROSS-ORIGIN-INVESTIGATION.md.
+21
View File
@@ -0,0 +1,21 @@
{
"checked_at": "2026-12-03T16:17:30.410831+00:00",
"authenticated": false,
"results": [
{
"path": "/",
"status": 200,
"content_type": "text/html",
"bytes": 31252,
"elapsed_seconds": 0.0
},
{
"path": "/info",
"status": 200,
"content_type": "application/json; charset=utf-8",
"bytes": 386,
"elapsed_seconds": 0.0
}
],
"server_version": "2.10.6"
}
+86
View File
@@ -0,0 +1,86 @@
{
"scope": "isolated real Firefox HTTPS/WSS policy tests; local transport server, no MA, no Foundry, no credentials or audio",
"browser": "144.0.2",
"tls": "local CA trusted in disposable Firefox profile; no certificate bypass",
"checks": [
{
"name": "Trusted HTTPS cross-origin WSS allowed",
"results": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
]
},
{
"name": "Enforced CSP blocks cross-origin before upgrade",
"results": [
{
"path": "/ws",
"code": "csp-blocked"
},
{
"path": "/sendspin",
"code": "csp-blocked"
}
]
},
{
"name": "Same MA origin control",
"results": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
]
},
{
"name": "Report-only CSP does not block",
"results": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
]
},
{
"name": "Server Origin rejection stays opaque",
"results": [
{
"path": "/ws",
"code": "upgrade-failed"
},
{
"path": "/sendspin",
"code": "upgrade-failed"
}
]
},
{
"name": "Same origin still succeeds under Origin restriction",
"results": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
]
}
],
"passed": true
}
+405
View File
@@ -0,0 +1,405 @@
UTC 2026-12-03T20:59:41.184630+00:00
Evidence: offline regressions/source/package checks. Separate actual synthetic browser and live read-only MA results are in browser-audio.json and module-only-prerequisites.json. No live MA audio/Foundry/WAN verification.
$ node --version
v24.23.0
exit=0
$ npm --version
11.21.3
exit=0
$ python3 --version
Python 3.12.3
exit=0
$ npm test
> adaptive-music@0.5.0 test
> node --test tests/js/*.test.mjs
✔ catalog paginates, strips private metadata and filters unapproved mappings (38.46361ms)
✔ empty provider allowlist denies without I/O; malformed and endless pages fail (20.827361ms)
✔ target validation rejects group, changed identity and unavailable player (1.374042ms)
✔ synthetic audio isolates simultaneous campaigns and copies every frame (0.435995ms)
✔ audio denies forged origin/session/role, unknown fields and cross-campaign grants (0.222736ms)
✔ active listener revocation/expiry and slow-client overflow close handles (0.404296ms)
✔ synthetic source rejects stale sessions/generations, oversized frames; connections are bounded (0.35765ms)
✔ catalog authorization denies listener and injection before upstream (0.360554ms)
✔ scene/combat configuration preserves independent flags and stores only tagged references (1.270817ms)
✔ role loss, stale selection and arbitrary URL/ID fail before document write (0.329095ms)
✔ editor uses text for catalog labels and rechecks GM on actual save event (0.360413ms)
✔ configuration hook disposal prevents pending asynchronous render from mounting (0.195415ms)
✔ packaged browser client connects through real loopback companion/MA wire fixtures and restores combat queue (96.38079ms)
✔ companion denies listener control, wrong scope/Origin, upstream injection and unknown routes (9.391963ms)
✔ browser accepts only relative same-origin paths and never persists a connection grant (0.171381ms)
✔ companion operation replay is idempotent and same ID with changed payload is denied (12.023186ms)
✔ companion listener stream rejects controller grant and closes on live revocation and expiry (90.295314ms)
✔ catalog revocation during upstream I/O suppresses the response at the companion boundary (6.811085ms)
✔ policy precedence and explicit silence (1.288631ms)
✔ inactive, unstarted and other scene combats ignored; boss ties stable (3.916738ms)
✔ scene -> combat -> boss -> nested manual -> unwind restores offsets, duplicates and pause (1.549288ms)
✔ scene change during manual never resurrects previous scene (0.270146ms)
✔ boss removed during manual and deleted combat cannot return (0.290985ms)
✔ duplicate intent causes zero provider mutations (0.138488ms)
✔ prepare failure leaves current playback intact (0.445754ms)
✔ partial apply failure restores outgoing playback (0.220112ms)
✔ obsolete async resolve is rejected before stop/apply (0.243806ms)
✔ lease loss during stop prevents apply and stale rollback (0.231364ms)
✔ provider switch and bounded nested stack (0.299902ms)
✔ no authority retains playback without provider access (0.105036ms)
✔ queued state is captured at submission rather than read after caller mutation (0.06934ms)
✔ supersession after snapshot prevents mutations (0.16576ms)
✔ failed cross-provider apply cleans new owned audio before outgoing restoration (0.147205ms)
✔ superseded cross-provider apply is reconciled by stopping partially touched target (0.166159ms)
✔ extracted companion launches privately with fixture credentials, serves catalog diagnostics and listener PCM (193.762492ms)
✔ gateway binds target server-side and sanitizes metadata (1.054182ms)
✔ forged, wrong origin/campaign/session and unknown args deny before upstream (0.367508ms)
✔ listener cannot read queues or acquire controller lease (0.162183ms)
✔ expiry, revocation, stale fence and replay reject (0.269445ms)
✔ lease cannot be stolen and increases fence after revoke (0.138238ms)
✔ revocation during upstream I/O suppresses response (0.705801ms)
✔ MA adapter uses pinned envelope, Bearer header, fixed path, no redirects and returns no metadata (12.7784ms)
✔ MA mismatched queue, upstream failures and redirects fail with sanitized errors (1.87536ms)
✔ MA rejects URL credentials, query/fragment, paths and non-HTTP configuration (0.214121ms)
✔ MA read adapter performs real local HTTP POST against an isolated fixture (16.7976ms)
✔ signaling is confidential, per-listener authenticated, scoped and replay resistant (6.537352ms)
✔ signaling denies expired invitation, unknown/audio message types and unapproved TURN secrets (0.630831ms)
✔ GM browser policy refuses mixed content and SDK identity mismatch before any MA connection (0.568644ms)
✔ official pinned SDK decodes real binary PCM frames and discards stale generations (0.309118ms)
✔ parallel signaling replay cannot pass the asynchronous authentication check twice (1.495718ms)
✔ GM API WebSocket adapter authenticates privately, assembles partial results and refuses broad commands (14.752335ms)
✔ loopback transport denies unauthenticated, cross-campaign, controller, query and wrong-origin requests (14.358346ms)
✔ loopback streams synthetic PCM bytes and closes an active stream on revocation (41.212213ms)
✔ loopback closes idle synthetic stream when its listener capability expires (21.925676ms)
✔ MA snapshots ordered duplicate occurrences, pause and seek then reconstructs exact unshuffled order (7.914799ms)
✔ tampered, foreign/future snapshots and stale authority deny before MA mutations (1.351109ms)
✔ shuffled snapshot fails before interruption rather than promising exact restore (0.158526ms)
✔ prepared media cannot be forged and stale generations cannot issue controls (0.190847ms)
✔ every wire mutation revalidates exact identity/topology and uses fixed dedicated queue (14.987794ms)
✔ queue injection, transfer, arbitrary media URL and authority loss deny without writes (0.548456ms)
✔ catalog IDs survive independent adapter construction and differ across campaigns (2.585898ms)
✔ same-generation duplicate controls and restores issue no duplicate mutations (0.707344ms)
✔ MA provider with mock MA client composes with controller for nested contexts and rapid supersession (3.595579ms)
✔ ambiguous wire mutation failure latches closed instead of retrying or restoring blindly (0.911135ms)
✔ listener cannot obtain a playback fence guard or renew a controller lease (0.765943ms)
✔ playlist preparation expands approved ordered tracks before any playback mutation (0.954477ms)
✔ installable development entry defaults automation off and imports no gateway (7.147644ms)
✔ native captures actual offset and paused state, stops per sound, restores repeat/volume (1.230282ms)
✔ native resolves sequential playlist and touches only owned documents (0.396662ms)
✔ native rejects unsupported shuffle and empty playlist (0.118061ms)
✔ native rejects expired tracks, changed playlist membership and foreign/future snapshots before mutation (0.157575ms)
✔ native reports nonseekable restoration and clamps near-end seek (0.142567ms)
✔ scene-linked playlist conflict and lost authority fail before mutation (0.18704ms)
✔ GM election deterministic and no GM means none (4.923312ms)
✔ Foundry bootstrap registers local settings/hooks and disposes without ambient or actor access (0.768578ms)
✔ synthetic WAV termination emits fixed PCM frames through campaign listener authorization (0.871321ms)
✔ malformed, truncated and incompatible WAV formats fail closed before PCM publication (6.066001ms)
✔ credential loader rejects permissive modes, symlinks and malformed secrets (4.9003ms)
✔ private catalog identity key persists and unsafe key permissions fail (53.152506ms)
✔ scene assignments persist independently and world defaults/boss priority resolve without actor schemas (1.187302ms)
✔ native fallback is explicit, manual silence wins and legacy ambient does not resurrect after clearing (0.690973ms)
✔ unavailable saved MA selections are preserved but new forged IDs/non-native fallback and role loss deny (0.380373ms)
✔ GM setup connects catalog into independent scene editors and never persists its connection code (1.961399ms)
✔ browser PCM sink resumes from gesture, decodes stereo frames and closes its context on stream end (16.382984ms)
ℹ tests 84
ℹ suites 0
ℹ pass 84
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1326.873707
exit=0
$ python3 -m unittest discover -s tests -v
test_companion_is_separate_complete_and_excludes_private_configuration (test_package.DevelopmentPackageTests.test_companion_is_separate_complete_and_excludes_private_configuration) ... ok
test_package_excludes_gateway_private_state_and_false_verification (test_package.DevelopmentPackageTests.test_package_excludes_gateway_private_state_and_false_verification) ... ok
test_complete_offline_bundle_is_repeatable_and_checksums_match (test_release.ReleaseTests.test_complete_offline_bundle_is_repeatable_and_checksums_match) ... ok
test_gitea_github_stable_manifest_and_immutable_download_contract (test_release.ReleaseTests.test_gitea_github_stable_manifest_and_immutable_download_contract) ... ok
test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata (test_release.ReleaseTests.test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata) ... ok
test_tampered_manifest_or_missing_asset_is_rejected (test_release.ReleaseTests.test_tampered_manifest_or_missing_asset_is_rejected) ... ok
test_documentation_versions_are_not_private_addresses (test_repository.RepositorySafetyTests.test_documentation_versions_are_not_private_addresses) ... ok
test_embedded_url_credentials_rejected (test_repository.RepositorySafetyTests.test_embedded_url_credentials_rejected) ... ok
test_key_material_rejected (test_repository.RepositorySafetyTests.test_key_material_rejected) ... ok
test_network_evidence_is_unauthenticated (test_repository.RepositorySafetyTests.test_network_evidence_is_unauthenticated) ... ok
test_private_addresses_rejected (test_repository.RepositorySafetyTests.test_private_addresses_rejected) ... ok
test_private_config_rejected_even_when_forced_into_git (test_repository.RepositorySafetyTests.test_private_config_rejected_even_when_forced_into_git) ... ok
test_private_paths_are_ignored (test_repository.RepositorySafetyTests.test_private_paths_are_ignored) ... ok
test_provenance_pins_have_hashes (test_repository.RepositorySafetyTests.test_provenance_pins_have_hashes) ... ok
test_repository_guardrails (test_repository.RepositorySafetyTests.test_repository_guardrails) ... ok
----------------------------------------------------------------------
Ran 15 tests in 0.209s
OK
exit=0
$ python3 scripts/audit_repository.py
PASS: repository privacy/attribution guardrails
exit=0
$ python3 scripts/verify_upstream.py
PASS: all recorded Git heads, source and distribution file hashes
exit=0
$ git diff --check
exit=0
Final after peer signaling bound/tests:
$ npm test
> adaptive-music@0.5.0 test
> node --test tests/js/*.test.mjs
✔ catalog paginates, strips private metadata and filters unapproved mappings (34.489068ms)
✔ empty provider allowlist denies without I/O; malformed and endless pages fail (19.785397ms)
✔ target validation rejects group, changed identity and unavailable player (0.905344ms)
✔ synthetic audio isolates simultaneous campaigns and copies every frame (0.447057ms)
✔ audio denies forged origin/session/role, unknown fields and cross-campaign grants (0.209794ms)
✔ active listener revocation/expiry and slow-client overflow close handles (0.258885ms)
✔ synthetic source rejects stale sessions/generations, oversized frames; connections are bounded (0.312956ms)
✔ catalog authorization denies listener and injection before upstream (0.324718ms)
✔ scene/combat configuration preserves independent flags and stores only tagged references (1.271449ms)
✔ role loss, stale selection and arbitrary URL/ID fail before document write (0.321131ms)
✔ editor uses text for catalog labels and rechecks GM on actual save event (0.353852ms)
✔ configuration hook disposal prevents pending asynchronous render from mounting (0.188401ms)
✔ packaged browser client connects through real loopback companion/MA wire fixtures and restores combat queue (96.734315ms)
✔ companion denies listener control, wrong scope/Origin, upstream injection and unknown routes (8.058096ms)
✔ browser accepts only relative same-origin paths and never persists a connection grant (0.173145ms)
✔ companion operation replay is idempotent and same ID with changed payload is denied (11.338403ms)
✔ companion listener stream rejects controller grant and closes on live revocation and expiry (91.136521ms)
✔ catalog revocation during upstream I/O suppresses the response at the companion boundary (7.375589ms)
✔ policy precedence and explicit silence (1.319699ms)
✔ inactive, unstarted and other scene combats ignored; boss ties stable (4.027014ms)
✔ scene -> combat -> boss -> nested manual -> unwind restores offsets, duplicates and pause (1.273683ms)
✔ scene change during manual never resurrects previous scene (0.207358ms)
✔ boss removed during manual and deleted combat cannot return (0.249657ms)
✔ duplicate intent causes zero provider mutations (0.114244ms)
✔ prepare failure leaves current playback intact (0.378869ms)
✔ partial apply failure restores outgoing playback (0.232705ms)
✔ obsolete async resolve is rejected before stop/apply (0.222235ms)
✔ lease loss during stop prevents apply and stale rollback (4.212221ms)
✔ provider switch and bounded nested stack (0.292198ms)
✔ no authority retains playback without provider access (0.105488ms)
✔ queued state is captured at submission rather than read after caller mutation (0.09027ms)
✔ supersession after snapshot prevents mutations (0.166812ms)
✔ failed cross-provider apply cleans new owned audio before outgoing restoration (0.16018ms)
✔ superseded cross-provider apply is reconciled by stopping partially touched target (0.177582ms)
✔ extracted companion launches privately with fixture credentials, serves catalog diagnostics and listener PCM (201.412951ms)
✔ gateway binds target server-side and sanitizes metadata (1.013095ms)
✔ forged, wrong origin/campaign/session and unknown args deny before upstream (0.391262ms)
✔ listener cannot read queues or acquire controller lease (0.179616ms)
✔ expiry, revocation, stale fence and replay reject (0.201757ms)
✔ lease cannot be stolen and increases fence after revoke (0.129522ms)
✔ revocation during upstream I/O suppresses response (0.134181ms)
✔ MA adapter uses pinned envelope, Bearer header, fixed path, no redirects and returns no metadata (16.0455ms)
✔ MA mismatched queue, upstream failures and redirects fail with sanitized errors (1.798383ms)
✔ MA rejects URL credentials, query/fragment, paths and non-HTTP configuration (0.211004ms)
✔ MA read adapter performs real local HTTP POST against an isolated fixture (16.105082ms)
✔ signaling is confidential, per-listener authenticated, scoped and replay resistant (6.635415ms)
✔ signaling denies expired invitation, unknown/audio message types and unapproved TURN secrets (0.54029ms)
✔ GM browser policy refuses mixed content and SDK identity mismatch before any MA connection (0.715168ms)
✔ official pinned SDK decodes real binary PCM frames and discards stale generations (0.248766ms)
✔ parallel signaling replay cannot pass the asynchronous authentication check twice (1.826007ms)
✔ GM API WebSocket adapter authenticates privately, assembles partial results and refuses broad commands (12.583653ms)
✔ peer signaling bounds queued work and rejects expired invites before allocating a connection (25.202933ms)
✔ loopback transport denies unauthenticated, cross-campaign, controller, query and wrong-origin requests (12.953336ms)
✔ loopback streams synthetic PCM bytes and closes an active stream on revocation (43.258833ms)
✔ loopback closes idle synthetic stream when its listener capability expires (22.15983ms)
✔ MA snapshots ordered duplicate occurrences, pause and seek then reconstructs exact unshuffled order (7.12461ms)
✔ tampered, foreign/future snapshots and stale authority deny before MA mutations (0.866281ms)
✔ shuffled snapshot fails before interruption rather than promising exact restore (0.122439ms)
✔ prepared media cannot be forged and stale generations cannot issue controls (0.207959ms)
✔ every wire mutation revalidates exact identity/topology and uses fixed dedicated queue (15.898154ms)
✔ queue injection, transfer, arbitrary media URL and authority loss deny without writes (0.583201ms)
✔ catalog IDs survive independent adapter construction and differ across campaigns (1.436568ms)
✔ same-generation duplicate controls and restores issue no duplicate mutations (0.550701ms)
✔ MA provider with mock MA client composes with controller for nested contexts and rapid supersession (3.584397ms)
✔ ambiguous wire mutation failure latches closed instead of retrying or restoring blindly (0.947353ms)
✔ listener cannot obtain a playback fence guard or renew a controller lease (0.867032ms)
✔ playlist preparation expands approved ordered tracks before any playback mutation (1.429755ms)
✔ installable development entry defaults automation off and imports no gateway (7.558522ms)
✔ native captures actual offset and paused state, stops per sound, restores repeat/volume (1.465481ms)
✔ native resolves sequential playlist and touches only owned documents (0.502239ms)
✔ native rejects unsupported shuffle and empty playlist (0.147065ms)
✔ native rejects expired tracks, changed playlist membership and foreign/future snapshots before mutation (0.194464ms)
✔ native reports nonseekable restoration and clamps near-end seek (0.177542ms)
✔ scene-linked playlist conflict and lost authority fail before mutation (0.220453ms)
✔ GM election deterministic and no GM means none (4.613983ms)
✔ Foundry bootstrap registers local settings/hooks and disposes without ambient or actor access (0.664022ms)
✔ synthetic WAV termination emits fixed PCM frames through campaign listener authorization (0.875678ms)
✔ malformed, truncated and incompatible WAV formats fail closed before PCM publication (5.881385ms)
✔ credential loader rejects permissive modes, symlinks and malformed secrets (5.428296ms)
✔ private catalog identity key persists and unsafe key permissions fail (41.697223ms)
✔ scene assignments persist independently and world defaults/boss priority resolve without actor schemas (1.144961ms)
✔ native fallback is explicit, manual silence wins and legacy ambient does not resurrect after clearing (1.34135ms)
✔ unavailable saved MA selections are preserved but new forged IDs/non-native fallback and role loss deny (0.431697ms)
✔ GM setup connects catalog into independent scene editors and never persists its connection code (2.344586ms)
✔ browser PCM sink resumes from gesture, decodes stereo frames and closes its context on stream end (17.582896ms)
ℹ tests 85
ℹ suites 0
ℹ pass 85
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1347.229561
$ python3 -m unittest discover -s tests -v
test_companion_is_separate_complete_and_excludes_private_configuration (test_package.DevelopmentPackageTests.test_companion_is_separate_complete_and_excludes_private_configuration) ... ok
test_package_excludes_gateway_private_state_and_false_verification (test_package.DevelopmentPackageTests.test_package_excludes_gateway_private_state_and_false_verification) ... ok
test_complete_offline_bundle_is_repeatable_and_checksums_match (test_release.ReleaseTests.test_complete_offline_bundle_is_repeatable_and_checksums_match) ... ok
test_gitea_github_stable_manifest_and_immutable_download_contract (test_release.ReleaseTests.test_gitea_github_stable_manifest_and_immutable_download_contract) ... ok
test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata (test_release.ReleaseTests.test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata) ... ok
test_tampered_manifest_or_missing_asset_is_rejected (test_release.ReleaseTests.test_tampered_manifest_or_missing_asset_is_rejected) ... ok
test_documentation_versions_are_not_private_addresses (test_repository.RepositorySafetyTests.test_documentation_versions_are_not_private_addresses) ... ok
test_embedded_url_credentials_rejected (test_repository.RepositorySafetyTests.test_embedded_url_credentials_rejected) ... ok
test_key_material_rejected (test_repository.RepositorySafetyTests.test_key_material_rejected) ... ok
test_network_evidence_is_unauthenticated (test_repository.RepositorySafetyTests.test_network_evidence_is_unauthenticated) ... ok
test_private_addresses_rejected (test_repository.RepositorySafetyTests.test_private_addresses_rejected) ... ok
test_private_config_rejected_even_when_forced_into_git (test_repository.RepositorySafetyTests.test_private_config_rejected_even_when_forced_into_git) ... ok
test_private_paths_are_ignored (test_repository.RepositorySafetyTests.test_private_paths_are_ignored) ... ok
test_provenance_pins_have_hashes (test_repository.RepositorySafetyTests.test_provenance_pins_have_hashes) ... ok
test_repository_guardrails (test_repository.RepositorySafetyTests.test_repository_guardrails) ... ok
----------------------------------------------------------------------
Ran 15 tests in 0.193s
OK
Final backend mutual-exclusion check:
$ npm test
> adaptive-music@0.5.0 test
> node --test tests/js/*.test.mjs
✔ catalog paginates, strips private metadata and filters unapproved mappings (34.696629ms)
✔ empty provider allowlist denies without I/O; malformed and endless pages fail (20.325816ms)
✔ target validation rejects group, changed identity and unavailable player (1.810717ms)
✔ synthetic audio isolates simultaneous campaigns and copies every frame (0.554908ms)
✔ audio denies forged origin/session/role, unknown fields and cross-campaign grants (0.381735ms)
✔ active listener revocation/expiry and slow-client overflow close handles (0.470911ms)
✔ synthetic source rejects stale sessions/generations, oversized frames; connections are bounded (0.358902ms)
✔ catalog authorization denies listener and injection before upstream (0.314629ms)
✔ scene/combat configuration preserves independent flags and stores only tagged references (1.750965ms)
✔ role loss, stale selection and arbitrary URL/ID fail before document write (0.331429ms)
✔ editor uses text for catalog labels and rechecks GM on actual save event (0.414065ms)
✔ configuration hook disposal prevents pending asynchronous render from mounting (0.190486ms)
✔ packaged browser client connects through real loopback companion/MA wire fixtures and restores combat queue (100.68071ms)
✔ companion denies listener control, wrong scope/Origin, upstream injection and unknown routes (8.076499ms)
✔ browser accepts only relative same-origin paths and never persists a connection grant (0.16008ms)
✔ companion operation replay is idempotent and same ID with changed payload is denied (11.60538ms)
✔ companion listener stream rejects controller grant and closes on live revocation and expiry (90.26337ms)
✔ catalog revocation during upstream I/O suppresses the response at the companion boundary (6.482046ms)
✔ policy precedence and explicit silence (1.518581ms)
✔ inactive, unstarted and other scene combats ignored; boss ties stable (4.045799ms)
✔ scene -> combat -> boss -> nested manual -> unwind restores offsets, duplicates and pause (1.253274ms)
✔ scene change during manual never resurrects previous scene (0.222587ms)
✔ boss removed during manual and deleted combat cannot return (0.291025ms)
✔ duplicate intent causes zero provider mutations (0.125034ms)
✔ prepare failure leaves current playback intact (0.343953ms)
✔ partial apply failure restores outgoing playback (0.183673ms)
✔ obsolete async resolve is rejected before stop/apply (0.309378ms)
✔ lease loss during stop prevents apply and stale rollback (0.230632ms)
✔ provider switch and bounded nested stack (1.168335ms)
✔ no authority retains playback without provider access (0.107982ms)
✔ queued state is captured at submission rather than read after caller mutation (0.068407ms)
✔ supersession after snapshot prevents mutations (0.16593ms)
✔ failed cross-provider apply cleans new owned audio before outgoing restoration (0.168415ms)
✔ superseded cross-provider apply is reconciled by stopping partially touched target (0.173114ms)
✔ extracted companion launches privately with fixture credentials, serves catalog diagnostics and listener PCM (196.285252ms)
✔ gateway binds target server-side and sanitizes metadata (0.985664ms)
✔ forged, wrong origin/campaign/session and unknown args deny before upstream (0.376113ms)
✔ listener cannot read queues or acquire controller lease (0.188895ms)
✔ expiry, revocation, stale fence and replay reject (0.190857ms)
✔ lease cannot be stolen and increases fence after revoke (0.121416ms)
✔ revocation during upstream I/O suppresses response (0.738723ms)
✔ MA adapter uses pinned envelope, Bearer header, fixed path, no redirects and returns no metadata (13.573212ms)
✔ MA mismatched queue, upstream failures and redirects fail with sanitized errors (1.742879ms)
✔ MA rejects URL credentials, query/fragment, paths and non-HTTP configuration (0.191988ms)
✔ MA read adapter performs real local HTTP POST against an isolated fixture (15.582672ms)
✔ signaling is confidential, per-listener authenticated, scoped and replay resistant (6.879711ms)
✔ signaling denies expired invitation, unknown/audio message types and unapproved TURN secrets (0.633104ms)
✔ GM browser policy refuses mixed content and SDK identity mismatch before any MA connection (0.540021ms)
✔ official pinned SDK decodes real binary PCM frames and discards stale generations (0.258925ms)
✔ parallel signaling replay cannot pass the asynchronous authentication check twice (1.449151ms)
✔ GM API WebSocket adapter authenticates privately, assembles partial results and refuses broad commands (12.419294ms)
✔ peer signaling bounds queued work and rejects expired invites before allocating a connection (24.838497ms)
✔ loopback transport denies unauthenticated, cross-campaign, controller, query and wrong-origin requests (13.373719ms)
✔ loopback streams synthetic PCM bytes and closes an active stream on revocation (42.631304ms)
✔ loopback closes idle synthetic stream when its listener capability expires (21.663446ms)
✔ MA snapshots ordered duplicate occurrences, pause and seek then reconstructs exact unshuffled order (8.238082ms)
✔ tampered, foreign/future snapshots and stale authority deny before MA mutations (1.022132ms)
✔ shuffled snapshot fails before interruption rather than promising exact restore (0.140523ms)
✔ prepared media cannot be forged and stale generations cannot issue controls (0.198481ms)
✔ every wire mutation revalidates exact identity/topology and uses fixed dedicated queue (15.718245ms)
✔ queue injection, transfer, arbitrary media URL and authority loss deny without writes (0.588681ms)
✔ catalog IDs survive independent adapter construction and differ across campaigns (2.752148ms)
✔ same-generation duplicate controls and restores issue no duplicate mutations (0.661507ms)
✔ MA provider with mock MA client composes with controller for nested contexts and rapid supersession (3.769762ms)
✔ ambiguous wire mutation failure latches closed instead of retrying or restoring blindly (0.612365ms)
✔ listener cannot obtain a playback fence guard or renew a controller lease (0.730557ms)
✔ playlist preparation expands approved ordered tracks before any playback mutation (2.677008ms)
✔ installable development entry defaults automation off and imports no gateway (9.722018ms)
✔ native captures actual offset and paused state, stops per sound, restores repeat/volume (4.196049ms)
✔ native resolves sequential playlist and touches only owned documents (0.489666ms)
✔ native rejects unsupported shuffle and empty playlist (0.149099ms)
✔ native rejects expired tracks, changed playlist membership and foreign/future snapshots before mutation (0.263082ms)
✔ native reports nonseekable restoration and clamps near-end seek (0.168274ms)
✔ scene-linked playlist conflict and lost authority fail before mutation (0.185315ms)
✔ GM election deterministic and no GM means none (3.762779ms)
✔ Foundry bootstrap registers local settings/hooks and disposes without ambient or actor access (0.648934ms)
✔ synthetic WAV termination emits fixed PCM frames through campaign listener authorization (0.819092ms)
✔ malformed, truncated and incompatible WAV formats fail closed before PCM publication (6.152892ms)
✔ credential loader rejects permissive modes, symlinks and malformed secrets (6.562927ms)
✔ private catalog identity key persists and unsafe key permissions fail (34.527232ms)
✔ scene assignments persist independently and world defaults/boss priority resolve without actor schemas (1.210996ms)
✔ native fallback is explicit, manual silence wins and legacy ambient does not resurrect after clearing (0.620279ms)
✔ unavailable saved MA selections are preserved but new forged IDs/non-native fallback and role loss deny (0.43879ms)
✔ GM setup connects catalog into independent scene editors and never persists its connection code (1.952823ms)
✔ browser PCM sink resumes from gesture, decodes stereo frames and closes its context on stream end (14.895866ms)
ℹ tests 85
ℹ suites 0
ℹ pass 85
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1347.263856
$ python3 -m unittest discover -s tests -v
test_companion_is_separate_complete_and_excludes_private_configuration (test_package.DevelopmentPackageTests.test_companion_is_separate_complete_and_excludes_private_configuration) ... ok
test_package_excludes_gateway_private_state_and_false_verification (test_package.DevelopmentPackageTests.test_package_excludes_gateway_private_state_and_false_verification) ... ok
test_complete_offline_bundle_is_repeatable_and_checksums_match (test_release.ReleaseTests.test_complete_offline_bundle_is_repeatable_and_checksums_match) ... ok
test_gitea_github_stable_manifest_and_immutable_download_contract (test_release.ReleaseTests.test_gitea_github_stable_manifest_and_immutable_download_contract) ... ok
test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata (test_release.ReleaseTests.test_source_archive_rebuild_does_not_need_a_git_remote_or_metadata) ... ok
test_tampered_manifest_or_missing_asset_is_rejected (test_release.ReleaseTests.test_tampered_manifest_or_missing_asset_is_rejected) ... ok
test_documentation_versions_are_not_private_addresses (test_repository.RepositorySafetyTests.test_documentation_versions_are_not_private_addresses) ... ok
test_embedded_url_credentials_rejected (test_repository.RepositorySafetyTests.test_embedded_url_credentials_rejected) ... ok
test_key_material_rejected (test_repository.RepositorySafetyTests.test_key_material_rejected) ... ok
test_network_evidence_is_unauthenticated (test_repository.RepositorySafetyTests.test_network_evidence_is_unauthenticated) ... ok
test_private_addresses_rejected (test_repository.RepositorySafetyTests.test_private_addresses_rejected) ... ok
test_private_config_rejected_even_when_forced_into_git (test_repository.RepositorySafetyTests.test_private_config_rejected_even_when_forced_into_git) ... ok
test_private_paths_are_ignored (test_repository.RepositorySafetyTests.test_private_paths_are_ignored) ... ok
test_provenance_pins_have_hashes (test_repository.RepositorySafetyTests.test_provenance_pins_have_hashes) ... ok
test_repository_guardrails (test_repository.RepositorySafetyTests.test_repository_guardrails) ... ok
----------------------------------------------------------------------
Ran 15 tests in 0.184s
OK
$ python3 scripts/audit_repository.py
PASS: repository privacy/attribution guardrails
$ python3 scripts/verify_upstream.py
PASS: all recorded Git heads, source and distribution file hashes
+24
View File
@@ -0,0 +1,24 @@
{
"at": "2026-12-04T03:16:41.371Z",
"scope": "actual deployed Foundry ApplicationV2 before login, in-memory sample documents; no world writes or MA connection",
"browser": "159.0.8154.6",
"applicationV2": true,
"version": "14.371",
"receiverVault": {
"reopened": true,
"tokenExcluded": true,
"userIsolation": true,
"forgotten": true
},
"sizes": [
{
"width": 380,
"fits": true
},
{
"width": 640,
"fits": true
}
],
"passed": true
}
+12
View File
@@ -0,0 +1,12 @@
{
"checked_at": "2026-12-03T17:24:19.084Z",
"target": {
"dedicated": true,
"available": true,
"standalone": true
},
"playlists": 11,
"radios": 1,
"sanitized": true,
"independent_adapter_ids_match": true
}
+12
View File
@@ -0,0 +1,12 @@
{
"evidence_class": "live dedicated MA control tests; no content playback",
"runs": [
{"checked_at":"2026-12-03T17:16:04.878Z","successful_mutations":9,"original_state":"empty idle queue","restored":true},
{"checked_at":"2026-12-03T17:24:18.937Z","successful_mutations":0,"result":"session mismatch denied before mutations; harness corrected"},
{"checked_at":"2026-12-03T17:24:30.986Z","successful_mutations":9,"original_state":"empty idle queue","restored":true}
],
"total_successful_mutations":18,
"content_playback_mutations":0,
"synthetic_ingestion": "five-second metadata request failed; longer diagnostic returned HTTP 400; no queue mutation",
"limitations": "No pause/resume/seek with content, ordered nonempty restore, live combat/boss/manual or actual MA playlist playback verified"
}
+50
View File
@@ -0,0 +1,50 @@
{
"checked_at": "2026-12-03T17:24:30.986Z",
"evidence_class": "live dedicated MA",
"mutations": 9,
"checks": [
{
"action": "shuffle",
"value": true,
"result": "pass",
"scope": "idle queue controls"
},
{
"action": "shuffle",
"value": false,
"result": "pass",
"scope": "idle queue controls"
},
{
"action": "repeat",
"value": "one",
"result": "pass",
"scope": "idle queue controls"
},
{
"action": "repeat",
"value": "all",
"result": "pass",
"scope": "idle queue controls"
},
{
"action": "repeat",
"value": "off",
"result": "pass",
"scope": "idle queue controls"
},
{
"action": "stop",
"value": null,
"result": "pass",
"scope": "idle queue controls"
}
],
"restored": true,
"isolation_verified": true,
"original": {
"state": "idle",
"items": 0,
"position": 0
}
}
+40
View File
@@ -0,0 +1,40 @@
{
"checked_at": "2026-12-03T16:58:07.948228+00:00",
"credential": {
"directory_mode": "0700",
"token_mode": "0600",
"git_ignored": true,
"token_absent_reachable_history": true,
"token_absent_tracked_files": true
},
"authentication": true,
"role": "user",
"player_filter_count": 1,
"provider_filter_count": 7,
"dedicated_name_matches": true,
"player_available": true,
"sendspin_provider": true,
"standalone_topology": true,
"queue_id_matches_player": true,
"queue_active": true,
"synthetic_target_denial_status": 403,
"synthetic_provider_denial_status": 403,
"role_scopes": [
"config.core.read",
"config.players.read",
"config.providers.read",
"library.read",
"library.write",
"players.control",
"players.read",
"providers.read",
"queues.control",
"queues.read",
"system.read",
"users.invite"
],
"playlists_count": 11,
"playlists_approved_mappings": true,
"radios_count": 1,
"radios_approved_mappings": true
}
+16
View File
@@ -0,0 +1,16 @@
test_documentation_versions_are_not_private_addresses (test_repository.RepositorySafetyTests.test_documentation_versions_are_not_private_addresses) ... ok
test_embedded_url_credentials_rejected (test_repository.RepositorySafetyTests.test_embedded_url_credentials_rejected) ... ok
test_key_material_rejected (test_repository.RepositorySafetyTests.test_key_material_rejected) ... ok
test_network_evidence_is_unauthenticated (test_repository.RepositorySafetyTests.test_network_evidence_is_unauthenticated) ... ok
test_private_addresses_rejected (test_repository.RepositorySafetyTests.test_private_addresses_rejected) ... ok
test_private_config_rejected_even_when_forced_into_git (test_repository.RepositorySafetyTests.test_private_config_rejected_even_when_forced_into_git) ... ok
test_private_paths_are_ignored (test_repository.RepositorySafetyTests.test_private_paths_are_ignored) ... ok
test_provenance_pins_have_hashes (test_repository.RepositorySafetyTests.test_provenance_pins_have_hashes) ... ok
test_repository_guardrails (test_repository.RepositorySafetyTests.test_repository_guardrails) ... ok
----------------------------------------------------------------------
Ran 9 tests in 0.010s
OK
PASS: repository privacy/attribution guardrails
PASS: all recorded Git heads and source file hashes
+17
View File
@@ -0,0 +1,17 @@
{
"checked_at": "2026-12-03T20:42:10.945Z",
"evidence_class": "live MA target/queue reads plus browser-policy/source checks; no live browser-to-MA connection",
"target_verified": true,
"queue_state": "idle",
"queue_items": 0,
"target_identity_format_compatible": true,
"configured_ma_scheme": "http:",
"https_foundry_origin_policy": "mixed-content",
"gm_identity_profile_present": false,
"sendspin_connections": 0,
"identities_created": 0,
"mutations_sent": 0,
"actual_ma_audio": "blocked pending existing DEV private identity, secure private browser access and approved synthetic ingestion",
"websocket_auth_log_safety": "not verified live; source logs raw inbound auth at VERBOSE, explicit operator review required",
"live_websocket_auth_attempts": 0
}
+44
View File
@@ -0,0 +1,44 @@
{
"checked_at": "2026-12-03T21:01:48.898612+00:00",
"version": "0.5.0",
"artifacts": [
{
"artifact": "dist/adaptive-music-dev.zip",
"sha256": "ec45c0a3e4f8eae2593c7ae9cf1bdc3d724b5c6e6e9afd199ff6a506db71163f",
"bytes": 115735,
"files": 36
},
{
"artifact": "dist/releases/v0.5.0/adaptive-music.zip",
"sha256": "a9f904cb9e0844fe9b6a5c3a19f24358dfa6a0c4ca995aea9b1a3f81b301d584",
"bytes": 115735,
"files": 36
}
],
"foundry_live_verified": false,
"browser_zip_has_server_code": false,
"automation_default": false,
"history": [
{
"checked_at": "2026-12-03T20:07:10.575810+00:00",
"version": "0.4.0-dev",
"artifacts": [
{
"artifact": "dist/adaptive-music-dev.zip",
"sha256": "28637fd0a4b9754d591893a8224d059fc71a9371f6a978bfb5b935088e0956c2",
"bytes": 27681,
"files": 17
},
{
"artifact": "dist/adaptive-music-companion-dev.zip",
"sha256": "05427fc4998d8bef6d3d5ccb61d68931cd98fae2e28f6b777b9468d993c5558e",
"bytes": 33191,
"files": 19
}
],
"foundry_live_verified": false,
"browser_zip_has_server_code": false,
"automation_default": false
}
]
}
+53
View File
@@ -0,0 +1,53 @@
{
"checked_at": "2026-12-03T19:50:32.141285+00:00",
"audited_version": "0.3.0-dev",
"sha256": "2e0d5370a64e854b4bbdbea12d6969e6467b3eef9f5846361886d45058d3e801",
"files": [
"adaptive-music/module.json",
"adaptive-music/LICENSE",
"adaptive-music/THIRD-PARTY-NOTICES",
"adaptive-music/README.md",
"adaptive-music/src/core/controller.mjs",
"adaptive-music/src/foundry/configuration.mjs",
"adaptive-music/src/foundry/module.mjs",
"adaptive-music/src/foundry/runtime.mjs",
"adaptive-music/src/providers/native/provider.mjs",
"adaptive-music/licenses/Apache-2.0.txt",
"adaptive-music/licenses/VGM-MIT.txt"
],
"findings": {
"ma_connection_setup": false,
"browser_gateway_client": false,
"ma_catalog_in_configuration": false,
"separate_scene_ambient_combat": false,
"sendspin_browser_playback": false,
"crossfade": false
},
"assessment": "Native-only development package; server-side components were not connected to its browser entrypoint.",
"rebuilt_assessment": {
"version": "0.4.0-dev",
"ma_connection_setup": "operator capability + private same-origin companion route",
"browser_gateway_client": true,
"ma_catalog_in_configuration": true,
"separate_scene_ambient_combat": true,
"world_defaults_boss_native_fallback": true,
"synthetic_pcm_browser_sink": true,
"sendspin_browser_playback": false,
"crossfade": false,
"foundry_live_verified": false,
"artifacts": [
{
"artifact": "dist/adaptive-music-dev.zip",
"sha256": "28637fd0a4b9754d591893a8224d059fc71a9371f6a978bfb5b935088e0956c2",
"bytes": 27681,
"files": 17
},
{
"artifact": "dist/adaptive-music-companion-dev.zip",
"sha256": "05427fc4998d8bef6d3d5ccb61d68931cd98fae2e28f6b777b9468d993c5558e",
"bytes": 33191,
"files": 19
}
]
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"checked_at": "2026-12-03T20:59:20.741930+00:00",
"local_directory_mode": "0700",
"token_file_mode": "0600",
"token_ignored": true,
"local_files_tracked": false,
"git_history_blob_count": 136,
"credential_in_git_history": false,
"generated_module_and_source_private_value_scan": "pass",
"gitea_contacted": false,
"limitations": "exact credential and configured private endpoint/target scan supplements repository heuristics; not a comprehensive secret detector"
}
+259
View File
@@ -0,0 +1,259 @@
{
"version": "0.7.0",
"publicationReady": false,
"completedCoreRunPassed": true,
"macPrivateRouteVerified": false,
"foundryLoggedInWorldVerified": true,
"actualMAAuthentication": true,
"actualMACatalogPlaylists": 11,
"actualMADedicatedProvisioning": true,
"actualMAAudioAndTwoListeners": true,
"actualAmbientCombatRestore": true,
"actualNativePause": false,
"logicalPauseEmulation": true,
"browserAudioHardwareAudibilityVerified": false,
"crossfade": false,
"coreSuccessEvidence": "evidence/v0.7.0-live-chromium.json",
"browserAuthentication": {
"at": "2026-12-04T03:13:45.898Z",
"scope": "actual origins, read-only API authentication; Ubuntu browsers, not Mac",
"browsers": [
{
"browser": "firefox",
"version": "159.0",
"origin": "foundry",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "firefox",
"version": "159.0",
"origin": "ma",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "chromium",
"version": "159.0.8154.6",
"origin": "foundry",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "chromium",
"version": "159.0.8154.6",
"origin": "ma",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
}
]
},
"networkBoundary": {
"sandboxNormalDNS": "public addresses",
"operatorMacMAResolution": "private proxy mapping",
"temporaryAccessRequestPrepared": true,
"initialUbuntuPrivateProxyTCP443": "timeout before TLS",
"followUpUbuntuPrivateProxyTCP443": "verified TLS and installed Foundry browser through operator-scoped firewall access",
"infrastructureChangedByTestAgent": false
},
"remaining": [
"original Mac connection and AM-005 reproduction if the symptom persists",
"WAN/30-minute behavior and hardware audibility"
],
"credentialUseAuthorized": true,
"dedicatedReceiverMutationsPerformed": true,
"latestCatalogReplayPassed": true,
"freshProvisioningObserved": {
"browser": "Firefox 144.0.2",
"at": "2026-12-04T03:10:40.566Z",
"path": "module creates a fresh identity; no manual protocol pre-provisioning",
"pairing": true,
"audioTwoListeners": true,
"ambientOrderAndOffsetRestored": true,
"finalQueueRestored": true,
"source": "observed live driver output; private driver reports were subsequently superseded by current-browser reruns"
},
"productionDependencyAudit": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 0,
"critical": 0,
"total": 0
},
"history": [
{
"version": "0.7.0",
"scope": "Local acceptance package with isolated browser checks, deployed Foundry ApplicationV2 rendering and dedicated MA receiver tests",
"publicationReady": false,
"foundryInstalledWorldVerified": true,
"originalMacConnectionVerified": false,
"deployedOriginAuthentication": "Ubuntu Chromium and Firefox",
"maReceiver": {
"chromiumPlaybackPassed": true,
"firefoxFreshProvisioningPassed": true,
"firefoxPlaybackPassed": true,
"priorFirefoxPlaybackError": "MA MediaNotFoundError on the first ambient play_media command"
},
"evidence": [
"evidence/v0.7.0-live.json",
"evidence/v0.7.0-live-follow-up.json",
"evidence/foundry-application-v070.json",
"evidence/v0.7.0-checks.txt",
"evidence/v0.7.0-foundry-private.json"
],
"regression": {
"javascript": 101,
"python": 15
},
"giteaContacted": false,
"productionInfrastructureChanged": false,
"remainingAcceptance": [
"Mac private MA route",
"listener renewal, actual player devices and WAN route"
],
"history": [
{
"version": "0.6.0",
"scope": "offline regressions, actual Chromium DOM fixture, pinned-source and package checks; no v0.6.0 live Foundry/MA verification",
"connection_configuration": "three-step GM wizard; memory-only endpoint/token/identity; imported existing dedicated receiver only",
"catalog_and_assignments": "connected catalog playlists, explicit playback opt-in and persistent scene ambient/combat/boss/native fallback and world defaults",
"audio": "existing official Sendspin GM host integrated; automatic individually encrypted WebRTC listener invitations; browser activation when required",
"bootstrap": "ephemeral ECDH P-256 keys bound to permission-controlled Foundry User documents; AES-GCM encrypted capabilities; live server permissions remain an acceptance gate",
"companion": "hidden by default; client-scoped advanced development setting; no mandatory service",
"https_wss": "trusted private MA origin with /ws and /sendspin WSS required from HTTPS Foundry; no mixed-content or certificate bypass; deployment untouched",
"distribution": "one installable module ZIP plus complete offline manual publication bundle, sources, docs, licenses and checksums",
"regression": {
"javascript": 91,
"python": 15,
"passed": true
},
"browser_ui": {
"browser": "Chromium 143.0.7499.4",
"passed": true,
"scope": "fake Foundry documents and fake connection; no MA or actual Foundry",
"pageErrors": []
},
"user_report": {
"version": "0.5.0",
"giteaPublished": true,
"manifestInstalled": true,
"foundry": "14.371",
"system": "D&D 5e 6.1.2",
"activated": true,
"configurationAndListenerWindowsRender": true,
"source": "user report; not independently accessed"
},
"ma_mutations_this_revision": 0,
"credential_use_this_revision": false,
"gitea_contacted": false,
"production_changes": false,
"v060_live_audio_verified": false,
"remaining_acceptance": [
"real Foundry v14.371 ApplicationV2 and User permissions",
"trusted private MA HTTPS/WSS",
"matching dedicated Sendspin identity/pairing backup",
"authentication logging review",
"authorized audible catalog playback and nonempty restore",
"autoplay/renewal/reconnect across browsers",
"WAN ICE/TURN and drift"
],
"unreleased_follow_up": {
"publication_ready": false,
"deployed_root_cause_confirmed": false,
"integrated_provisioning": false,
"production_credentials_used": false,
"production_changes": false,
"javascript_tests": 96,
"browser_policy_evidence": "evidence/cross-origin-browser.json",
"details": "evidence/CROSS-ORIGIN-INVESTIGATION.md",
"pending": [
"current trusted Foundry and MA origins",
"explicit read-only credential approval",
"deployed diagnosis and accepted correction",
"dedicated receiver provisioning and audio acceptance"
]
}
},
{
"version": "0.5.0",
"scope": "offline package audit; actual browser synthetic experiment separate from MA/Foundry acceptance",
"connection_configuration": "GM-local in-memory developer API; optional companion setup retained; no one-click GM MA wizard",
"catalog_and_assignments": "shared MA catalog connected to existing GM choices and persistent scene ambient/combat/boss/native fallback + world defaults; real MA playback gated",
"audio": "official SDK PCM and WebRTC implemented experimentally; measured synthetic loopback browser audio, no live MA receiver connection",
"crossfade": "unimplemented",
"companion": "optional source and experimental/companion-0.4.0 branch; no deployment",
"distribution": "one module ZIP; configurable Git-hosted stable manifest + versioned download; offline bundle/checksums/tests pass; no hosted install/update verification",
"ma_mutations_this_revision": 0,
"regression": {
"javascript": 85,
"python": 15
},
"blocking_infrastructure": [
"isolated Foundry v14.371 world",
"existing DEV private identity/pairing",
"secure private browser MA access",
"operator WebSocket auth log review",
"approved synthetic MA ingestion",
"explicit existing TURN relay if required by NAT"
],
"gitea_contacted": false
}
]
}
],
"priorFirefoxFailureEvidence": "evidence/v0.7.0-live-firefox-latest.json",
"priorChromiumFailureEvidence": "evidence/v0.7.0-live-chromium-latest.json",
"latestFirefoxEvidence": "evidence/v0.7.0-live-follow-up.json",
"latestChromiumEvidence": "evidence/v0.7.0-live-follow-up.json",
"priorMAError": {
"code": 2,
"meaning": "MediaNotFound",
"phase": "player_queues/play_media",
"bothBrowserEngines": true,
"catalogMetadataStillPlayable": true,
"exactUpstreamResolutionCause": "unconfirmed",
"automaticMutationRetries": false
},
"dedicatedReceiverReconnectPassed": true,
"privateNginxRouteVerifiedFromUbuntu": true,
"installedFoundryEvidence": "evidence/v0.7.0-foundry-private.json",
"priorBrowserEvidenceScope": "deployed Foundry origin with local source overlay; actual MA, PCM, Web Audio and WebRTC; test-runner signaling, not installed world",
"evidenceScope": "Installed Foundry and actual MA over the private Nginx HTTPS route. Two real player accounts used Foundry module signaling and browser-measured WebRTC playback."
}
+32
View File
@@ -0,0 +1,32 @@
{
"sdk": "@sendspin/sendspin-js",
"version": "5.0.0",
"git_commit": "7d103075138dda5c8909045647bb42b33c2d44fc",
"license": "Apache-2.0",
"integrity": "sha512-yRRjPsz6TyR1GzRYO7ur7oAzwZ11tELK1PEp6Ci7fscXOI0JdtP6BbwPhw+/CR0TWQxu/VwtVPtXT9SH/xhzFw==",
"inspected_before_install": true,
"install_hooks": false,
"dependency_pins": {
"@noble/ciphers": "1.3.0",
"@noble/curves": "1.9.7",
"@noble/hashes": "1.8.0",
"opus-encdec": "0.1.1"
},
"tool_pins": {
"esbuild": "0.27.1",
"playwright": "1.57.0"
},
"distribution_gate": "Pinned bundle hash, all notices and release validator required; no install hooks executed",
"license_review": "Reviewed Apache-2.0 SDK and full MIT noble license texts copied to licenses/vendor; optional opus-encdec fallback disabled, not distributed",
"lockfile": "package-lock.json",
"audit_checked_at": "2026-12-03T20:42:10.993687+00:00",
"vulnerabilities": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 0,
"critical": 0,
"total": 0
},
"bundle_sha256": "b3a7c91e87c0a45e4bdb5a3bd3f323a12ffde9b54babd5ba38351d5dfd4d8556"
}
+42
View File
@@ -0,0 +1,42 @@
{
"license": "MIT; original mathematically generated tones",
"sample_rate": 24000,
"channels": 2,
"duration_seconds": 90,
"sequences": {
"ambient": [
{
"file": "ambient-1.wav",
"frequency_hz": 110,
"sha256": "12ec19bfe12e8a8e3d0f29e79de31812127f1f7e360ac4a2175026e5f210211e"
},
{
"file": "ambient-2.wav",
"frequency_hz": 165,
"sha256": "b12e11c31154dae190c9e448165577decd932d53af5f1969eaa8869db4ea690f"
},
{
"file": "ambient-3.wav",
"frequency_hz": 220,
"sha256": "c9bf2501ba41d16f0c1055b8b383db05f7de714206af35446eb0aad82476376b"
}
],
"combat": [
{
"file": "combat-1.wav",
"frequency_hz": 440,
"sha256": "4e6ba740d0fba4115e6117a118faec5eb74d5d171b1d4051602f86e004b9ee2e"
},
{
"file": "combat-2.wav",
"frequency_hz": 660,
"sha256": "95e8758c279780d4687011a755f7d79528e359e1b9221fb9739602eade7c5b08"
},
{
"file": "combat-3.wav",
"frequency_hz": 880,
"sha256": "cb83457277efdaa44e181697eadc7b8542fe60d00199bb10d547a5c21c29d4e9"
}
]
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"checked_at": "2026-12-03T17:18:24.860Z",
"synthetic_ingestion": false,
"error": "unavailable",
"playback_mutations": 0
}
+8
View File
@@ -0,0 +1,8 @@
{
"checked_at": "2026-12-03T17:25:16.043Z",
"evidence_class": "local generated audio decoding",
"tracks": 6,
"frames": 27000,
"duration_seconds": 540,
"hashes_match": true
}
+150
View File
@@ -0,0 +1,150 @@
{
"checked_at": "2026-12-03",
"git_sources": [
{
"repository": "https://github.com/Sayshal/vgmusic",
"tag": "release-1.4.5",
"commit": "eba07a08c9925f31b9c8adb72faf95de11ae705c",
"local_directory": "vgmusic",
"files": {
"LICENSE": "8da4373e2f64fdd0289d5aba0ad81856f39742582dfa8caf49b22eece53e62d0",
"module.json": "2a50f7dfaaf91e953f6ffde97c8d58f5c88ab3cf2499863cf873d8f264539357",
"package.json": "6e607c8234023df368935e22fd7463d15ac6ab357e604899999c8a78ee1747fa",
"package-lock.json": "245c2723ddfc25a549e600630a324603e9cb234553dc392c8c5c92cc6da896f2",
"scripts/music-controller.mjs": "fc51195eda3c9cb8e04b9fc90ab9a4bd91c99ce6735a54929cf2bf3fa7404ccf",
"scripts/hooks.mjs": "069f1ede780ef1d55c51d65ff17322606f2d89f83d7d02284d2b1149a44898a0",
"scripts/playlist-context.mjs": "5126fbdef6b8129e6a8050da098a6fd904b02684565db014b9afe53d00bd2c0f"
}
},
{
"repository": "https://github.com/music-assistant/server",
"tag": "2.10.6",
"commit": "c24866405bd2068c25a60e1014e5ef8c3f6445bb",
"local_directory": "server",
"files": {
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"pyproject.toml": "39e6e2cd3962b081b6b8d2b905846d1e79a3ebc21f330d8003bf748f6913c84c",
"requirements_all.txt": "bf97bece2eaca5c0a9beead3a9a2f4e9cf66228c891e6580cb074219c1b2a141",
"music_assistant/controllers/webserver/controller.py": "93a3784d2c2070be512ed2f4619a6ea32088cb91aaa13879ab2fc2a7725a2f06",
"music_assistant/controllers/webserver/auth.py": "462717a6b2486c692d18f3917b26cf12eb036d1bb31ab1a4d0281a9ab505b116",
"music_assistant/controllers/webserver/websocket_client.py": "7ad62ba1f015914cdea6f99c8cac384a4c10ee33fb5b03ab0b6049cce729ecfd",
"music_assistant/controllers/webserver/sendspin_proxy.py": "0b2a25363786e8ef13a460b18c43e1a4a9d0ba30d816349a61f8db7421b85e7e",
"music_assistant/controllers/player_queues/controller.py": "3d610ee9b643a5a338104fbf13d67d2b680b7d4570bc7dfe2364e4d9712b4588",
"music_assistant/providers/sendspin/manifest.json": "cb99a3715f32c573a5120b960e5c3a31c6823bfc269f4963b8d72910132e38ea",
"music_assistant/controllers/webserver/helpers/auth_middleware.py": "f1c45cc4927c9a5e71193b13ff9d4300daaa65dc7b849d255c924fa495fb24a5",
"music_assistant/controllers/players/controller.py": "fd4a66cfe2b28ab7859f46990b3c45f58778d9fbb8dfb196346bed516a012c99",
"music_assistant/controllers/music/media/base.py": "a47aa23c9ed1039e303db1e4da1903c84d2122ed7c66c2b66ad8edd2d7341d45",
"music_assistant/providers/sendspin/provider.py": "9ba7235cd48723255a1d7e4af28f8f90f0e7448f4b234228571e219fa92ccb14",
"music_assistant/providers/sendspin/player.py": "306251735f52295cce3293549ca7f226fe37cab4d454966e8fb657aca7c535c6",
"music_assistant/providers/sendspin/README.md": "ee43c336550a7f4b8cac188f77e6d4e0b580d47d94321f392738d93da9e2c890",
"music_assistant/controllers/player_queues/queue_loader.py": "ead02948ca4450d3651d0c90683df16a16e8b6e23a040bf16b3eb877756e7a0e",
"music_assistant/helpers/uri.py": "c97c43f28db833910635bc89268dd44cb2487b3c26005737f55eb6c1f55521ca",
"music_assistant/providers/builtin/__init__.py": "54349ff427defa5a8c6664ccbcaf47c6564e1eb1606def5b8572c6d57e77df91",
"music_assistant/controllers/music/media/playlists.py": "7dbc38f93688a2b4f6fcd0501607a22942af55766d40f81795beef0dc037eb3e",
"music_assistant/controllers/player_queues/helpers.py": "0206927895599dae0b1dd4842a37d11d5d8e0de539e8f710b07684572de25529",
"music_assistant/controllers/config/core.py": "4703113e383c70edd4d2e2b997fb3c0d6cbd86209cb076eb21e723991e49c634"
}
},
{
"repository": "https://github.com/music-assistant/frontend",
"tag": "2.17.297",
"commit": "e779b9d359e47cd210c2801f16a0ce6263571903",
"local_directory": "frontend",
"files": {
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"package.json": "83c66acc4371e0f10119ee50ee3d6940e3126fbf36898de02875331a590847c6",
"pnpm-lock.yaml": "129e7a8526a2e96c37f53bcc1895292cb56a73443c373198974ac7aa90b40093",
"src/plugins/sendspin-connection.ts": "780f52ad85fa38b1789267a50f03c744d59b59fa3dca3599ae0f742b150173ee"
}
},
{
"repository": "https://github.com/sendspin/sendspin-js",
"tag": "5.0.0",
"commit": "7d103075138dda5c8909045647bb42b33c2d44fc",
"local_directory": "sendspin-js-5",
"files": {
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"package.json": "6e1a04d4cf82ddae3e09ac7964952c718395b22a6de260f2e092d9848235aa88",
"src/core/protocol-handler.ts": "b3108d57fbaf974dd7aaf2b8bf0102817928fa1de501b0806b52bdd50a5d9436",
"src/core/transport.ts": "0d855eab42e1f94ef94e5aa324244eadd0e6fe99cb8be8e528199ab07cedb6b2",
"src/audio/clock-source.ts": "bd1c7321702211db42e3bedac746c0fa490a1e12215c3e34ec6b372a2c48a0e6",
"src/audio/decoder.ts": "0abefd87c26079cde9e2f87ad4c8d77a19818818d4ae745002e22930afac1e6a",
"src/audio/output-latency-tracker.ts": "1f5f6492fbb8ee7c1b2dc15c0299c7bbb62aa7dd356c8845c6c4e4178017d7c7",
"src/audio/platform-output-latency.ts": "ad916a598042e1a28578e9568668cdf2c3f880950f9232c438eebbdb34a1519a",
"src/audio/recorrection-monitor.ts": "075660439b7d1ae4140979c20d92a4b15d0842adf4d66f2ad32be031d2116858",
"src/audio/scheduler.ts": "d6d5b134d83d06c0d93b3da49aa70503e38da2fe5800f5029f299b233dd38b9a",
"src/client-identity.ts": "27b645e35d7967577c3a63246128b26350989e4a6ec8cfd66687682c048c4726",
"src/core/activate-authorization.ts": "e2a23dec97ef03829baafee8a4c83075e29c4c265d281926b2ce921d0ec1ccab",
"src/core/codec-support.ts": "fe160adfa40d2c5e0a3b3edd255ea94a283bf98e77431846ae3a0048e6cc50ce",
"src/core/core.ts": "44ce239896faca0887dbf33b5d5b7de924a3ee94c8babfe4e631ef6a82c2c5db",
"src/core/noise/base64url.ts": "0a8fc8f065de1b79497cd166cdfd02f0b1a8558d371bd641c0f8ab6f13cb9a16",
"src/core/noise/cipher-state.ts": "f31000531f6c5aecdbab4cb7ea3d2bfe3911fb58136b72c9e9a58cd0c386cd5d",
"src/core/noise/constants.ts": "bde591118b52136f90cd7e41f6901494c4a1cfae61cb0edaea26b599337829de",
"src/core/noise/handshake.ts": "40caa0df0098d1121a50547614b3564837241945d136fd2faab9202d8228ee3a",
"src/core/noise/identity.ts": "9f23c76b71aa7558aed9a6d416a5c9e75c69798cd74748454d96e96b9791022e",
"src/core/noise/index.ts": "0facbc17a2621f2e9ebf86dd1fadf5efece71028a495eb7165c62c8fe68c8218",
"src/core/noise/pairing-token.ts": "dfbc2e88478bbf9b7e4559c6597206b2262de431007143f8b3d099000980b762",
"src/core/noise/psk.ts": "7c5028446c85ff15e61f1afbee8fa6cc95628afb670018a107f0bd33622acafd",
"src/core/noise/session.ts": "fc1c6747c3d556920e5ac21726f1baa401c575ff6efe9546c8aa6687ebc95c50",
"src/core/noise/suites.ts": "59ba4f407a462c82afbd15568af682de823b012e5e831e67b368a2506d696abc",
"src/core/noise/symmetric-state.ts": "c498ce9caaf89af44076fa89dbd1fc8919289c6ca1b6de2a9670f4b99496a5f9",
"src/core/pairing.ts": "59c0994b3cd422035b98812268e2e87a87b99554786e8da46936af751cbcdc34",
"src/core/pake/cpace.ts": "fed37dbc91bb0f7711492a8481598982c887f14e244c0d1ef1ec0d59a103a2ec",
"src/core/pake/pin.ts": "5852b68967caa92626636f9cb48be3fd527ebee6911ddd54228740674efb71e4",
"src/core/state-manager.ts": "827fff0bbbb6153d807f21456a952f73b61b3aa81fa7bcd5b7aad7362ad122f9",
"src/core/static-delay-store.ts": "265dddae81afe28a8d1b376560e70cbe8c8c26f996ace0bf0bd1be84079d8f29",
"src/core/time-filter.ts": "0d562c167deb3cbdc2b7a23e5baa6f2dc70f214e5307b89903762f01dd6000f7",
"src/core/time-sync-manager.ts": "d64b7b648422333f68bafa878b2b3e2c084bd91d00f980b88c51c4ad8b07f913",
"src/core/websocket-manager.ts": "4acada3e75f19f63f2f7e6d367c545e2dc37a8735fdb32a40e100d94e6bb96db",
"src/index.ts": "e4ba034a7ab604ab80786ca255c73821cd4951ffc4a80c1bf24c4db3fb8d173b",
"src/internal-types.ts": "26e818c95bf831a7123788ca79cba104fc05c887e654c5e67bae06b9669cc2e2",
"src/opus-encdec.d.ts": "e05ec654daf12453bfe44d81b0ec8bc5162d1cd47a12df4502d0e879ca6be40a",
"src/sync-delay.ts": "8bdc54745a7b75da3d2dc78133e82601241323f9e33ee381f9c657d58c58916f",
"src/types.ts": "939c8df601891ad7b483fafa49df2b837e834881685f7e2278eb9e2ffd5dea15"
}
},
{
"repository": "https://github.com/sendspin/sendspin-js",
"tag": "6.1.0",
"commit": "7ee7ca35ac29ae3ef5f2eeeeaac1e24751a8790b",
"local_directory": "sendspin-js",
"files": {
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"package.json": "b6cae2c9836e467941bb7baab35bde2ead29f3171ce8be18fdb23b758d6b30e9",
"src/core/core.ts": "54a122bada7d50890336af583b38b4f84d1dc2b343867fbadf2b1fe315862a07",
"src/core/transport.ts": "f3b275b436bc008c64f8f8b7d97530a7fb0a4611a8541585e047157d4d9d172c",
"src/core/websocket-manager.ts": "f302d00e67815b4052b4ca68029152ed0c28d36de074730f257a68e6f73e3315",
"src/core/noise/identity.ts": "bce6e2a4382702a89f690337a752a36a989318234af407aec0f7cc97ae233d6c",
"src/index.ts": "3099bac414aa077cd2d816fd75a38e129cdc3f84f15808e19a7fde57318744a5",
"src/core/state-manager.ts": "74a053e6315b5e5915ff42fea8ca4f7d7fc8f3e970050b3e2a8511b54c3aaf9f",
"src/core/protocol-handler.ts": "75fdafd6c19906385f4c53699080494d0141f77d0cb9c45301853db0462b75f3"
}
}
],
"pypi_sources": [
{
"version": "9.1.1",
"url": "https://files.pythonhosted.org/packages/73/f0/03f798813a0e09f4e1565691d2e5138f0750c98b36d93f522d06c44efe66/aiosendspin-9.1.1.tar.gz",
"sha256": "1e9a33ec5b6dcbc16b4f03c07586195beaa80eb2e5ba4254b97979ae0e0ec4b7",
"inspected_files": {
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"README.md": "c7f2aaeb734b6628edf06ea9b4a5b425f25a5949a606a3d7f1f3dfb2268c749d",
"pyproject.toml": "940b19e327b155d56ca4935a6d62b946a28b60b734e4f35f61c49bd7b194798c",
"aiosendspin/client/client.py": "1fb7911997417fc97b85221de84935a0c4ae6cfc71d6dc29ca2e2aef5e4b4a08",
"aiosendspin/noise/trust_store.py": "b5a8dbd3f5d6692dca9ccdd4e9eba8eb9b706fa1ced69ef91bb8dcccb0d3f37f"
},
"local_directory": "aiosendspin/aiosendspin-9.1.1"
},
{
"name": "music-assistant-models",
"version": "1.1.205",
"license": "Apache-2.0",
"url": "https://files.pythonhosted.org/packages/93/f3/2d9bad4aabf98a12353f9cade2b37fb460b8dd61ad190aab230a17e6abdd/music_assistant_models-1.1.205-py3-none-any.whl",
"sha256": "9a7a7f72d2eaeaa5ab12a5f32b15000605d6ee9053f72934e06aae3d1535ae4f",
"inspected_files": {
"music_assistant_models/errors.py": "6257aafd11910b27c228d7bfbff2240024363e6eb64c2ae6c1a0a07e1cea0ed4"
},
"local_directory": "music-assistant-models-1.1.205"
}
]
}
+29
View File
@@ -0,0 +1,29 @@
Adaptive Music v0.6.0 validation — 2026-12-03
/home/ubuntu/.nvm/versions/node/v24.23.0/bin/node --test --test-reporter=tap tests/js/*.test.mjs
PASS: 91 tests, 0 failed, 0 skipped. Full output: v0.6.0-js-tests.txt.
Temporary loopback fixture servers required execution outside the restricted sandbox.
python3 -m unittest discover -s tests -v
PASS: 15 tests, OK.
python3 scripts/audit_repository.py
PASS: repository privacy/attribution guardrails.
python3 scripts/verify_upstream.py
PASS: all recorded Git heads, source and distribution file hashes.
Read local pinned research checkouts; did not fetch or install dependencies.
git diff --check
PASS: no whitespace errors.
PLAYWRIGHT_BROWSERS_PATH=.local/browsers node scripts/check_setup_browser.mjs
PASS: Chromium 143.0.7499.4 actual DOM fixture; wizard render/steps,
private field clearing, catalog selectors, scene ambient/combat save,
hidden advanced controls, listener activation; no page errors.
Temporary loopback HTTP and headless browser; fixture documents/connection only.
No v0.6.0 live Foundry or MA connection/playback, no production credential use,
no Git server access, and no production service/network changes.
User-reported v0.5.0 publication/install/window rendering is recorded separately.
Release import/manifest/license/privacy/checksum validation is performed by release.py.
+556
View File
@@ -0,0 +1,556 @@
TAP version 13
# Subtest: automatic invitations use document-bound ephemeral keys and never broadcast the capability
ok 1 - automatic invitations use document-bound ephemeral keys and never broadcast the capability
---
duration_ms: 11.117677
type: 'test'
...
# Subtest: forged GM claims, recipient changes, tampering and rotated document keys fail closed
ok 2 - forged GM claims, recipient changes, tampering and rotated document keys fail closed
---
duration_ms: 2.082811
type: 'test'
...
# Subtest: parallel bootstrap replay, multiple GMs, revoked roles and expired capabilities cannot connect
ok 3 - parallel bootstrap replay, multiple GMs, revoked roles and expired capabilities cannot connect
---
duration_ms: 2.475986
type: 'test'
...
# Subtest: catalog paginates, strips private metadata and filters unapproved mappings
ok 4 - catalog paginates, strips private metadata and filters unapproved mappings
---
duration_ms: 32.850148
type: 'test'
...
# Subtest: empty provider allowlist denies without I/O; malformed and endless pages fail
ok 5 - empty provider allowlist denies without I/O; malformed and endless pages fail
---
duration_ms: 18.296825
type: 'test'
...
# Subtest: target validation rejects group, changed identity and unavailable player
ok 6 - target validation rejects group, changed identity and unavailable player
---
duration_ms: 1.442234
type: 'test'
...
# Subtest: synthetic audio isolates simultaneous campaigns and copies every frame
ok 7 - synthetic audio isolates simultaneous campaigns and copies every frame
---
duration_ms: 0.485778
type: 'test'
...
# Subtest: audio denies forged origin/session/role, unknown fields and cross-campaign grants
ok 8 - audio denies forged origin/session/role, unknown fields and cross-campaign grants
---
duration_ms: 0.315819
type: 'test'
...
# Subtest: active listener revocation/expiry and slow-client overflow close handles
ok 9 - active listener revocation/expiry and slow-client overflow close handles
---
duration_ms: 0.506526
type: 'test'
...
# Subtest: synthetic source rejects stale sessions/generations, oversized frames; connections are bounded
ok 10 - synthetic source rejects stale sessions/generations, oversized frames; connections are bounded
---
duration_ms: 0.400789
type: 'test'
...
# Subtest: catalog authorization denies listener and injection before upstream
ok 11 - catalog authorization denies listener and injection before upstream
---
duration_ms: 0.376122
type: 'test'
...
# Subtest: scene/combat configuration preserves independent flags and stores only tagged references
ok 12 - scene/combat configuration preserves independent flags and stores only tagged references
---
duration_ms: 4.695721
type: 'test'
...
# Subtest: role loss, stale selection and arbitrary URL/ID fail before document write
ok 13 - role loss, stale selection and arbitrary URL/ID fail before document write
---
duration_ms: 0.347479
type: 'test'
...
# Subtest: editor uses text for catalog labels and rechecks GM on actual save event
ok 14 - editor uses text for catalog labels and rechecks GM on actual save event
---
duration_ms: 0.372166
type: 'test'
...
# Subtest: configuration hook disposal prevents pending asynchronous render from mounting
ok 15 - configuration hook disposal prevents pending asynchronous render from mounting
---
duration_ms: 0.222887
type: 'test'
...
# Subtest: packaged browser client connects through real loopback companion/MA wire fixtures and restores combat queue
ok 16 - packaged browser client connects through real loopback companion/MA wire fixtures and restores combat queue
---
duration_ms: 94.0349
type: 'test'
...
# Subtest: companion denies listener control, wrong scope/Origin, upstream injection and unknown routes
ok 17 - companion denies listener control, wrong scope/Origin, upstream injection and unknown routes
---
duration_ms: 11.775335
type: 'test'
...
# Subtest: browser accepts only relative same-origin paths and never persists a connection grant
ok 18 - browser accepts only relative same-origin paths and never persists a connection grant
---
duration_ms: 0.275675
type: 'test'
...
# Subtest: companion operation replay is idempotent and same ID with changed payload is denied
ok 19 - companion operation replay is idempotent and same ID with changed payload is denied
---
duration_ms: 12.942194
type: 'test'
...
# Subtest: companion listener stream rejects controller grant and closes on live revocation and expiry
ok 20 - companion listener stream rejects controller grant and closes on live revocation and expiry
---
duration_ms: 92.342037
type: 'test'
...
# Subtest: catalog revocation during upstream I/O suppresses the response at the companion boundary
ok 21 - catalog revocation during upstream I/O suppresses the response at the companion boundary
---
duration_ms: 8.904953
type: 'test'
...
# Subtest: policy precedence and explicit silence
ok 22 - policy precedence and explicit silence
---
duration_ms: 1.199009
type: 'test'
...
# Subtest: inactive, unstarted and other scene combats ignored; boss ties stable
ok 23 - inactive, unstarted and other scene combats ignored; boss ties stable
---
duration_ms: 3.984422
type: 'test'
...
# Subtest: scene -> combat -> boss -> nested manual -> unwind restores offsets, duplicates and pause
ok 24 - scene -> combat -> boss -> nested manual -> unwind restores offsets, duplicates and pause
---
duration_ms: 1.248452
type: 'test'
...
# Subtest: scene change during manual never resurrects previous scene
ok 25 - scene change during manual never resurrects previous scene
---
duration_ms: 0.257202
type: 'test'
...
# Subtest: boss removed during manual and deleted combat cannot return
ok 26 - boss removed during manual and deleted combat cannot return
---
duration_ms: 0.309818
type: 'test'
...
# Subtest: duplicate intent causes zero provider mutations
ok 27 - duplicate intent causes zero provider mutations
---
duration_ms: 0.115966
type: 'test'
...
# Subtest: prepare failure leaves current playback intact
ok 28 - prepare failure leaves current playback intact
---
duration_ms: 0.348671
type: 'test'
...
# Subtest: partial apply failure restores outgoing playback
ok 29 - partial apply failure restores outgoing playback
---
duration_ms: 3.387266
type: 'test'
...
# Subtest: obsolete async resolve is rejected before stop/apply
ok 30 - obsolete async resolve is rejected before stop/apply
---
duration_ms: 0.246049
type: 'test'
...
# Subtest: lease loss during stop prevents apply and stale rollback
ok 31 - lease loss during stop prevents apply and stale rollback
---
duration_ms: 0.785727
type: 'test'
...
# Subtest: provider switch and bounded nested stack
ok 32 - provider switch and bounded nested stack
---
duration_ms: 0.299308
type: 'test'
...
# Subtest: no authority retains playback without provider access
ok 33 - no authority retains playback without provider access
---
duration_ms: 0.104495
type: 'test'
...
# Subtest: queued state is captured at submission rather than read after caller mutation
ok 34 - queued state is captured at submission rather than read after caller mutation
---
duration_ms: 0.070922
type: 'test'
...
# Subtest: supersession after snapshot prevents mutations
ok 35 - supersession after snapshot prevents mutations
---
duration_ms: 0.179354
type: 'test'
...
# Subtest: failed cross-provider apply cleans new owned audio before outgoing restoration
ok 36 - failed cross-provider apply cleans new owned audio before outgoing restoration
---
duration_ms: 0.158736
type: 'test'
...
# Subtest: superseded cross-provider apply is reconciled by stopping partially touched target
ok 37 - superseded cross-provider apply is reconciled by stopping partially touched target
---
duration_ms: 0.161141
type: 'test'
...
# Subtest: extracted companion launches privately with fixture credentials, serves catalog diagnostics and listener PCM
ok 38 - extracted companion launches privately with fixture credentials, serves catalog diagnostics and listener PCM
---
duration_ms: 202.3378
type: 'test'
...
# Subtest: gateway binds target server-side and sanitizes metadata
ok 39 - gateway binds target server-side and sanitizes metadata
---
duration_ms: 1.026207
type: 'test'
...
# Subtest: forged, wrong origin/campaign/session and unknown args deny before upstream
ok 40 - forged, wrong origin/campaign/session and unknown args deny before upstream
---
duration_ms: 0.381642
type: 'test'
...
# Subtest: listener cannot read queues or acquire controller lease
ok 41 - listener cannot read queues or acquire controller lease
---
duration_ms: 0.165018
type: 'test'
...
# Subtest: expiry, revocation, stale fence and replay reject
ok 42 - expiry, revocation, stale fence and replay reject
---
duration_ms: 0.216595
type: 'test'
...
# Subtest: lease cannot be stolen and increases fence after revoke
ok 43 - lease cannot be stolen and increases fence after revoke
---
duration_ms: 0.125214
type: 'test'
...
# Subtest: revocation during upstream I/O suppresses response
ok 44 - revocation during upstream I/O suppresses response
---
duration_ms: 0.132218
type: 'test'
...
# Subtest: MA adapter uses pinned envelope, Bearer header, fixed path, no redirects and returns no metadata
ok 45 - MA adapter uses pinned envelope, Bearer header, fixed path, no redirects and returns no metadata
---
duration_ms: 13.038734
type: 'test'
...
# Subtest: MA mismatched queue, upstream failures and redirects fail with sanitized errors
ok 46 - MA mismatched queue, upstream failures and redirects fail with sanitized errors
---
duration_ms: 1.733057
type: 'test'
...
# Subtest: MA rejects URL credentials, query/fragment, paths and non-HTTP configuration
ok 47 - MA rejects URL credentials, query/fragment, paths and non-HTTP configuration
---
duration_ms: 0.276196
type: 'test'
...
# Subtest: MA read adapter performs real local HTTP POST against an isolated fixture
ok 48 - MA read adapter performs real local HTTP POST against an isolated fixture
---
duration_ms: 16.08324
type: 'test'
...
# Subtest: signaling is confidential, per-listener authenticated, scoped and replay resistant
ok 49 - signaling is confidential, per-listener authenticated, scoped and replay resistant
---
duration_ms: 6.13541
type: 'test'
...
# Subtest: signaling denies expired invitation, unknown/audio message types and unapproved TURN secrets
ok 50 - signaling denies expired invitation, unknown/audio message types and unapproved TURN secrets
---
duration_ms: 3.598632
type: 'test'
...
# Subtest: GM browser policy refuses mixed content and SDK identity mismatch before any MA connection
ok 51 - GM browser policy refuses mixed content and SDK identity mismatch before any MA connection
---
duration_ms: 0.721157
type: 'test'
...
# Subtest: official pinned SDK decodes real binary PCM frames and discards stale generations
ok 52 - official pinned SDK decodes real binary PCM frames and discards stale generations
---
duration_ms: 0.249546
type: 'test'
...
# Subtest: parallel signaling replay cannot pass the asynchronous authentication check twice
ok 53 - parallel signaling replay cannot pass the asynchronous authentication check twice
---
duration_ms: 1.522783
type: 'test'
...
# Subtest: GM API WebSocket adapter authenticates privately, assembles partial results and refuses broad commands
ok 54 - GM API WebSocket adapter authenticates privately, assembles partial results and refuses broad commands
---
duration_ms: 12.304332
type: 'test'
...
# Subtest: peer signaling bounds queued work and rejects expired invites before allocating a connection
ok 55 - peer signaling bounds queued work and rejects expired invites before allocating a connection
---
duration_ms: 23.16561
type: 'test'
...
# Subtest: wizard inspects only the imported dedicated identity, loads stable catalog IDs and enables guarded playlist playback
ok 56 - wizard inspects only the imported dedicated identity, loads stable catalog IDs and enables guarded playlist playback
---
duration_ms: 6.110794
type: 'test'
...
# Subtest: disconnect cancels pending GM startup before any authenticated receiver connection
ok 57 - disconnect cancels pending GM startup before any authenticated receiver connection
---
duration_ms: 0.285383
type: 'test'
...
# Subtest: loopback transport denies unauthenticated, cross-campaign, controller, query and wrong-origin requests
ok 58 - loopback transport denies unauthenticated, cross-campaign, controller, query and wrong-origin requests
---
duration_ms: 15.412999
type: 'test'
...
# Subtest: loopback streams synthetic PCM bytes and closes an active stream on revocation
ok 59 - loopback streams synthetic PCM bytes and closes an active stream on revocation
---
duration_ms: 42.102941
type: 'test'
...
# Subtest: loopback closes idle synthetic stream when its listener capability expires
ok 60 - loopback closes idle synthetic stream when its listener capability expires
---
duration_ms: 22.434864
type: 'test'
...
# Subtest: MA snapshots ordered duplicate occurrences, pause and seek then reconstructs exact unshuffled order
ok 61 - MA snapshots ordered duplicate occurrences, pause and seek then reconstructs exact unshuffled order
---
duration_ms: 7.970949
type: 'test'
...
# Subtest: tampered, foreign/future snapshots and stale authority deny before MA mutations
ok 62 - tampered, foreign/future snapshots and stale authority deny before MA mutations
---
duration_ms: 0.994428
type: 'test'
...
# Subtest: shuffled snapshot fails before interruption rather than promising exact restore
ok 63 - shuffled snapshot fails before interruption rather than promising exact restore
---
duration_ms: 0.12279
type: 'test'
...
# Subtest: prepared media cannot be forged and stale generations cannot issue controls
ok 64 - prepared media cannot be forged and stale generations cannot issue controls
---
duration_ms: 0.197099
type: 'test'
...
# Subtest: every wire mutation revalidates exact identity/topology and uses fixed dedicated queue
ok 65 - every wire mutation revalidates exact identity/topology and uses fixed dedicated queue
---
duration_ms: 16.659427
type: 'test'
...
# Subtest: queue injection, transfer, arbitrary media URL and authority loss deny without writes
ok 66 - queue injection, transfer, arbitrary media URL and authority loss deny without writes
---
duration_ms: 0.561489
type: 'test'
...
# Subtest: catalog IDs survive independent adapter construction and differ across campaigns
ok 67 - catalog IDs survive independent adapter construction and differ across campaigns
---
duration_ms: 2.228873
type: 'test'
...
# Subtest: same-generation duplicate controls and restores issue no duplicate mutations
ok 68 - same-generation duplicate controls and restores issue no duplicate mutations
---
duration_ms: 0.864215
type: 'test'
...
# Subtest: MA provider with mock MA client composes with controller for nested contexts and rapid supersession
ok 69 - MA provider with mock MA client composes with controller for nested contexts and rapid supersession
---
duration_ms: 2.850994
type: 'test'
...
# Subtest: ambiguous wire mutation failure latches closed instead of retrying or restoring blindly
ok 70 - ambiguous wire mutation failure latches closed instead of retrying or restoring blindly
---
duration_ms: 0.537284
type: 'test'
...
# Subtest: listener cannot obtain a playback fence guard or renew a controller lease
ok 71 - listener cannot obtain a playback fence guard or renew a controller lease
---
duration_ms: 0.734622
type: 'test'
...
# Subtest: playlist preparation expands approved ordered tracks before any playback mutation
ok 72 - playlist preparation expands approved ordered tracks before any playback mutation
---
duration_ms: 0.80827
type: 'test'
...
# Subtest: installable development entry defaults automation off and imports no gateway
ok 73 - installable development entry defaults automation off and imports no gateway
---
duration_ms: 7.235745
type: 'test'
...
# Subtest: native captures actual offset and paused state, stops per sound, restores repeat/volume
ok 74 - native captures actual offset and paused state, stops per sound, restores repeat/volume
---
duration_ms: 1.289138
type: 'test'
...
# Subtest: native resolves sequential playlist and touches only owned documents
ok 75 - native resolves sequential playlist and touches only owned documents
---
duration_ms: 0.389277
type: 'test'
...
# Subtest: native rejects unsupported shuffle and empty playlist
ok 76 - native rejects unsupported shuffle and empty playlist
---
duration_ms: 0.136165
type: 'test'
...
# Subtest: native rejects expired tracks, changed playlist membership and foreign/future snapshots before mutation
ok 77 - native rejects expired tracks, changed playlist membership and foreign/future snapshots before mutation
---
duration_ms: 0.153157
type: 'test'
...
# Subtest: native reports nonseekable restoration and clamps near-end seek
ok 78 - native reports nonseekable restoration and clamps near-end seek
---
duration_ms: 0.166301
type: 'test'
...
# Subtest: scene-linked playlist conflict and lost authority fail before mutation
ok 79 - scene-linked playlist conflict and lost authority fail before mutation
---
duration_ms: 0.16035
type: 'test'
...
# Subtest: GM election deterministic and no GM means none
ok 80 - GM election deterministic and no GM means none
---
duration_ms: 3.895297
type: 'test'
...
# Subtest: Foundry bootstrap registers local settings/hooks and disposes without ambient or actor access
ok 81 - Foundry bootstrap registers local settings/hooks and disposes without ambient or actor access
---
duration_ms: 0.706259
type: 'test'
...
# Subtest: synthetic WAV termination emits fixed PCM frames through campaign listener authorization
ok 82 - synthetic WAV termination emits fixed PCM frames through campaign listener authorization
---
duration_ms: 0.897347
type: 'test'
...
# Subtest: malformed, truncated and incompatible WAV formats fail closed before PCM publication
ok 83 - malformed, truncated and incompatible WAV formats fail closed before PCM publication
---
duration_ms: 5.927141
type: 'test'
...
# Subtest: credential loader rejects permissive modes, symlinks and malformed secrets
ok 84 - credential loader rejects permissive modes, symlinks and malformed secrets
---
duration_ms: 5.456782
type: 'test'
...
# Subtest: private catalog identity key persists and unsafe key permissions fail
ok 85 - private catalog identity key persists and unsafe key permissions fail
---
duration_ms: 52.916147
type: 'test'
...
# Subtest: scene assignments persist independently and world defaults/boss priority resolve without actor schemas
ok 86 - scene assignments persist independently and world defaults/boss priority resolve without actor schemas
---
duration_ms: 1.092932
type: 'test'
...
# Subtest: native fallback is explicit, manual silence wins and legacy ambient does not resurrect after clearing
ok 87 - native fallback is explicit, manual silence wins and legacy ambient does not resurrect after clearing
---
duration_ms: 0.897637
type: 'test'
...
# Subtest: unavailable saved MA selections are preserved but new forged IDs/non-native fallback and role loss deny
ok 88 - unavailable saved MA selections are preserved but new forged IDs/non-native fallback and role loss deny
---
duration_ms: 0.389588
type: 'test'
...
# Subtest: GM setup connects catalog into independent scene editors and never persists private GM authentication
ok 89 - GM setup connects catalog into independent scene editors and never persists private GM authentication
---
duration_ms: 3.130998
type: 'test'
...
# Subtest: browser PCM sink resumes from gesture, decodes stereo frames and closes its context on stream end
ok 90 - browser PCM sink resumes from gesture, decodes stereo frames and closes its context on stream end
---
duration_ms: 15.104151
type: 'test'
...
# Subtest: normal listener has one activation action and no token or invitation entry
ok 91 - normal listener has one activation action and no token or invitation entry
---
duration_ms: 0.236251
type: 'test'
...
1..91
# tests 91
# suites 0
# pass 91
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 1421.813847
+19
View File
@@ -0,0 +1,19 @@
{
"scope": "isolated development tools only, not distributed dependencies",
"packages": [
{
"name": "playwright",
"version": "1.65.2",
"integrity": "sha512-Bfg9lfUnqknFzjWrvz2GMckl656TWYwDHiR+T8MQK1V+Sp1D+ODuxpcsnMQ31BYH+LBiKs6kXRMInesqO8F41w==",
"license": "Apache-2.0"
},
{
"name": "playwright-core",
"version": "1.65.2",
"integrity": "sha512-aHu9F46Mx5ha9iiB+VLZMUUtex3PBw4am9MHptc0IXaJhz++6YXsH96eEyThwCwMkIUiB8TdZcwXqnb3xKDzmA==",
"license": "Apache-2.0"
}
],
"installHooksExecuted": false,
"browserVersionsFromLiveReports": true
}
+37
View File
@@ -0,0 +1,37 @@
v0.7.0 staged acceptance — updated 2026-12-04
Node 24.23.0 JavaScript suite: 101 passed, 0 failed.
Python repository/release suite: 15 passed.
Repository privacy/attribution audit: PASS.
Pinned upstream Git heads and file hashes: PASS.
Production dependency npm audit: 0 reported advisories (not a security guarantee).
Chromium DOM fixture: PASS, 380/640/1000px, no page errors.
Actual Foundry 14.371 ApplicationV2 / browser IndexedDB: PASS at 380/640px.
Browser signaling: Firefox/Chromium real negotiation PASS after SDP fix.
Trusted local-CA HTTPS/WSS policy matrix: six scenarios PASS.
Actual deployed-origin authentication: Firefox 159 and Chromium 159 PASS through
normal sandbox DNS (public addresses); seven providers.
Actual MA catalog/audio + two browser listeners + emulated pause/seek/resume/volume
+ combat interruption and ordered/position restoration: complete passing live runs
recorded separately, including Chromium 159 and a fresh module-created receiver in
Firefox 144. The listener relay is in the test runner, not Foundry's module socket.
Earlier Firefox and Chromium 159 runs received MA error 2 / MediaNotFound on catalog
startup. The cause remains unconfirmed. Both engines subsequently passed full live
playback with two listeners, ambient/combat/ambient, pause, seek, volume and starting
queue restoration. Both engines also passed dedicated receiver reconnect after
transport loss and page reload. See v0.7.0-live-follow-up.json.
A Firefox startup attempt reached an available paired receiver before MA returned
its queue. Startup now retries a null queue read briefly on the bound API session.
The offline regression exercises the waiting path. In the passing live reruns both
browsers received the queue on the first read.
The initial VM-to-proxy TCP probe timed out before TLS. After the operator enabled
the scoped firewall exception, private Nginx TLS and Chromium GM/player login passed.
Real Foundry signaling, Player User flag denial, dedicated MA playback for both
listeners, combat/ambient restore to seven seconds, and listener Stop/Enable and
reload passed. See v0.7.0-foundry-private.json. The original Mac issue did not
reproduce on Ubuntu. Mac, WAN, renewal and physical audibility remain unverified.
Publication readiness remains false.
+612
View File
@@ -0,0 +1,612 @@
{
"scope": "Foundry and Music Assistant through the operator private Nginx HTTPS route, with trusted TLS and a verified proxy peer",
"foundryVersion": "14.371",
"installedModuleVersion": "0.7.0",
"privateRouteVerified": true,
"transport": [
{
"engine": "chromium",
"version": "159.0.8154.6",
"at": "2026-12-04T15:00:10.335Z",
"checks": {
"foundryAnonymous": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": []
},
"maSameOrigin": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": true,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-failed"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": [],
"nativeSendspinUpgrade": "upgrade-ok"
},
"foundryLoggedIn": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": []
}
}
},
{
"engine": "firefox",
"version": "159.0",
"at": "2026-12-04T14:51:41.129Z",
"checks": {
"foundryAnonymous": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
],
"handshakeReplies": [],
"failedRequests": [],
"policyIssues": []
},
"maSameOrigin": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": true,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-failed"
}
],
"handshakeReplies": [],
"failedRequests": [],
"policyIssues": [],
"nativeSendspinUpgrade": "upgrade-ok"
}
}
}
],
"signedInPlayers": [
{
"worldVerified": true,
"foundry": "14.371",
"moduleVersion": "0.7.0",
"foreignWriteDenied": true,
"gmActive": true,
"apiReady": true,
"publicKeyPublished": true
},
{
"worldVerified": true,
"foundry": "14.371",
"moduleVersion": "0.7.0",
"foreignWriteDenied": true,
"gmActive": true,
"apiReady": true,
"publicKeyPublished": true
}
],
"gmVerified": true,
"maControlPageFinding": "The Music Assistant frontend replaces window.WebSocket and intercepts Sendspin. The intercepted call failed on its unauthenticated page. The same page opened Sendspin with the native constructor retained before frontend scripts.",
"originalMacAM005Reproduced": false,
"originalMacAM005RootCauseConfirmed": false,
"threeAccountsVerifiedTogether": true,
"installedWorldPlaybackBaseline": {
"at": "2026-12-04T15:00:10.335Z",
"engine": "chromium",
"playback": {
"stage": "ambient",
"publicKeys": [
true,
true,
true
],
"playerCannotWriteGMFlag": true,
"maAPIAuthenticated": true,
"sendspinAuthenticated": true,
"accountPairingPassed": true,
"catalogChoices": 11,
"listenerStatsAtFailure": [
{
"bytes": 125468,
"energy": 0,
"samples": 1560000
},
{
"bytes": 125468,
"energy": 0,
"samples": 1560480
}
],
"queueWrites": [
{
"command": "player_queues/play_media",
"reply": true,
"error": null
}
],
"gmAudioDiagnostics": {
"stage": "ready",
"state": "connected",
"audioContext": "running",
"decoded": 1367,
"scheduled": 1367,
"droppedLate": 0,
"droppedAhead": 0,
"signalRMS": 0.1258655905070254,
"muted": false,
"listenerConnections": 2,
"volume": 100
},
"browserAudio": [
{
"decodedFrames": 1367,
"signaling": {
"invitationsForMe": 0,
"invitationEvents": 0,
"offers": 2,
"answers": 0,
"sentInvitations": 2,
"sentSignals": 2
},
"browsers": [
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
},
{
"decodedFrames": null,
"signaling": {
"invitationsForMe": 1,
"invitationEvents": 2,
"offers": 1,
"answers": 2,
"sentInvitations": 0,
"sentSignals": 1
},
"browsers": [
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
},
{
"decodedFrames": null,
"signaling": {
"invitationsForMe": 1,
"invitationEvents": 2,
"offers": 1,
"answers": 2,
"sentInvitations": 0,
"sentSignals": 1
},
"browsers": [
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
}
],
"temporaryWorldChangesRestored": true
},
"failure": {
"stage": "installed-world-playback",
"code": "listener-audio-energy-did-not-increase"
},
"interpretation": "Chromium reported zero inbound RTP energy although later direct Web Audio playback measurements in the installed world were positive with the same module files."
},
"diagnosticBeforePlaybackMeters": {
"inboundStats": [
{
"bytes": 124880,
"energy": 0,
"samples": 1558080
},
{
"bytes": 124937,
"energy": 0,
"samples": 1558080
}
],
"senderEnergy": [
4.082235420083857,
4.082235420083857
],
"gmAnalyserRMS": [
0.1651397004235531
]
},
"installedWorldPlaybackPass": {
"at": "2026-12-04T15:05:54.779Z",
"engine": "chromium",
"browser": "159.0.8154.6",
"accounts": {
"gm-login": {
"worldMatches": true,
"accountMatches": true,
"gm": true,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 0,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
},
"player-1-login": {
"worldMatches": true,
"accountMatches": true,
"gm": false,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 1,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
},
"player-2-login": {
"worldMatches": true,
"accountMatches": true,
"gm": false,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 1,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
}
},
"playback": {
"stage": "passed",
"publicKeys": [
true,
true,
true
],
"playerCannotWriteGMFlag": true,
"maAPIAuthenticated": true,
"sendspinAuthenticated": true,
"accountPairingPassed": true,
"catalogChoices": 11,
"ambient": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.004791336274277526,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.004743247823567246,
"samplesIncreased": true
}
],
"combat": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.12556049134588929,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.1205585037803511,
"samplesIncreased": true
}
],
"ambientOrderRestored": true,
"ambientRestoreOffset": {
"index": 0,
"seconds": 7
},
"ambientIndexAndOffsetRestored": true,
"restoredAmbient": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.0457946358080247,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.04364745631856095,
"samplesIncreased": true
}
],
"onlyDedicatedQueueWritten": true,
"afterListenerResume": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.04998535387418037,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.051046648244698796,
"samplesIncreased": true
}
],
"afterListenerReload": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.1276089199898213,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.09472793662374407,
"samplesIncreased": true
}
],
"queueWrites": [
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/clear",
"reply": true,
"error": null
},
{
"command": "player_queues/repeat",
"reply": true,
"error": null
},
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/play_index",
"reply": true,
"error": null
}
],
"gmAudioDiagnostics": {
"stage": "ready",
"state": "connected",
"audioContext": "running",
"decoded": 1608,
"scheduled": 1608,
"droppedLate": 0,
"droppedAhead": 0,
"signalRMS": 0.13149861108647076,
"muted": false,
"listenerConnections": 2,
"volume": 100
},
"browserAudio": [
{
"decodedFrames": 1608,
"signaling": {
"invitationsForMe": 0,
"invitationEvents": 0,
"offers": 4,
"answers": 0,
"sentInvitations": 5,
"sentSignals": 4
},
"contexts": [
{
"state": "running",
"time": 35.735510204081635,
"track": "live"
}
],
"analyserRMS": [
0.2428510186200088
],
"browsers": [
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"outgoingEnergy": 4.711130388295272
},
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"outgoingEnergy": 0.2959549249485192
}
]
},
{
"decodedFrames": null,
"signaling": {
"invitationsForMe": 2,
"invitationEvents": 5,
"offers": 2,
"answers": 4,
"sentInvitations": 0,
"sentSignals": 2
},
"contexts": [],
"analyserRMS": [],
"browsers": [
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
},
{
"decodedFrames": null,
"contexts": [],
"analyserRMS": [],
"browsers": [
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
}
],
"temporaryWorldChangesRestored": true
}
},
"firefoxInstalledWorldBlocker": "The Firefox build completed WSS probes, but the Foundry join form did not render on this headless or Xvfb host. A WebGL 2 context was unavailable."
}
+109
View File
@@ -0,0 +1,109 @@
{
"at": "2026-12-04T03:24:28.333Z",
"scope": "real MA dedicated receiver from deployed Foundry origin; local source overlay and test-runner signaling, not an installed world",
"browser": "Chromium",
"browserVersion": "159.0.8154.6",
"steps": [
{
"path": "raw protocol preflight on remembered test identity",
"provisioned": true,
"queueItems": 4,
"available": true,
"standalone": true
}
],
"host": {
"ok": true
},
"pipeline": {
"catalogCount": 11,
"candidates": [
"usable",
"usable"
],
"restored": false,
"phase": "ambient",
"error": "uncertain",
"command": "player_queues/play_media",
"upstreamCode": 2,
"translationKey": null,
"failureStatus": {
"state": "connected",
"catalog": 12,
"audioContext": "running",
"catalogPlayback": true,
"stage": "queue reconciliation required",
"decodedFrames": 0,
"lastAudioAt": 0,
"outputRMS": 0,
"rms": 0,
"attachedExistingQueue": false,
"volume": 100,
"muted": false,
"pauseMode": "emulated",
"scheduledFrames": 0,
"droppedLate": 0,
"droppedAhead": 0,
"lastLeadSeconds": 0,
"audioTime": 5.3986394557823125,
"lastError": {
"code": "uncertain",
"stage": "ready",
"command": "player_queues/play_media",
"upstreamCode": 2,
"translationKey": null
}
},
"restoreSkipped": "queue reconciliation required"
},
"relay": {
"gm": 2,
"listener": 2,
"failures": 0
},
"gmPeers": {
"rejectedSignals": 0,
"peers": [
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
},
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
}
]
},
"mediaStats": [
{
"type": "candidate-pair",
"bytesSent": 21875,
"bytesReceived": 5477,
"currentRoundTripTime": 0
},
{
"type": "outbound-rtp",
"bytesSent": 9411
},
{
"type": "candidate-pair",
"bytesSent": 21874,
"bytesReceived": 5444,
"currentRoundTripTime": 0
},
{
"type": "outbound-rtp",
"bytesSent": 9411
}
],
"browserWarnings": [
"Foundry Virtual Tabletop requires a screen resolution of 1366px by 768px or greater. Your display has a resolution of 1280px by 720px. You must increase your resolution or use a di"
],
"passed": false
}
+253
View File
@@ -0,0 +1,253 @@
{
"at": "2026-12-04T03:14:46.888Z",
"scope": "real MA dedicated receiver from deployed Foundry origin; local source overlay and test-runner signaling, not an installed world",
"browser": "Chromium",
"browserVersion": "159.0.8154.6",
"steps": [
{
"path": "raw protocol preflight on remembered test identity",
"provisioned": true,
"queueItems": 4,
"available": true,
"standalone": true
}
],
"host": {
"ok": true
},
"pipeline": {
"catalogCount": 11,
"candidates": [
"usable",
"usable"
],
"restored": true,
"gmPeerDiagnostics": {
"rejectedSignals": 0,
"peers": [
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
},
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
}
]
},
"ambient": {
"state": "connected",
"catalog": 12,
"audioContext": "running",
"catalogPlayback": true,
"stage": "ready",
"decodedFrames": 549,
"lastAudioAt": 1796354102931,
"outputRMS": 0.04921308464995044,
"rms": 0.0671612288164562,
"attachedExistingQueue": false,
"volume": 100,
"muted": false,
"pauseMode": "emulated",
"scheduledFrames": 549,
"droppedLate": 0,
"droppedAhead": 0,
"lastLeadSeconds": 3.973421,
"audioTime": 13.397913832199546
},
"ambientListeners": [
{
"currentRMS": 0.030545943832978314,
"maximumRMS": 0.058502134399453995,
"measurements": 143,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
},
{
"currentRMS": 0.033752629068495146,
"maximumRMS": 0.054916530670132836,
"measurements": 131,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
}
],
"controls": {
"paused": true,
"seekPosition": 3,
"resumed": true,
"volume": true
},
"combat": {
"state": "connected",
"catalog": 12,
"audioContext": "running",
"catalogPlayback": true,
"stage": "ready",
"decodedFrames": 1210,
"lastAudioAt": 1796354115182,
"outputRMS": 0.12068391176023772,
"rms": 0.09744877113552601,
"attachedExistingQueue": false,
"volume": 100,
"muted": false,
"pauseMode": "emulated",
"scheduledFrames": 1210,
"droppedLate": 0,
"droppedAhead": 0,
"lastLeadSeconds": 3.972349,
"audioTime": 25.658049886621317
},
"combatListeners": [
{
"currentRMS": 0.11736051792312625,
"maximumRMS": 0.3094812285235373,
"measurements": 265,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
},
{
"currentRMS": 0.10247671612159892,
"maximumRMS": 0.2766517889229327,
"measurements": 253,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
}
],
"ambientOrderRestored": true,
"ambientPositionBefore": 4,
"ambientPositionRestored": 4,
"ambientStateRestored": "playing",
"returnedAmbient": {
"state": "connected",
"catalog": 12,
"audioContext": "running",
"catalogPlayback": true,
"stage": "ready",
"decodedFrames": 1605,
"lastAudioAt": 1796354123750,
"outputRMS": 0.06371873072766408,
"rms": 0.09363425367488697,
"attachedExistingQueue": false,
"volume": 100,
"muted": false,
"pauseMode": "emulated",
"scheduledFrames": 1605,
"droppedLate": 0,
"droppedAhead": 0,
"lastLeadSeconds": 3.972924,
"audioTime": 34.2378231292517
},
"restoredListeners": [
{
"currentRMS": 0.04320093615787444,
"maximumRMS": 0.26127431126808276,
"measurements": 351,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
},
{
"currentRMS": 0.039217057552145614,
"maximumRMS": 0.18129978959096216,
"measurements": 339,
"peers": [
{
"role": "listener",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "validate SDP"
}
]
}
],
"transitionsCompleted": true
},
"relay": {
"gm": 2,
"listener": 2,
"failures": 0
},
"gmPeers": {
"rejectedSignals": 0,
"peers": [
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
},
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
}
]
},
"mediaStats": [
{
"type": "candidate-pair",
"bytesSent": 165647,
"bytesReceived": 25203,
"currentRoundTripTime": 0
},
{
"type": "outbound-rtp",
"bytesSent": 96584
},
{
"type": "candidate-pair",
"bytesSent": 160475,
"bytesReceived": 24905,
"currentRoundTripTime": 0
},
{
"type": "outbound-rtp",
"bytesSent": 92001
}
],
"passed": true
}
+119
View File
@@ -0,0 +1,119 @@
{
"at": "2026-12-04T03:26:05.240Z",
"scope": "real MA dedicated receiver from deployed Foundry origin; local source overlay and test-runner signaling, not an installed world",
"browser": "Firefox",
"browserVersion": "159.0",
"steps": [
{
"path": "raw protocol preflight on remembered test identity",
"provisioned": true,
"queueItems": 4,
"available": true,
"standalone": true
}
],
"host": {
"ok": true
},
"pipeline": {
"playlistOffset": 2,
"catalogCount": 9,
"candidates": [
"unsupported",
"unsupported",
"unavailable",
"usable",
"usable"
],
"restored": false,
"phase": "ambient",
"error": "uncertain",
"command": "player_queues/play_media",
"upstreamCode": 2,
"translationKey": null,
"failureStatus": {
"state": "connected",
"catalog": 12,
"audioContext": "running",
"catalogPlayback": true,
"stage": "queue reconciliation required",
"decodedFrames": 0,
"lastAudioAt": 0,
"outputRMS": 0,
"rms": 0,
"attachedExistingQueue": false,
"volume": 100,
"muted": false,
"pauseMode": "emulated",
"scheduledFrames": 0,
"droppedLate": 0,
"droppedAhead": 0,
"lastLeadSeconds": 0,
"audioTime": 19.086802721088436,
"lastError": {
"code": "uncertain",
"stage": "ready",
"command": "player_queues/play_media",
"upstreamCode": 2,
"translationKey": null
}
},
"restoreSkipped": "queue reconciliation required"
},
"relay": {
"gm": 2,
"listener": 2,
"failures": 0
},
"gmPeers": {
"rejectedSignals": 0,
"peers": [
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
},
{
"role": "gm",
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"stage": "send answer"
}
]
},
"mediaStats": [
{
"type": "outbound-rtp",
"bytesSent": 2697
},
{
"type": "candidate-pair",
"bytesSent": 39868,
"bytesReceived": 17569,
"currentRoundTripTime": 0
},
{
"type": "outbound-rtp",
"bytesSent": 2586
},
{
"type": "candidate-pair",
"bytesSent": 38176,
"bytesReceived": 17026,
"currentRoundTripTime": 0
}
],
"browserWarnings": [
"[JavaScript Warning: \"downloadable font: glyf: Glyph bbox was incorrect; adjusting (glyph 59) (font-family: \"Modesto Condensed\" style:normal weight:700 width:100 src index:0) sourc",
"[JavaScript Warning: \"unreachable code after return statement\" {file: \"[address] line: 2}]",
"[JavaScript Warning: \"unreachable code after return statement\" {file: \"[address] line: 2}]",
"[JavaScript Warning: \"unreachable code after return statement\" {file: \"[address] line: 54}]",
"[JavaScript Warning: \"unreachable code after return statement\" {file: \"[address] line: 54}]",
"[JavaScript Warning: \"unreachable code after return statement\" {file: \"[address] line: 54}]",
"[JavaScript Warning: \"Failed to create WebGL context: WebGL creation failed: \n* WebglAllowWindowsNativeGl:false restricts context creation on this system. ()\n* Exhausted GL driver "
],
"passed": false
}
+178
View File
@@ -0,0 +1,178 @@
{
"scope": "Ubuntu browsers with real MA and the deployed Foundry origin, local source overlay and test-runner signaling. Audio measured in-browser, without a logged-in world or physical listener devices.",
"playback": [
{
"at": "2026-12-04T13:50:56.500Z",
"browser": "Firefox",
"browserVersion": "159.0",
"passed": true,
"queueBefore": {
"state": "idle",
"items": 0,
"index": null,
"repeat": "off"
},
"audio": {
"ambient": {
"gmDecodedFramesCumulative": 549,
"listenerPeakRMS": [
0.112356,
0.151159
],
"listenersConnected": true
},
"combat": {
"gmDecodedFramesCumulative": 1211,
"listenerPeakRMS": [
0.281149,
0.208914
],
"listenersConnected": true
},
"restored": {
"gmDecodedFramesCumulative": 1601,
"listenerPeakRMS": [
0.233427,
0.220558
],
"listenersConnected": true
}
},
"controls": {
"paused": true,
"seekPosition": 3,
"resumed": true,
"volume": true
},
"ambientOrderRestored": true,
"ambientPositionBefore": 4,
"ambientPositionRestored": 4,
"ambientStateRestored": "playing",
"transitionsCompleted": true,
"ambientIndexRestored": true,
"startingQueueRestored": true
},
{
"at": "2026-12-04T13:52:15.173Z",
"browser": "Chromium",
"browserVersion": "159.0.8154.6",
"passed": true,
"queueBefore": {
"state": "idle",
"items": 0,
"index": null,
"repeat": "off"
},
"audio": {
"ambient": {
"gmDecodedFramesCumulative": 549,
"listenerPeakRMS": [
0.117859,
0.118074
],
"listenersConnected": true
},
"combat": {
"gmDecodedFramesCumulative": 1210,
"listenerPeakRMS": [
0.207405,
0.278865
],
"listenersConnected": true
},
"restored": {
"gmDecodedFramesCumulative": 1604,
"listenerPeakRMS": [
0.142352,
0.230279
],
"listenersConnected": true
}
},
"controls": {
"paused": true,
"seekPosition": 3,
"resumed": true,
"volume": true
},
"ambientOrderRestored": true,
"ambientIndexRestored": true,
"ambientPositionBefore": 4,
"ambientPositionRestored": 4,
"ambientStateRestored": "playing",
"transitionsCompleted": true,
"startingQueueRestored": true
}
],
"reconnect": [
{
"at": "2026-12-04T03:32:42.269Z",
"browser": "Firefox",
"browserVersion": "159.0",
"passed": true,
"transportLossDetected": true,
"reconnectedAfterLoss": true,
"reconnectedAfterReload": true,
"sameReceiver": true,
"rememberedIdentityWithoutToken": true,
"oldSnapshotRejected": true,
"emptyBaselineRestored": true,
"queueAfter": {
"state": "idle",
"items": 0,
"index": null,
"position": 0,
"repeat": "off"
}
},
{
"at": "2026-12-04T03:33:13.440Z",
"browser": "Chromium",
"browserVersion": "159.0.8154.6",
"passed": true,
"transportLossDetected": true,
"reconnectedAfterLoss": true,
"reconnectedAfterReload": true,
"sameReceiver": true,
"rememberedIdentityWithoutToken": true,
"oldSnapshotRejected": true,
"emptyBaselineRestored": true,
"queueAfter": {
"state": "idle",
"items": 0,
"index": null,
"position": 0,
"repeat": "off"
}
}
],
"queueRegistration": {
"beforeFix": {
"at": "2026-12-04T13:49:26.827Z",
"browser": "Firefox",
"browserVersion": "159.0",
"passed": false,
"authenticated": true,
"dedicatedPlayerAvailable": true,
"successfulLookupReturnedNoQueue": true,
"queueWritesSent": false
},
"afterFixFirefoxFirstLookupReturnedActiveQueue": true,
"delayedQueueResponseCoveredByRegressionFixture": true,
"afterFix": [
{
"at": "2026-12-04T13:50:56.500Z",
"browser": "Firefox",
"queueAvailableOnFirstRead": true
},
{
"at": "2026-12-04T13:52:15.173Z",
"browser": "Chromium",
"queueAvailableOnFirstRead": true
}
],
"offlineRegression": "First queue read returns null, a later read succeeds on the same authenticated API session, and startup issues no queue writes."
},
"priorMediaNotFoundCauseConfirmed": false,
"publicationReady": false
}
+138
View File
@@ -0,0 +1,138 @@
{
"version": "0.7.0",
"publicationReady": false,
"completedCoreRunPassed": true,
"macPrivateRouteVerified": false,
"foundryLoggedInWorldVerified": true,
"actualMAAuthentication": true,
"actualMACatalogPlaylists": 11,
"actualMADedicatedProvisioning": true,
"actualMAAudioAndTwoListeners": true,
"actualAmbientCombatRestore": true,
"actualNativePause": false,
"logicalPauseEmulation": true,
"browserAudioHardwareAudibilityVerified": false,
"crossfade": false,
"coreSuccessEvidence": "evidence/v0.7.0-live-chromium.json",
"browserAuthentication": {
"at": "2026-12-04T03:13:45.898Z",
"scope": "actual origins, read-only API authentication; Ubuntu browsers, not Mac",
"browsers": [
{
"browser": "firefox",
"version": "159.0",
"origin": "foundry",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "firefox",
"version": "159.0",
"origin": "ma",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "chromium",
"version": "159.0.8154.6",
"origin": "foundry",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
},
{
"browser": "chromium",
"version": "159.0.8154.6",
"origin": "ma",
"maRoute": "normal resolver",
"httpStatus": 200,
"csp": null,
"result": {
"stage": "authenticated",
"providerCount": 7,
"commandError": null,
"metaCSP": [],
"blocked": [],
"secureContext": true
}
}
]
},
"networkBoundary": {
"sandboxNormalDNS": "public addresses",
"operatorMacMAResolution": "private proxy mapping",
"temporaryAccessRequestPrepared": true,
"initialUbuntuPrivateProxyTCP443": "timeout before TLS",
"followUpUbuntuPrivateProxyTCP443": "verified TLS and installed Foundry browser through operator-scoped firewall access",
"infrastructureChangedByTestAgent": false
},
"remaining": [
"original Mac connection and AM-005 reproduction if the symptom persists",
"WAN/30-minute behavior and hardware audibility"
],
"credentialUseAuthorized": true,
"dedicatedReceiverMutationsPerformed": true,
"latestCatalogReplayPassed": true,
"freshProvisioningObserved": {
"browser": "Firefox 144.0.2",
"at": "2026-12-04T03:10:40.566Z",
"path": "module creates a fresh identity; no manual protocol pre-provisioning",
"pairing": true,
"audioTwoListeners": true,
"ambientOrderAndOffsetRestored": true,
"finalQueueRestored": true,
"source": "observed live driver output; private driver reports were subsequently superseded by current-browser reruns"
},
"productionDependencyAudit": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 0,
"critical": 0,
"total": 0
},
"priorFirefoxFailureEvidence": "evidence/v0.7.0-live-firefox-latest.json",
"priorChromiumFailureEvidence": "evidence/v0.7.0-live-chromium-latest.json",
"latestFirefoxEvidence": "evidence/v0.7.0-live-follow-up.json",
"latestChromiumEvidence": "evidence/v0.7.0-live-follow-up.json",
"priorMAError": {
"code": 2,
"meaning": "MediaNotFound",
"phase": "player_queues/play_media",
"bothBrowserEngines": true,
"catalogMetadataStillPlayable": true,
"exactUpstreamResolutionCause": "unconfirmed",
"automaticMutationRetries": false
},
"dedicatedReceiverReconnectPassed": true,
"privateNginxRouteVerifiedFromUbuntu": true,
"installedFoundryEvidence": "evidence/v0.7.0-foundry-private.json",
"priorBrowserEvidenceScope": "deployed Foundry origin with local source overlay; actual MA, PCM, Web Audio and WebRTC; test-runner signaling, not installed world",
"evidenceScope": "Installed Foundry and actual MA over the private Nginx HTTPS route. Two real player accounts used Foundry module signaling and browser-measured WebRTC playback."
}
+536
View File
@@ -0,0 +1,536 @@
{
"version": "0.7.1",
"defect": "AM-006",
"publicationReady": false,
"completedCoreRunPassed": true,
"macPrivateRouteVerified": false,
"foundryLoggedInWorldVerified": false,
"verifiedGraphicalPreview": {
"at": "2026-12-04T15:29:05.529Z",
"scope": "private Nginx HTTPS route",
"checks": {},
"engine": "chromium",
"browser": "159.0.8154.6",
"moduleAssets": "workspace module assets in the test browser",
"accounts": {
"gm-login": {
"worldMatches": true,
"accountMatches": true,
"gm": true,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 0,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
}
},
"layout": {
"resizable": true,
"layout": [
{
"width": 760,
"tab": "Connection",
"horizontalFit": true,
"nestedScroll": false
},
{
"width": 760,
"tab": "Scene Music",
"horizontalFit": true,
"nestedScroll": false
},
{
"width": 760,
"tab": "Playback",
"horizontalFit": true,
"nestedScroll": false
},
{
"width": 380,
"tab": "Connection",
"horizontalFit": true,
"nestedScroll": false
},
{
"width": 380,
"tab": "Scene Music",
"horizontalFit": true,
"nestedScroll": false
},
{
"width": 380,
"tab": "Playback",
"horizontalFit": true,
"nestedScroll": false
}
],
"keyboardTabs": true,
"advancedCollapsed": true,
"invalidAddressRejected": true,
"missingTokenRejected": true,
"routeDiagnostics": [
{
"path": "/ws",
"opened": true
},
{
"path": "/sendspin",
"opened": true
}
]
},
"completed": true
},
"regression": {
"javascript": 102,
"python": 15,
"offlineBrowserControls": [
"connect",
"tabs",
"save assignments",
"current track",
"pause",
"resume",
"seek",
"volume",
"stop"
]
},
"remaining": [
"verify the packaged candidate after a server-side installation in the development environment",
"Mac and WAN acceptance"
],
"previousInstalledWorldEvidence": "evidence/v0.7.0-foundry-private.json",
"verifiedLiveWorkflowPreview": {
"at": "2026-12-04T15:32:01.859Z",
"scope": "private Nginx HTTPS route",
"checks": {
"foundryAnonymous": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": []
},
"maSameOrigin": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": true,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-failed"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": [],
"nativeSendspinUpgrade": "upgrade-ok"
},
"foundryLoggedIn": {
"pageStatus": 200,
"privatePeerVerified": true,
"cspHeaderPresent": false,
"reportOnlyCspHeaderPresent": false,
"cspMetaPresent": false,
"secureContext": true,
"pageReplacesWebSocket": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok"
},
{
"path": "/sendspin",
"code": "upgrade-ok"
}
],
"handshakeReplies": [
{
"path": "/ws",
"httpStatus": 101
},
{
"path": "/sendspin",
"httpStatus": 101
}
],
"failedRequests": [],
"policyIssues": []
}
},
"engine": "chromium",
"browser": "159.0.8154.6",
"moduleAssets": "workspace module assets in the test browser",
"accounts": {
"gm-login": {
"worldMatches": true,
"accountMatches": true,
"gm": true,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 0,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
},
"player-1-login": {
"worldMatches": true,
"accountMatches": true,
"gm": false,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 1,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
},
"player-2-login": {
"worldMatches": true,
"accountMatches": true,
"gm": false,
"foundryVersion": "14.371",
"system": "dnd5e",
"otherActiveGMs": 1,
"adaptiveMusicActive": true,
"adaptiveMusicVersion": "0.7.0",
"canvasTickerPaused": true
}
},
"playback": {
"stage": "passed",
"publicKeys": [
true,
true,
true
],
"playerCannotWriteGMFlag": true,
"advancedInitiallyCollapsed": true,
"formRejectedMissingTokenWithoutNetwork": true,
"oneClickConnection": true,
"maAPIAuthenticated": true,
"sendspinAuthenticated": true,
"accountPairingPassed": true,
"catalogChoices": 11,
"sceneAssignmentVerified": true,
"ambient": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.008014325143255013,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.007670743474125928,
"samplesIncreased": true
}
],
"combat": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.12679305568945426,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.12893801659879386,
"samplesIncreased": true
}
],
"ambientOrderRestored": true,
"ambientRestoreOffset": {
"index": 0,
"seconds": 8
},
"ambientIndexAndOffsetRestored": true,
"restoredAmbient": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.09003888968411675,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.09750464413094424,
"samplesIncreased": true
}
],
"onlyDedicatedQueueWritten": true,
"afterListenerResume": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.0868827545622943,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.09662535253515621,
"samplesIncreased": true
}
],
"afterListenerReload": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.08775154314156451,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.08398555055737364,
"samplesIncreased": true
}
],
"afterPlaybackResume": [
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.10693401545725446,
"samplesIncreased": true
},
{
"bytesIncreased": true,
"energyIncrease": 0,
"playbackRMS": 0.14311589172943934,
"samplesIncreased": true
}
],
"playbackTabControls": true,
"queueWrites": [
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/clear",
"reply": true,
"error": null
},
{
"command": "player_queues/repeat",
"reply": true,
"error": null
},
{
"command": "player_queues/play_media",
"reply": true,
"error": null
},
{
"command": "player_queues/play_index",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
},
{
"command": "player_queues/play_index",
"reply": true,
"error": null
},
{
"command": "player_queues/stop",
"reply": true,
"error": null
}
],
"gmAudioDiagnostics": {
"stage": "ready",
"state": "connected",
"audioContext": "running",
"decoded": 1829,
"scheduled": 1829,
"droppedLate": 0,
"droppedAhead": 0,
"signalRMS": 0.12175643489717901,
"muted": false,
"listenerConnections": 2,
"volume": 99
},
"browserAudio": [
{
"decodedFrames": null,
"signaling": {
"invitationsForMe": 0,
"invitationEvents": 0,
"offers": 4,
"answers": 0,
"sentInvitations": 4,
"sentSignals": 4
},
"contexts": [
{
"state": "running",
"time": 101.05324263038548,
"track": "live"
}
],
"analyserRMS": [
0
],
"browsers": [
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"outgoingEnergy": 2.5731208355109527
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable",
"outgoingEnergy": 0.4176949028255943
}
]
},
{
"decodedFrames": null,
"signaling": {
"invitationsForMe": 2,
"invitationEvents": 4,
"offers": 2,
"answers": 4,
"sentInvitations": 0,
"sentSignals": 2
},
"contexts": [],
"analyserRMS": [],
"browsers": [
{
"connection": "closed",
"ice": "closed",
"signaling": "closed"
},
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
},
{
"decodedFrames": null,
"contexts": [],
"analyserRMS": [],
"browsers": [
{
"connection": "connected",
"ice": "connected",
"signaling": "stable"
}
]
}
],
"temporaryWorldChangesRestored": true
},
"completed": true
},
"earlierAttempts": [
"The private Foundry vhost served the logged-in application. The Music Assistant vhost completed trusted TLS and supplied no HTTP response before the deadline. The in-window token-free checks opened neither WebSocket.",
{
"at": "2026-12-04T15:29:22.993Z",
"failure": {
"stage": "installed-world-playback",
"code": "ma-play-media-not-observed"
},
"restoredWorld": true
}
],
"productionDependencyAudit": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 0,
"critical": 0,
"total": 0
}
}
+49
View File
@@ -0,0 +1,49 @@
{
"version": "0.7.2",
"publicationReady": false,
"completedCoreRunPassed": false,
"foundryLoggedInWorldVerified": false,
"installedV070GuiReview": {
"at": "2026-12-04T15:55:39.842Z",
"moduleVersion": "0.7.0",
"assetOverrides": false,
"injectedRuntimeScripts": false,
"manualGuiControls": true,
"authenticatedAndConnected": true,
"catalogCount": 12,
"savedScene": true,
"decodedFrames": 299,
"passed": true,
"reviewScene": "Adaptive Music \u2014 GM review"
},
"accountPersistence": "Encrypted address and name in a Foundry User Setting. The MA token is required for each new browser session. The server does not host the browser audio relay.",
"regression": {
"javascript": 104,
"python": 15
},
"candidateAccountSettingVerified": {
"scope": "Actual development world, v0.7.2 candidate assets supplied in Playwright only",
"firstSession": {
"settingScope": "user",
"hasEnvelope": true,
"connected": true,
"manualAddressEntry": true,
"addressRestored": true
},
"newBrowserSession": {
"settingScope": "user",
"hasEnvelope": true,
"connected": true,
"manualAddressEntry": false,
"addressRestored": true
}
},
"productionDependencyAudit": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 0,
"critical": 0,
"total": 0
}
}
File diff suppressed because it is too large. Load diff
+701
View File
@@ -0,0 +1,701 @@
{
"version": "0.8.1",
"scope": "Firefox diagnostics and native Combat Tracker candidate. Private development-world package previews, transport checks and browser fixtures.",
"publicationReady": false,
"serverInstalledExactVersion": false,
"completedCoreRunPassed": true,
"macPrivateRouteVerified": false,
"macFirefoxRootCauseConfirmed": false,
"operatorAcceptanceV080": {
"source": "Operator-reported manual acceptance on installed Adaptive Music v0.8.0 on macOS",
"installedVersion": "0.8.0",
"passed": [
"Chrome connectivity",
"No stuttering or crackling during testing",
"Chrome credential retention after full quit and reopen",
"Automatic scene playlist activation",
"Background-tab audio continuity",
"Remote player audio over WAN",
"Smooth music transitions"
],
"failed": [
"Firefox connectivity on macOS"
],
"notTested": [
"Automatic combat music",
"Ambient restoration",
"Boss music",
"Manual playback controls"
],
"combatFollowUp": {
"scope": "Operator follow-up from their actual Foundry scene",
"ambientPlayback": "pass",
"battlePlaylistPlayableWhenAssignedToAmbient": true,
"combatCueSwitch": "fail: ambient continued",
"bossDesignationDiscoverability": "fail",
"combatAndBossUsedSamePlaylist": true,
"candidateManualRetest": "pending"
}
},
"localHistory": {
"originalHead": "987122ffee17ddbdb6266a12d4d8beb29903b838",
"localV080Release": "1ed6b4c8ccd35e1187b83003379fe05d3cbeed8a",
"v080SourceFilesIdentical": 157,
"reportedPublishedCommit": "95b0427",
"publishedObjectAvailableLocally": false,
"v081Branch": "v0.8.1-firefox"
},
"installedBaselineComparison": {
"scope": "anonymous exact-path read of installed Foundry module files over trusted private HTTPS",
"manifestStatus": 200,
"installedVersion": "0.8.0",
"runtimeFilesCompared": 28,
"runtimeFilesIdentical": 28,
"runtimeMismatches": []
},
"stockFirefox": {
"version": "161.0.1",
"platform": "Linux x86-64",
"archiveSha512": "9ef6ccc1b0e4376980ab88a49408924e75d3cafca248becfb8893424c6f025a58d715bf05f1f5397a4a997059de4c054a3e6490a140bdf4dc8795ec78b26e02a",
"download": "https://archive.mozilla.org/pub/firefox/releases/161.0.1/linux-x86_64/en-US/firefox-161.0.1.tar.xz",
"archiveVerifiedAgainstMozillaSha512Listing": true,
"privateRoute": {
"scope": "official Mozilla Firefox on Ubuntu, anonymous private Foundry and MA HTTPS pages, fixed unauthenticated WSS routes",
"browser": "161.0.1",
"tlsValidation": true,
"checks": {
"foundryOrigin": {
"status": 200,
"cspHeaderPresent": false,
"reportOnlyHeaderPresent": false,
"secureContext": true,
"cspMetaPresent": false,
"replaced": false,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 19,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 9,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
],
"networkEvents": [
{
"path": "/ws",
"code": 101
},
{
"path": "/sendspin",
"code": 101
}
]
},
"maOrigin": {
"secureContext": true,
"cspMetaPresent": false,
"replaced": true,
"upgrades": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 195,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 19,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
],
"networkEvents": [
{
"path": "/ws",
"code": 101
},
{
"path": "/ws",
"code": 101
},
{
"path": "/sendspin",
"code": 101
}
]
}
},
"completed": true
},
"isolatedPolicyChecks": {
"scope": "isolated real Firefox HTTPS/WSS policy tests; local transport server, no MA, no Foundry, no credentials or audio",
"browser": "161.0.1",
"mozillaStockBuild": true,
"tls": "local CA trusted in disposable Firefox profile; no certificate bypass",
"checks": [
{
"name": "Trusted HTTPS cross-origin WSS allowed",
"results": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 11,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 4,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Enforced CSP blocks cross-origin before upgrade",
"results": [
{
"path": "/ws",
"code": "csp-blocked",
"elapsedMs": 1,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "csp-blocked",
"elapsedMs": 0,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Same MA origin control",
"results": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 3,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 3,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Report-only CSP does not block",
"results": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 3,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 4,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Server Origin rejection stays opaque",
"results": [
{
"path": "/ws",
"code": "upgrade-failed",
"elapsedMs": 31,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-failed",
"elapsedMs": 29,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Same origin still succeeds under Origin restriction",
"results": [
{
"path": "/ws",
"code": "upgrade-ok",
"elapsedMs": 3,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-ok",
"elapsedMs": 2,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
},
{
"name": "Mismatched WSS certificate stays opaque and connection closed",
"results": [
{
"path": "/ws",
"code": "upgrade-failed",
"elapsedMs": 29,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
},
{
"path": "/sendspin",
"code": "upgrade-failed",
"elapsedMs": 28,
"permissions": {
"local-network": "prompt",
"loopback-network": "prompt"
}
}
]
}
],
"passed": true
}
},
"offlineSetup": [
{
"status": "pass",
"engine": "chromium",
"browser": "159.0.8154.6",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "firefox",
"browser": "159.0",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "webkit",
"browser": "27.2",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
}
],
"regression": {
"javascriptPassed": 115,
"javascriptFailed": 0,
"pythonPassed": 17,
"pythonFailed": 0,
"repositoryPrivacyAndAttribution": "pass",
"upstreamProvenance": "pass",
"npmAuditReportedVulnerabilities": 0
},
"remainingAcceptance": [
"Capture the failure on the operator Mac and identify its WebSocket or subsequent setup stage",
"Verify the exact server-installed v0.8.1 candidate in the affected Firefox profile and the working Chrome profile",
"Retest the corrected combat, ambient restoration, boss designation and manual playback controls on the operator Mac"
],
"combatTrackerAcceptance": {
"scope": "Authorized private development world; the candidate ZIP supplied runtime assets to the browser",
"dnd5eReviewedCommit": "75750bf1b8bd79f8448af40495c8bb5c99f49551",
"installedV080Reproduction": {
"at": "2026-12-05T18:15:47.932Z",
"scope": "actual Foundry development world, native token HUD and Combat Tracker GUI",
"browser": "159.0.8154.6",
"foundry": "14.371",
"serverVersion": "0.8.0",
"system": {
"id": "dnd5e",
"version": "6.1.2",
"combatClass": "Combat5e",
"combatantClass": "Combatant5e",
"trackerClass": "CombatTracker5e"
},
"cleanup": true,
"nativeHudAndStartCombat": true,
"encounter": {
"linked": false,
"linkedToActive": false,
"active": true,
"started": true,
"round": 1,
"turn": 0,
"participants": 1,
"participantsInActiveScene": 1
},
"ambientQueueChanged": false,
"lifecycle": [
{
"event": "createCombat",
"linked": false,
"linkedToActive": false,
"active": true,
"started": false,
"round": 0,
"turn": null,
"participants": 0,
"participantsInActiveScene": 0,
"updateKeys": []
},
{
"event": "createCombatant",
"linked": false,
"linkedToActive": false,
"active": true,
"started": false,
"round": 0,
"turn": null,
"participants": 1,
"participantsInActiveScene": 1
},
{
"event": "combatStart",
"linked": false,
"linkedToActive": false,
"active": true,
"started": false,
"round": 0,
"turn": null,
"participants": 1,
"participantsInActiveScene": 1,
"updateKeys": [
"round",
"turn"
]
},
{
"event": "updateCombat",
"linked": false,
"linkedToActive": false,
"active": true,
"started": true,
"round": 1,
"turn": 0,
"participants": 1,
"participantsInActiveScene": 1,
"updateKeys": [
"round",
"turn"
]
},
{
"event": "combatTurnChange",
"linked": false,
"linkedToActive": false,
"active": true,
"started": true,
"round": 1,
"turn": 0,
"participants": 1,
"participantsInActiveScene": 1,
"updateKeys": [
"round",
"turn"
]
}
]
},
"candidateNormalEncounter": {
"at": "2026-12-05T18:20:56.093Z",
"scope": "actual Foundry development world, native token HUD and Combat Tracker GUI",
"browser": "159.0.8154.6",
"foundry": "14.371",
"serverVersion": "0.8.0",
"system": {
"id": "dnd5e",
"version": "6.1.2",
"combatClass": "Combat5e",
"combatantClass": "Combatant5e",
"trackerClass": "CombatTracker5e"
},
"runtimeAssetsSHA256": "fc23b02b1df425ed3154e43aed3f60088aa797c38a862efeaa4781471bad8093",
"packageSHA256": "f5a47f711f9f22ae81717a8e563fdb27d5a6ee2bd18fee0c7567535c0ddd319d",
"cleanup": true,
"checks": {
"normalCombat": {
"state": {
"linked": false,
"linkedToActive": false,
"active": true,
"started": true,
"round": 1,
"turn": 0,
"participants": 2,
"participantsInActiveScene": 2
},
"gmRMS": 0.04104
},
"turnAndRoundWithoutRestart": true,
"cancelEndPreservedCombat": true,
"normalRestoration": {
"index": 0,
"seconds": 30
},
"bossFromSceneDefault": {
"distinct": true,
"gmRMS": 0.0348
}
},
"harnessResult": "Normal encounter checks passed. The first scene-navigation locator timed out and the focused follow-up exercised the scene edge cases.",
"postCommitEvents": [
"combatRound",
"combatStart",
"combatTurn",
"combatTurnChange",
"createCombat",
"createCombatant",
"deleteCombat",
"updateCombat",
"updateCombatant"
]
},
"candidateBossSceneAndOverride": {
"at": "2026-12-05T18:29:02.740Z",
"scope": "actual Foundry development world, native token HUD and Combat Tracker GUI",
"browser": "159.0.8154.6",
"foundry": "14.371",
"serverVersion": "0.8.0",
"system": {
"id": "dnd5e",
"version": "6.1.2",
"combatClass": "Combat5e",
"combatantClass": "Combatant5e",
"trackerClass": "CombatTracker5e"
},
"runtimeAssetsSHA256": "fc23b02b1df425ed3154e43aed3f60088aa797c38a862efeaa4781471bad8093",
"packageSHA256": "f5a47f711f9f22ae81717a8e563fdb27d5a6ee2bd18fee0c7567535c0ddd319d",
"cleanup": true,
"checks": {
"bossFromSceneDefault": {
"distinct": true,
"gmRMS": 0.11936
},
"sceneExcursionDuringCombat": {
"passed": true,
"outwardMethod": "native-scene-activation",
"returnMethod": "native-scene-activation"
},
"bossRestoration": {
"index": 0,
"seconds": 33
},
"manualOverrideAndTrackerReturn": true,
"repeatedRestoration": {
"index": 0,
"seconds": 46
}
},
"onlyDedicatedQueueWritten": true
},
"candidateFirefox": {
"completed": true,
"at": "2026-12-05T18:32:54.490Z",
"scope": "actual Foundry development world, native token HUD and Combat Tracker GUI",
"browser": "159.0",
"foundry": "14.371",
"serverVersion": "0.8.0",
"system": {
"id": "dnd5e",
"version": "6.1.2",
"combatClass": "Combat5e",
"combatantClass": "Combatant5e",
"trackerClass": "CombatTracker5e"
},
"runtimeAssetsSHA256": "fc23b02b1df425ed3154e43aed3f60088aa797c38a862efeaa4781471bad8093",
"packageSHA256": "f5a47f711f9f22ae81717a8e563fdb27d5a6ee2bd18fee0c7567535c0ddd319d",
"cleanup": true,
"checks": {
"normalCombat": {
"state": {
"linked": false,
"linkedToActive": false,
"active": true,
"started": true,
"round": 1,
"turn": 0,
"participants": 2,
"participantsInActiveScene": 2
},
"gmRMS": 0.03617
},
"turnAndRoundWithoutRestart": true,
"cancelEndPreservedCombat": true,
"normalRestoration": {
"index": 0,
"seconds": 9
}
}
}
},
"combatCandidateOfflineSetup": [
{
"status": "pass",
"engine": "chromium",
"browser": "159.0.8154.6",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "firefox",
"browser": "159.0",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "webkit",
"browser": "27.2",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
}
],
"operatorAcceptanceV081": {
"source": "Operator-reported installed v0.8.1 manual testing",
"passed": [
"Automatic combat music",
"Initiative progression",
"Boss music",
"Ambient restoration",
"Manual controls",
"Audio quality"
],
"releaseBlockingFailure": "A player login stopped GM playback and removed the catalog; logout restored fetching.",
"reportedPlayerRole": "Not specified"
}
}
+587
View File
@@ -0,0 +1,587 @@
{
"version": "0.8.2",
"scope": "Private Foundry development-world baseline and mixed-browser candidate runtime previews, plus local regressions",
"publicationReady": false,
"serverInstalledExactVersion": false,
"completedCoreRunPassed": true,
"macPrivateRouteVerified": false,
"operatorAcceptanceV081": {
"source": "Operator-reported installed v0.8.1 manual testing",
"passed": [
"Automatic combat music",
"Initiative progression",
"Boss music",
"Ambient restoration",
"Manual controls",
"Audio quality"
],
"releaseBlockingFailure": "A player login stopped GM playback and removed the catalog; logout restored fetching.",
"reportedPlayerRole": "Not specified"
},
"installedBaselineRuntimeComparison": {
"scope": "anonymous exact-path read of installed Foundry module files over trusted private HTTPS",
"manifestStatus": 200,
"installedVersion": "0.8.1",
"runtimeFilesCompared": 28,
"runtimeFilesIdentical": 28,
"runtimeMismatches": []
},
"baseline": {
"at": "2026-12-05T18:53:48.339Z",
"scope": "Foundry development-world GUI logins with independent browser contexts, dedicated receiver",
"runtimeAssetsSHA256": "fc23b02b1df425ed3154e43aed3f60088aa797c38a862efeaa4781471bad8093",
"packageSHA256": "8e27dd86e1f93d3a0785a28a49bbe20cb35c444f5a242e876ec1cc882dedd4e9",
"foundry": "14.371",
"serverVersion": "0.8.1",
"engines": {
"chromium": "159.0.8154.6"
},
"onlyDedicatedQueueWritten": true,
"cleanup": true,
"confirmedRootCase": "A late Assistant GM join made the old isGM-based guard close both MA sockets.",
"gmAlone": {
"summaryConnected": true,
"summaryCatalogChoices": 13,
"hasAvailableCatalog": true,
"socketConnected": true,
"activeGMFlags": 1,
"activeFullGMs": 1,
"rms": 0.04012488569058989
},
"lateJoin": [
{
"description": "Player",
"role": 1,
"foundryIsGM": false,
"summaryConnected": true,
"summaryCatalogChoices": 13,
"hasAvailableCatalog": true,
"socketConnected": true,
"activeGMFlags": 1,
"activeFullGMs": 1,
"gmClockAdvanced": true,
"maSocketsClosedSincePlay": 0,
"listenerAudio": true
},
{
"description": "Trusted Player",
"role": 2,
"foundryIsGM": false,
"summaryConnected": true,
"summaryCatalogChoices": 13,
"hasAvailableCatalog": true,
"socketConnected": true,
"activeGMFlags": 1,
"activeFullGMs": 1,
"gmClockAdvanced": true,
"maSocketsClosedSincePlay": 0,
"listenerAudio": true
},
{
"description": "Assistant GM control case",
"role": 3,
"foundryIsGM": true,
"summaryConnected": true,
"summaryCatalogChoices": 13,
"hasAvailableCatalog": false,
"socketConnected": true,
"activeGMFlags": 2,
"activeFullGMs": 1,
"gmClockAdvanced": false,
"maSocketsClosedSincePlay": 2
}
],
"notes": "The hidden connection tab still displayed its stale connected summary. The live Foundry socket, closed MA sockets, stopped audio clock, and missing Scene Music catalog were measured independently.",
"foundrySocketDisconnects": 0
},
"candidateJoinsAndLocalControls": {
"at": "2026-12-05T19:05:45.974Z",
"scope": "Foundry development-world GUI logins with independent browser contexts, dedicated receiver",
"runtimeAssetsSHA256": "001640e13504ee0dd0b4d1d1cad22134daf194e54a6e3cd3839f1bbc6f06de3e",
"packageSHA256": "c10bbb550ec600c582e5f044c4dcf7b79652879c36b7d8a9de066a87d5f1b35f",
"foundry": "14.371",
"serverVersion": "0.8.1",
"engines": {
"chromium": "159.0.8154.6",
"firefox": "159.0"
},
"onlyDedicatedQueueWritten": true,
"cleanup": true,
"phases": {
"gmAlone": {
"connected": true,
"catalogChoices": 13,
"hasAvailableCatalog": true,
"socketConnected": true,
"activeGMFlags": 1,
"activeFullGMs": 1,
"rms": 0.0376457506053313
},
"individualJoin": {
"permission": {
"role": 1,
"foundryIsGM": false
},
"audio": {
"rms": 0.18813604887456326,
"bytes": 1374,
"energy": 0.029702336390144513,
"samples": 13920
},
"gm": {
"catalogChoices": 13,
"rms": 0.11432
},
"gate": {
"controlRejected": true,
"gmMenuAvailable": false,
"sceneWriteRejected": true
}
},
"simultaneousJoin": {
"listeners": [
{
"bytes": 87156,
"rms": 0.14137
},
{
"bytes": 32928,
"rms": 0.13995
},
{
"bytes": 18367,
"rms": 0.11148
}
],
"gm": {
"catalogChoices": 13,
"rms": 0.22792
},
"roles": [
{
"role": 2,
"foundryIsGM": false
},
{
"role": 1,
"foundryIsGM": false
}
],
"gates": [
{
"controlRejected": true,
"gmMenuAvailable": false,
"sceneWriteRejected": true
},
{
"controlRejected": true,
"gmMenuAvailable": false,
"sceneWriteRejected": true
}
]
},
"assistantJoin": {
"permission": {
"role": 3,
"foundryIsGM": true
},
"audio": {
"rms": 0.1857330142680303,
"bytes": 20569,
"energy": 0.7933958871843928,
"samples": 120480
},
"gm": {
"catalogChoices": 13,
"rms": 0.11677
},
"gate": {
"controlRejected": true,
"gmMenuAvailable": false,
"sceneWriteRejected": null
}
},
"assistantLogout": {
"gm": {
"catalogChoices": 13,
"rms": 0.12284
},
"remaining": [
{
"bytes": 159353,
"rms": 0.12483
},
{
"bytes": 105182,
"rms": 0.12524
},
{
"bytes": 162382,
"rms": 0.27907
}
]
},
"localMix": {
"quarter": {
"local": 0.027069456983698843,
"incoming": 0.1082382650030415
},
"muted": {
"local": 0,
"incoming": 0.10330119351387644
},
"untouched": [
{
"local": 0.12999302119140788,
"incoming": 0.12999302119140788
},
{
"local": 0.10522020398150214,
"incoming": 0.10522020398150214
}
],
"gm": {
"catalogChoices": 13,
"rms": 0.12545
}
},
"reconnect": {
"savedVolumeAndMute": true,
"rejoinedAudio": {
"local": 0.0043508963105295655,
"incoming": 0.09564166615949304
},
"gm": {
"catalogChoices": 13,
"rms": 0.1574
},
"others": [
{
"bytes": 150275,
"rms": 0.16162
},
{
"bytes": 251804,
"rms": 0.11233
},
{
"bytes": 3739,
"rms": 0.1435
}
]
}
},
"harnessNote": "Join, control isolation and rejoin checks passed. A test pointer timeout starting the subsequent encounter led to a separate focused transition and duration run."
},
"candidateTransitionsAndDuration": {
"at": "2026-12-05T19:08:22.486Z",
"scope": "Foundry development-world GUI logins with independent browser contexts, dedicated receiver",
"runtimeAssetsSHA256": "001640e13504ee0dd0b4d1d1cad22134daf194e54a6e3cd3839f1bbc6f06de3e",
"packageSHA256": "c10bbb550ec600c582e5f044c4dcf7b79652879c36b7d8a9de066a87d5f1b35f",
"foundry": "14.371",
"serverVersion": "0.8.1",
"engines": {
"chromium": "159.0.8154.6",
"firefox": "159.0"
},
"onlyDedicatedQueueWritten": true,
"cleanup": true,
"phases": {
"gmAlone": {
"connected": true,
"catalogChoices": 13,
"hasAvailableCatalog": true,
"socketConnected": true,
"activeGMFlags": 1,
"activeFullGMs": 1,
"rms": 0.04257364351922578
},
"transitionParty": {
"roles": [
{
"role": 1,
"foundryIsGM": false
},
{
"role": 2,
"foundryIsGM": false
},
{
"role": 1,
"foundryIsGM": false
}
],
"audible": [
{
"bytes": 45245,
"rms": 0.10862
},
{
"bytes": 32124,
"rms": 0.10361
},
{
"bytes": 1287,
"rms": 0.01968
}
],
"gm": {
"catalogChoices": 13,
"rms": 0.09174
}
},
"combat": {
"prepared": "unstarted-core-fixture",
"listeners": [
{
"bytes": 120490,
"rms": 0.03282
},
{
"bytes": 107374,
"rms": 0.03426
},
{
"bytes": 150933,
"rms": 0.0437
}
],
"restored": {
"index": 0,
"seconds": 41,
"allListeners": [
{
"bytes": 170792,
"rms": 0.09777
},
{
"bytes": 157698,
"rms": 0.09725
},
{
"bytes": 253720,
"rms": 0.10896
}
]
},
"initiativeDidNotRestart": true
},
"boss": {
"prepared": "token-hud",
"listeners": [
{
"bytes": 273794,
"rms": 0.07048
},
{
"bytes": 260726,
"rms": 0.06743
},
{
"bytes": 451959,
"rms": 0.04784
}
],
"restored": {
"index": 0,
"seconds": 66,
"allListeners": [
{
"bytes": 314211,
"rms": 0.10057
},
{
"bytes": 301203,
"rms": 0.09554
},
{
"bytes": 534595,
"rms": 0.10016
}
]
}
},
"sceneAndManual": {
"otherListeners": [
{
"bytes": 346215,
"rms": 0.02421
},
{
"bytes": 333348,
"rms": 0.02596
},
{
"bytes": 598733,
"rms": 0.02808
}
],
"manualListeners": [
{
"bytes": 384431,
"rms": 0.04368
},
{
"bytes": 371703,
"rms": 0.04618
},
{
"bytes": 675809,
"rms": 0.03875
}
],
"backToAutomation": [
{
"bytes": 406853,
"rms": 0.03773
},
{
"bytes": 394235,
"rms": 0.03511
},
{
"bytes": 720158,
"rms": 0.0477
}
]
},
"soak": {
"seconds": 360.0130000000001,
"intervals": 30,
"stableCatalogAndSockets": true,
"listenerPacketsAdvancedEveryInterval": true,
"gmAudibleIntervals": 30,
"listenerAudibleIntervals": [
30,
30,
30
]
},
"gmCredentialReload": {
"reattachedSameReceiver": true,
"tokenFieldEmpty": true,
"queuePreserved": true,
"listenersRecovered": [
{
"bytes": 11630,
"rms": 0.13284
},
{
"bytes": 11665,
"rms": 0.12935
},
{
"bytes": 9506,
"rms": 0.15943
}
]
},
"playerDirectMusicAssistant": 0
}
},
"credentialPersistenceFixtures": [
{
"engine": "chromium",
"browser": "159.0.8154.6",
"lockedKeys": true,
"scopeIsolation": true,
"authenticatedAfterBrowserRestart": true,
"revokedAuthDeniedByFixture": true,
"pause": true,
"forgetSurvivedBrowserRestart": true
},
{
"engine": "firefox",
"browser": "159.0",
"lockedKeys": true,
"scopeIsolation": true,
"authenticatedAfterBrowserRestart": true,
"revokedAuthDeniedByFixture": true,
"pause": true,
"forgetSurvivedBrowserRestart": true
},
{
"engine": "webkit",
"browser": "27.2",
"lockedKeys": true,
"scopeIsolation": true,
"authenticatedAfterBrowserRestart": true,
"revokedAuthDeniedByFixture": true,
"pause": true,
"forgetSurvivedBrowserRestart": true
}
],
"regressions": {
"javascriptPassed": 117,
"pythonPassed": 17,
"npmAuditReportedVulnerabilities": 0,
"upstreamProvenance": "pass",
"repositoryPrivacyAndAttribution": "pass",
"offlineSetup": [
{
"status": "pass",
"engine": "chromium",
"browser": "159.0.8154.6",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "firefox",
"browser": "159.0",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
},
{
"status": "pass",
"engine": "webkit",
"browser": "27.2",
"scope": "offline DOM fixture; no live Foundry or MA",
"checks": [
"380/640/1000px layout",
"three setup tabs",
"failed connection diagnostics exclude secrets and clear after retry",
"private field clearing",
"catalog selectors",
"ambient/combat save",
"advanced controls hidden",
"sidebar catalog refresh and pointer drag",
"track and listeners",
"pause/resume/seek/repeat/volume/stop",
"listener activation"
],
"pageErrors": []
}
]
},
"acceptanceRemaining": [
"Install and manually accept exact v0.8.2 in the operator multiplayer session",
"Retest the original macOS Firefox private-route connection separately"
]
}
+84
View File
@@ -0,0 +1,84 @@
> Optional experimental companion fallback. The standard module has no mandatory
> companion or sandbox dependency. See ../ARCHITECTURE.md and ../INSTALL.md for
> the 0.5.0 module-only experiment and remaining deployment gates. This guide
> does not authorize host routing, service installation or production changes.
# Private companion — 0.4.0 development
The companion now connects the browser-safe provider/catalog interface to the
existing MA client, fenced control and playback provider. It is a separate server
artifact; no gateway code or MA credential is bundled into Foundry. Follow
[SETUP.md](SETUP.md) for exact isolated-world setup and infrastructure gates.
`development-service.mjs` accepts only fixed controller phases: connect, diagnostics,
catalog, renew, release, prepare, snapshot, apply, restore and stop. Server-bound
campaign/session/target identity, controller role, lease/fence/generation and
operation IDs constrain requests. Preparation and raw signed snapshots stay in
server memory behind expiring opaque handles. Prepared handles bind their generation;
restore handles bind fenced session and expiry. Same-ID changed payloads deny;
replayed operations do not issue duplicate effects. Queue selectors, raw media,
upstream commands/paths and proxy operations are not accepted from browsers.
`development-http.mjs` binds loopback only, with exact Host/Origin, header-only auth,
fixed POST routes, bounded headers/body/responses/connections/request rate and queued
work. The browser client uses same-origin relative `/adaptive-music-gateway` routes,
credentials omitted and no redirects, with capability codes held in memory only.
A private HTTPS route is still an operator infrastructure requirement. No public
exposure, proxy/firewall change, CORS wildcard or MA Sendspin pass-through exists.
This prototype still lacks permanent hosting, durable fencing/process locks and
automatic Foundry login verification. Do not expose it publicly.
`run-development.mjs` loads protected ignored `.local/` config and pins the prior
verified account's sole target, exact name Adaptive Music DEV and provider. It
serves five minutes with separate controller/listener grants and starts no playback.
Playback defaults off; explicit synthetic opt-in authorizes only generated sequence
IDs. Real MA catalog entries remain selectable for configuration but unplayable
under the current authorization. There is no automatic household discovery or
selection, queue transfer, grouping or new receiver provisioning.
The browser package saves separate scene ambient/combat/boss/native-fallback refs,
world defaults and explicit boss flags. Native fallback applies before preparation
when MA is disconnected, expired or not authorized for that selection. It never
bypasses an uncertain active MA target to start overlapping native audio. The
controller still uses one base music layer interrupted by combat/boss/manual;
concurrent ambient layers and crossfade are not implemented.
The existing `ma-provider.mjs` and `ma-client.mjs` retain fixed guarded commands:
play_media, play_index, pause, resume, stop, seek, shuffle, repeat and clear. Every
mutation rechecks supported queue modes, active queue identity and exact player/
provider/topology, then authority immediately before dispatch. Registered approved
media only; no arbitrary URI injection. Ambiguous responses latch the client closed
with `uncertain`, without retries or blind restoration. The public MA API cannot
atomically bind topology checks to a write; concurrent external changes and restart
reconciliation remain development limitations.
Signed snapshots preserve ordered duplicate occurrences, index, whole-second
position, state and repeat for supported unshuffled static queues. They expire in
five minutes and bind campaign/session/fence/generation. Capture repeats bounded
pagination; restore stages items, checks order, then seeks/plays and reapplies pause
or idle. Shuffle/dynamic/autoplay/overlay/ended/nonstandard-speed restoration is
unsupported. Volume is unchanged. Losing topology/authority can prevent recovery;
report it rather than bypass guards. Durable recovery still needs further work.
Private `.local/catalog-key` and `.local/catalog-namespace.json` give opaque
campaign-scoped catalog IDs persistence across companion restarts. Refresh the
catalog to rebuild private mappings; back up those files. Secrets/config require
0600 and directory 0700, owner checks and symlink refusal. MA tokens never enter
browser assets/settings/flags/storage/URLs/logs. The upstream user role remains
broader than read-only and queue reads lack player filtering in pinned source, so
gateway boundaries remain essential even with account filters.
Separate listener POST /audio accepts listener capabilities only and streams quiet
companion-generated PCM; joining causes no MA effects. Expiry/revocation/backpressure
closes active sockets. The packaged Web Audio sink validates PCM and starts only
on Enable Audio. This is a **synthetic test stream, not MA/Sendspin audio**. A
supported public-interface dedicated receiver, private pairing, audited codecs and
protocol/time tests are still needed; see `evidence/SENDSPIN-RECEIVER.md` in the repo.
Crossfade remains explicitly unavailable in setup and diagnostics.
Actual connected live reading: verified DEV target, **11 playlists / 1 radio**, no
MA token/endpoint/target ID in browser-facing responses, playback disabled and zero
mutations. This exercised a local HTTP client/companion, not Foundry or TLS. New
phase/queue restoration tests use an isolated fake MA HTTP server. Earlier live
idle-queue controls/restoration and failed synthetic ingestion remain separately
recorded; no new playback mutation occurred in this revision.
+94
View File
@@ -0,0 +1,94 @@
> Optional experimental companion fallback. The standard module has no mandatory
> companion or sandbox dependency. See ../ARCHITECTURE.md and ../INSTALL.md for
> the 0.5.0 module-only experiment and remaining deployment gates. This guide
> does not authorize host routing, service installation or production changes.
# Private companion setup — 0.4.0-dev
This is a development companion, not a public deployment. It always binds an
ephemeral **127.0.0.1** port, runs for five minutes, and starts no MA playback on
launch. No firewall, reverse proxy, MA service or production Foundry configuration
has been changed by this project. Node 24.23.0 or later; no npm install is needed.
The module and companion are separate artifacts. Extract the module into an isolated
Foundry Data/modules directory. Extract `adaptive-music-companion-dev.zip` on the
operator's private gateway host (or run the repository). All operator data stays in
an owner-controlled `.local/` directory mode 0700, JSON/secret files mode 0600.
The module ZIP contains only browser code; the companion ZIP contains server code
and notices, never actual endpoint configuration or secrets.
For the existing authorized DEV target, provide private `.local/environment.json`
with `ma_url`, `.local/ma-token`, and `.local/ma-readonly-results.json` generated by
the existing approved read-only probe. The launcher pins that verified account's
sole player, exact name Adaptive Music DEV and provider instance. It does not list
or choose household players. Back up `.local/catalog-key` and
`.local/catalog-namespace.json` to retain catalog IDs across restarts. Corrupt or
unsafe existing namespace/key files fail rather than silently changing IDs.
Create `.local/development-gateway.json` with these operator values (placeholders):
```json
{
"foundryOrigin": "https://foundry.example.invalid",
"proxyHost": true,
"syntheticAudio": true,
"enableSyntheticControl": false
}
```
Use the exact isolated Foundry origin, with no trailing slash/path. HTTPS is
required except for localhost development. `proxyHost: true` requires the preserved
Host header to match that origin. With `proxyHost: false`, only the ephemeral
loopback Host is accepted (for local harnesses, not browser deployment). The process
also requires an exact Origin and header-only grants; it rejects arbitrary paths,
query strings, commands, target selectors, oversized bodies and excess requests.
Run `node gateway/run-development.mjs` from the companion/repository root. The
loopback address is written to `.local/development-gateway-runtime.json`, never
browser settings. The operator must already have, or separately approve and review,
a **private same-origin HTTPS route** `/adaptive-music-gateway` from the isolated
Foundry origin to this local companion, preserving Host, Origin and Authorization,
streaming responses without buffering or token/header logging. Preserve every
existing network restriction. No proxy template was applied, no route has been
created and this build does not bypass mixed-content/private-network protections.
A remote browser cannot reach the operator's loopback listener without that
infrastructure. This ephemeral prototype is not suitable for permanent hosting.
Privately deliver `.local/controller-bootstrap.json` to the elected active GM.
In Foundry settings → Configure Settings → Adaptive Music setup, paste the JSON
into the password field and choose **Connect and load MA catalog**. The field is
cleared and the capability stays in memory only. Do not paste an MA token. The
module never receives one. Diagnostics show target availability, catalog contents,
content authorization and the missing Sendspin/crossfade capabilities. Capabilities
expire after five minutes; get a fresh bootstrap after restarting the companion.
Only the elected active GM should connect; other GMs may configure native music.
Set owned native playlists using checkboxes, reload, then configure world defaults
and each scene's ambient, combat, boss and native fallback choices. Boss combatants
can override playlist, priority and inactive state in setup. Enable automation only
after configuration. MA catalog assignments persist as opaque IDs, but real MA
playlist playback remains disallowed under the current synthetic-only authorization.
Unavailable/unapproved MA assignments choose the explicit scene/world native
fallback or silence before preparing playback. A target with uncertain active MA
playback cannot be bypassed by silently starting fallback audio.
`enableSyntheticControl: true` is an explicit operator opt-in for the **existing
approved generated fixtures only**. It requires `.local/fixture-origin.json` and
MA-readable synthetic files; it adds generated ambient/combat sequence choices.
All real MA catalog IDs remain excluded from playback authorization. The earlier
fixture ingestion attempt failed, so this is still an infrastructure gate. Do not
modify existing playlists or select other MA players to work around it.
For browser audio, give listeners `.local/listener-bootstrap.json` privately. They
open **Campaign audio (development)** and press Enable Audio. The separate listener
grant cannot browse catalog, acquire a lease or control queues. This plays the
companion's quiet synthetic PCM tone through Web Audio; it is independent of the
DEV target and does **not** prove Sendspin/MA audio playback. Closing/stopping audio
or capability expiry/revocation closes the stream. Browser rendering and autoplay
still need actual Foundry/browser validation. Joining never changes any MA player.
For Sendspin audio, a separately approved gateway-owned public-interface receiver,
private pairing/identity storage, codec review and termination are still needed.
No direct MA Sendspin proxy is provided. Crossfade and concurrent ambient layers
remain unimplemented, and the UI says so. See TESTING.md/PROGRESS.md in the repository
for exact offline/live evidence. Do not expose this companion publicly.
+78
View File
@@ -0,0 +1,78 @@
// In-process, read-only security PoC. No HTTP/WSS listener or live credential bootstrap.
import { randomBytes } from 'node:crypto';
import { MusicError } from '../src/core/controller.mjs';
export class GatewayControl {
#grants = new Map(); #leases = new Map();
constructor({ campaigns, origin, now = () => Date.now() }) {
this.campaigns = new Map(Object.entries(campaigns)); this.origin = origin; this.now = now;
}
// Operator-only API. Never expose mint/revoke/acquire directly to unauthenticated browsers.
mint({ campaign, session, role, ttlMs = 60000 }) {
if (!this.campaigns.has(campaign) || !['controller','listener'].includes(role) ||
!session || !(ttlMs > 0 && ttlMs <= 300000)) throw new MusicError('denied');
const token = randomBytes(32).toString('base64url');
this.#grants.set(token, { campaign, session, role, expires: this.now()+ttlMs }); return token;
}
revoke(token) { this.#grants.delete(token); }
authorize(token, origin, campaign, session, role) {
const grant = this.#grants.get(token);
if (origin !== this.origin || !grant || grant.expires <= this.now() ||
grant.campaign !== campaign || grant.session !== session || grant.role !== role) throw new MusicError('denied');
return grant;
}
acquire(request) {
const g = this.authorize(request.token, request.origin, request.campaign, request.session, 'controller');
const previous = this.#leases.get(g.campaign);
// No live takeover: new controller waits for expiry/revocation, then gets a greater fence.
if (previous && previous.expires > this.now() && this.#grants.has(previous.token)) throw new MusicError('denied');
const lease = { token: request.token, session: g.session, fence: (previous?.fence ?? 0)+1, generation: 0,
expires: Math.min(g.expires, this.now()+30000) };
this.#leases.set(g.campaign, lease); return { fence: lease.fence, expires: lease.expires };
}
// Server-only guard for a provider bound to this exact controller lease.
fenceGuard(request) {
const captured = {...request};
return fence => {
this.authorize(captured.token,captured.origin,captured.campaign,captured.session,'controller');
const lease=this.#leases.get(captured.campaign);
if (!lease || lease.token!==captured.token || lease.session!==captured.session ||
lease.fence!==fence || fence!==captured.fence || lease.expires<=this.now()) throw new MusicError('stale');
};
}
release(request) {this.fenceGuard(request)(request.fence);this.#leases.get(request.campaign).expires=this.now();}
renew(request) {
this.fenceGuard(request)(request.fence);
const grant=this.authorize(request.token,request.origin,request.campaign,request.session,'controller');
const lease=this.#leases.get(request.campaign);
lease.expires=Math.min(grant.expires,this.now()+30000);
return {fence:lease.fence,expires:lease.expires};
}
async #controllerRead(request, operation) {
const allowed = new Set(['token','origin','campaign','session','fence','generation']);
if (Object.keys(request).some(k => !allowed.has(k))) throw new MusicError('denied');
const check = () => {
this.authorize(request.token, request.origin, request.campaign, request.session, 'controller');
const lease = this.#leases.get(request.campaign);
if (!lease || lease.token !== request.token || lease.session !== request.session || lease.expires <= this.now() ||
lease.fence !== request.fence || !Number.isSafeInteger(request.generation) ||
request.generation <= lease.generation) throw new MusicError('stale');
return lease;
};
const lease = check();
// Consume generation before I/O so concurrent/replayed requests cannot both pass.
lease.generation = request.generation;
const result = await operation(this.campaigns.get(request.campaign));
this.authorize(request.token, request.origin, request.campaign, request.session, 'controller');
if (this.#leases.get(request.campaign) !== lease || lease.generation !== request.generation || lease.expires <= this.now()) throw new MusicError('stale');
return result;
}
async readCatalog(request) {
return this.#controllerRead(request, ({client}) => client.catalog());
}
async readQueue(request) {
const queue = await this.#controllerRead(request, ({client,target}) => client.getOwnedQueue(target));
// No URIs, names, upstream IDs, artwork or raw metadata leave the queue response.
return { state: ['playing','paused','idle'].includes(queue.state) ? queue.state : 'unknown',
items: Number.isSafeInteger(queue.items) && queue.items >= 0 ? queue.items : 0 };
}
}
+38
View File
@@ -0,0 +1,38 @@
import {createServer} from 'node:http';
import {MusicError} from '../src/core/controller.mjs';
// Development companion: fixed loopback binding. Public exposure is deliberately unavailable.
export async function startDevelopmentHTTP({service,origin,prefix='/adaptive-music-gateway',expectedHost}){
const streams=new Set(),rates=new Map();
const server=createServer({maxHeaderSize:4096},async(req,res)=>{
const respond=(status,data)=>{res.writeHead(status,{'Content-Type':'application/json','Cache-Control':'no-store','X-Content-Type-Options':'nosniff'});res.end(JSON.stringify(data));};
let handle;
try{
if(req.method!=='POST'||![prefix+'/rpc',prefix+'/audio'].includes(req.url)||req.headers.host!==(expectedHost??`127.0.0.1:${server.address().port}`)||req.headers.origin!==origin||
req.headers['content-type']!=='application/json'||typeof req.headers.authorization!=='string'||!req.headers.authorization.startsWith('Bearer '))throw new MusicError('denied');
// Fixed peer count: this listener only accepts local peers, never arbitrary IP maps.
const peer=req.socket.remoteAddress,now=Date.now(),rate=rates.get(peer);
if(!rate||now-rate.start>60000)rates.set(peer,{start:now,count:1});else if(++rate.count>600)throw new MusicError('denied');
const chunks=[];let size=0;
for await(const chunk of req){size+=chunk.length;if(size>16384)throw new MusicError('denied');chunks.push(chunk);}
let body;try{body=JSON.parse(Buffer.concat(chunks).toString('utf8'));}catch{throw new MusicError('denied');}
if(!body||typeof body!=='object'||Array.isArray(body))throw new MusicError('denied');
const token=req.headers.authorization.slice(7);
if(req.url===prefix+'/rpc'){
const value=await service.rpc(token,origin,body);service.authorize(token,origin,body);
if(JSON.stringify(value).length>1048576)throw new MusicError('unavailable');respond(200,value);return;
}
if(Object.keys(body).sort().join(',')!=='campaign,session'||!service.audio)throw new MusicError('denied');
service.authorize(token,origin,body,'listener');
handle=service.audio.connect({token,origin,...body});
res.writeHead(200,{'Content-Type':'application/octet-stream','Cache-Control':'no-store','X-Content-Type-Options':'nosniff','X-Audio-Format':'pcm16le;rate=24000;channels=2'});res.flushHeaders();
const connection={res,handle,timer:setInterval(()=>{
try{const frame=handle.next();if(frame&&!res.write(frame.pcm))res.destroy();}catch{res.destroy();}
},20)};
streams.add(connection);
res.on('close',()=>{clearInterval(connection.timer);handle.close();streams.delete(connection);});
}catch(error){handle?.close();if(res.headersSent)res.destroy();else respond(error.code==='denied'?403:409,{code:['denied','stale','unsupported','unavailable','uncertain','expired-media'].includes(error.code)?error.code:'unavailable'});}
});
server.maxHeadersCount=16;server.headersTimeout=2000;server.requestTimeout=5000;server.keepAliveTimeout=1000;server.maxConnections=32;
await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(0,'127.0.0.1',resolve);});
return {url:`http://127.0.0.1:${server.address().port}${prefix}`,async close(){for(const {res,handle,timer}of streams){clearInterval(timer);handle.close();res.destroy();}const done=new Promise(resolve=>server.close(resolve));server.closeAllConnections();await done;}};
}
+68
View File
@@ -0,0 +1,68 @@
import {randomUUID} from 'node:crypto';
import {MusicError} from '../src/core/controller.mjs';
import {MAPlaybackProvider} from './ma-provider.mjs';
// Server-only bridge. No upstream IDs, raw snapshots, arbitrary commands or URLs cross it.
export class DevelopmentService {
#control; #campaign; #session; #client; #key; #allowed; #provider; #binding; #latest=0; #tail=Promise.resolve(); #handles=new Map(); #cache=new Map(); #pending=0;
constructor({control,campaign,session,client,snapshotKey,allowedIds=[],playbackEnabled=false,audio}){
this.#control=control;this.#campaign=campaign;this.#session=session;this.#client=client;this.#key=snapshotKey;
this.#allowed=new Set(allowedIds);this.playbackEnabled=playbackEnabled;this.audio=audio;
}
authorize(token,origin,body,role='controller'){
this.#control.authorize(token,origin,body.campaign,body.session,role);
if(body.campaign!==this.#campaign||body.session!==this.#session)throw new MusicError('denied');
}
async rpc(token,origin,body){
this.authorize(token,origin,body);
const base=['action','campaign','session'];
const shape={connect:[],diagnostics:[],catalog:[],renew:['fence'],release:['fence'],prepare:['generation','operationId','fence','id'],snapshot:['generation','operationId','fence'],apply:['generation','operationId','fence','handle'],restore:['generation','operationId','fence','handle'],stop:['generation','operationId','fence']};
if(!Object.hasOwn(shape,body.action)||Object.keys(body).some(k=>![...base,...shape[body.action]].includes(k)))throw new MusicError('denied');
const request={token,origin,campaign:this.#campaign,session:this.#session,fence:body.fence};
if(body.action==='connect'){
const lease=this.#control.acquire(request);request.fence=lease.fence;
this.#binding=request;this.#latest=0;this.#handles.clear();this.#cache.clear();
this.#provider=new MAPlaybackProvider({client:this.#client,campaign:this.#campaign,session:this.#session,fence:lease.fence,authority:this.#control.fenceGuard(request),snapshotKey:this.#key});return lease;
}
if(body.action==='diagnostics'){
let target='unavailable';try{await this.#client.verifyTarget();target='verified';}catch{}
this.authorize(token,origin,body);
return {target,catalog:true,playbackEnabled:this.playbackEnabled && target==='verified',allowedIds:[...this.#allowed],
expiresAt:this.#control.authorize(token,origin,body.campaign,body.session,'controller').expires,audioSource:this.audio?'synthetic-pcm':'none',sendspin:false,crossfade:false,ambientLayers:1};
}
if(body.action==='catalog'){const items=await this.#client.catalog();this.authorize(token,origin,body);return [...items,...[...this.#allowed].filter(id=>id.startsWith('synthetic-')).map(id=>({provider:'ma',id,kind:'sequence',name:id==='synthetic-ambient'?'Generated ambient test sequence':'Generated combat test sequence'}))];}
if(body.action==='renew')return this.#control.renew(request);
if(body.action==='release'){this.#control.release(request);return {ok:true};}
if(!this.playbackEnabled || !this.#provider || !Number.isSafeInteger(body.generation)||body.generation<1 || typeof body.operationId!=='string'||body.operationId.length>80 || !body.operationId ||
this.#binding.token!==token || this.#binding.fence!==body.fence)throw new MusicError('denied');
this.#control.fenceGuard(request)(body.fence);
if(body.generation<this.#latest)throw new MusicError('stale');
this.#latest=body.generation;
const signature=JSON.stringify(body),cached=this.#cache.get(body.operationId);
if(cached){if(cached.signature!==signature)throw new MusicError('denied');return cached.result;}
const ctx={campaign:this.#campaign,session:this.#session,generation:body.generation,check:()=>{
this.authorize(token,origin,body);this.#control.fenceGuard(request)(body.fence);if(body.generation!==this.#latest)throw new MusicError('stale');
}};
const put=(type,value)=>{
ctx.check();
for(const [id,entry]of this.#handles)if(entry.expires<=Date.now())this.#handles.delete(id);
if(this.#handles.size>=64)throw new MusicError('unavailable');
const handle=randomUUID(),expires=Date.now()+300000;this.#handles.set(handle,{type,value,expires,generation:body.generation});return {handle,expires};
};
const get=type=>{const entry=this.#handles.get(body.handle);if(!entry||entry.type!==type||entry.expires<=Date.now()||type==='prepared'&&entry.generation!==body.generation)throw new MusicError('expired-media');return entry.value;};
for(const [id,entry]of this.#cache)if(entry.generation<body.generation)this.#cache.delete(id);
if(this.#cache.size>=128||this.#pending>=16)throw new MusicError('unavailable');
this.#pending++;
const operation=this.#tail.catch(()=>{}).then(async()=>{
ctx.check();
switch(body.action){
case 'prepare':if(!this.#allowed.has(body.id))throw new MusicError('denied');return put('prepared',await this.#provider.resolve({provider:'ma',id:body.id},ctx));
case 'snapshot':return put('snapshot',await this.#provider.snapshot(ctx));
case 'apply':await this.#provider.apply(get('prepared'),ctx);return {ok:true};
case 'restore':await this.#provider.restore(get('snapshot'),ctx);return {ok:true};
case 'stop':await this.#provider.stopOwned(ctx);return {ok:true};
}
}).finally(()=>{this.#pending--;});
this.#tail=operation;
this.#cache.set(body.operationId,{signature,result:operation,generation:body.generation});return operation;
}
}
+43
View File
@@ -0,0 +1,43 @@
import { createServer } from 'node:http';
// Local experiment only. No public binding, MA dependency, credential, control route or deployment entrypoint.
// Wire format: raw signed stereo PCM16 little endian, 24 kHz, 20 ms per frame.
export async function startLoopbackAudio({ audio, campaign, session }) {
const active = new Set();
const server = createServer({ maxHeaderSize: 4096 }, (req, res) => {
let listener;
try {
if (req.method !== 'GET' || req.url !== '/audio' || req.headers.host !== `127.0.0.1:${server.address().port}` ||
req.headers['content-length'] || req.headers['transfer-encoding'] ||
typeof req.headers.authorization !== 'string' || !req.headers.authorization.startsWith('Bearer ')) throw Error();
listener = audio.connect({ campaign, session, origin: req.headers.origin,
token: req.headers.authorization.slice(7) });
} catch { res.writeHead(403, { 'Cache-Control': 'no-store' }); res.end(); return; }
res.writeHead(200, { 'Content-Type': 'application/octet-stream', 'Cache-Control': 'no-store',
'X-Content-Type-Options': 'nosniff', 'X-Audio-Format': 'pcm16le;rate=24000;channels=2' });
res.flushHeaders();
const connection = { res, listener, timer: null };
const close = () => { clearInterval(connection.timer); listener.close(); active.delete(connection); };
res.on('close', close);
connection.timer = setInterval(() => {
try {
const frame = listener.next();
// Never queue an unbounded stream for a slow consumer.
if (frame && !res.write(frame.pcm)) res.destroy();
} catch { res.destroy(); }
}, 20);
active.add(connection);
});
server.maxHeadersCount = 16; server.headersTimeout = 1000;
server.requestTimeout = 1000; server.keepAliveTimeout = 1000;
server.maxConnections = 32;
await new Promise((resolve,reject) => { server.once('error',reject); server.listen(0,'127.0.0.1',resolve); });
return {
url: `http://127.0.0.1:${server.address().port}/audio`,
async close() {
for (const {res,listener,timer} of active) { clearInterval(timer); listener.close(); res.destroy(); }
active.clear();
const closed = new Promise((resolve,reject) => server.close(error => error ? reject(error) : resolve()));
server.closeAllConnections(); await closed;
}
};
}
+2
View File
@@ -0,0 +1,2 @@
// Compatibility export; validated transport is shared with the GM-local browser path.
export {MAReadClient} from '../src/providers/ma/client.mjs';
+2
View File
@@ -0,0 +1,2 @@
// Compatibility export; the same provider now runs with browser Web Crypto.
export {MAPlaybackProvider} from '../src/providers/ma/provider.mjs';
+19
View File
@@ -0,0 +1,19 @@
import { MusicError } from '../src/core/controller.mjs';
// Strict local-fixture decoder only. No file/network fetch or third-party codec.
export function* pcmFixtureFrames(input) {
const data=Buffer.from(input);
if(data.length<44 || data.length>9000000 || data.toString('ascii',0,4)!=='RIFF' || data.toString('ascii',8,12)!=='WAVE' || data.readUInt32LE(4)+8!==data.length)throw new MusicError('unsupported');
let format=false,pcm;
for(let offset=12;offset+8<=data.length;){
const kind=data.toString('ascii',offset,offset+4),length=data.readUInt32LE(offset+4);offset+=8;
if(offset+length>data.length)throw new MusicError('unsupported');
if(kind==='fmt '){
if(length<16 || data.readUInt16LE(offset)!==1 || data.readUInt16LE(offset+2)!==2 || data.readUInt32LE(offset+4)!==24000 || data.readUInt16LE(offset+12)!==4 || data.readUInt16LE(offset+14)!==16)throw new MusicError('unsupported');
format=true;
}
if(kind==='data'){if(pcm)throw new MusicError('unsupported');pcm=data.subarray(offset,offset+length);}
offset+=length+(length%2);
}
if(!format || !pcm?.length || pcm.length%1920!==0)throw new MusicError('unsupported');
for(let offset=0;offset<pcm.length;offset+=1920)yield Uint8Array.from(pcm.subarray(offset,offset+1920));
}
+38
View File
@@ -0,0 +1,38 @@
import { lstat, open } from 'node:fs/promises';
import { constants } from 'node:fs';
import { join } from 'node:path';
import { MusicError } from '../src/core/controller.mjs';
// Fixed private file only. No environment secret, URL parameter or browser input.
export async function loadMAToken(directory) {
try {
const dir = await lstat(directory);
if (!dir.isDirectory() || dir.isSymbolicLink() || (dir.mode & 0o777) !== 0o700 || dir.uid !== process.getuid()) throw Error();
const file = await open(join(directory, 'ma-token'), constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
try {
const info = await file.stat();
if (!info.isFile() || (info.mode & 0o777) !== 0o600 || info.uid !== process.getuid() || info.size > 16384) throw Error();
const token = (await file.readFile('utf8')).trim();
if (!token || /[\r\n]/.test(token)) throw Error();
return token;
} finally { await file.close(); }
} catch { throw new MusicError('denied'); }
}
// Separate from the MA token. Back up this private key to preserve scene identifiers.
export async function loadCatalogKey(directory) {
const { randomBytes } = await import('node:crypto');
const path = join(directory, 'catalog-key');
// Reuse the directory/token owner-mode validation before creating private state.
await loadMAToken(directory);
try {
const created = await open(path, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
try { await created.writeFile(randomBytes(32)); await created.sync(); }
finally { await created.close(); }
} catch (error) { if (error.code !== 'EEXIST') throw new MusicError('denied'); }
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
try {
const info = await file.stat();
if (!info.isFile() || info.uid !== process.getuid() || (info.mode & 0o777) !== 0o600 || info.size !== 32) throw new MusicError('denied');
return await file.readFile();
} finally { await file.close(); }
}
+45
View File
@@ -0,0 +1,45 @@
// Explicit private development companion. Never launched by the Foundry module.
import {open} from 'node:fs/promises';
import {constants} from 'node:fs';
import {randomUUID} from 'node:crypto';
import {MAReadClient} from './ma-client.mjs';
import {loadMAToken,loadCatalogKey} from './private-config.mjs';
import {GatewayControl} from './control.mjs';
import {DevelopmentService} from './development-service.mjs';
import {startDevelopmentHTTP} from './development-http.mjs';
import {SyntheticAudioGateway} from './synthetic-audio.mjs';
async function privateJSON(name,value){const file=await open(`.local/${name}`,constants.O_WRONLY|constants.O_CREAT|constants.O_NOFOLLOW,0o600);try{const info=await file.stat();if(!info.isFile()||(info.mode&0o777)!==0o600||info.uid!==process.getuid())throw Error();await file.truncate(0);await file.writeFile(JSON.stringify(value,null,2));}finally{await file.close();}}
let activeServer,sourceTimer;
async function readPrivate(name){const file=await open(`.local/${name}`,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);try{const info=await file.stat();if(!info.isFile()||(info.mode&0o777)!==0o600||info.uid!==process.getuid()||info.size>1048576)throw Error();return JSON.parse(await file.readFile('utf8'));}finally{await file.close();}}
try{
await loadMAToken('.local');
const config=await readPrivate('development-gateway.json');
if(Object.keys(config).some(k=>!['foundryOrigin','proxyHost','syntheticAudio','enableSyntheticControl'].includes(k))||['proxyHost','syntheticAudio','enableSyntheticControl'].some(k=>config[k]!==undefined&&typeof config[k]!=='boolean'))throw Error();
const environment=await readPrivate('environment.json');
const verified=await readPrivate('ma-readonly-results.json');
const origin=new URL(config.foundryOrigin);
if(origin.origin!==config.foundryOrigin||origin.protocol!=='https:'&&!['localhost','127.0.0.1'].includes(origin.hostname)||verified.me.player_filter.length!==1||verified.player.name!=='Adaptive Music DEV')throw Error();
const campaign=randomUUID(),session=randomUUID(),snapshotKey=await loadCatalogKey('.local');
// Persist the opaque campaign namespace independently from ephemeral session/grants.
let namespace;
try{namespace=(await readPrivate('catalog-namespace.json')).campaign;}catch(error){if(error.code!=='ENOENT')throw error;namespace=randomUUID();await privateJSON('catalog-namespace.json',{campaign:namespace});}
if(typeof namespace!=='string'||!namespace||namespace.length>256)throw Error();
let sequences={};if(config.enableSyntheticControl){const fixture=await readPrivate('fixture-origin.json');sequences=Object.fromEntries(Object.entries(fixture.sequences).map(([kind,names])=>[`synthetic-${kind}`,names.map(name=>`builtin://track/${fixture.base_url}/${name}`)]));}
const client=new MAReadClient({baseUrl:environment.ma_url,token:await loadMAToken('.local'),target:verified.me.player_filter[0],approvedProviders:verified.me.provider_filter,
catalogKey:snapshotKey,campaign:namespace,expectedName:'Adaptive Music DEV',expectedProvider:verified.player.provider,syntheticSequences:sequences});
const control=new GatewayControl({campaigns:{[campaign]:{client}},origin:origin.origin});
const controller=control.mint({campaign,session,role:'controller',ttlMs:300000}),listener=control.mint({campaign,session,role:'listener',ttlMs:300000});
let audio;if(config.syntheticAudio){audio=new SyntheticAudioGateway({control});audio.provision({campaign,session});}
const service=new DevelopmentService({control,campaign,session,client,snapshotKey,allowedIds:Object.keys(sequences),playbackEnabled:config.enableSyntheticControl===true,audio});
const server=await startDevelopmentHTTP({service,origin:origin.origin,expectedHost:config.proxyHost?origin.host:undefined});
activeServer=server;
await privateJSON('development-gateway-runtime.json',{url:server.url,expires:new Date(Date.now()+300000).toISOString()});
await privateJSON('controller-bootstrap.json',{token:controller,campaign,session});
await privateJSON('listener-bootstrap.json',{token:listener,campaign,session});
let generation=0,sample=0;
const timer=sourceTimer=audio&&setInterval(()=>{const pcm=new Uint8Array(1920),view=new DataView(pcm.buffer);for(let i=0;i<480;i++){const value=Math.round(500*Math.sin(2*Math.PI*220*sample++/24000));view.setInt16(i*4,value,true);view.setInt16(i*4+2,value,true);}audio.publish({campaign,session,generation:++generation,pcm});},20);
let closing=false;
const close=async()=>{if(closing)return;closing=true;clearInterval(timer);control.revoke(controller);control.revoke(listener);await server.close();process.exitCode=0;};
process.once('SIGINT',close);process.once('SIGTERM',close);setTimeout(close,300000).unref();
console.log('Private loopback companion ready for five minutes. Connection codes and address are in .local/; no MA playback starts on launch.');
}catch{clearInterval(sourceTimer);await activeServer?.close();console.error('Companion startup failed; check protected .local configuration and origin. Details withheld.');process.exitCode=1;}
+63
View File
@@ -0,0 +1,63 @@
import { MusicError } from '../src/core/controller.mjs';
// In-process transport prototype; accepts only operator-generated 20 ms PCM fixtures.
// No Sendspin socket, upstream URL, codec negotiation, network listener or MA connection.
export class SyntheticAudioGateway {
#control; #streams = new Map(); #connections = new Set();
constructor({ control }) { this.#control = control; }
// Operator-only session bootstrap; rotate on gateway restart. Never a browser route.
provision({ campaign, session }) {
if (!this.#control.campaigns.has(campaign) || !session || this.#streams.has(campaign)) throw new MusicError('denied');
this.#streams.set(campaign, { session, generation: 0, frames: [] });
}
// Operator-only synthetic source. Real sources must acquire/check the authority fence.
publish({ campaign, session, generation, pcm }) {
const stream = this.#streams.get(campaign);
if (!stream || stream.session !== session || !Number.isSafeInteger(generation) || generation !== stream.generation + 1) throw new MusicError('stale');
if (!(pcm instanceof Uint8Array) || pcm.byteLength !== 1920) throw new MusicError('denied');
stream.generation = generation;
stream.frames.push({ generation, pcm: Uint8Array.from(pcm) });
// At most 200 ms of stereo PCM16 at 24 kHz per campaign, no disk cache.
if (stream.frames.length > 10) stream.frames.shift();
}
#check(request) {
if (!request || Object.keys(request).sort().join(',') !== 'campaign,origin,session,token') throw new MusicError('denied');
this.#control.authorize(request.token, request.origin, request.campaign, request.session, 'listener');
const stream = this.#streams.get(request.campaign);
if (!stream || stream.session !== request.session) throw new MusicError('denied');
return stream;
}
connect(request) {
const stream = this.#check(request);
this.sweep();
if ([...this.#connections].filter(c => c.request.campaign === request.campaign).length >= 16) throw new MusicError('denied');
const connection = { request: { ...request }, cursor: stream.generation, closed: false };
this.#connections.add(connection);
const close = () => { connection.closed = true; this.#connections.delete(connection); };
return {
close,
get closed() { return connection.closed; },
next: () => {
try {
if (connection.closed) throw new MusicError('denied');
const current = this.#check(connection.request);
const frame = current.frames.find(f => f.generation > connection.cursor);
// Fail closed for listeners that fell behind the bounded ring.
if (current.frames.length && connection.cursor < current.frames[0].generation - 1) throw new MusicError('stale');
if (!frame) return null;
connection.cursor = frame.generation;
return { generation: frame.generation, pcm: Uint8Array.from(frame.pcm), sampleRate: 24000, channels: 2 };
} catch (error) { close(); throw error; }
}
};
}
// A future transport must schedule this and close its socket when a handle closes.
sweep() {
for (const connection of this.#connections) {
try { this.#check(connection.request); }
catch { connection.closed = true; this.#connections.delete(connection); }
}
}
purge(campaign) {
this.#streams.delete(campaign); this.sweep();
}
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 3 Death Saves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+22
View File
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+28
View File
@@ -0,0 +1,28 @@
{
"id": "adaptive-music",
"title": "Adaptive Music",
"description": "Scene and combat playlist automation with native Foundry fallback, private GM Music Assistant setup and Sendspin/WebRTC campaign audio.",
"version": "0.8.3",
"authors": [
{
"name": "CheddahBoxMB"
}
],
"compatibility": {
"minimum": "14",
"maximum": "14"
},
"esmodules": [
"src/foundry/module.mjs"
],
"relationships": {
"requires": []
},
"styles": [
"styles/adaptive-music.css"
],
"socket": true,
"url": "https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music",
"manifest": "https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/raw/branch/main/module.json",
"download": "https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/releases/download/v0.8.3/adaptive-music.zip"
}
+614
View File
@@ -0,0 +1,614 @@
{
"name": "adaptive-music",
"version": "0.8.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "adaptive-music",
"version": "0.8.0",
"license": "MIT",
"dependencies": {
"@sendspin/sendspin-js": "5.0.0"
},
"devDependencies": {
"esbuild": "0.27.1",
"playwright": "1.57.0"
},
"engines": {
"node": ">=24.23.0"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz",
"integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz",
"integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz",
"integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz",
"integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz",
"integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz",
"integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz",
"integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz",
"integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz",
"integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz",
"integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz",
"integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz",
"integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz",
"integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==",
"cpu": [
"mips64el"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz",
"integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz",
"integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz",
"integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz",
"integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/netbsd-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz",
"integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz",
"integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz",
"integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz",
"integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openharmony-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz",
"integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openharmony"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz",
"integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz",
"integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz",
"integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz",
"integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@noble/ciphers": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
"integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
"license": "MIT",
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@noble/curves": {
"version": "1.9.7",
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
"integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
"license": "MIT",
"dependencies": {
"@noble/hashes": "1.8.0"
},
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@noble/hashes": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
"integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
"license": "MIT",
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@sendspin/sendspin-js": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@sendspin/sendspin-js/-/sendspin-js-5.0.0.tgz",
"integrity": "sha512-yRRjPsz6TyR1GzRYO7ur7oAzwZ11tELK1PEp6Ci7fscXOI0JdtP6BbwPhw+/CR0TWQxu/VwtVPtXT9SH/xhzFw==",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^1.2.1",
"@noble/curves": "^1.8.1",
"@noble/hashes": "^1.7.1",
"opus-encdec": "^0.1.1"
},
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/esbuild": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz",
"integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.27.1",
"@esbuild/android-arm": "0.27.1",
"@esbuild/android-arm64": "0.27.1",
"@esbuild/android-x64": "0.27.1",
"@esbuild/darwin-arm64": "0.27.1",
"@esbuild/darwin-x64": "0.27.1",
"@esbuild/freebsd-arm64": "0.27.1",
"@esbuild/freebsd-x64": "0.27.1",
"@esbuild/linux-arm": "0.27.1",
"@esbuild/linux-arm64": "0.27.1",
"@esbuild/linux-ia32": "0.27.1",
"@esbuild/linux-loong64": "0.27.1",
"@esbuild/linux-mips64el": "0.27.1",
"@esbuild/linux-ppc64": "0.27.1",
"@esbuild/linux-riscv64": "0.27.1",
"@esbuild/linux-s390x": "0.27.1",
"@esbuild/linux-x64": "0.27.1",
"@esbuild/netbsd-arm64": "0.27.1",
"@esbuild/netbsd-x64": "0.27.1",
"@esbuild/openbsd-arm64": "0.27.1",
"@esbuild/openbsd-x64": "0.27.1",
"@esbuild/openharmony-arm64": "0.27.1",
"@esbuild/sunos-x64": "0.27.1",
"@esbuild/win32-arm64": "0.27.1",
"@esbuild/win32-ia32": "0.27.1",
"@esbuild/win32-x64": "0.27.1"
}
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/opus-encdec": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/opus-encdec/-/opus-encdec-0.1.1.tgz",
"integrity": "sha512-TDzyGqYqrwn5UEUNaLsfLGu8Ma+HRNrgLYj7Vx5wfTnafAA21G6Bnm/qTIa3orQi/yZPZYmkdpO/gez4nfA1Rw==",
"license": "MIT"
},
"node_modules/playwright": {
"version": "1.57.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0.tgz",
"integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.57.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.57.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0.tgz",
"integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"name": "adaptive-music",
"version": "0.8.0",
"private": true,
"type": "module",
"license": "MIT",
"engines": {
"node": ">=24.23.0"
},
"scripts": {
"test": "node --test tests/js/*.test.mjs",
"package:module": "python3 scripts/package_module.py",
"gateway:dev": "node gateway/run-development.mjs",
"build:vendor": "node scripts/build_sendspin.mjs",
"release": "python3 scripts/release.py",
"test:browser-audio": "node scripts/measure_browser_audio.mjs"
},
"dependencies": {
"@sendspin/sendspin-js": "5.0.0"
},
"devDependencies": {
"esbuild": "0.27.1",
"playwright": "1.57.0"
},
"overrides": {
"@noble/ciphers": "1.3.0",
"@noble/curves": "1.9.7",
"@noble/hashes": "1.8.0",
"opus-encdec": "0.1.1"
}
}
+52
View File
@@ -0,0 +1,52 @@
"""Offline tracked/unignored-file guardrails; not a complete secret scanner."""
from __future__ import annotations
import ipaddress
from pathlib import Path
import re
import subprocess
ROOT = Path(__file__).resolve().parents[1]
REQUIRED = ('AGENTS.md', 'ARCHITECTURE.md', 'PROGRESS.md', 'TESTING.md',
'SECURITY.md', 'THIRD-PARTY-NOTICES', '.gitignore')
def findings(name: str, data: str) -> list[str]:
issues = []
if name.startswith('.local/') or Path(name).name.startswith('.env'):
issues.append('private configuration file included')
for candidate in re.findall(r'(?<![\w.])(?:\d{1,3}\.){3}\d{1,3}(?![\w.])', data):
try:
address = ipaddress.ip_address(candidate)
except ValueError:
continue
if address.is_private and not address.is_loopback:
issues.append('private IP address included')
if re.search(r'-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----', data):
issues.append('private key material included')
if re.search(r'https?://[^\s/@]+:[^\s/@]+@', data):
issues.append('URL credentials included')
return sorted(set(issues))
def audit() -> list[str]:
errors = [f'missing {name}' for name in REQUIRED if not (ROOT / name).is_file()]
paths = subprocess.check_output(
['git', 'ls-files', '-z', '--cached', '--others', '--exclude-standard'],
cwd=ROOT).decode().split('\0')
for name in sorted(set(filter(None, paths))):
path = ROOT / name
if path.is_file():
errors.extend(f'{name}: {reason}' for reason in findings(
name, path.read_text(errors='replace')))
notices = (ROOT / 'THIRD-PARTY-NOTICES').read_text()
for credit in ('CheddahBoxMB', '3 Death Saves', 'Furyspark', 'Tyler', 'Apache-2.0'):
if credit not in notices:
errors.append(f'missing attribution: {credit}')
return errors
if __name__ == '__main__':
problems = audit()
print('\n'.join(problems) if problems else 'PASS: repository privacy/attribution guardrails')
raise SystemExit(bool(problems))
+61
View File
@@ -0,0 +1,61 @@
// Test instrumentation only. Report counts; never record or retain audio.
class AdaptiveContinuityMeter extends AudioWorkletProcessor {
frames=0;
channelSamples=0;
zeroRun=0;
maxZeroRun=0;
shortDropouts=0;
nearFullScale=0;
jumps=0;
maxStep=0;
last=0;
nextReport=0;
audible=false;
constructor(){
super();
this.port.onmessage=event=>{
if(event.data!=='start-phase')return;
this.zeroRun=this.maxZeroRun=0;
this.port.postMessage({...this.metrics(),phaseStarted:true});
};
}
metrics(){
return {sampleRate,frames:this.frames,channelSamples:this.channelSamples,shortDropouts:this.shortDropouts,
maxZeroRun:this.maxZeroRun,trailingZeroRun:this.zeroRun,nearFullScale:this.nearFullScale,jumps:this.jumps,maxStep:this.maxStep};
}
process([input],[output]) {
const length=output[0].length;
for(let i=0;i<length;i++){
let peak=0;
for(const channel of input){
peak=Math.max(peak,Math.abs(channel[i]));
if(Math.abs(channel[i])>=0.999)this.nearFullScale++;
this.channelSamples++;
}
if(peak<=0.000001)this.zeroRun++;
if(peak>0.000001){
if(this.audible){
this.maxZeroRun=Math.max(this.maxZeroRun,this.zeroRun);
if(this.zeroRun>=sampleRate*0.00075&&this.zeroRun<=sampleRate*0.08)this.shortDropouts++;
}
this.zeroRun=0;
this.audible=true;
}
const sample=input[0]?.[i]??0;
const step=Math.abs(this.last-sample);
this.maxStep=Math.max(this.maxStep,step);
if(step>0.35)this.jumps++;
this.last=sample;
}
this.frames+=length;
if(currentFrame>=this.nextReport){
this.nextReport=currentFrame+sampleRate;
this.port.postMessage(this.metrics());
}
return true;
}
}
registerProcessor('adaptive-continuity-meter',AdaptiveContinuityMeter);
+16
View File
@@ -0,0 +1,16 @@
// Rebuild only with npm ci --ignore-scripts from the audited lock. Releases use committed output.
import {build} from 'esbuild';
import {readFile,writeFile,copyFile,mkdir} from 'node:fs/promises';
import {createHash} from 'node:crypto';
await mkdir('vendor',{recursive:true});await mkdir('licenses/vendor',{recursive:true});
const result=await build({stdin:{contents:"export {SendspinCore,SendspinDecoder,loadSendspinClientIdentity} from '@sendspin/sendspin-js';",resolveDir:process.cwd()},bundle:true,format:'esm',platform:'browser',target:'es2022',minify:true,legalComments:'eof',write:false,metafile:true,
plugins:[{name:'pcm-only-no-optional-codec',setup(builder){builder.onResolve({filter:/^opus-encdec\//},()=>({path:'disabled-codec',namespace:'pcm-only'}));builder.onLoad({filter:/.*/,namespace:'pcm-only'},()=>({contents:"throw new Error('Optional Opus fallback is not distributed; negotiate PCM'); export default undefined;",loader:'js'}));}}]});
const banner='// @sendspin/sendspin-js 5.0.0 (Apache-2.0), bundled with audited noble MIT dependencies.\n// Modification: optional opus-encdec decoder imports disabled; this build negotiates PCM only.\n// See licenses/vendor and THIRD-PARTY-NOTICES. No source maps or remote imports.\n';
const bytes=banner+result.outputFiles[0].text;await writeFile('vendor/sendspin-5.0.0.mjs',bytes);
const licenses=[['@sendspin/sendspin-js','LICENSE'],['@noble/ciphers','LICENSE'],['@noble/curves','LICENSE'],['@noble/hashes','LICENSE']];
for(const [name,file]of licenses)await copyFile(`node_modules/${name}/${file}`,`licenses/vendor/${name.replace(/[@/]/g,'-')}.txt`);
const lock=JSON.parse(await readFile('package-lock.json','utf8'));
const provenance={sdk:'@sendspin/sendspin-js',version:'5.0.0',sha256:createHash('sha256').update(bytes).digest('hex'),build:'scripts/build_sendspin.mjs',pcm_only:true,optional_opus_fallback_distributed:false,
packages:licenses.map(([name])=>({name,version:lock.packages['node_modules/'+name].version,integrity:lock.packages['node_modules/'+name].integrity})),input_files:Object.keys(result.metafile.inputs).filter(p=>p.startsWith('node_modules/'))};
await writeFile('vendor/provenance.json',JSON.stringify(provenance,null,2)+'\n');
console.log('Built pinned PCM-only official SDK bundle and copied notices.');
+88
View File
@@ -0,0 +1,88 @@
// Browser interoperability checks for encrypted signaling and audio-only SDP.
import {createServer} from 'node:http';
import {readFile,stat,writeFile} from 'node:fs/promises';
import {resolve} from 'node:path';
const playwright=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const engines=process.argv.includes('--webkit-only')?['webkit']:process.argv.includes('--webkit')?['firefox','chromium','webkit']:['firefox','chromium'];
const relayFile=process.env.AM_LOOPBACK_TURN_CONFIG;
let relay;
if(relayFile){
if(!resolve(relayFile).startsWith(resolve('.local')+'/')||((await stat(relayFile)).mode&0o777)!==0o600)throw Error('private TURN fixture file required');
relay=JSON.parse(await readFile(relayFile,'utf8'));
if(typeof relay?.urls!=='string'||!/^turn:127\.0\.0\.1:\d{1,5}\?transport=udp$/.test(relay.urls))throw Error('loopback TURN fixture required');
}
const root=resolve(import.meta.dirname,'..');
const server=createServer(async(req,res)=>{if(req.url==='/'){res.end('<!doctype html><title>Signal check</title>');return;}const path=resolve(root,'.'+new URL(req.url,'http://localhost').pathname);if(!path.startsWith(root+'/src/')){res.writeHead(404);res.end();return;}try{res.setHeader('Content-Type','text/javascript');res.end(await readFile(path));}catch{res.writeHead(404);res.end();}});
await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve));const reports=[];
try{
for(const name of engines){
const browser=await playwright[name].launch({headless:!process.argv.includes('--headed'),...(name==='chromium'?{args:['--no-sandbox']}: {})});
let pages=[],stage='browser-setup';
try{
const context=await browser.newContext();pages=[await context.newPage(),await context.newPage()];
for(const page of pages)await page.goto('http://127.0.0.1:'+server.address().port);
const invite=await pages[0].evaluate(async()=>{const {newAudioInvite,SignalCodec}=await import('/src/audio/signal-codec.mjs');const invite=newAudioInvite({session:'browser-test',userId:'test-listener'});window.codec=new SignalCodec(invite,'gm');return invite;});
await pages[1].evaluate(async invite=>{const {SignalCodec}=await import('/src/audio/signal-codec.mjs');window.codec=new SignalCodec(invite,'listener');},invite);
const frame=await pages[1].evaluate(()=>window.codec.seal({type:'offer',sdp:'fixture'}));
const cryptoResult=await pages[0].evaluate(async frame=>{try{await window.codec.open(frame);return 'pass';}catch(e){return e.code;}},frame);
const sdp=await pages[1].evaluate(async()=>{const pc=new RTCPeerConnection({iceServers:[]});pc.addTransceiver('audio',{direction:'recvonly'});const offer=await pc.createOffer();pc.close();return {media:offer.sdp.split(/\r?\n/).filter(l=>l.startsWith('m=')),directionLines:offer.sdp.split(/\r?\n/).filter(l=>/^a=(send|recv|inactive)/.test(l)),unsafe:/a=sendrecv|a=sendonly/.test(offer.sdp)};});
for(let i=0;i<pages.length;i++){
await pages[i].exposeFunction('signal',async frame=>pages[1-i].evaluate(frame=>window.receiveSignal?.(frame),frame));
await pages[i].evaluate(async isGM=>{
const {PeerAudio}=await import('/src/audio/peer-audio.mjs');
const handlers=new Map();
const socket={on:(event,fn)=>handlers.set(event,fn),off:event=>handlers.delete(event),emit:(event,frame)=>window.signal(frame)};
window.receiveSignal=frame=>handlers.get('module.adaptive-music')?.(frame);
window.authorized=true;
const audio=new AudioContext();
const element=document.createElement('audio');element.muted=true;element.autoplay=true;document.body.append(element);
const activate=document.createElement('button');activate.textContent='Start test audio';
activate.onclick=()=>{void audio.resume();void element.play().catch(()=>{});};document.body.append(activate);
const analyser=audio.createAnalyser(),silent=audio.createGain();silent.gain.value=0;
analyser.connect(silent).connect(audio.destination);
window.signalLevel=()=>{
const samples=new Float32Array(analyser.fftSize);analyser.getFloatTimeDomainData(samples);
return Math.sqrt(samples.reduce((sum,sample)=>sum+sample*sample,0)/samples.length);
};
window.peer=new PeerAudio({socket,userId:isGM?'gm':'test-listener',isGM:()=>isGM,isAuthorizedUser:()=>window.authorized,
onStream:stream=>{
element.srcObject=stream;void element.play().catch(()=>{});
window.testSource=audio.createMediaStreamSource(stream);
window.testSource.connect(analyser);
},
createPeer:config=>{window.createdPC=new RTCPeerConnection(config);return window.createdPC;}});
if(isGM){
const destination=audio.createMediaStreamDestination(),tone=audio.createOscillator();
tone.connect(destination);tone.connect(analyser);tone.start();
window.peer.setSource(destination.stream);
}
},i===0);
await pages[i].getByRole('button',{name:'Start test audio'}).click();
}
stage='peer-connection';
const peerInvite=await pages[0].evaluate(relay=>window.peer.invite('test-listener',{
ttlMs:16000,...(relay&&{iceServers:[relay],relayOnly:true})
}),relay);
await pages[1].evaluate(invite=>window.peer.listen(invite),peerInvite);
await pages[0].waitForFunction(()=>window.peer.diagnostics().peers[0]?.connection==='connected',null,{polling:100,timeout:10000});
stage='rendered-audio';
const beforeExpiry=await pages[1].waitForFunction(()=>window.signalLevel()>0.05,null,{polling:100,timeout:7500}).then(()=>true);
const finalSDP=await pages[1].evaluate(()=>({media:window.createdPC.localDescription.sdp.split(/\r?\n/).filter(l=>l.startsWith('m=')),directions:window.createdPC.localDescription.sdp.split(/\r?\n/).filter(l=>/^a=(send|recv|inactive)/.test(l)),sessionHeader:window.createdPC.localDescription.sdp.split('m=')[0].split(/\r?\n/).filter(l=>/^a=(send|recv|inactive)/.test(l))}));
const peers=await Promise.all(pages.map(page=>page.evaluate(()=>window.peer.diagnostics())));
await pages[1].waitForFunction(expires=>Date.now()>expires+500,peerInvite.expires,{polling:100});
const afterExpiry=await pages[1].evaluate(()=>window.createdPC.connectionState==='connected'&&window.signalLevel()>0.05);
await pages[0].evaluate(()=>{window.authorized=false;window.peer.reconcile();});
const revoked=await pages[0].evaluate(()=>window.createdPC.connectionState==='closed'&&window.peer.diagnostics().peers.length===0);
if(cryptoResult!=='pass'||!beforeExpiry||!afterExpiry||!revoked)throw Error('browser signaling or audio assertion failed');
reports.push({browser:name,version:browser.version(),cryptoResult,frameKeys:Object.keys(frame),sdp,finalSDP,peers,beforeExpiry,afterExpiry,revoked,relayOnly:Boolean(relay)});
}catch(error){
const diagnostics=await Promise.all(pages.map(page=>page.evaluate(()=>({
peer:window.peer?.diagnostics(),rms:window.signalLevel?.(),tracks:window.createdPC?.getReceivers().map(r=>({state:r.track.readyState,muted:r.track.muted}))
})).catch(()=>null)));
reports.push({browser:name,version:browser.version(),stage,error:error.name,diagnostics,relayOnly:Boolean(relay)});
process.exitCode=1;
}finally{await browser.close();}
}
console.log(JSON.stringify(reports,null,2));
await writeFile(relay?'.local/browser-signaling-relay.json':'.local/browser-signaling.json',JSON.stringify(reports,null,2),{mode:0o600});
}finally{await new Promise(resolve=>server.close(resolve));}
+26
View File
@@ -0,0 +1,26 @@
// Authorized reads only: browser-safe client -> loopback companion -> dedicated live MA.
import {readFile,writeFile} from 'node:fs/promises';
import {liveClient} from './live_ma_preflight.mjs';
import {GatewayControl} from '../gateway/control.mjs';
import {DevelopmentService} from '../gateway/development-service.mjs';
import {startDevelopmentHTTP} from '../gateway/development-http.mjs';
import {GatewayClient} from '../src/providers/ma/remote.mjs';
const origin='https://foundry.example.test';let server,browser;
try{
const {client,catalogKey}=await liveClient();
const campaign='read-only-local',session='read-only-session';
const control=new GatewayControl({campaigns:{[campaign]:{client}},origin});
const token=control.mint({campaign,session,role:'controller'});
const service=new DevelopmentService({control,campaign,session,client,snapshotKey:catalogKey,playbackEnabled:false});
server=await startDevelopmentHTTP({service,origin});const wire=[];
browser=new GatewayClient({origin,fetchImpl:async(path,options)=>{const response=await fetch(server.url+path.replace('/adaptive-music-gateway',''),{...options,headers:{...options.headers,Origin:origin}});wire.push(await response.clone().text());return response;}});
const status=await browser.connect({token,campaign,session});
const maToken=(await readFile('.local/ma-token','utf8')).trim(),environment=JSON.parse(await readFile('.local/environment.json','utf8')),prior=JSON.parse(await readFile('.local/ma-readonly-results.json','utf8'));
const report={checked_at:new Date().toISOString(),evidence_class:'live MA reads through local companion and browser-safe client; no real Foundry browser',target:status.target,
playlists:browser.catalog.filter(c=>c.kind==='playlist').length,radios:browser.catalog.filter(c=>c.kind==='radio').length,
browser_payloads_private:!wire.join('').includes(maToken)&&!wire.join('').includes(environment.ma_url)&&!wire.join('').includes(prior.me.player_filter[0]),
playback_enabled:status.playbackEnabled,mutations_sent:0,foundry_verified:false,tls_verified:false};
await writeFile('evidence/connected-ma-readonly.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report,null,2));
if(report.target!=='verified'||!report.browser_payloads_private)process.exitCode=1;
}catch(error){console.error('Connected catalog check failed:',error.code??'unavailable');process.exitCode=1;}
finally{await browser?.disconnect();await server?.close();}
+59
View File
@@ -0,0 +1,59 @@
// Real browser policy/transport reproduction, NOT MA/Foundry acceptance.
// Local CA is trusted only by the disposable Firefox profile. No TLS bypass.
import {createServer} from 'node:https';
import {readFile,mkdir,writeFile,chmod} from 'node:fs/promises';
import {execFileSync} from 'node:child_process';
import {createHash} from 'node:crypto';
import {resolve} from 'node:path';
import assert from 'node:assert/strict';
import {firefox} from 'playwright';
const root=resolve(import.meta.dirname,'..'),dir=resolve(root,'.local/browser-policy'),profile=resolve(dir,'firefox-profile');
await mkdir(profile,{recursive:true,mode:0o700});await chmod(dir,0o700);
const run=(binary,args)=>execFileSync(binary,args,{cwd:dir,stdio:'pipe'});
run('openssl',['req','-x509','-newkey','rsa:2048','-nodes','-keyout','ca.key','-out','ca.pem','-days','2','-subj','/CN=Adaptive Music isolated test CA','-addext','basicConstraints=critical,CA:TRUE']);
run('openssl',['req','-newkey','rsa:2048','-nodes','-keyout','server.key','-out','server.csr','-subj','/CN=localhost']);
await writeFile(resolve(dir,'extensions.cnf'),'subjectAltName=DNS:localhost,IP:127.0.0.1\nbasicConstraints=CA:FALSE\nextendedKeyUsage=serverAuth\n',{mode:0o600});
run('openssl',['x509','-req','-in','server.csr','-CA','ca.pem','-CAkey','ca.key','-CAcreateserial','-out','server.pem','-days','2','-extfile','extensions.cnf']);
for(const name of ['ca.key','server.key'])await chmod(resolve(dir,name),0o600);
const certutil=process.env.AM_CERTUTIL??resolve(dir,'nss/usr/bin/certutil');
try{run(certutil,['-N','--empty-password','-d','sql:'+profile]);}catch{}
try{run(certutil,['-D','-n','am-isolated-ca','-d','sql:'+profile]);}catch{}
run(certutil,['-A','-n','am-isolated-ca','-t','C,,','-i',resolve(dir,'ca.pem'),'-d','sql:'+profile]);
const tls={key:await readFile(resolve(dir,'server.key')),cert:await readFile(resolve(dir,'server.pem'))};
let mode='allow',maOrigin,foundryOrigin,upgrades=0;const seenOrigins=new Set(),sockets=new Set();
const handler=async(req,res)=>{
if(req.url==='/src/providers/ma/diagnostics.mjs'){res.setHeader('Content-Type','text/javascript');res.end(await readFile(resolve(root,'src/providers/ma/diagnostics.mjs')));return;}
const policy=`default-src 'self'; script-src 'self'; connect-src 'self'${mode==='allow'||mode==='reject-origin'?' '+maOrigin.replace('https:','wss:'):''}`;
res.setHeader(mode==='report-only'?'Content-Security-Policy-Report-Only':'Content-Security-Policy',policy);
res.end('<!doctype html><title>Isolated browser policy test</title>');
};
const ma=createServer(tls,handler),foundry=createServer(tls,handler);
for(const server of [ma,foundry]){
server.on('upgrade',(req,socket)=>{
sockets.add(socket);socket.on('error',()=>{});socket.on('close',()=>sockets.delete(socket));seenOrigins.add(req.headers.origin);
if(mode==='reject-origin'&&req.headers.origin!==maOrigin){socket.end('HTTP/1.1 403 Forbidden\r\nContent-Length: 0\r\n\r\n');return;}
upgrades++;const accept=createHash('sha1').update(req.headers['sec-websocket-key']+'258EAFA5-E914-47DA-95CA-C5AB0DC85B11').digest('base64');
socket.write('HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: '+accept+'\r\n\r\n');
socket.on('data',()=>socket.end(Buffer.from([0x88,0]))); // No authentication, protocol emulation or commands.
});
await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve));
}
maOrigin=`https://127.0.0.1:${ma.address().port}`;foundryOrigin=`https://localhost:${foundry.address().port}`;
let context;const checks=[];
try{
context=await firefox.launchPersistentContext(profile,{headless:true});const page=await context.newPage();
const check=async(name,origin,expected)=>{
await page.goto(origin);assert.equal(await page.evaluate(()=>isSecureContext),true);
const results=await page.evaluate(async base=>{const {probeWebSockets}=await import('/src/providers/ma/diagnostics.mjs');return probeWebSockets(base);},maOrigin);
assert.deepEqual(results.map(r=>r.code),[expected,expected]);checks.push({name,results});
};
await check('Trusted HTTPS cross-origin WSS allowed',foundryOrigin,'upgrade-ok');
mode='csp';const before=upgrades;await check('Enforced CSP blocks cross-origin before upgrade',foundryOrigin,'csp-blocked');assert.equal(upgrades,before);
// Explicit WSS self is necessary across browser interpretations of HTTPS self.
mode='allow';await check('Same MA origin control',maOrigin,'upgrade-ok');
mode='report-only';await check('Report-only CSP does not block',foundryOrigin,'upgrade-ok');
mode='reject-origin';await check('Server Origin rejection stays opaque',foundryOrigin,'upgrade-failed');await check('Same origin still succeeds under Origin restriction',maOrigin,'upgrade-ok');
assert.ok(seenOrigins.has(foundryOrigin));assert.ok(seenOrigins.has(maOrigin));
const result={scope:'isolated real Firefox HTTPS/WSS policy tests; local transport server, no MA, no Foundry, no credentials or audio',browser:context.browser().version(),tls:'local CA trusted in disposable Firefox profile; no certificate bypass',checks,passed:true};
await mkdir(resolve(root,'evidence'),{recursive:true});await writeFile(resolve(root,'evidence/cross-origin-browser.json'),JSON.stringify(result,null,2)+'\n');console.log(JSON.stringify(result,null,2));
}finally{await context?.close();for(const socket of sockets)socket.destroy();await Promise.all([ma,foundry].map(server=>new Promise(resolve=>server.close(resolve))));}
@@ -0,0 +1,115 @@
// Exercise persisted browser credentials and API auth against an isolated fixture.
import assert from 'node:assert/strict';
import {mkdtemp,readFile,rm} from 'node:fs/promises';
import {tmpdir} from 'node:os';
import {resolve} from 'node:path';
const playwright=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const engines=process.argv.includes('--webkit')?['chromium','firefox','webkit']:['chromium','firefox'];
const origin='https://fixture.invalid';
const allow=new Set(['/src/foundry/receiver-vault.mjs','/src/core/controller.mjs','/src/providers/ma/websocket.mjs']);
const scope={campaign:'demo-world',userId:'demo-gm'};
const credential={maUrl:'https://ma.example.test',token:'synthetic-credential-fixture',targetName:'Demo receiver',auto:true};
async function startProfile(engine,profile){
const context=await playwright[engine].launchPersistentContext(profile);
const fixture={revoked:false,attempts:0};
try{
await context.routeWebSocket('wss://ma.example.test/ws',socket=>{
socket.onMessage(data=>{
const frame=JSON.parse(data);
assert.equal(frame.command,'auth');
fixture.attempts++;
socket.send(JSON.stringify({message_id:frame.message_id,
result:{authenticated:!fixture.revoked&&frame.args?.token===credential.token}}));
});
});
await context.route(origin+'/**',async route=>{
const path=new URL(route.request().url()).pathname;
if(path==='/')return route.fulfill({body:'<!doctype html><title>Credential fixture</title>',contentType:'text/html'});
if(!allow.has(path))return route.abort();
return route.fulfill({body:await readFile(resolve(import.meta.dirname,'..','.'+path)),contentType:'text/javascript'});
});
const page=context.pages()[0]??await context.newPage();
await page.goto(origin);
return {context,page,fixture};
}catch(error){
await context.close();
throw error;
}
}
async function connectWithSavedCredential(page){
return page.evaluate(async scope=>{
const {ReceiverVault}=await import('/src/foundry/receiver-vault.mjs');
const {GMMAWebSocket}=await import('/src/providers/ma/websocket.mjs');
const saved=await new ReceiverVault().loadCredential(scope);
if(!saved?.auto)return 'no-auto-credential';
const transport=new GMMAWebSocket({baseUrl:saved.maUrl,token:saved.token});
try{await transport.connect();return 'authenticated';}
catch(error){return error.code;}
finally{transport.close();}
},scope);
}
for(const engine of engines){
const profile=await mkdtemp(resolve(tmpdir(),'adaptive-music-vault-'));
let active;
try{
active=await startProfile(engine,profile);
const {page}=active;
const before=await page.evaluate(async({scope,credential})=>{
const {ReceiverVault}=await import('/src/foundry/receiver-vault.mjs');
const vault=new ReceiverVault();
await vault.saveCredential(scope,credential);
await vault.save({...scope,maUrl:credential.maUrl},{token:credential.token,identityStorage:{'sendspin-identity-sk':'fictional-device-only-identity'},targetName:credential.targetName});
const receiver=await vault.load({...scope,maUrl:credential.maUrl});
const keys=await new Promise((resolve,reject)=>{
const request=indexedDB.open('adaptive-music-private-receivers',1);
request.onerror=()=>reject(request.error);
request.onsuccess=()=>{
const connection=request.result;
const scan=connection.transaction('records').objectStore('records').getAll();
scan.onerror=()=>reject(scan.error);
scan.onsuccess=()=>{
resolve(scan.result.map(({key,data,iv})=>[key.extractable,data instanceof ArrayBuffer,iv.length]));
connection.close();
};
};
});
return {receiverHasToken:Object.hasOwn(receiver,'token'),keys};
},{scope,credential});
assert.deepEqual(before,{receiverHasToken:false,keys:[[false,true,12],[false,true,12]]});
assert.equal(await connectWithSavedCredential(page),'authenticated');
await active.context.close();
active=await startProfile(engine,profile);
assert.equal(await connectWithSavedCredential(active.page),'authenticated');
active.fixture.revoked=true;
assert.equal(await connectWithSavedCredential(active.page),'ws-auth-denied');
assert.equal(active.fixture.attempts,2);
const checks=await active.page.evaluate(async({scope,credential})=>{
const {ReceiverVault}=await import('/src/foundry/receiver-vault.mjs');
const vault=new ReceiverVault();
const reopened=await vault.loadCredential(scope);
const differentUser=await vault.loadCredential({...scope,userId:'ordinary-player'});
const differentWorld=await vault.loadCredential({...scope,campaign:'another-world'});
await vault.saveCredential(scope,{...reopened,auto:false});
const paused=(await vault.loadCredential(scope)).auto===false;
await vault.forgetCredential(scope);
return {reopened:reopened.token===credential.token&&reopened.maUrl===credential.maUrl&&reopened.auto,
differentUser,differentWorld,paused,forgotten:await vault.loadCredential(scope),
receiverRetained:!!await vault.load({...scope,maUrl:credential.maUrl})};
},{scope,credential});
assert.deepEqual(checks,{reopened:true,differentUser:null,differentWorld:null,paused:true,forgotten:null,receiverRetained:true});
await active.context.close();
active=await startProfile(engine,profile);
assert.equal(await connectWithSavedCredential(active.page),'no-auto-credential');
assert.equal(active.fixture.attempts,0);
console.log(JSON.stringify({engine,browser:active.context.browser().version(),lockedKeys:true,scopeIsolation:true,
authenticatedAfterBrowserRestart:true,revokedAuthDeniedByFixture:true,pause:true,forgetSurvivedBrowserRestart:true}));
}finally{
await active?.context.close();
await rm(profile,{recursive:true,force:true});
}
}
+30
View File
@@ -0,0 +1,30 @@
// Uses the deployed Foundry ApplicationV2 renderer, with in-memory sample documents.
// Does not log in, install anything, update a world or connect to MA.
import {readFile,writeFile,mkdir} from 'node:fs/promises';
import {resolve} from 'node:path';
import assert from 'node:assert/strict';
const {chromium}=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const root=resolve(import.meta.dirname,'..'),config=JSON.parse(await readFile('.local/live-environment.json','utf8'));
const browser=await chromium.launch({headless:true,args:['--no-sandbox']});const page=await browser.newPage({viewport:{width:1440,height:1000}});
try{
await page.route(config.foundry+'/adaptive-music-development/**',async route=>{const rel=new URL(route.request().url()).pathname.slice('/adaptive-music-development/'.length),file=resolve(root,rel);if(!file.startsWith(root+'/src/'))return route.abort();try{await route.fulfill({contentType:'text/javascript',body:await readFile(file)});}catch{await route.abort();}});
await page.goto(config.foundry,{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>globalThis.foundry?.applications?.api?.ApplicationV2);
await page.addStyleTag({content:await readFile('styles/adaptive-music.css','utf8')});
const details=await page.evaluate(async()=>{
const {createSetupClass}=await import('/adaptive-music-development/src/foundry/setup.mjs');
const {ReceiverVault}=await import('/adaptive-music-development/src/foundry/receiver-vault.mjs');
const collection=items=>{const m=new Map(items.map(i=>[i.id,i]));m[Symbol.iterator]=function*(){yield*m.values();};return m;};
const fixtureGame={world:{id:'ui-test',title:'UI test'},user:{isGM:true},settings:{get:(ns,key)=>({ownedPlaylistIds:'',musicDefaults:{},enabled:false})[key]},playlists:collection([]),scenes:collection([]),combats:[]};
const connection={status:{state:'disconnected',catalog:0,audioContext:'closed'},test:async()=>{},connect:async()=>{},refresh:async()=>{},resume:async()=>{},disconnect:async()=>{}};
const Setup=createSetupClass({game:fixtureGame,connection,getChoices:async()=>[],start(){},stop(){},setOverrides(){},onError(){}});window.testApplication=new Setup();await window.testApplication.render({force:true});
const scope={campaign:'isolated-ui-test',userId:'isolated-test-gm',maUrl:'https://ma.example.test'};
const vault=new ReceiverVault();await vault.save(scope,{identityStorage:{'sendspin-identity-sk':'A'.repeat(43)},targetName:'Test receiver',catalogKey:'fixture-key',namespace:'test',token:'must-never-be-stored'});
const record=await new ReceiverVault().load(scope);const other=await vault.load({...scope,userId:'other-gm'});await vault.forget(scope);
return {applicationV2:true,version:game.version,receiverVault:{reopened:record.identityStorage['sendspin-identity-sk']==='A'.repeat(43),tokenExcluded:!Object.hasOwn(record,'token'),userIsolation:other===null,forgotten:await vault.load(scope)===null}};
});
assert.ok(Object.values(details.receiverVault).every(Boolean));const sizes=[];
for(const width of [380,640]){await page.evaluate(width=>window.testApplication.setPosition({width}),width);await page.waitForTimeout(100);const fits=await page.locator('#adaptive-music-setup .adaptive-music-setup').evaluate(el=>el.scrollWidth<=el.clientWidth+1);assert.equal(fits,true);sizes.push({width,fits});}
await mkdir('dist/previews',{recursive:true});await page.screenshot({path:'dist/previews/foundry-v14-setup.png'});
const report={at:new Date().toISOString(),scope:'actual deployed Foundry ApplicationV2 before login, in-memory sample documents; no world writes or MA connection',browser:browser.version(),...details,sizes,passed:true};
await writeFile('evidence/foundry-application-v070.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report,null,2));
}finally{await browser.close();}
+357
View File
@@ -0,0 +1,357 @@
// Browser diagnostics on the actual private HTTPS hosts. Records metadata only.
import {execFileSync} from 'node:child_process';
import {createHash} from 'node:crypto';
import {mkdtemp, readFile, rm, stat, writeFile} from 'node:fs/promises';
import {lookup} from 'node:dns/promises';
import {isIP} from 'node:net';
import {resolve} from 'node:path';
import {probeWebSockets} from '../src/providers/ma/diagnostics.mjs';
const report = {at: new Date().toISOString(), scope: 'private Nginx HTTPS route', checks: {}};
const playback = process.argv.includes('--playback');
const nativeSheet = process.argv.includes('--native-sheet');
const layoutOnly = process.argv.includes('--layout-only')||nativeSheet;
const loggedIn = playback || layoutOnly || process.argv.includes('--logged-in');
const engine = process.argv.includes('--firefox')?'firefox':process.argv.includes('--webkit')?'webkit':'chromium';
const packageOption=process.argv.indexOf('--package-preview');
const previewModule = process.argv.includes('--preview-module')||packageOption!==-1;
let packageDirectory;
const headed = process.argv.includes('--headed');
const long = process.argv.includes('--continuity');
const review = process.argv.includes('--review');
const expect = (ok, code) => { if (!ok) throw new Error(code); };
async function privateJSON(name) {
const file = `.local/${name}.json`;
expect(((await stat(file)).mode & 0o777) === 0o600, 'private-file-mode');
return JSON.parse(await readFile(file, 'utf8'));
}
function httpsOrigin(value) {
const url = new URL(value);
expect(url.protocol === 'https:' && !url.username && !url.password && url.pathname === '/' &&
!url.search && !url.hash && (!url.port || url.port === '443') &&
/^[a-z0-9.-]+$/i.test(url.hostname) && !isIP(url.hostname), 'invalid-https-origin');
return url;
}
async function verifyPrivateResponse(response, origin, proxyIP) {
expect(response && new URL(response.url()).origin === origin, 'unexpected-navigation-origin');
expect((await response.serverAddr())?.ipAddress === proxyIP, 'unexpected-server-address');
expect(await response.securityDetails(), 'missing-tls-details');
}
async function openPrivatePage(page, url, proxyIP) {
const response = await page.goto(url.href, {waitUntil: 'domcontentloaded', timeout: 30000});
await verifyPrivateResponse(response, url.origin, proxyIP);
return response;
}
async function retainBrowserWebSocket(page) {
await page.addInitScript(() => {
Object.defineProperty(window, '__adaptiveMusicProbeNativeSocket', {value: window.WebSocket});
});
}
async function collectTransport(page, response, ma) {
const headers = await response.allHeaders();
const session = engine === 'chromium' ? await page.context().newCDPSession(page) : null;
const requests = new Map();
const socketResults = [];
const failedRequests = [];
const policyIssues = [];
session?.on('Network.webSocketCreated', ({requestId, url}) => {
for (const path of ['/ws', '/sendspin']) {
if (url === `wss://${ma.host}${path}`) requests.set(requestId, path);
}
});
session?.on('Network.webSocketHandshakeResponseReceived', ({requestId, response}) => {
if (requests.has(requestId)) socketResults.push({path: requests.get(requestId), httpStatus: response.status});
});
session?.on('Network.loadingFailed', ({requestId, errorText, blockedReason}) => {
if (!requests.has(requestId)) return;
const error = /^net::ERR_[A-Z0-9_]+$/.test(errorText) ? errorText : null;
failedRequests.push({path: requests.get(requestId), error, blockedReason: blockedReason ?? null});
});
session?.on('Network.webSocketFrameError', ({requestId, errorMessage}) => {
if (!requests.has(requestId)) return;
const status = errorMessage?.match(/Unexpected response code: (\d{3})/);
const error = errorMessage?.match(/\bnet::ERR_[A-Z0-9_]+\b/);
if (status || error) failedRequests.push({path: requests.get(requestId), httpStatus: status ? Number(status[1]) : null, error: error?.[0] ?? null});
});
session?.on('Audits.issueAdded', ({issue}) => {
const detail = issue.details?.corsIssueDetails ?? issue.details?.contentSecurityPolicyIssueDetails;
const url = detail?.request?.url ?? detail?.blockedURL;
if (!URL.canParse(url) || ![ma.origin, `wss://${ma.host}`].includes(new URL(url).origin)) return;
policyIssues.push({code: issue.code, reason: detail.corsErrorStatus?.corsError ?? detail.contentSecurityPolicyViolationType});
});
try {
await session?.send('Network.enable');
await session?.send('Audits.enable');
const details = {
pageStatus: response.status(),
privatePeerVerified: true,
cspHeaderPresent: Boolean(headers['content-security-policy']),
reportOnlyCspHeaderPresent: Boolean(headers['content-security-policy-report-only']),
cspMetaPresent: await page.locator('meta[http-equiv="Content-Security-Policy" i]').count() > 0,
secureContext: await page.evaluate(() => globalThis.isSecureContext),
pageReplacesWebSocket: await page.evaluate(() => window.WebSocket !== window.__adaptiveMusicProbeNativeSocket),
upgrades: await page.evaluate(probeWebSockets, ma.origin),
handshakeReplies: socketResults,
failedRequests,
policyIssues,
};
if (details.pageReplacesWebSocket) {
details.nativeSendspinUpgrade = await page.evaluate(host => new Promise(resolve => {
const socket = new window.__adaptiveMusicProbeNativeSocket(`wss://${host}/sendspin`);
const timer = setTimeout(() => finish('upgrade-timeout'), 5000);
function finish(code) {
clearTimeout(timer);
socket.onopen = socket.onerror = socket.onclose = null;
socket.close();
resolve(code);
}
socket.onopen = () => finish('upgrade-ok');
socket.onerror = socket.onclose = () => finish('upgrade-failed');
}), ma.host);
}
return details;
} finally {
await session?.detach();
}
}
async function joinWorld(browser, foundry, proxyIP, world, {name, gm, password}, progress) {
expect(typeof name === 'string' && name && typeof password === 'string' && typeof gm === 'boolean', 'invalid-test-account');
const context=await browser.newContext({viewport:{width:1440,height:1000},screen:{width:1440,height:1000}});
const page=await context.newPage();
if (previewModule) {
const prefix='/modules/adaptive-music/';
const root=packageDirectory?resolve(packageDirectory,'adaptive-music'):resolve(import.meta.dirname,'..');
await page.context().route(`${foundry.origin}${prefix}**`,async route=>{
const file=new URL(route.request().url()).pathname.slice(prefix.length);
if(!/^(src\/.+\.mjs|styles\/.+\.css|vendor\/.+\.mjs)$/.test(file)||file.split('/').includes('..')){
return packageDirectory?route.abort():route.continue();
}
await route.fulfill({path:resolve(root,file),contentType:file.endsWith('.css')?'text/css':'text/javascript'});
});
}
page.setDefaultTimeout(20000);
if(playback) await page.context().route(`${foundry.origin}/adaptive-continuity-test.mjs`,route=>route.fulfill({
path:resolve(import.meta.dirname,'browser-continuity-worklet.mjs'),contentType:'text/javascript',
}));
await retainBrowserWebSocket(page);
if (playback) await page.addInitScript(() => {
const timeline = {gaps:0, overlaps:0, maxGapMs:0, maxOverlapMs:0, contiguous:0};
let prior;
const start = AudioBufferSourceNode.prototype.start;
AudioBufferSourceNode.prototype.start = function(when, offset, duration) {
const {buffer,context}=this;
if (buffer && context===window.__adaptiveMusicTestAudio.contexts[0]?.context && Number.isFinite(when) && when>0) {
const length=(duration??buffer.duration-(offset??0))/this.playbackRate.value;
if (prior?.context===context && when>=prior.start && Math.abs(when-prior.end)<0.2) {
const delta=(when-prior.end)*1000;
if(delta>0.1){timeline.gaps++;timeline.maxGapMs=Math.max(timeline.maxGapMs,delta);}
else if(delta < -0.1){timeline.overlaps++;timeline.maxOverlapMs=Math.max(timeline.maxOverlapMs,-delta);}
else timeline.contiguous++;
}
prior={context,start:when,end:when+length};
}
return start.apply(this,arguments);
};
window.__adaptiveMusicTestTimeline=timeline;
const peers = [];
const contexts = [];
const analysers = [];
const listenerAnalysers = [];
window.__adaptiveMusicTestAudio = {contexts, analysers, listenerAnalysers};
const createStream = AudioContext.prototype.createMediaStreamDestination;
AudioContext.prototype.createMediaStreamDestination = function () {
const destination = createStream.call(this);
contexts.push({context: this, destination});
return destination;
};
const createAnalyser = AudioContext.prototype.createAnalyser;
const modules = new WeakMap();
function measure(context,analyser,report) {
if(!context.audioWorklet)return;
if(!modules.has(context))modules.set(context,context.audioWorklet.addModule('/adaptive-continuity-test.mjs'));
modules.get(context).then(()=>{
const node=new AudioWorkletNode(context,'adaptive-continuity-meter');
const sink=context.createGain();sink.gain.value=0;
report.meterPort=node.port;
node.port.onmessage=event=>{
report.continuity=event.data;
if(event.data.phaseStarted)report.phaseStarted=event.data;
};
analyser.connect(node).connect(sink).connect(context.destination);
}).catch(()=>{report.meterFailed=true;});
}
AudioContext.prototype.createAnalyser = function () {
const analyser = createAnalyser.call(this);
analysers.push(analyser);
const report=contexts.find(entry=>entry.context===this);
if(report&&!report.measuring){report.measuring=true;report.analyser=analyser;measure(this,analyser,report);}
return analyser;
};
const createSource = AudioContext.prototype.createMediaStreamSource;
AudioContext.prototype.createMediaStreamSource = function (stream) {
const source = createSource.call(this, stream);
const analyser = createAnalyser.call(this);
source.connect(analyser);
const report={context: this, stream, analyser};
listenerAnalysers.push(report);
measure(this,analyser,report);
return source;
};
window.__adaptiveMusicTestPeers = peers;
window.RTCPeerConnection = new Proxy(window.RTCPeerConnection, {
construct(target, args, newTarget) {
const peer = Reflect.construct(target, args, newTarget);
peers.push(peer);
return peer;
},
});
});
const url = new URL('/join', foundry);
progress('join-page');
await openPrivatePage(page, url, proxyIP);
await page.getByText(world.title, {exact: true}).first().waitFor({timeout: 30000});
expect(new URL(page.url()).pathname === '/join', 'unexpected-join-path');
progress('select-account');
const form = page.locator('#join-game-form');
const users = form.locator('select[name="userId"]');
await users.waitFor({state: 'visible'});
const option = await users.evaluate((select, name) => {
const user = [...select.options].find(option => option.label === name);
return user ? {value: user.value, disabled: user.disabled} : null;
}, name);
expect(option?.value, 'development-account-not-found');
expect(!option.disabled, 'development-account-unavailable');
await users.selectOption({value: option.value});
await form.locator('input[type="password"]').fill(password);
progress('submit-join');
const navigation = page.waitForResponse(response => response.request().isNavigationRequest() &&
response.request().frame() === page.mainFrame() && new URL(response.url()).pathname === '/game');
const [response] = await Promise.all([navigation, form.locator('[type="submit"]').click()]);
await verifyPrivateResponse(response, foundry.origin, proxyIP);
progress('wait-for-game-ready');
await page.bringToFront();
await page.waitForFunction(() => globalThis.game?.ready && game.socket?.connected, undefined, {polling: 250, timeout: 55000});
const state = await page.evaluate(({id, title, account}) => ({
worldMatches: game.world.id === id && game.world.title === title,
accountMatches: game.user.name === account,
gm: game.user.isGM,
foundryVersion: game.version,
system: game.system.id,
otherActiveGMs: game.users.filter(user => user.id !== game.user.id && user.active && user.isGM).length,
adaptiveMusicActive: game.modules.get('adaptive-music')?.active === true,
adaptiveMusicVersion: game.modules.get('adaptive-music')?.version ?? null,
}), {id: world.id, title: world.title, account: name});
expect(state.worldMatches && state.accountMatches && state.gm === gm, 'unexpected-world-account-or-role');
expect(state.foundryVersion === '14.371' && state.system === 'dnd5e', 'unexpected-foundry-or-system');
expect(state.otherActiveGMs === (state.gm ? 0 : 1), 'unexpected-active-gm-count');
expect(state.adaptiveMusicActive, 'adaptive-music-inactive');
// Keep the unattended canvases from saturating the shared headless renderer.
state.canvasTickerPaused = (!headed||review) && await page.evaluate(() => {
const ticker = globalThis.canvas?.app?.ticker;
if (!ticker?.started) return false;
ticker.stop();
return true;
});
return {page, response, state};
}
let browser, stage = 'configuration';
try {
if(packageOption!==-1){
stage='package-preview-validation';
const archive=process.argv[packageOption+1];
expect(archive&&!archive.startsWith('-'),'package-preview-path-required');
packageDirectory=await mkdtemp('.local/v080-package-preview-');
report.runtimeAssetsSHA256=execFileSync('python3',[resolve(import.meta.dirname,'release.py'),'--runtime-sha256',archive],{encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim();
execFileSync('python3',['-m','zipfile','-e',archive,packageDirectory],{stdio:'ignore'});
report.packageSHA256=createHash('sha256').update(await readFile(archive)).digest('hex');
}
const config = await privateJSON('live-environment');
const foundry = httpsOrigin(config.foundry), ma = httpsOrigin(config.ma);
const proxyIP = config.proxy_ip;
expect(isIP(proxyIP) === 4 && foundry.host !== ma.host, 'invalid-private-route');
const playwright = await import(process.env.AM_PLAYWRIGHT_MODULE ?? 'playwright');
stage = 'browser-launch';
if (engine !== 'chromium') {
for (const host of [foundry.hostname, ma.hostname]) {
const answers = await lookup(host, {all: true});
expect(answers.length && answers.every(answer => answer.address === proxyIP), 'private-hostname-resolution-required');
}
}
browser = await playwright[engine].launch(engine === 'chromium' ? {headless: !headed,
...(review&&headed&&{ignoreDefaultArgs:['--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows','--disable-renderer-backgrounding']}),
args: ['--no-sandbox', '--no-proxy-server',
`--host-resolver-rules=MAP ${foundry.hostname} ${proxyIP}, MAP ${ma.hostname} ${proxyIP}`]} :
{headless: !headed,...(engine==='firefox'&&{firefoxUserPrefs:{'network.trr.mode':5,'network.proxy.type':0}})});
report.engine = engine;
report.browser = browser.version();
report.headed = headed;
report.moduleAssets = packageDirectory?'validated ZIP assets in the test browser':previewModule?
'workspace module assets in the test browser':'installed module assets';
for (const [name, origin] of (layoutOnly ? [] : [['foundryAnonymous', foundry], ['maSameOrigin', ma]])) {
stage = name;
const page = await browser.newPage();
await retainBrowserWebSocket(page);
const response = await openPrivatePage(page, origin, proxyIP);
report.checks[name] = await collectTransport(page, response, ma);
await page.context().close();
}
if (loggedIn) {
stage = 'development-world-configuration';
const {world, accounts} = await privateJSON('foundry-development');
expect(typeof world?.id === 'string' && world.id && typeof world.title === 'string' && world.title &&
Array.isArray(accounts) && accounts.length === 3 && accounts.every((account, index) => account?.gm === (index === 0)) &&
new Set(accounts.map(account => account.name)).size === 3, 'invalid-development-world-configuration');
report.accounts = {};
const pages = [];
for (const [index, account] of (layoutOnly ? accounts.slice(0,1) : accounts).entries()) {
const login = index === 0 ? 'gm-login' : `player-${index}-login`;
const {page, response, state} = await joinWorld(browser, foundry, proxyIP, world, account, step => {
stage = `${login}-${step}`;
console.error(`Development world authentication stage: ${stage}`);
});
report.accounts[login] = state;
pages.push(page);
if (index === 0 && !layoutOnly) {
stage = 'foundryLoggedIn';
report.checks[stage] = await collectTransport(page, response, ma);
}
}
if(layoutOnly){
stage='foundry-graphical-layout';
const {checkFoundryLayout,checkNativeSceneSheet}=await import('./live_foundry_playback.mjs');
if(nativeSheet)await checkNativeSceneSheet(pages[0],report);
else report.layout=await checkFoundryLayout(pages[0],ma);
}
if (playback) {
stage = 'development-world-playback';
const {checkFoundryPlayback,checkFoundryV080Review} = await import('./live_foundry_playback.mjs');
report.playback = {};
const run=review?checkFoundryV080Review:checkFoundryPlayback;
await run({pages, ma, world, report: report.playback, long});
}
}
report.completed = true;
} catch (error) {
if(error.name==='SyntaxError')console.error(error.stack);
report.completed = false;
report.failure = {stage, code: /^[a-z][a-z-]+$/.test(error.message) ? error.message : error.code ?? error.name};
process.exitCode = 1;
} finally {
await browser?.close();
if(packageDirectory)await rm(packageDirectory,{recursive:true,force:true});
const resultName=nativeSheet?`foundry-native-sheet-${engine}`:review?`foundry-v080-review-${engine}`:headed?`foundry-headed-${previewModule?'candidate':'installed'}-${engine}`:previewModule?`foundry-am006-preview-${engine}`:`foundry-private-route-${engine}`;
await writeFile(`.local/${resultName}.json`, JSON.stringify(report, null, 2) + '\n', {mode: 0o600});
console.log(JSON.stringify(report, null, 2));
}
+13
View File
@@ -0,0 +1,13 @@
// Authorized target/catalog reads only; compare two independent adapters for restart identity.
import { writeFile } from 'node:fs/promises';
import { liveClient } from './live_ma_preflight.mjs';
try {
const {client}=await liveClient();const target=await client.verifyTarget();const catalog=await client.catalog();
const restarted=await liveClient();const after=await restarted.client.catalog();
const ids=items=>items.map(c=>c.id).sort().join(',');
const report={checked_at:new Date().toISOString(),target,playlists:catalog.filter(c=>c.kind==='playlist').length,
radios:catalog.filter(c=>c.kind==='radio').length,sanitized:catalog.every(c=>Object.keys(c).sort().join(',')==='id,kind,name,provider'),
independent_adapter_ids_match:ids(catalog)===ids(after)};
await writeFile('evidence/ma-adapter.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report,null,2));
if(!report.independent_adapter_ids_match)process.exitCode=1;
}catch{console.error('MA adapter verification failed (details withheld)');process.exitCode=1;}
@@ -0,0 +1,15 @@
// Authorized live read-only preflight. No Sendspin connection, pairing, new identity or playback.
import {readFile,writeFile,access} from 'node:fs/promises';
import {liveClient} from './live_ma_preflight.mjs';
import {gmAccessPolicy} from '../src/audio/gm-host.mjs';
const environment=JSON.parse(await readFile('.local/environment.json','utf8'));
const previous=JSON.parse(await readFile('.local/ma-readonly-results.json','utf8'));
const {client}=await liveClient();await client.verifyTarget();const queue=await client.queueState();
let policy='allowed';try{gmAccessPolicy(environment.ma_url,'https://foundry.example.test/');}catch(error){policy=error.code??'denied';}
let identityProfilePresent=false;try{await access('.local/gm-profile.json');identityProfilePresent=true;}catch{}
const result={checked_at:new Date().toISOString(),evidence_class:'live MA target/queue reads plus browser-policy/source checks; no live browser-to-MA connection',
target_verified:true,queue_state:queue.state,queue_items:queue.items,target_identity_format_compatible:/^[A-Za-z0-9_-]{43}$/.test(previous.player.player_id),
configured_ma_scheme:new URL(environment.ma_url).protocol,https_foundry_origin_policy:policy,gm_identity_profile_present:identityProfilePresent,sendspin_connections:0,identities_created:0,mutations_sent:0,
websocket_auth_log_safety:'not verified live; source logs raw inbound auth at VERBOSE, explicit operator review required',live_websocket_auth_attempts:0,
actual_ma_audio:'blocked pending existing DEV private identity, secure private browser access and approved synthetic ingestion'};
await writeFile('evidence/module-only-prerequisites.json',JSON.stringify(result,null,2)+'\n');console.log(JSON.stringify(result,null,2));
+71
View File
@@ -0,0 +1,71 @@
// Measure the v0.7.2 per-packet clock mapping and the new scheduler in actual
// OfflineAudioContexts against the same deterministic stereo PCM and clock trace.
import {readFile} from 'node:fs/promises';
const playwright=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const engines=process.argv.includes('--webkit')?['chromium','firefox','webkit']:['chromium','firefox'];
const source=await readFile(new URL('../src/audio/pcm-timeline.mjs',import.meta.url),'utf8');
for(const engine of engines){
const browser=await playwright[engine].launch({headless:!process.argv.includes('--headed')});
try{
const page=await browser.newPage();
await page.route('https://fixture.invalid/**',route=>route.fulfill({
contentType:route.request().url().endsWith('.mjs')?'text/javascript':'text/html',
body:route.request().url().endsWith('.mjs')?source:'<!doctype html><title>PCM fixture</title>'
}));
await page.goto('https://fixture.invalid/');
const cases=await page.evaluate(async()=>{
const {PcmTimeline}=await import('/pcm.mjs');
async function run(legacy,inputRate,outputRate){
const context=new OfflineAudioContext(2,Math.round(outputRate*9),outputRate);
let now=0;
const playback={
get currentTime(){return now;}, state:'running',
createBuffer:(...args)=>context.createBuffer(...args),
createBufferSource:()=>context.createBufferSource()
};
const timeline=new PcmTimeline(playback,context.destination);
const length=inputRate/50;
const fraction=128/outputRate;
for(let packet=0;packet<400;packet++){
const samples=[new Float32Array(length),new Float32Array(length)];
for(let i=0;i<length;i++){
samples[0][i]=0.45*Math.cos(2*Math.PI*997*(packet*length+i)/inputRate);
samples[1][i]=0.45*Math.sin(2*Math.PI*997*(packet*length+i)/inputRate);
}
const sent=packet/50+0.367+0.012*Math.sin(packet);
now=Math.floor((sent-0.367)/fraction)*fraction;
const serverNowUs=(sent-0.367)*1e6;
const serverTimeUs=(packet/50+0.367)*1e6;
if(legacy){
const buffer=context.createBuffer(2,length,inputRate);
samples.forEach((channel,index)=>buffer.copyToChannel(channel,index));
const node=context.createBufferSource();node.buffer=buffer;node.connect(context.destination);
node.start(Math.max(now+0.01,now+(serverTimeUs-serverNowUs)/1e6));
}else timeline.push({samples,sampleRate:inputRate,serverTimeUs},serverNowUs);
}
const rendered=await context.startRendering();
const left=rendered.getChannelData(0),right=rendered.getChannelData(1);
let dropouts=0,clipped=0,nearSilenceSamples=0,run=0,largestRun=0,jumps=0;
for(let i=outputRate;i<outputRate*8;i++){
const quiet=Math.hypot(left[i],right[i])<0.05;
if(quiet){run++;nearSilenceSamples++;}
else if(run){
if(run>=outputRate*0.00075)dropouts++;
largestRun=Math.max(largestRun,run);
run=0;
}
if(Math.max(Math.abs(left[i]),Math.abs(right[i]))>=0.999)clipped++;
if(Math.hypot(left[i]-left[i-1],right[i]-right[i-1])>0.23)jumps++;
}
return {dropouts,clipped,nearSilenceSamples,largestRun,jumps};
}
const result=[];
for(const [sourceRate,contextRate] of [[48000,48000],[44100,48000],[48000,44100]]){
result.push({sourceRate,contextRate,baseline:await run(true,sourceRate,contextRate),candidate:await run(false,sourceRate,contextRate)});
}
return result;
});
console.log(JSON.stringify({engine,version:browser.version(),cases}));
if(cases.some(({baseline,candidate})=>baseline.dropouts===0||candidate.dropouts!==0||candidate.clipped!==0||candidate.jumps>=baseline.jumps))process.exitCode=1;
}finally{await browser.close();}
}
+118
View File
@@ -0,0 +1,118 @@
// Offline Chromium UI fixture. No Foundry, MA, Git host, token or production access.
import {createServer} from 'node:http';
import {readFile,mkdir,realpath} from 'node:fs/promises';
import {resolve,extname} from 'node:path';
import assert from 'node:assert/strict';
const playwright=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const engine=process.argv.includes('--firefox')?'firefox':process.argv.includes('--webkit')?'webkit':'chromium';
const root=resolve(import.meta.dirname,'..');
const isFixtureAsset=path=>path==='/tests/browser/setup.html'||/^\/src\/[\w/-]+\.mjs$/.test(path)||path==='/styles/adaptive-music.css';
const server=createServer(async(req,res)=>{
try{
const asset=new URL(req.url,'http://localhost').pathname;
if(req.method!=='GET'||!isFixtureAsset(asset))throw Error();
const path=await realpath(resolve(root,'.'+asset));
if(path!==root+asset)throw Error();
const data=await readFile(path);
res.setHeader('Content-Type',extname(path)==='.mjs'?'text/javascript':extname(path)==='.css'?'text/css':'text/html');
res.end(data);
}catch{res.writeHead(404);res.end();}
});
await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve));let browser;
try{
browser=await playwright[engine].launch({headless:true,...(engine==='chromium'&&{args:['--no-sandbox']})});
const page=await browser.newPage({viewport:{width:1000,height:1000}}),errors=[];page.on('pageerror',e=>errors.push(e.message));
await page.goto(`http://127.0.0.1:${server.address().port}/tests/browser/setup.html`);await page.waitForFunction(()=>window.ready);
assert.equal(await page.getByText('Connect optional companion',{exact:true}).count(),0);
for(const width of [380,640,1000]){
await page.setViewportSize({width,height:1000});
assert.equal(await page.locator('.adaptive-music-setup').evaluate(el=>el.scrollWidth<=el.clientWidth+1),true,'setup must fit narrow window');
assert.equal(await page.getByLabel('ICE server URL').isVisible(),false,'advanced fields must remain hidden');
}
await page.evaluate(()=>window.nativeConfiguration());
const sidebar=page.locator('#fixture-playlists');
await sidebar.locator('summary').click();
assert.equal(await sidebar.locator('li').count(),0);
await page.getByLabel('Music Assistant server address').fill('https://ma.example.test');
await page.evaluate(()=>Object.defineProperty(navigator.clipboard,'writeText',{value:async text=>{window.copiedDiagnostics=text;}}));
await page.getByLabel('Private GM access token').fill('synthetic-secret-sentinel');
const copyDiagnostics=page.getByRole('button',{name:'Copy connection diagnostics'});
await page.getByRole('button',{name:'Connect',exact:true}).click();
await page.getByText(/^Connection failed\./).waitFor();
await copyDiagnostics.click();
let copied=await page.evaluate(()=>window.copiedDiagnostics);
const {at,...failure}=JSON.parse(copied).lastConnectFailure;
assert.ok(Number.isFinite(Date.parse(at)));
assert.deepEqual(failure,{code:'ws-upgrade-failed',stage:'API authentication'});
assert.doesNotMatch(copied,/synthetic-secret-sentinel|ma\.example\.test/);
await page.getByLabel('Private GM access token').fill('fixture-token');
await page.getByRole('button',{name:'Connect',exact:true}).click();await page.getByText('Campaign audio connected.',{exact:false}).waitFor();
await copyDiagnostics.click();
copied=await page.evaluate(()=>window.copiedDiagnostics);
assert.equal(JSON.parse(copied).lastConnectFailure,undefined);
assert.equal(await page.getByLabel('Private GM access token').inputValue(),'');
await page.evaluate(()=>window.refreshNativeConfiguration());
const source=sidebar.getByText('Forest at night',{exact:true}),scene=page.locator('#fixture-scene');
await source.waitFor();
const ambient=scene.getByLabel('Ambient playlist');
const target=ambient.locator('..');
await source.dragTo(target);
assert.equal(await ambient.inputValue(),'["ma","ambient"]');
await scene.getByRole('button',{name:'Save assignments'}).click();
assert.deepEqual(await page.evaluate(()=>window.saved.ambient),{provider:'ma',id:'ambient'});
await page.evaluate(()=>window.closeNativeConfiguration());
await page.getByRole('button',{name:'Choose scene music',exact:true}).click();
const panel=page.locator('fieldset').filter({has:page.locator('legend',{hasText:'Scene music'})});
await panel.locator('select').nth(0).selectOption('["ma","ambient"]');await panel.locator('select').nth(1).selectOption('["ma","combat"]');await panel.getByRole('button',{name:'Save assignments'}).click();
assert.deepEqual(await page.evaluate(()=>window.saved.ambient),{provider:'ma',id:'ambient'});assert.deepEqual(await page.evaluate(()=>window.saved.combat),{provider:'ma',id:'combat'});
await page.getByRole('button',{name:'Go to Playback',exact:true}).click();await page.getByRole('heading',{name:'Forest at night'}).waitFor();
await page.getByText('2 connected listeners',{exact:true}).waitFor();
await page.getByRole('button',{name:'Pause',exact:true}).click();await page.getByRole('button',{name:'Resume',exact:true}).click();
await page.getByLabel('Playback position').press('ArrowRight');await page.getByText('0:13 / 1:30',{exact:true}).waitFor();
await page.getByLabel('Repeat',{exact:true}).selectOption('all');
await page.waitForFunction(()=>document.querySelector('select[aria-label="Repeat"]').value==='all');
await page.getByLabel('Campaign volume').press('ArrowLeft');
assert.equal(await page.getByLabel('Campaign volume').inputValue(),'99');
await page.getByRole('button',{name:'Stop playback',exact:true}).click();await page.getByText('Stopped',{exact:true}).waitFor();
assert.deepEqual(await page.evaluate(()=>window.controlActions),['pause','resume','seek','repeat','stop']);
if(engine==='chromium'){await mkdir(resolve(root,'dist/previews'),{recursive:true});await page.screenshot({path:resolve(root,'dist/previews/am006-setup.png'),fullPage:true});}
await page.evaluate(()=>window.listener());assert.equal(await page.locator('input:not([type="range"])').count(),0);
assert.equal(await page.getByRole('slider',{name:'Listening volume'}).count(),1);
await page.getByRole('button',{name:'Mute',exact:true}).click();await page.getByRole('button',{name:'Unmute',exact:true}).waitFor();
await page.getByRole('button',{name:'Enable Audio'}).click();assert.equal(await page.evaluate(()=>window.activated),true);assert.deepEqual(errors,[]);
const bar=page.getByRole('region',{name:'Adaptive Music bar'});
await page.setViewportSize({width:380,height:600});
await page.evaluate(()=>window.musicBar(false));
await bar.getByRole('button',{name:'Enable audio'}).click();
await bar.getByRole('button',{name:'Mute',exact:true}).click();
await bar.getByRole('slider',{name:'My volume'}).press('ArrowLeft');
assert.equal(await bar.getByRole('button',{name:'Pause all music'}).count(),0);
assert.equal(await bar.getByRole('slider',{name:'Campaign volume'}).count(),0);
await bar.getByRole('button',{name:'Hide',exact:true}).click();
await bar.getByRole('slider').waitFor({state:'hidden'});
await bar.getByRole('button',{name:'Show',exact:true}).click();
assert.deepEqual(await page.evaluate(()=>window.barActions),[
['enable'],['local',{muted:true}],['local',{volume:99}],['layout',{collapsed:true}],['layout',{collapsed:false}],
]);
await page.evaluate(()=>window.musicBar(true));
assert.ok((await bar.boundingBox()).width<=380-16);
await bar.getByRole('button',{name:'Pause all music'}).click();
await bar.getByText('Campaign music paused').waitFor();
assert.equal(await bar.getByRole('button',{name:'Skip track'}).isDisabled(),true);
await bar.getByRole('button',{name:'Play all music'}).click();
await bar.getByRole('button',{name:'Skip track'}).click();
await bar.getByRole('slider',{name:'Campaign volume'}).press('ArrowLeft');
await bar.getByRole('button',{name:'Playback controls'}).click();
assert.deepEqual(await page.evaluate(()=>window.barActions),[
['pause',true],['pause',false],['skip'],['campaign-volume',99],['playback'],
]);
const grip=await bar.getByText('Adaptive Music',{exact:true}).boundingBox();
await page.mouse.move(grip.x+20,grip.y+5);
await page.mouse.down();
await page.mouse.move(4,260,{steps:5});
await page.mouse.up();
assert.equal(Math.round((await bar.boundingBox()).x),8);
assert.equal(await page.evaluate(()=>window.barActions.at(-1)[0]),'layout');
assert.deepEqual(errors,[]);
console.log(JSON.stringify({status:'pass',engine,browser:browser.version(),scope:'offline DOM fixture; no live Foundry or MA',checks:['380/640/1000px layout','three setup tabs','failed connection diagnostics exclude secrets and clear after retry','private field clearing','catalog selectors','ambient/combat save','advanced controls hidden','sidebar catalog refresh and pointer drag','track and listeners','pause/resume/seek/repeat/volume/stop','listener activation','floating bar roles, local vs campaign volume, pause/play, collapse and drag'],pageErrors:errors},null,2));
}finally{await browser?.close();await new Promise(resolve=>server.close(resolve));}
+15
View File
@@ -0,0 +1,15 @@
import {readFile,writeFile} from 'node:fs/promises';
import {liveClient} from './live_ma_preflight.mjs';
export async function syntheticSequences(){
const source=JSON.parse(await readFile('.local/fixture-origin.json','utf8'));
return Object.fromEntries(Object.entries(source.sequences).map(([kind,files])=>[`synthetic-${kind}`,files.map(name=>`builtin://track/${source.base_url}/${name}`)]));
}
try{
const {client}=await liveClient(await syntheticSequences());await client.verifyTarget();
const tracks=await client.inspectSynthetic();
const report={checked_at:new Date().toISOString(),synthetic_ingestion:true,tracks:tracks.length,durations:tracks.map(t=>t.duration),playback_mutations:0};
await writeFile('evidence/synthetic-ingestion.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report));
}catch(error){
const report={checked_at:new Date().toISOString(),synthetic_ingestion:false,error:error.code??'unavailable',playback_mutations:0};
await writeFile('evidence/synthetic-ingestion.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report));process.exitCode=1;
}
+12
View File
@@ -0,0 +1,12 @@
import {readFile,writeFile} from 'node:fs/promises';
import {createHash} from 'node:crypto';
import {pcmFixtureFrames} from '../gateway/pcm-fixture.mjs';
const manifest=JSON.parse(await readFile('.local/synthetic-audio/manifest.json','utf8'));
const result={checked_at:new Date().toISOString(),evidence_class:'local generated audio decoding',tracks:0,frames:0,duration_seconds:0,hashes_match:true};
for(const tracks of Object.values(manifest.sequences))for(const track of tracks){
const bytes=await readFile(`.local/synthetic-audio/${track.file}`);
if(createHash('sha256').update(bytes).digest('hex')!==track.sha256)throw Error('fixture mismatch');
let frames=0;for(const frame of pcmFixtureFrames(bytes)){if(frame.length!==1920)throw Error('frame mismatch');frames++;}
if(frames!==4500)throw Error('duration mismatch');result.tracks++;result.frames+=frames;result.duration_seconds+=frames*.02;
}
await writeFile('evidence/synthetic-pipeline.json',JSON.stringify(result,null,2)+'\n');console.log(JSON.stringify(result));
+12
View File
@@ -0,0 +1,12 @@
"""Runner-neutral artifact generation; no publish/upload/git-host API calls."""
import os
from pathlib import Path
import json
from release import ROOT,DEFAULT_REPOSITORY,build_release
manifest=json.loads((ROOT/'module.json').read_text())
ref=os.environ.get('GITHUB_REF_NAME') or os.environ.get('GITEA_REF_NAME','')
if ref.startswith('v') and ref!='v'+manifest['version']:raise SystemExit('tag/manifest version mismatch')
repository=os.environ.get('RELEASE_REPOSITORY')
if not repository and os.environ.get('GITHUB_SERVER_URL')=='https://github.com' and os.environ.get('GITHUB_REPOSITORY'):repository='https://github.com/'+os.environ['GITHUB_REPOSITORY']
repository=repository or DEFAULT_REPOSITORY
print(build_release(repository))
+18
View File
@@ -0,0 +1,18 @@
// Read-only comparison of browser-prepared media. Raw identifiers remain private.
import {readFile,writeFile} from 'node:fs/promises';
import {resolve} from 'node:path';
import {createHash} from 'node:crypto';
import {loadMAToken} from '../gateway/private-config.mjs';
const {chromium,firefox}=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
const cfg=JSON.parse(await readFile('.local/live-environment.json','utf8')),token=await loadMAToken('.local'),root=resolve(import.meta.dirname,'..');
const result=[];
for(const [name,type]of [['firefox',firefox],['chromium',chromium]]){
const browser=await type.launch({headless:true,...(name==='chromium'?{args:['--no-sandbox']}: {})});
try{const page=await browser.newPage();await page.route(cfg.foundry+'/adaptive-music-development/**',async route=>{const rel=new URL(route.request().url()).pathname.slice('/adaptive-music-development/'.length),file=resolve(root,rel);if(!file.startsWith(root+'/src/')&&!file.startsWith(root+'/vendor/'))return route.abort();await route.fulfill({contentType:'text/javascript',body:await readFile(file)});});await page.goto(cfg.foundry,{waitUntil:'domcontentloaded'});
const data=await page.evaluate(async({base,token})=>{
const {GMMAWebSocket}=await import('/adaptive-music-development/src/providers/ma/websocket.mjs');const {MAReadClient}=await import('/adaptive-music-development/src/providers/ma/client.mjs');const transport=new GMMAWebSocket({baseUrl:base,token});
try{const providers=await (await transport.fetch(base+'/api',{method:'POST',redirect:'error',body:JSON.stringify({command:'providers',args:{provider_type:'music'}})})).json();const client=new MAReadClient({baseUrl:base,token,target:'read-only-unused-target',approvedProviders:providers.filter(p=>p.available).map(p=>p.instance_id),fetchImpl:transport.fetch});const choices=await client.catalog();const prepared=[];for(const choice of choices.filter(c=>c.kind==='playlist').slice(0,2))prepared.push(await client.prepareMedia({provider:'ma',id:choice.id}));return prepared;}finally{transport.close();}
},{base:cfg.ma,token});await writeFile('.local/catalog-prepared-'+name+'.json',JSON.stringify(data),{mode:0o600});result.push({browser:name,version:browser.version(),tracks:data.map(p=>p.length),digest:createHash('sha256').update(JSON.stringify(data)).digest('hex')});
}finally{await browser.close();}
}
console.log(JSON.stringify({results:result,identical:result[0].digest===result[1].digest},null,2));
+39
View File
@@ -0,0 +1,39 @@
// Authorized read-only real-origin browser check. Private inputs/results stay .local.
import {readFile,writeFile,chmod} from 'node:fs/promises';
const {chromium,firefox}=await import(process.env.AM_PLAYWRIGHT_MODULE??'playwright');
import {loadMAToken} from '../gateway/private-config.mjs';
const config=JSON.parse(await readFile('.local/live-environment.json','utf8')),token=await loadMAToken('.local');
const report={at:new Date().toISOString(),scope:'actual origins, read-only API authentication; Ubuntu browsers, not Mac',browsers:[]};
for(const [name,type]of (process.env.AM_PRIVATE_ROUTE==='1'?[['chromium',chromium]]:[['firefox',firefox],['chromium',chromium]])){
const browser=await type.launch({headless:true,...(name==='chromium'?{args:['--no-sandbox',...(process.env.AM_PRIVATE_ROUTE==='1'?['--host-resolver-rules=MAP '+new URL(config.ma).hostname+' '+config.proxy_ip]:[])]}: {})});
try{
for(const origin of ['foundry','ma']){
const page=await browser.newPage();const entry={browser:name,version:browser.version(),origin,maRoute:process.env.AM_PRIVATE_ROUTE==='1'&&name==='chromium'?'sandbox DNS override to private proxy; TLS validation unchanged':'normal resolver'};
try{
const response=await page.goto(config[origin],{waitUntil:'domcontentloaded',timeout:20000});const headers=await response.allHeaders();
entry.httpStatus=response.status();entry.csp=headers['content-security-policy']??null;
entry.result=await page.evaluate(async({base,token})=>{
const meta=[...document.querySelectorAll('meta[http-equiv]')].filter(e=>e.httpEquiv.toLowerCase()==='content-security-policy').map(e=>e.content);
const blocked=[];const policy=e=>blocked.push({directive:e.effectiveDirective,disposition:e.disposition});document.addEventListener('securitypolicyviolation',policy);
const result=await new Promise(resolve=>{
const url=new URL('/ws',base);url.protocol='wss:';let opened=false,settled=false,socket;
const finish=result=>{if(settled)return;settled=true;clearTimeout(timer);if(socket){socket.onmessage=socket.onerror=socket.onclose=null;socket.close();}resolve(result);};
const timer=setTimeout(()=>finish({stage:opened?'auth-timeout':'upgrade-timeout'}),10000);
try{socket=new WebSocket(url);socket.onopen=()=>{opened=true;socket.send(JSON.stringify({message_id:'am-preflight-auth',command:'auth',args:{token}}));};
socket.onmessage=e=>{let msg;try{msg=JSON.parse(e.data);}catch{return;}
if(msg.message_id==='am-preflight-auth'){
if(msg.result?.authenticated!==true){finish({stage:'auth-rejected'});return;}
socket.send(JSON.stringify({message_id:'am-preflight-providers',command:'providers',args:{provider_type:'music'}}));
}
if(msg.message_id==='am-preflight-providers')finish({stage:'authenticated',providerCount:Array.isArray(msg.result)?msg.result.length:null,commandError:msg.error_code??null});
};socket.onerror=()=>setTimeout(()=>finish({stage:opened?'socket-error':'upgrade-error'}),100);socket.onclose=e=>finish({stage:opened?'closed-after-open':'closed-before-open',code:e.code});
}catch{setTimeout(()=>finish({stage:'constructor-error'}),100);}
});document.removeEventListener('securitypolicyviolation',policy);return {...result,metaCSP:meta,blocked,secureContext:isSecureContext};
},{base:config.ma,token});
}catch{entry.result={stage:'navigation-failed'};}
report.browsers.push(entry);await page.close();
}
}finally{await browser.close();}
}
await writeFile(process.env.AM_PRIVATE_ROUTE==='1'?'.local/live-browser-private-preflight.json':'.local/live-browser-preflight.json',JSON.stringify(report,null,2)+'\n',{mode:0o600});await chmod('.local/live-browser-preflight.json',0o600);
console.log(JSON.stringify(report,null,2));
+908
View File
@@ -0,0 +1,908 @@
// Exercises module playback in the authorized Foundry development world.
import {randomUUID} from 'node:crypto';
import {setTimeout as delay} from 'node:timers/promises';
import {loadMAToken} from '../gateway/private-config.mjs';
const moduleId = 'adaptive-music';
const check = (value, code) => { if (!value) throw new Error(code); };
async function until(read, accept, code, timeout = 25000) {
const end = Date.now() + timeout;
do {
const result = await read();
if (accept(result)) return result;
await delay(300);
} while (Date.now() < end);
throw new Error(code);
}
function observeMA(page, ma) {
const commands = [];
let sendspinAuthenticated = false;
const json = event => {
if (typeof event.payload !== 'string') return null;
try { return JSON.parse(event.payload); } catch { return null; }
};
page.on('websocket', socket => {
if (socket.url() === `wss://${ma.host}/sendspin`) {
socket.on('framereceived', event => {
if (json(event)?.type === 'auth_ok') sendspinAuthenticated = true;
});
}
if (socket.url() !== `wss://${ma.host}/ws`) return;
const pending = new Map();
socket.on('framesent', event => {
const frame = json(event);
if (!frame?.message_id || typeof frame.command !== 'string') return;
const entry = {command: frame.command, args: frame.command.startsWith('player_queues/') ? frame.args : null};
commands.push(entry);
pending.set(frame.message_id, entry);
});
socket.on('framereceived', event => {
const frame = json(event);
const entry = pending.get(frame?.message_id);
if (!entry || frame.partial) return;
pending.delete(frame.message_id);
entry.reply = true;
entry.error = frame.error_code ?? null;
if (entry.command === 'auth') entry.authenticated = frame.result?.authenticated === true;
if (entry.command === 'players/get' && frame.result) entry.player = {id:frame.result.player_id,name:frame.result.name};
if (entry.command === 'player_queues/get' && frame.result) {
const {state, current_index, elapsed_time, ended, repeat_mode} = frame.result;
entry.queue = {state, index: current_index, position: elapsed_time, ended, repeat:repeat_mode};
}
});
});
return {commands, sendspinAuthenticated: () => sendspinAuthenticated};
}
function safeStats(page) {
return page.evaluate(async moduleId => {
const stats = await game.modules.get(moduleId).api.peerStats();
const streams = [...document.querySelectorAll('audio')].map(element => element.srcObject).filter(Boolean);
const rms = (window.__adaptiveMusicTestAudio?.listenerAnalysers ?? []).filter(sensor => streams.includes(sensor.stream))
.reduce((max, {analyser}) => {
const samples = new Float32Array(analyser.fftSize);
analyser.getFloatTimeDomainData(samples);
return Math.max(max, Math.sqrt(samples.reduce((sum, sample) => sum + sample ** 2, 0) / samples.length));
}, 0);
return stats.filter(row => row.type === 'inbound-rtp').reduce((result, row) => ({
rms,
bytes: result.bytes + (row.bytesReceived ?? 0),
energy: result.energy + (row.totalAudioEnergy ?? 0),
samples: result.samples + (row.totalSamplesReceived ?? 0),
}), {rms, bytes: 0, energy: 0, samples: 0});
}, moduleId);
}
async function gmAudioDiagnostics(page, setup) {
await page.evaluate(() => {
Object.defineProperty(navigator.clipboard, 'writeText', {
configurable: true,
value: async text => { window.__adaptiveMusicTestDiagnostics = JSON.parse(text); },
});
});
await setup.getByRole('button', {name: 'Copy connection diagnostics', exact: true}).click({timeout: 3000});
return page.evaluate(() => {
const d = window.__adaptiveMusicTestDiagnostics;
if (!d) return null;
return {
stage: d.stage, state: d.state, audioContext: d.audioContext, decoded: d.decodedFrames,
scheduled: d.scheduledFrames, droppedLate: d.droppedLate, droppedAhead: d.droppedAhead,
underruns:d.underruns,sourceGaps:d.sourceGaps,sourceOverlaps:d.sourceOverlaps,bufferOverruns:d.bufferOverruns,
signalRMS: d.signalRMS, muted: d.muted, listenerConnections: d.listenerConnections,
volume: Number([...document.querySelectorAll('#adaptive-music-setup input[type="range"]')][0]?.value),
};
});
}
async function openMenu(page, name) {
await page.evaluate(async key => {
const type = game.settings.menus.get(key)?.type;
if (!type) throw Error('missing-installed-module-menu');
const app=new type();
await app.render({force: true});
window.__adaptiveTestWindow=app;
}, `${moduleId}.${name}`);
}
const writes = new Set(['stop', 'clear', 'play_media', 'play_index', 'repeat', 'pause', 'resume', 'seek', 'next', 'shuffle'].map(action => 'player_queues/' + action));
export async function checkFoundryLayout(page,ma){
await openMenu(page,'setup');
const setup=page.locator('#adaptive-music-setup');
const tabs=setup.getByRole('tab');
check(await tabs.count()===3,'three-foundry-tabs-required');
const resizable=await page.evaluate(()=>window.__adaptiveTestWindow.options.window.resizable);
check(resizable===true,'foundry-window-not-resizable');
const originalWidth=Math.round((await setup.boundingBox()).width);
const layout=[];
for(const width of [originalWidth,380]){
await page.evaluate(width=>window.__adaptiveTestWindow.setPosition({width,height:490}),width);
for(const label of ['Connection','Scene Music','Playback']){
await setup.getByRole('tab',{name:label,exact:true}).click();
const panel=setup.getByRole('tabpanel');
await panel.waitFor({state:'visible'});
const measurements=await panel.evaluate(el=>{
const content=el.closest('.window-content');
const horizontalFit=el.scrollWidth<=el.clientWidth+1&&content.scrollWidth<=content.clientWidth+1;
const nestedScroll=[...content.querySelectorAll('div,section,details,fieldset')].some(node=>['auto','scroll'].includes(getComputedStyle(node).overflowY));
return {horizontalFit,nestedScroll};
});
check(measurements.horizontalFit&&!measurements.nestedScroll,'foundry-layout-overflow');
layout.push({width,tab:label,...measurements});
}
}
await setup.getByRole('tab',{name:'Connection',exact:true}).press('ArrowRight');
check(await setup.getByRole('tabpanel',{name:'Scene Music'}).isVisible(),'tab-keyboard-navigation-failed');
await setup.getByRole('tab',{name:'Connection',exact:true}).click();
const advanced=setup.getByText('Advanced',{exact:true});
check(!await setup.getByLabel('ICE server URL').isVisible(),'advanced-visible-by-default');
await advanced.click();
check(await setup.getByLabel('ICE server URL').isVisible(),'advanced-controls-unreachable');
await advanced.click();
await setup.getByLabel('Music Assistant server address').fill('https://ma.example.test/path');
await setup.getByRole('button',{name:'Connect',exact:true}).click();
await setup.getByRole('alert').filter({hasText:'Enter the MA server origin'}).waitFor();
await setup.getByLabel('Music Assistant server address').fill(ma.origin);
await setup.getByRole('button',{name:'Connect',exact:true}).click();
await setup.getByRole('alert').filter({hasText:'Enter a Music Assistant access token'}).waitFor();
await setup.getByRole('button',{name:'Check browser connection',exact:true}).click();
await setup.getByText('Browser checks complete.',{exact:true}).waitFor();
const routeDiagnostics=await setup.locator('[aria-live="polite"] p').evaluateAll(lines=>lines.map(line=>({
path:line.textContent.startsWith('/ws')?'/ws':'/sendspin',opened:line.textContent.includes('upgrade succeeded'),
})));
check(routeDiagnostics.length===2,'missing-graphical-route-diagnostics');
return {resizable,layout,keyboardTabs:true,advancedCollapsed:true,invalidAddressRejected:true,missingTokenRejected:true,routeDiagnostics};
}
export async function checkNativeSceneSheet(gm,report){
const details=await gm.evaluate(async()=>{
const scene=game.scenes.active??game.scenes.contents[0];
const app=scene?.sheet;
if(!app)return null;
await app.render({force:true});
return {type:app.constructor.name,documentName:app.document?.documentName,id:app.id,tag:app.element?.tagName};
});
check(details?.id,'native-scene-sheet-unavailable');
report.nativeSheet={type:details.type,documentName:details.documentName,tag:details.tag};
const shell=gm.locator(`[id="${details.id}"]`);
await shell.waitFor({state:'attached'});
const panel=shell.locator('[data-adaptive-music="assignments"]');
await panel.waitFor({state:'attached'});
report.nativeSheet.tab=await panel.evaluate(node=>node.closest('.tab')?.dataset.tab??null);
report.nativeSheet.navigationTabs=await shell.locator('nav [data-tab]').evaluateAll(nodes=>nodes.map(node=>node.dataset.tab));
if(report.nativeSheet.tab&&!await panel.isVisible()){
await gm.evaluate(({id,tab})=>foundry.applications.instances.get(id)?.changeTab(tab,'sheet'),{id:details.id,tab:report.nativeSheet.tab});
}
await panel.waitFor({state:'visible'});
report.nativeSheet.visible=true;
}
export async function checkFoundryPlayback({pages, ma, world, report, long=false}) {
const [gm, ...players] = pages;
const run = randomUUID().slice(0, 8);
const receiverName = `Adaptive Music integration ${run}`;
const fixtureName = `Adaptive Music verification ${run}`;
const setup = gm.locator('#adaptive-music-setup');
const wire = observeMA(gm, ma);
const continuity=(reset=false)=>Promise.all(pages.map(page=>page.evaluate(async reset=>{
const {contexts,listenerAnalysers}=window.__adaptiveMusicTestAudio;
const active=[...contexts.filter(item=>item.context.state==='running'),
...listenerAnalysers.filter(item=>[...document.querySelectorAll('audio')].some(audio=>audio.srcObject===item.stream))];
if(reset){
await Promise.all(active.map(async item=>{
const deadline=Date.now()+10000;
while(!item.meterPort&&Date.now()<deadline)await new Promise(resolve=>setTimeout(resolve,100));
if(!item.meterPort)return;
item.phaseStarted=null;
item.meterPort.postMessage('start-phase');
while(!item.phaseStarted&&Date.now()<deadline)await new Promise(resolve=>setTimeout(resolve,100));
}));
}
const meters=active.map(item=>reset?item.phaseStarted:item.continuity).filter(Boolean);
const rtp=(await game.modules.get('adaptive-music').api.peerStats()).filter(item=>item.type==='inbound-rtp');
return {meters,rtp,timeline:window.__adaptiveMusicTestTimeline,visible:!document.hidden};
},reset)));
const soak=async duration=>{
const initial=await continuity(true),start=performance.now(),checkpoints=[];
check(initial.every(client=>client.meters.length===1),'missing-continuity-meter');
do{
await delay(Math.min(5000,Math.max(1,duration-(performance.now()-start))));
const progress=await continuity();
checkpoints.push(progress);
if(checkpoints.length%12===0)console.error(`Continuity measurement: ${Math.round((performance.now()-start)/1000)} seconds in phase`);
if(progress.some(client=>client.meters.length!==1||client.meters[0].trailingZeroRun/client.meters[0].sampleRate>4))break;
}while(performance.now()-start<duration);
const seconds=(performance.now()-start)/1000,final=checkpoints.at(-1);
const clients=final.map((client,index)=>{
const first=initial[index].meters[0],last=client.meters[0];
const silenceSeconds=Math.max(0,...checkpoints.flatMap(point=>point[index].meters
.map(meter=>Math.max(meter.trailingZeroRun,meter.maxZeroRun)/meter.sampleRate)));
return {
renderedSeconds:last?(last.frames-first.frames)/last.sampleRate:0,
longestDigitalSilenceSeconds:silenceSeconds,
shortDropouts:last?last.shortDropouts-first.shortDropouts:null,
metersRetained:checkpoints.every(point=>point[index].meters.length===1),
rtpAudio:!index||((client.rtp[0]?.totalSamplesReceived??0)>(initial[index].rtp[0]?.totalSamplesReceived??0)),
};
});
return {seconds,initial,final,clients,passed:seconds>=duration/1000&&clients.every(client=>
client.metersRetained&&client.rtpAudio&&client.renderedSeconds>=seconds*0.95&&client.longestDigitalSilenceSeconds<=4)};
};
const stage = name => {
report.stage = name;
console.error(`Development-world playback stage: ${name}`);
};
let baseline, sceneId, combatId, receiver;
const fixture = data => gm.evaluate(async ({world, moduleId, ...data}) => {
if (!game.ready || game.world.id !== world || !game.user.isGM || !game.socket?.connected) throw Error('wrong-development-world');
if (data.action === 'scene') {
const scene = await CONFIG.Scene.documentClass.create({name: data.fixtureName, width: 1200, height: 1000, navigation: false, tokenVision: false});
return scene.id;
}
if (data.action === 'combat') {
const combat = await CONFIG.Combat.documentClass.create({scene: data.sceneId, active: true});
await combat.createEmbeddedDocuments('Combatant', [{name: data.fixtureName, initiative: 12}]);
return combat.id;
}
if (data.action === 'start-combat') {
const combat = game.combats.get(data.combatId);
await combat.startCombat();
return Boolean(combat.started && combat.active);
}
if (data.action === 'delete-combat') return game.combats.get(data.combatId)?.delete().then(() => true);
if (data.action === 'activate-scene') return game.scenes.get(data.sceneId)?.activate().then(() => true);
if (data.action === 'baseline') {
const enabled = game.settings.get(moduleId, 'enabled');
const scene = game.scenes.active?.id ?? null;
if (enabled) {
game.modules.get(moduleId).api.stopDevelopment();
await game.settings.set(moduleId, 'enabled', false);
}
return {enabled, scene, connection:game.settings.get(moduleId,'savedConnection')};
}
if (data.action === 'cleanup') {
const api = game.modules.get(moduleId).api;
api.stopDevelopment();
await api.closeGMHost();
if (data.combatId) await game.combats.get(data.combatId)?.delete();
if (data.baseline.scene && game.scenes.active?.id !== data.baseline.scene) await game.scenes.get(data.baseline.scene)?.activate();
if (data.sceneId) await game.scenes.get(data.sceneId)?.delete();
if (game.settings.get(moduleId, 'enabled') !== data.baseline.enabled) await game.settings.set(moduleId, 'enabled', data.baseline.enabled);
await game.settings.set(moduleId,'savedConnection',data.baseline.connection);
return (!data.sceneId || !game.scenes.has(data.sceneId)) && (!data.combatId || !game.combats.has(data.combatId)) &&
game.settings.get(moduleId, 'enabled') === data.baseline.enabled;
}
throw Error('unknown-fixture-operation');
}, {world: world.id, moduleId, ...data});
const command = (from, name, predicate = () => true) => until(
() => wire.commands.slice(from).find(entry => entry.command === `player_queues/${name}` && entry.reply && predicate(entry.args)),
Boolean, `ma-${name.replaceAll('_', '-')}-not-observed`, 70000).then(entry => {
if (entry.error !== null) report.upstreamError = {command: entry.command, code: entry.error};
check(entry.error === null, 'ma-queue-command-failed');
return entry;
});
const audio = async () => {
const before = await Promise.all(players.map(safeStats));
try {
return await Promise.all(players.map(async (page, index) => {
const after = await until(() => safeStats(page), value => value.bytes > before[index].bytes &&
(value.energy - before[index].energy > 1e-6 || value.rms > 0.001),
'listener-audio-energy-did-not-increase', 30000);
return {bytesIncreased: true, energyIncrease: after.energy - before[index].energy, playbackRMS: after.rms,
samplesIncreased: after.samples > before[index].samples};
}));
} catch (error) {
report.listenerStatsAtFailure = await Promise.all(players.map(page => safeStats(page).catch(() => null)));
throw error;
}
};
try {
stage('world-readiness');
await gm.waitForFunction(({moduleId, count}) => game.modules.get(moduleId)?.api &&
[...game.users].filter(user => user.active && !user.isGM).length >= count &&
[...game.users].filter(user => user.active && user.isGM).length === 1, {moduleId, count: players.length});
report.publicKeys = await Promise.all(pages.map(page => page.waitForFunction(moduleId => Boolean(game.user.getFlag(moduleId, 'audioPublicKey')?.key), moduleId, {timeout: 8000}).then(() => true, () => false)));
await Promise.all(pages.map(page => page.evaluate(() => {
const tally = {invitationsForMe: 0, invitationEvents: 0, offers: 0, answers: 0, sentInvitations: 0, sentSignals: 0};
window.__adaptiveMusicTestSignaling = tally;
game.socket.on('module.adaptive-music', frame => {
if (frame?.type === 'audio-invite-v1') {
tally.invitationEvents++;
if (frame.to === game.user.id) tally.invitationsForMe++;
}
if (frame?.v === 1 && frame.from === 'listener') tally.offers++;
if (frame?.v === 1 && frame.from === 'gm') tally.answers++;
});
game.socket.onAnyOutgoing?.((event, frame) => {
if (event !== 'module.adaptive-music') return;
if (frame?.type === 'audio-invite-v1') tally.sentInvitations++;
if (frame?.v === 1 && typeof frame.cipher === 'string') tally.sentSignals++;
});
})));
stage('user-document-permissions');
const gmId = await gm.evaluate(() => game.user.id);
const probeFlag = `integrationProbe${run}`;
report.playerFlagDenials = await Promise.all(players.map(player=>player.evaluate(async ({gmId, moduleId, probeFlag}) => {
try { await game.users.get(gmId).setFlag(moduleId, probeFlag, true); return false; }
catch { return true; }
}, {gmId, moduleId, probeFlag})));
report.playerCannotWriteGMFlag=report.playerFlagDenials.every(Boolean);
if (!report.playerCannotWriteGMFlag) await gm.evaluate(({moduleId, probeFlag}) => game.user.unsetFlag(moduleId, probeFlag), {moduleId, probeFlag});
check(report.playerCannotWriteGMFlag,'player-wrote-gm-user-flag');
stage('create-test-scene');
baseline = await fixture({action: 'baseline'});
sceneId = await fixture({action: 'scene', fixtureName});
await fixture({action: 'activate-scene', sceneId});
await gm.waitForFunction(id=>game.scenes.active?.id===id,sceneId,{polling:100});
await openMenu(gm, 'setup');
await gm.evaluate(()=>{
window.__adaptiveTestNotifications=[];
const observer=new MutationObserver(()=>{
for(const node of document.querySelectorAll('#notifications .notification')){
const text=node.textContent.trim();
if(text.startsWith('Adaptive Music: ')&&!window.__adaptiveTestNotifications.includes(text))window.__adaptiveTestNotifications.push(text);
}
});
observer.observe(document.body,{childList:true,subtree:true});
});
stage('ma-authentication');
const tabbed=await setup.getByRole('tab',{name:'Connection',exact:true}).count()>0;
await setup.getByLabel('Music Assistant server address').fill(ma.origin);
if(tabbed){
const before=wire.commands.length;
report.advancedInitiallyCollapsed=!await setup.getByLabel('ICE server URL').isVisible();
await setup.getByRole('button',{name:'Connect',exact:true}).click();
await setup.getByRole('alert').filter({hasText:'Enter a Music Assistant access token'}).waitFor();
report.formRejectedMissingTokenWithoutNetwork=wire.commands.length===before;
check(report.formRejectedMissingTokenWithoutNetwork&&report.advancedInitiallyCollapsed,'connection-form-validation-failed');
await setup.getByText('Advanced',{exact:true}).click();
await setup.getByLabel('Dedicated receiver name').fill(receiverName);
await setup.getByText('Advanced',{exact:true}).click();
await setup.getByLabel('Private GM access token').fill(await loadMAToken('.local'));
await setup.getByRole('button',{name:'Connect',exact:true}).click();
await setup.getByText(/^Campaign audio connected\./).waitFor({timeout:85000});
receiver=wire.commands.findLast(entry=>entry.player?.name===receiverName)?.player.id;
check(receiver,'receiver-identity-not-verified');
report.oneClickConnection=true;
await setup.getByRole('button',{name:'Choose scene music'}).click();
}else{
await setup.getByLabel('Private GM access token').fill(await loadMAToken('.local'));
await setup.getByText('Receiver options',{exact:true}).click();
await setup.getByLabel('Dedicated receiver name').fill(receiverName);
await setup.getByRole('button',{name:'Authenticate',exact:true}).click();
const selector=setup.getByLabel('Dedicated campaign receiver');
await selector.locator('option').filter({hasText:receiverName}).waitFor({state:'attached',timeout:25000});
receiver=await selector.inputValue();
await setup.getByRole('button',{name:'Connect audio',exact:true}).click();
}
report.maAPIAuthenticated = wire.commands.some(entry => entry.authenticated);
check(receiver && report.maAPIAuthenticated, 'receiver-identity-not-verified');
stage('dedicated-sendspin-connection');
if(!tabbed)await setup.getByText(/^Campaign audio connected\./).waitFor({timeout: 50000});
report.sendspinAuthenticated = wire.sendspinAuthenticated();
report.accountPairingPassed = wire.commands.some(entry => entry.command === 'sendspin/pair_web_player' && entry.reply && entry.error === null);
check(report.sendspinAuthenticated && report.accountPairingPassed, 'sendspin-pairing-not-observed');
stage('scene-assignments');
if(tabbed)await setup.getByLabel('Scene',{exact:true}).selectOption(sceneId);
const assignments = setup.locator('fieldset[data-adaptive-music="assignments"]').filter({has: gm.locator('legend', {hasText: /^Scene music$/})});
const ambient = assignments.getByLabel('Ambient playlist');
const references = await ambient.locator('option').evaluateAll(options => options.map(option => option.value).filter(value => value.startsWith('["ma",')));
report.catalogChoices = references.length;
check(references.length >= 2, 'insufficient-ma-catalog-choices');
await ambient.selectOption(references[0]);
await assignments.getByLabel('Combat playlist').selectOption(references[1]);
if(tabbed)await assignments.getByLabel('Default boss music').selectOption(references[1]);
check(await ambient.inputValue()===references[0],'ambient-selection-lost-before-save');
await assignments.getByRole('button', {name: 'Save assignments', exact: true}).click();
await assignments.getByText('Assignments saved.', {exact: true}).waitFor();
report.sceneAssignmentVerified=await gm.evaluate(({sceneId,ambient})=>{
const scene=game.scenes.get(sceneId);
return scene?.active===true&&JSON.stringify(['ma',scene.getFlag('adaptive-music','music')?.ambient?.id])===ambient;
},{sceneId,ambient:references[0]});
check(report.sceneAssignmentVerified,'assignment-not-saved-to-active-scene');
stage('activate-listener-audio');
await Promise.all(players.map(async page => {
await openMenu(page, 'listen');
await page.locator('#adaptive-music-listener').getByRole('button', {name: 'Enable Audio', exact: true}).click();
}));
stage('ambient');
const start = wire.commands.length;
if(tabbed){
await setup.getByRole('button',{name:'Go to Playback'}).click();
await setup.getByRole('button',{name:'Enable automation'}).click();
await setup.getByText('Automation active',{exact:true}).waitFor({timeout:10000});
}else{
await setup.getByLabel('Enable music automation').check();
await setup.getByRole('button',{name:'Apply automation setting',exact:true}).click();
}
const ambientPlay = await command(start, 'play_media', args => args.option === 'replace');
report.ambient = await audio();
await delay(6500);
if(long){
stage('enable-dedicated-queue-repeat');
const repeat=wire.commands.length;
const repeatSelect=setup.getByLabel('Repeat',{exact:true});
report.repeatControl={visible:await repeatSelect.isVisible(),enabled:await repeatSelect.isEnabled().catch(()=>false),
queueRepeat:wire.commands.findLast(entry=>entry.queue)?.queue.repeat};
await repeatSelect.selectOption('all');
await command(repeat,'repeat',args=>args.repeat_mode==='all'&&args.queue_id===receiver);
stage('continuous-ambient');
report.continuity={ambient:await soak(30000)};
check(report.continuity.ambient.passed,'ambient-continuity-failed');
}
stage('actual-combat');
combatId = await fixture({action: 'combat', sceneId, fixtureName});
const interrupt = wire.commands.length;
check(await fixture({action: 'start-combat', combatId}), 'foundry-combat-did-not-start');
const combatPlay = await command(interrupt, 'play_media', args => args.option === 'replace');
check(JSON.stringify(combatPlay.args.media) !== JSON.stringify(ambientPlay.args.media), 'combat-playlist-was-not-distinct');
await delay(4500);
report.combat = await audio();
if(long){
stage('continuous-combat');
report.continuity.combat=await soak(30000);
check(report.continuity.combat.passed,'combat-continuity-failed');
}
stage('ambient-restoration');
const restore = wire.commands.length;
check(await fixture({action: 'delete-combat', combatId}), 'foundry-combat-delete-not-observed');
const restored = await command(restore, 'play_media', args => args.option === 'add');
const seek = await command(restore, 'play_index');
report.ambientOrderRestored = JSON.stringify(restored.args.media) === JSON.stringify(ambientPlay.args.media);
const snapshot = wire.commands.slice(interrupt, wire.commands.indexOf(combatPlay)).findLast(entry => entry.queue?.state === 'playing')?.queue;
report.ambientRestoreOffset = {index: seek.args.index, seconds: seek.args.seek_position};
report.ambientIndexAndOffsetRestored = Boolean(snapshot && seek.args.seek_position > 0 &&
snapshot.index === seek.args.index && Math.abs(snapshot.position - seek.args.seek_position) <= 2);
await delay(4500);
report.restoredAmbient = await audio();
if(long){
stage('continuous-restored-ambient');
report.continuity.restoredAmbient=await soak(1740000);
report.continuity.totalMeasuredSeconds=Object.values(report.continuity).reduce((total,phase)=>total+phase.seconds,0);
check(report.continuity.restoredAmbient.passed,'restored-ambient-continuity-failed');
}
report.onlyDedicatedQueueWritten = wire.commands.filter(entry => writes.has(entry.command)).every(entry => entry.args?.queue_id === receiver);
check(report.ambientOrderRestored && report.ambientIndexAndOffsetRestored && report.onlyDedicatedQueueWritten, 'queue-restore-or-ownership-mismatch');
stage('listener-stop-and-resume');
const listener = players[0].locator('#adaptive-music-listener');
await listener.getByRole('button', {name: 'Stop Audio', exact: true}).click();
await until(() => safeStats(players[0]), stats => stats.bytes === 0, 'listener-stop-did-not-close-peer');
await listener.getByRole('button', {name: 'Enable Audio', exact: true}).click();
report.afterListenerResume = await audio();
stage('listener-reload');
const reloaded = players[1];
await reloaded.reload({waitUntil: 'domcontentloaded', timeout: 30000});
await reloaded.waitForFunction(id => game.ready && game.world.id === id && !game.user.isGM && game.socket?.connected,
world.id, {polling: 250, timeout: 45000});
await openMenu(reloaded, 'listen');
await reloaded.locator('#adaptive-music-listener').getByRole('button', {name: 'Enable Audio', exact: true}).click();
report.afterListenerReload = await audio();
if(tabbed){
stage('playback-tab-controls');
await setup.getByText('2 connected listeners',{exact:true}).waitFor();
await setup.locator('.adaptive-now h3').filter({hasText:/^(?!Nothing playing).+/}).waitFor();
const slider=setup.getByLabel('Campaign volume');
await slider.press('ArrowLeft');
await setup.getByRole('button',{name:'Pause',exact:true}).click();
await setup.getByRole('button',{name:'Resume',exact:true}).click();
report.afterPlaybackResume=await audio();
await setup.getByRole('button',{name:'Stop playback',exact:true}).click();
await setup.getByText('Stopped',{exact:true}).waitFor();
report.playbackTabControls=true;
}
stage('passed');
} finally {
report.maAPIAuthenticated = wire.commands.some(entry => entry.authenticated);
report.sendspinAuthenticated = wire.sendspinAuthenticated();
report.accountPairingPassed = wire.commands.some(entry => entry.command === 'sendspin/pair_web_player' && entry.reply && entry.error === null);
if(report.stage!=='passed')report.playbackFailureDetails={
notifications:await gm.evaluate(()=>window.__adaptiveTestNotifications??[]).catch(()=>[]),
recentMACommands:wire.commands.slice(-20).map(({command,reply,error})=>({command,reply:reply===true,error})),
};
if (receiver) {
if(await setup.getByRole('tab',{name:'Connection',exact:true}).count())await setup.getByRole('tab',{name:'Connection',exact:true}).click().catch(()=>{});
report.gmAudioDiagnostics = await gmAudioDiagnostics(gm, setup).catch(() => null);
}
report.browserAudio = await Promise.all(pages.map(page => page.evaluate(async () => {
const diagnostic = [...document.querySelectorAll('#adaptive-music-setup [role="status"]')].map(node => node.textContent).find(text => text.includes('Decoded frames:'));
const {contexts = [], analysers = []} = window.__adaptiveMusicTestAudio ?? {};
return {
timeline: window.__adaptiveMusicTestTimeline,
decodedFrames: diagnostic ? Number(diagnostic.match(/Decoded frames: (\d+)/)?.[1] ?? 0) : null,
signaling: window.__adaptiveMusicTestSignaling,
contexts: contexts.map(({context, destination,continuity}) => ({state: context.state, time: context.currentTime, continuity, track: destination.stream.getAudioTracks()[0]?.readyState})),
analyserRMS: analysers.map(analyser => {
const samples = new Float32Array(analyser.fftSize);
analyser.getFloatTimeDomainData(samples);
return Math.sqrt(samples.reduce((sum, sample) => sum + sample ** 2, 0) / samples.length);
}),
browsers: await Promise.all((window.__adaptiveMusicTestPeers ?? []).map(async peer => {
const stats = peer.connectionState === 'connected' ? [...(await peer.getStats()).values()] : [];
return {connection: peer.connectionState, ice: peer.iceConnectionState, signaling: peer.signalingState,
outgoingEnergy: stats.find(row => row.type === 'media-source' && row.kind === 'audio')?.totalAudioEnergy};
})),
};
}).catch(() => null)));
if (!report.upstreamError) {
const lastError = wire.commands.findLast(entry => entry.reply && entry.error !== null);
if (lastError) report.upstreamError = {command: lastError.command, code: lastError.error};
}
if (baseline) {
try {
if (report.stage === 'passed') await gm.evaluate(moduleId => game.modules.get(moduleId).api.setOverrides([{id: 'integration-cleanup', playlist: null}]), moduleId);
} finally {
report.temporaryWorldChangesRestored = await fixture({action: 'cleanup', sceneId, combatId, baseline}).catch(() => false);
}
}
const queueWrites=wire.commands.filter(entry=>writes.has(entry.command));
report.onlyDedicatedQueueWritten=Boolean(receiver)&&queueWrites.length>0&&queueWrites.every(entry=>entry.args?.queue_id===receiver);
report.queueWrites=queueWrites.map(({command,reply,error})=>({command,reply:reply===true,error}));
}
check(report.temporaryWorldChangesRestored,'test-world-cleanup-not-verified');
check(report.onlyDedicatedQueueWritten,'non-dedicated-write');
}
// Candidate GUI acceptance. Public Foundry document APIs create and activate the
// dedicated fixtures. Assignment, transport, and credential actions use the GUI.
export async function checkFoundryV080Review({pages,ma,world,report}) {
const [gm,...players]=pages;
const namespace='adaptive-music';
const receiverName='Adaptive Music integration '+randomUUID().slice(0,8);
const names=['Adaptive Music v0.8 — Ambience','Adaptive Music v0.8 — Combat and boss'];
const setup=gm.locator('#adaptive-music-setup');
const controls=gm.locator('#adaptive-music-controls');
const playlistIndexes=(process.env.AM_REVIEW_PLAYLIST_INDEXES??'0,1,2').split(',').map(Number);
check(playlistIndexes.length===3&&new Set(playlistIndexes).size===3&&playlistIndexes.every(index=>Number.isSafeInteger(index)&&index>=0),
'three-distinct-review-playlist-indexes-required');
const token=await loadMAToken('.local');
const wire=observeMA(gm,ma);
const stage=name=>{report.stage=name;console.error('v0.8.0 GUI review stage:',name);};
let saved,scenes=[],combatId;
const documentAction=(action,args={})=>gm.evaluate(async({action,args,world,namespace})=>{
if(!game.ready||game.world.id!==world||!game.user.isGM)throw Error('wrong-development-world');
const module=game.modules.get(namespace);
if(action==='baseline'){
const state={scene:game.scenes.active?.id,enabled:game.settings.get(namespace,'enabled'),
connection:game.settings.get(namespace,'savedConnection'),nativePlaylists:game.playlists.map(playlist=>playlist.id).sort()};
if(state.enabled){module.api.stopDevelopment();await game.settings.set(namespace,'enabled',false);}
return state;
}
if(action==='add-scene'){
const scene=await CONFIG.Scene.documentClass.create({name:args.name,width:1200,height:1000,navigation:true,tokenVision:false});
return scene.id;
}
if(action==='activate')return !!(await game.scenes.get(args.scene)?.activate());
if(action==='open-scene'){
const sheet=game.scenes.get(args.scene).sheet;
await sheet.render({force:true,position:{left:120,top:100}});
return sheet.id;
}
if(action==='close-scene')return game.scenes.get(args.scene).sheet.close();
if(action==='add-combat'){
const combat=await CONFIG.Combat.documentClass.create({scene:args.scene,active:true});
await combat.createEmbeddedDocuments('Combatant',[{name:'Development boss',initiative:12}]);
return combat.id;
}
if(action==='start-combat')return game.combats.get(args.combat).startCombat();
if(action==='delete-combat')return game.combats.get(args.combat)?.delete();
if(action==='cleanup'){
module.api.stopDevelopment();
await module.api.closeGMHost();
if(args.combat)await game.combats.get(args.combat)?.delete();
if(args.baseline.scene&&game.scenes.active?.id!==args.baseline.scene)await game.scenes.get(args.baseline.scene)?.activate();
if(game.settings.get(namespace,'enabled')!==args.baseline.enabled)await game.settings.set(namespace,'enabled',args.baseline.enabled);
if(JSON.stringify(game.settings.get(namespace,'savedConnection'))!==JSON.stringify(args.baseline.connection)){
await game.settings.set(namespace,'savedConnection',args.baseline.connection);
}
for(const [index,id] of args.scenes.entries()){
const scene=game.scenes.get(id);
if(!args.keepScenes||game.scenes.some(other=>other.id!==id&&other.name===args.names[index]))await scene?.delete();
else await scene?.update({name:args.names[index],navigation:true});
}
return {demonstrationScenes:args.names.filter(name=>game.scenes.some(scene=>scene.name===name)).length,
activeSceneRestored:(game.scenes.active?.id??null)===(args.baseline.scene??null),
automationRestored:game.settings.get(namespace,'enabled')===args.baseline.enabled,
accountEnvelopeRestored:JSON.stringify(game.settings.get(namespace,'savedConnection'))===JSON.stringify(args.baseline.connection),
nativePlaylistInventoryUnchanged:JSON.stringify(game.playlists.map(playlist=>playlist.id).sort())===JSON.stringify(args.baseline.nativePlaylists),
temporaryCombatRemoved:!args.combat||!game.combats.has(args.combat)};
}
throw Error('invalid-fixture-action');
},{action,args,world:world.id,namespace});
const selectTab=label=>setup.getByRole('tab',{name:label,exact:true}).click();
const connected=()=>setup.getByText(/^Connected · \d+ catalog choices$/).waitFor({timeout:65000});
const openSetup=async()=>{
if(await setup.isVisible())return;
await openMenu(gm,'setup');
};
const openPlaylists=async()=>{
const catalog=gm.locator('.adaptive-catalog');
if(!await catalog.isVisible()){
report.sidebarState=await gm.evaluate(()=>{
const directory=ui.playlists;
ui.sidebar?.expand();
directory?.activate();
return {directoryAvailable:Boolean(directory),expanded:ui.sidebar?.expanded,
renderState:directory?.rendered,elementConnected:directory?.element?.isConnected};
});
}
await catalog.waitFor({state:'visible'});
if(!await catalog.getByRole('button',{name:'Music controls'}).isVisible())await catalog.locator('summary').click();
return catalog;
};
const openControls=async()=>{
if(await controls.isVisible()){
await gm.evaluate(()=>foundry.applications.instances.get('adaptive-music-controls')?.bringToFront());
return;
}
const list=await openPlaylists();
await list.getByRole('button',{name:'Music controls'}).click();
};
const reload=async()=>{
await gm.reload({waitUntil:'domcontentloaded'});
await gm.waitForFunction(id=>game.ready&&game.world.id===id&&game.user.isGM&&game.socket?.connected,world.id,{polling:250,timeout:60000});
};
const command=(index,action,predicate=()=>true)=>until(()=>wire.commands.slice(index).find(entry=>
entry.command==='player_queues/'+action&&entry.reply&&entry.error===null&&predicate(entry.args)),
Boolean,'ma-'+action.replaceAll('_','-')+'-not-verified',65000);
const heard=async()=>Promise.all(players.map(async player=>{
const initial=await safeStats(player);
const end=await until(()=>safeStats(player),value=>value.bytes>initial.bytes&&
(value.rms>0.001||value.energy>initial.energy+1e-6),'review-listener-audio-missing',30000);
return {rms:end.rms,energyDelta:end.energy-initial.energy};
}));
let receiver;
try{
stage('setup-menu');
await gm.bringToFront();
saved=await documentAction('baseline');
await openSetup();
await gm.evaluate(()=>{
window.__adaptiveReviewWarnings=[];
new MutationObserver(()=>{
for(const notice of document.querySelectorAll('#notifications .notification')){
const message=notice.textContent.trim();
if(message.startsWith('Adaptive Music: ')&&!window.__adaptiveReviewWarnings.includes(message))window.__adaptiveReviewWarnings.push(message);
}
}).observe(document.body,{childList:true,subtree:true});
});
stage('graphical-connection');
await setup.getByLabel('Music Assistant server address').fill(ma.origin);
await setup.getByLabel('Private GM access token').fill(token);
await setup.getByLabel('Remember credentials and reconnect on this trusted device').check();
await setup.getByText('Advanced',{exact:true}).click();
await setup.getByLabel('Dedicated receiver name').fill(receiverName);
await setup.getByRole('button',{name:'Connect',exact:true}).click();
await connected();
receiver=wire.commands.findLast(entry=>entry.player?.name===receiverName)?.player.id;
check(receiver,'dedicated-review-receiver-not-confirmed');
report.guiConnection=true;
await gm.evaluate(()=>foundry.applications.instances.get('adaptive-music-setup').close());
stage('native-scene-assignments-and-playlist-sidebar');
for(const name of names)scenes.push(await documentAction('add-scene',{name:name+' '+receiverName.split(' ').at(-1)}));
stage('playlist-sidebar');
const catalog=await openPlaylists();
await catalog.locator('li').first().waitFor();
const priorities=['Ambient playlist','Combat playlist','Default boss music'];
let keys;
let usedPointerDrag=false;
for(const [index,scene] of scenes.entries()){
stage('scene-config-'+(index+1));
const sheetId=await documentAction('open-scene',{scene});
const shell=gm.locator(`[id="${sheetId}"]`);
const fieldset=shell.locator('fieldset[data-adaptive-music="assignments"]');
await fieldset.waitFor({state:'attached'});
const tab=await fieldset.evaluate(node=>node.closest('.tab')?.dataset.tab);
if(tab&&!await fieldset.isVisible())await gm.evaluate(({sheetId,tab})=>
foundry.applications.instances.get(sheetId)?.changeTab(tab,'sheet'),{sheetId,tab});
stage('scene-config-catalog-'+(index+1));
const options=await fieldset.getByLabel('Ambient playlist').locator('option').evaluateAll(items=>items
.filter(item=>item.value.startsWith('["ma",')).map(item=>({value:item.value,name:item.textContent.replace(/^Music Assistant: /,'')})));
check(playlistIndexes.every(index=>options[index]),'review-playlist-index-out-of-range');
keys??=playlistIndexes.map(index=>options[index]);
for(const [slot,label] of priorities.entries()){
const choice=keys[(index+slot)%keys.length],target=fieldset.getByLabel(label);
if(index===0&&slot===0){
stage('scene-config-pointer-drag');
const entries=catalog.locator('li');
const row=await entries.evaluateAll((nodes,value)=>nodes.findIndex(node=>node.dataset.reference===value),choice.value);
check(row>=0,'assigned-playlist-missing-from-foundry-sidebar');
const source=entries.nth(row),destination=target.locator('..');
report.dragEndpoints={sourceVisible:await source.isVisible(),destinationVisible:await destination.isVisible()};
await source.dragTo(destination,{targetPosition:{x:15,y:8}});
usedPointerDrag=await target.inputValue()===choice.value;
check(usedPointerDrag,'native-playlist-pointer-drag-failed');
}
stage('scene-config-select-'+(index+1)+'-'+(slot+1));
await target.selectOption(choice.value);
}
stage('save-scene-config-'+(index+1));
await fieldset.getByRole('button',{name:'Save assignments'}).click();
await fieldset.getByText('Assignments saved.',{exact:true}).waitFor();
await documentAction('close-scene',{scene});
}
report.nativeAssignments=2;
report.playlistSidebarEntries=await catalog.locator('li').count();
report.pointerDragAssigned=usedPointerDrag;
check(usedPointerDrag,'native-playlist-pointer-drag-failed');
stage('gameplay-controls-and-scene-automation');
await documentAction('activate',{scene:scenes[0]});
const toolbar=gm.locator('button[data-tool="adaptiveMusic"],button[data-control="adaptiveMusic"],button[data-tooltip="Adaptive Music controls"]').filter({visible:true});
await toolbar.first().click();
await controls.waitFor();
report.toolbarOpened=true;
await gm.evaluate(()=>foundry.applications.instances.get('adaptive-music-controls').close());
await openControls();
await controls.waitFor();
report.sidebarOpened=true;
const writeIndex=wire.commands.length;
await controls.getByRole('button',{name:'Enable automation'}).click();
const ambientFirst=await command(writeIndex,'play_media',args=>args.option==='replace');
await Promise.all(players.map(async page=>{
await openMenu(page,'listen');
await page.locator('#adaptive-music-listener').getByRole('button',{name:'Enable Audio'}).click();
}));
await controls.getByText('2 connected listeners',{exact:true}).waitFor({timeout:40000});
report.listenerAudio={firstScene:await heard()};
const sceneChange=wire.commands.length;
await documentAction('activate',{scene:scenes[1]});
const ambientSecond=await command(sceneChange,'play_media',args=>args.option==='replace');
check(JSON.stringify(ambientFirst.args.media)!==JSON.stringify(ambientSecond.args.media),'scene-ambient-did-not-change');
report.listenerAudio.secondScene=await heard();
await delay(8500);
stage('combat-then-boss-then-restoration');
combatId=await documentAction('add-combat',{scene:scenes[1]});
const beforeCombat=wire.commands.length;
await documentAction('start-combat',{combat:combatId});
const combat=await command(beforeCombat,'play_media',args=>args.option==='replace');
check(JSON.stringify(ambientSecond.args.media)!==JSON.stringify(combat.args.media),'combat-did-not-change-playlist');
await delay(3500);
stage('boss-override');
await openSetup();
await selectTab('Scene Music');
await setup.getByText('World defaults and boss combatants',{exact:true}).click();
const boss=setup.getByLabel('Boss combatant');
const combatantId=await gm.evaluate(id=>game.combats.get(id)?.combatants.contents[0]?.id,combatId);
check(combatantId,'review-combatant-unavailable');
await boss.selectOption(`${combatId}:${combatantId}`);
await setup.getByLabel('Boss override',{exact:true}).check();
const beforeBoss=wire.commands.length;
await setup.getByRole('button',{name:'Save boss override'}).click();
const bossTrack=await command(beforeBoss,'play_media',args=>args.option==='replace');
check(JSON.stringify(combat.args.media)!==JSON.stringify(bossTrack.args.media),'boss-did-not-change-playlist');
report.listenerAudio.boss=await heard();
stage('restoration-after-boss');
const beforeRestore=wire.commands.length;
await documentAction('delete-combat',{combat:combatId});combatId=null;
const seek=await command(beforeRestore,'play_index');
const restored=await command(beforeRestore,'play_media',args=>args.option==='add');
const snapshot=wire.commands.slice(beforeCombat,wire.commands.indexOf(combat)).findLast(entry=>entry.queue?.state==='playing')?.queue;
check(JSON.stringify(ambientSecond.args.media)===JSON.stringify(restored.args.media)&&snapshot&&seek.args.index===snapshot.index&&
Math.abs(seek.args.seek_position-snapshot.position)<=2&&seek.args.seek_position>0,'ambient-restore-not-verified');
report.sceneCombatBossAndRestoration=true;
report.restoredSeconds=seek.args.seek_position;
report.listenerAudio.restored=await heard();
stage('manual-override-and-playback-actions');
await openControls();
await controls.getByText('Manual playlist override',{exact:true}).click();
const beforeManual=wire.commands.length;
await controls.getByLabel('Override playlist').selectOption(keys[0].value);
await controls.getByRole('button',{name:'Apply override'}).click();
await command(beforeManual,'play_media',args=>args.option==='replace');
stage('return-to-scene-music');
await controls.getByRole('button',{name:'Return to scene music'}).click();
await controls.getByText('Automation active',{exact:true}).waitFor();
stage('pause-and-resume');
await controls.getByRole('button',{name:'Pause',exact:true}).click();
await controls.getByText('Paused',{exact:true}).waitFor();
await controls.getByRole('button',{name:'Resume',exact:true}).click();
await controls.getByText('Playing',{exact:true}).waitFor();
stage('seek-and-skip');
const seekStart=wire.commands.length;
await controls.getByLabel('Playback position').press('ArrowRight');
await command(seekStart,'seek');
const skip=wire.commands.length;
await controls.getByRole('button',{name:'Skip track'}).click();
await command(skip,'next');
await controls.getByLabel('Campaign volume').press('ArrowLeft');
stage('background-gm-tab');
const [cover]=await Promise.all([
gm.waitForEvent('popup'),gm.evaluate(()=>{window.open('about:blank','_blank');}),
]);
await cover.bringToFront();
const time=()=>gm.evaluate(()=>{
const context=window.__adaptiveMusicTestAudio.contexts.at(-1);
const meter=context?.continuity;
const analyser=context?.analyser,samples=new Float32Array(analyser?.fftSize??1);
analyser?.getFloatTimeDomainData(samples);
return {visible:!document.hidden,time:context?.context.currentTime??0,frames:meter?.frames??0,
trailingSilence:meter?meter.trailingZeroRun/meter.sampleRate:null,
outputRMS:Math.sqrt(samples.reduce((sum,sample)=>sum+sample*sample,0)/samples.length)};
});
const [beforeBackground,beforeListeners]=await Promise.all([time(),Promise.all(players.map(safeStats))]);
await delay(12000);
const [afterBackground,afterListeners]=await Promise.all([time(),Promise.all(players.map(safeStats))]);
report.backgroundTab={hidden:!afterBackground.visible,contextSeconds:afterBackground.time-beforeBackground.time,
outputFrameDelta:afterBackground.frames-beforeBackground.frames,trailingSilenceSeconds:afterBackground.trailingSilence,
gmOutputRMS:afterBackground.outputRMS,
listenersWithContinuedAudio:afterListeners.map((listener,index)=>listener.bytes>beforeListeners[index].bytes&&
(listener.rms>0.001||listener.energy>beforeListeners[index].energy+1e-6))};
await cover.close();await gm.bringToFront();
await controls.getByRole('button',{name:'Stop playback'}).click();
await controls.getByText('Stopped',{exact:true}).waitFor();
report.manualAndPlayback=true;
stage('device-reconnect-disconnect-and-forget');
const beforeReload=wire.commands.length;
await reload();
await openSetup();await connected();
check(wire.commands.slice(beforeReload).some(entry=>entry.player?.id===receiver),'remembered-receiver-did-not-reconnect');
check(!wire.commands.slice(beforeReload).some(entry=>writes.has(entry.command)),'auto-reconnect-replaced-dedicated-queue');
check(await setup.getByLabel('Private GM access token').inputValue()==='','credential-field-leaked');
report.tokenFreeReload=true;
await setup.getByRole('button',{name:'Disconnect',exact:true}).click();
await setup.getByText(/Automatic reconnection is paused/).waitFor();
const disconnected=wire.commands.length;
await reload();
await openSetup();
await setup.getByRole('button',{name:'Connect',exact:true}).waitFor();
await delay(1800);
check(!wire.commands.slice(disconnected).some(entry=>entry.command==='auth'),'automatic-reconnect-after-disconnect');
await setup.getByRole('button',{name:'Connect',exact:true}).click();await connected();
await setup.getByRole('button',{name:'Forget Credentials',exact:true}).click();
await setup.getByText('Credentials removed from this device.',{exact:true}).waitFor();
const forgotten=wire.commands.length;
await reload();
await openSetup();
await setup.getByRole('button',{name:'Connect',exact:true}).waitFor();
await delay(1800);
check(!wire.commands.slice(forgotten).some(entry=>entry.command==='auth'),'automatic-reconnect-after-forgetting');
check(!await setup.getByRole('button',{name:'Forget Credentials'}).isVisible(),'device-credential-remains-after-forgetting');
report.disconnectPausesAutoReconnect=true;
report.forgetPreventsAutoReconnect=true;
const browserRenderedAudio=report.backgroundTab.outputFrameDelta>0&&report.backgroundTab.trailingSilenceSeconds<=4||
report.backgroundTab.gmOutputRMS>0.001;
check(report.backgroundTab.hidden&&report.backgroundTab.contextSeconds>=10&&browserRenderedAudio&&
report.backgroundTab.listenersWithContinuedAudio.every(Boolean),'background-render-not-verified');
stage('passed');
}finally{
report.onlyDedicatedQueueWritten=Boolean(receiver)&&wire.commands.filter(entry=>writes.has(entry.command)).every(entry=>entry.args?.queue_id===receiver);
report.queueWrites=wire.commands.filter(entry=>writes.has(entry.command)).map(({command,reply,error})=>({command,reply:reply===true,error}));
if(report.stage!=='passed')report.connectionVerification={
apiAuthenticated:wire.commands.some(entry=>entry.authenticated),
sendspinAuthenticated:wire.sendspinAuthenticated(),
lastCommandError:wire.commands.filter(entry=>entry.reply&&entry.error!==null).map(({command,error})=>({command,error})).at(-1),
recentMACommands:wire.commands.slice(-24).map(({command,reply,error})=>({command,reply:reply===true,error})),
notifications:await gm.evaluate(()=>window.__adaptiveReviewWarnings??[]).catch(()=>[]),
combatState:combatId?await gm.evaluate(id=>{
const combat=game.combats.get(id);
return {active:combat?.active,started:combat?.started,onActiveScene:(combat?.scene?.id??combat?.scene)===game.scenes.active?.id,
hasCombatCue:Boolean(game.scenes.active?.getFlag('adaptive-music','music')?.combat)};
},combatId).catch(()=>null):null,
};
if(saved)report.cleanup=await documentAction('cleanup',{combat:combatId,baseline:saved,scenes,names,
keepScenes:report.nativeAssignments===2&&report.sceneCombatBossAndRestoration===true}).catch(()=>null);
}
check(report.onlyDedicatedQueueWritten,'non-dedicated-write');
check(report.cleanup&&Object.entries(report.cleanup).every(([key,value])=>key==='demonstrationScenes'?value===2:value),'review-cleanup-not-verified');
}
+83
View File
@@ -0,0 +1,83 @@
// Explicit bounded DEV-only experiment. No browser or network control endpoint.
import { randomUUID } from 'node:crypto';
import { readFile,writeFile } from 'node:fs/promises';
import { liveClient,savePrivate } from './live_ma_preflight.mjs';
import { MAPlaybackProvider } from '../gateway/ma-provider.mjs';
import { GatewayControl } from '../gateway/control.mjs';
import { MusicController } from '../src/core/controller.mjs';
const report={checked_at:new Date().toISOString(),evidence_class:'live dedicated MA',mutations:0,checks:[],restored:false};
let provider,original,client,gateway,request,timer,controller,generation=0;
const session=randomUUID();
const ctx=()=>({campaign:'development',session,generation:(generation=Math.max(generation,controller?.generation??0)+1),check(){if(generation>10000)throw Error('stale');}});
const delay=ms=>new Promise(resolve=>setTimeout(resolve,ms));
try {
if(!process.argv.includes('--controls-only') && !process.argv.includes('--synthetic'))throw Object.assign(Error(),{code:'mode-required'});
let sequences;
if(process.argv.includes('--synthetic')) {
const source=JSON.parse(await readFile('.local/fixture-origin.json','utf8'));
sequences=Object.fromEntries(Object.entries(source.sequences).map(([kind,files])=>[`synthetic-${kind}`,files.map(name=>`builtin://track/${source.base_url}/${name}`)]));
}
const loaded=await liveClient(sequences);client=loaded.client;
if(sequences){await client.inspectSynthetic();report.content='original synthetic sequences; not MA playlists';}
await client.verifyTarget();report.isolation_verified=true;
gateway=new GatewayControl({campaigns:{development:{client}},origin:'https://example.test'});
request={campaign:'development',session,origin:'https://example.test',token:gateway.mint({campaign:'development',session,role:'controller',ttlMs:300000})};request.fence=gateway.acquire(request).fence;
timer=setInterval(()=>{try{gateway.renew(request);}catch{clearInterval(timer);}},10000);
const mutate=client.mutate.bind(client);client.mutate=async(...args)=>{await mutate(...args);report.mutations++;};
provider=new MAPlaybackProvider({client,campaign:request.campaign,session:request.session,fence:request.fence,authority:gateway.fenceGuard(request),snapshotKey:loaded.catalogKey});
original=await provider.snapshot(ctx());await savePrivate('ma-original-snapshot.json',original);
report.original={state:original.value.state,items:original.value.items.length,position:original.value.position};
// Abort instead of interrupting unexpected existing playback in a controls-only run.
if(process.argv.includes('--controls-only')){
if(original.value.items.length || original.value.state!=='idle')throw Object.assign(Error(),{code:'unsupported'});
for(const [action,value] of [['shuffle',true],['shuffle',false],['repeat','one'],['repeat','all'],['repeat','off'],['stop',null]]){
await provider.control(action,value,ctx());const q=await client.queueState();
if(action==='shuffle' && q.shuffle_enabled!==value || action==='repeat' && q.repeat_mode!==value)throw Error();
report.checks.push({action,value,result:'pass',scope:'idle queue controls'});
}
}else{
// Original generated fixtures only; actual MA playlist playback needs separate acceptance.
const refs=['synthetic-ambient','synthetic-combat'].map(id=>({provider:'ma',id}));
await provider.apply(await provider.resolve(refs[0],ctx()),ctx());await delay(1500);
for(const [action,value] of [['pause',null],['resume',null],['seek',3],['shuffle',true],['shuffle',false],['repeat','one'],['repeat','all'],['repeat','off']]){
await provider.control(action,value,ctx());await delay(250);report.checks.push({action,result:'command accepted'});
}
// Park the ambient fixture for exact offset comparisons through nested contexts.
await provider.control('pause',null,ctx());await delay(250);
const ambient=await provider.snapshot(ctx());
controller=new MusicController({campaign:request.campaign,session:request.session,providers:{ma:provider},authority:()=>true});
controller.generation=generation;
const base={scene:{id:'fixture',playlist:refs[0]},combats:[]};
// Adopt the existing fixture as current rather than restarting it.
const {candidates}=await import('../src/core/controller.mjs');controller.current=candidates(base)[0];
const combat={id:'fixture-combat',sceneId:'fixture',active:true,started:true,playlist:refs[1],bosses:[]};
await controller.update({...base,combats:[combat]});await delay(500);
const bossState={...base,combats:[{...combat,bosses:[{id:'boss',active:true,priority:1,playlist:refs[0]}]}]};
await controller.update(bossState);
await controller.update({...bossState,overrides:[{id:'manual',playlist:refs[1]}]});
await controller.update(bossState);
await controller.update({...base,combats:[combat]});await controller.update(base);
generation=controller.generation;const restored=await provider.snapshot(ctx());
if(JSON.stringify(restored.value.items)!==JSON.stringify(ambient.value.items) || restored.value.index!==ambient.value.index || Math.abs(restored.value.position-ambient.value.position)>1 || restored.value.state!==ambient.value.state)throw Object.assign(Error(),{code:'restore-mismatch'});
report.checks.push({action:'nested combat/boss/manual unwind',result:'pass'});
controller.generation=generation;
const mutationsBefore=report.mutations;
const results=await Promise.allSettled([controller.update({...base,combats:[combat]}),controller.update({...base,overrides:[{id:'rapid',playlist:refs[1]}]}),controller.update(base)]);
generation=controller.generation;report.checks.push({action:'rapid contexts',settled:results.map(r=>r.status),result:'completed',mutations:report.mutations-mutationsBefore});
if(report.mutations!==mutationsBefore)throw Object.assign(Error(),{code:'duplicate-mutation'});
}
}catch(error){report.error=error.code??'unavailable';}
finally{
if(original && provider){
try{
await provider.restore(original,ctx());await delay(250);const after=await provider.snapshot(ctx());
const fields=v=>JSON.stringify([v.state,v.items,v.index,v.repeat,v.shuffle,v.position]);
report.restored=fields(after.value)===fields(original.value);
if(!report.restored)report.restore_error='state mismatch';
}catch(error){report.restore_error=error.code??'unavailable';}
}
if(!original && report.mutations===0){report.original_unchanged=true;report.restored=null;}
clearInterval(timer);if(gateway&&request)gateway.revoke(request.token);
await writeFile(process.argv.includes('--synthetic')?'evidence/ma-synthetic-playback.json':'evidence/ma-playback.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify(report,null,2));
if(report.error || !report.restored)process.exitCode=1;
}
+23
View File
@@ -0,0 +1,23 @@
// Read-only; original state and identifiers remain in private storage.
import { constants } from 'node:fs';
import { readFile, open } from 'node:fs/promises';
import { MAReadClient } from '../gateway/ma-client.mjs';
import { loadMAToken,loadCatalogKey } from '../gateway/private-config.mjs';
export async function liveClient(syntheticSequences = {}) {
const config=JSON.parse(await readFile('.local/environment.json','utf8'));
const prior=JSON.parse(await readFile('.local/ma-readonly-results.json','utf8'));
if(prior.me.player_filter.length!==1 || prior.player.name!=='Adaptive Music DEV')throw Error('denied');
const catalogKey=await loadCatalogKey('.local');
const client=new MAReadClient({baseUrl:config.ma_url,token:await loadMAToken('.local'),target:prior.me.player_filter[0],
approvedProviders:prior.me.provider_filter,syntheticSequences,catalogKey,campaign:'development',expectedName:'Adaptive Music DEV',expectedProvider:prior.player.provider});
return {client,catalogKey};
}
export async function savePrivate(name,data) {
const file=await open(`.local/${name}`,constants.O_WRONLY|constants.O_CREAT|constants.O_NOFOLLOW,0o600);
try {const info=await file.stat();if(!info.isFile() || info.uid!==process.getuid() || (info.mode&0o777)!==0o600)throw Error('denied');await file.truncate(0);await file.writeFile(JSON.stringify(data,null,2)+'\n');await file.sync();}finally{await file.close();}
}
if(process.argv[1]?.endsWith('live_ma_preflight.mjs')) {
try {const {client}=await liveClient();await client.verifyTarget();const q=await client.queueState();const choices=await client.catalog();
console.log(JSON.stringify({isolation_verified:true,state:q.state,items:q.items,shuffle:q.shuffle_enabled,playlists:choices.filter(c=>c.kind==='playlist').length}));
} catch(error){console.log(JSON.stringify({isolation_verified:false,error:error.code??'unavailable',mutations_sent:0}));process.exitCode=1;}
}
Loaded 100 of 162 files, more files were not shown because too many files have changed in this diff. Show more