# Adaptive Music 0.5.0 — manual release and installation Module ID **adaptive-music**, author **CheddahBoxMB**, Foundry generation **14**; system-independent, no mandatory Foundry modules. Native operation needs only this module ZIP. No container, VM/LXC, Ubuntu sandbox, core patch or automatically installed OS service is required. GM-local MA/WebRTC audio remains experimental; limitations and measured results are in ARCHITECTURE.md and evidence/browser-audio.json. ## Build offline without Git credentials or a remote From this repository (Python 3 standard library; local Git metadata is optional): ``` python3 scripts/release.py python3 scripts/release.py --validate dist/releases/v0.5.0/adaptive-music.zip ``` This creates `dist/releases/v0.5.0/adaptive-music-release-v0.5.0.zip`. It contains: `adaptive-music.zip`, standalone `module.json`, `adaptive-music-source.zip`, README, this INSTALL guide, CHANGELOG, LICENSE, THIRD-PARTY-NOTICES, all vendor license texts, `release.json` and `SHA256SUMS`. The SDK bundle is committed, so packaging needs no npm installation, browser download, network, Git token or Git-host access. The builder never verifies, contacts, creates or pushes a remote repository. For another host, for example your own public GitHub repository: ``` python3 scripts/release.py --repository https://github.com/OWNER/adaptive-music --output dist/github-release ``` Use a real destination under your control. The generated manifest's `url`, stable `manifest` and version-specific `download` are changed together. The builder does not write to the Git host or alter the root manifest. It validates identity, v14 compatibility, import/assets closure, SDK hash, licenses, private-file exclusion and public HTTPS URL shape locally. This cannot prove that a planned URL exists. ## Upload to the planned Gitea destination manually Planned repository (existence/access **not checked**): `https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music` 1. On your own initiative, use Gitea's web UI to create/confirm that repository and enable public read access to the source manifest and release attachments. Foundry must be able to fetch them without Git credentials. This exposes release files, not MA. This agent has not accessed or authenticated with your Gitea server. 2. Unpack the **source archive**, not the outer release bundle, into the repository using your normal Git/web upload workflow. Preserve directory structure, notices, scripts and the generated root `module.json`. Exclude `.local/`, node_modules, private deployment files and credentials. Do not upload an outer bundle as the module contents. If web upload cannot preserve folders, use your own local Git client; no credential is needed by the release builder itself. 3. Create tag/release **v0.5.0** for this version. Keep that tag immutable. Paste the CHANGELOG entry into the release notes. Do not mark this unverified development release as Foundry-verified or production-ready. 4. Upload **adaptive-music.zip** and **module.json** as release attachments with those exact names. Upload source/archive, SHA256SUMS, docs/notices or the full outer bundle as additional review artifacts. Never use the source ZIP or outer bundle as the module download attachment. 5. After publishing, manually verify anonymous downloads and checksums. The module ZIP should resolve at: `https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/releases/download/v0.5.0/adaptive-music.zip` 6. Ensure `main/module.json` is the generated standalone manifest. The stable installation/update URL is: `https://cheddahboxmb.duckdns.org/CheddahBoxMB/adaptive-music/raw/branch/main/module.json` This URL is deliberately stable across releases. Do not give Foundry a tag-specific manifest URL if you expect automatic version discovery. No URL above was requested by the build/validation process. Uploading/publishing is manual; no token, remote connection, automatic push or release publication is used. ## Install and update through Foundry Once the public manifest and release attachments actually exist: 1. In isolated Foundry v14 Setup → Add-on Modules → Install Module, paste the stable manifest URL above and install. Enable Adaptive Music in the isolated world. 2. Configure Settings → Adaptive Music setup: select dedicated native music playlists, save ownership/reload, set world/scene ambient/combat/boss/native fallback choices, then enable automation. Sound effects/AmbientSound are excluded. Automation defaults off. Test real v14.371 behavior before considering production use. 3. For later versions, preserve the module ID and stable manifest URL. Bump semantic version in module.json/package.json/lockfile, update CHANGELOG and build a new immutable tag-specific release. The versioned ZIP URL must change with version. 4. Publish new attachments **before promoting the new standalone manifest to main**. Prepare on a release branch/tag if needed, leaving the previous main manifest untouched until assets are available. Never overwrite a previous version's ZIP. 5. Foundry Setup → Update Modules should discover the newer manifest version and download its new ZIP while keeping world/document settings. This is the standard update contract and is validated structurally, not measured against your server. GitHub uses the same ZIP and upload process, with a stable generated manifest at `https://raw.githubusercontent.com/OWNER/adaptive-music/main/module.json` and ZIP at `https://github.com/OWNER/adaptive-music/releases/download/v0.5.0/adaptive-music.zip`. Optional pinned GitHub/Gitea CI workflows only test/build artifacts for manual publication on an already provisioned runner. They install no runner/service or runtime infrastructure. CI/host execution has not been validated on your Gitea. ## GM-local MA and WebRTC experiment The intended module-only path is: private MA → official Sendspin JS SDK in the GM browser → Web Audio → encrypted WebRTC audio tracks → authorized player browsers. Foundry module sockets carry only encrypted bounded SDP/control, never continuous raw audio or an MA token. No STUN/TURN service is silently selected. Per-listener invitations must be delivered privately, not posted to a module socket/public flag. The GM must be able to reach MA privately over a browser-allowed secure connection. An HTTPS Foundry page cannot be assumed to access plain HTTP/ws MA just because the Sendspin payload is encrypted. CSP, local-network permissions and server Origin policy also apply. The GM-local control adapter uses the official /ws API because HTTP /api CORS preflight is not enabled in the inspected MA pin. No mixed-content bypass or public MA route is provided. Browser-local MA credentials are visible to that GM/user and any compromised code running in their browser; this design does not claim otherwise. Players never receive those credentials. Developer API (explicit operator actions; no automatic playback on module enable): - `api = game.modules.get('adaptive-music').api` - `api.readGMCatalog(profile)` reads through GM-local authentication. - `api.startGMHost(profile)` must be invoked directly by a user gesture with automation stopped and the optional companion disconnected. `profile` stays in GM memory. - `api.inviteListener(userId, {iceServers: []})` creates a unique expiring invitation. Deliver it over a private authenticated channel to that participant. - Player gesture: `api.listenWebRTC(invitation)`. No microphone/control channel. - `api.peerStats()` returns sanitized bandwidth/jitter statistics. - `api.closeGMHost()` tears down the local host. MA state recovery still requires the existing guarded bounded test procedure; do not assume tab closure restores MA. The private profile requires MA origin/token, pinned existing DEV ID/name/provider, approved providers, a base64 32-byte catalogKey and namespace retained privately, plus the **existing DEV Sendspin identity and pairing storage**, and `webSocketAuthLogSafe: true` only after verifying that MA raw WebSocket payload logging at VERBOSE is disabled. The pinned server would otherwise log the auth frame/token; no logging configuration was changed or verified here. No real profile is bundled or stored in world settings/flags/localStorage. `campaign` is supplied by the module. Use only previously approved generated synthetic sequences and explicit synthetic playback opt-in; real library playlist playback is a separate authorization gate. The current sandbox has **no existing DEV private identity**. The module refuses to register a random replacement or hijack a name-matching player. The GM must privately supply an authorized export of the existing web player's identity, or separately approve a new dedicated identity and update the target/account binding. No such provisioning has occurred. Synthetic files also still need to be reachable by MA. WebRTC without a configured relay cannot guarantee remote connections behind all NAT/firewall combinations. TURN, if required, must be an explicitly approved existing service with short-lived credentials; no new container/VM or service is installed. The GM's upload scales with listener count and their browser must stay running. Startup also requires one active GM, a browser Web Lock and a reconciled empty idle test target. Read-only identity checks can inspect the known unavailable target during operator handover; every mutation still rechecks full availability/topology. GM loss stops forwarding, invalidates automation authority and requires explicit reconciliation/reconnection; no seamless handover or distributed MA fence is claimed. If browser access/NAT/GM-availability gates cannot be satisfied, an optional minimal co-located worker on the **existing Foundry host** is the fallback design. Its source is retained in gateway/ and branch experimental/companion-0.4.0. It is not installed, started or required by the module. Any host placement, TLS route or manual service registration needs separate approval; MA remains private. No core modifications.