# BUILD-RECEIPT.md — Hospitality Arrival Soundcard (Fictional Prototype)

- **Artifact Directory:** `work/frontier-wave2-20261023/hospitality-audio-card`
- **Build Timestamp (UTC):** `2026-10-23T12:21:00Z`
- **Prototype Identity:** *The Lantern & Larch Inn · 14 Wharf Bosun Lane, Saltbox Harbor, Maine (Fictional Prototype)*
- **Validation Status:** **PASS** (`0` errors · `5/5` Demonstrated-RED mutations caught · `0` storage bytes · `0` external network requests)

---

## 1. Executive Summary & Scope Compliance

This package delivers an artifact-first, public-safe, mobile-first **Hospitality Arrival Soundcard** product sample built strictly inside `work/frontier-wave2-20261023/hospitality-audio-card`:

1. **Locally Synthesized Original Audio (`65.07s` WAV / `65.11s` MP3, within the `45–75s` window):**
   - Spoken by two fictional hospitality personas—**Clara Vance** (Innkeeper, `kokoro-onnx` `af_heart`) and **Julian Mercer** (Night Host & Baker, `kokoro-onnx` `bm_george`)—over an original procedural stereo soundscape (modal bronze harbor bell buoy, LFO-modulated coastal tide wash, Karplus-Strong/modal fingerpicked acoustic guitar in D major, brass key hook chime, and cedar fireplace crackle) with smooth sidechain voice ducking.
2. **Mobile-First Visual Player & Accessible Captions (`index.html`):**
   - Self-contained responsive card (`0 px` horizontal overflow at `390x844` mobile viewport) featuring play/pause, `±10s` skip, playback rate (`0.9x–1.25x`), mute toggle, an interactive 120-bar RMS waveform scrubber, 5 chapter jump pills, live synchronized captions (`aria-live="polite"` + native `<track kind="captions">`), click-to-seek full transcript, and one-tap offline downloads (`.mp3`, `.wav`, `.vtt`, `.txt`).
3. **Consent & Privacy-Safe Customization Form Mockup (Stores Nothing):**
   - Interactive sandbox allowing an evaluator or guest to preview personalized arrival scripts (optional alias, arrival window, sensory audio mix mode, and parlor food note) gated by an explicit local-only consent checkbox, a **Wipe Ephemeral Memory Now** control, and a live **Zero-Storage Privacy Telemetry Inspector** (`window.localStorage.length === 0`, `window.sessionStorage.length === 0`, `document.cookie === ""`, CSP `connect-src 'none'`).
4. **Blinded Preference Test Harness (Arrival Soundcard vs. Plain-Text Welcome):**
   - Built-in counterbalanced **Candidate Alpha / Candidate Beta** comparison view pairing the Arrival Soundcard against a matched plain-text welcome message ([`assets/plain-text-welcome.txt`](assets/plain-text-welcome.txt)) with **100% factual parity** across all 8 operational arrival details and an in-memory evaluator scorecard.

---

## 2. Audio Decode, Loudness & Duration Verification

Measured by [`src/validate_artifact.py`](src/validate_artifact.py) via `ffprobe`, `ffmpeg -v error`, `ebur128=peak=true`, and `soundfile`:

| Metric | Target / Gate | Measured (`arrival-soundcard.mp3`) | Measured (`arrival-soundcard.wav`) | Status |
| :--- | :--- | :--- | :--- | :--- |
| **Duration** | `45.0s <= d <= 75.0s` | `65.112 s` (`1:05`) | `65.071 s` (`1:05`) | **PASS** |
| **WAV/MP3 Duration Delta** | `<= 0.150 s` | `0.041 s` | `0.041 s` | **PASS** |
| **Integrated Loudness (I)** | `-18.5` to `-13.5 LUFS` (target `-16`) | `-16.0 LUFS` | `-15.8 LUFS` | **PASS** |
| **True Peak (TP)** | `<= -1.0 dBTP` | `-1.8 dBTP` | `-1.5 dBTP` | **PASS** |
| **Loudness Range (LRA)** | Conversational mobile clarity | `2.4 LU` | `2.4 LU` | **PASS** |
| **Sample Rate & Channels** | `48,000 Hz` · `2 ch (Stereo)` | `48,000 Hz` · `2 ch` (`mp3`) | `48,000 Hz` · `2 ch` (`pcm_s16le`) | **PASS** |
| **FFmpeg Stream Decode** | `0` decode errors | `0` errors | `0` errors | **PASS** |
| **Chapter RMS Floor** | `>= 0.005` (no dead air) | Min chapter RMS `0.1093` across 5 chapters | Ch1 `0.1222`, Ch2 `0.1132`, Ch3 `0.1145`, Ch4 `0.1317`, Ch5 `0.1093` | **PASS** |

---

## 3. Browser, Accessibility & Zero-Storage Validation

Executed via headless Chromium (`/opt/openclaw-browser/chromium-153/chrome-headless-shell`) in [`src/validate_artifact.py`](src/validate_artifact.py):

- **Mobile Viewport (`390x844`):** `0 px` horizontal overflow; visual proof saved at [`validation/mobile-arrival-soundcard.png`](validation/mobile-arrival-soundcard.png).
- **Desktop Viewport (`1280x900`):** Full-page layout proof saved at [`validation/desktop-overview.png`](validation/desktop-overview.png).
- **Interactive Chapter & Transcript Seeking:**
  - Clicking Chapter 4 (`0:38`) updates live caption speaker to `"Julian Mercer (Night Host & Baker, Fictional)"` and displays the parlor fireplace & rosemary focaccia caption.
  - Clicking Transcript Chapter 2 (`0:12`) updates live caption to the Wharf Bosun Lane gravel court & mudroom keypad (`4821#`) instruction.
- **Customization Form Zero-Storage Proof:**
  - Filled alias `"Marin"`, arrival window `"dusk-late"`, mix `"clear-voice"`, checked consent, submitted preview, and verified personalized output rendered in memory.
  - Measured `localStorage.length = 0`, `sessionStorage.length = 0`, `document.cookie = ""` both **during** active customization and **after** clicking `#btn-wipe-customization`.
- **Network Isolation Proof:** `0` external requests (`http://` / `https://` outside `127.0.0.1` loopback); `0` browser console errors.

---

## 4. Demonstrated-RED Negative Mutation Proof

In compliance with the **Demonstrated-RED Rule**, [`src/validate_artifact.py`](src/validate_artifact.py) executes 5 bounded negative mutations before asserting GREEN, plus a real browser defect caught and fixed during build:

1. **`RED-01-duration-too-short`:** Injected `duration_s = 31.2s` → Caught RED (`Audio duration 31.200s outside required [45.0, 75.0]s window`).
2. **`RED-02-loudness-and-true-peak-violation`:** Injected `integrated_lufs = -6.0`, `true_peak_dbtp = +0.4` → Caught RED (`Integrated loudness -6.00 LUFS outside [-18.5, -13.5] LUFS; True peak 0.40 dBTP exceeds -1.0 dBTP ceiling`).
3. **`RED-03-blinded-test-fact-parity-breach`:** Removed keypad code `4821#` from plain-text welcome control → Caught RED (`Plain-text control missing required arrival fact: keypad_code`).
4. **`RED-04-missing-fictional-prototype-disclosure`:** Removed `"Fictional Prototype"` disclosure from HTML → Caught RED (`HTML missing explicit 'Fictional Prototype' disclosure`).
5. **`RED-05-customization-form-storage-leak`:** Simulated `localStorage.length == 1` after form submission → Caught RED (`Zero-storage violation: localStorage has 1 item(s)`).
6. **Real-World Browser Catch During Build:** On the first Playwright run, clicking Chapter 4 while audio was paused over Python's `SimpleHTTPRequestHandler` (which lacks HTTP `206 Partial Content` range support) caused Chromium's `<audio>` element to emit `loadedmetadata` with `currentTime = 0`, resetting the live caption speaker back to Chapter 1. [`src/validate_artifact.py`](src/validate_artifact.py) failed RED (`error_count: 1: Chapter 4 seek did not update live speaker to Julian Mercer`). Fixed in [`index.html`](index.html) by maintaining a deterministic `virtualTime` state for paused chapter/transcript inspection, returning the suite to `PASS` (`error_count: 0`).

---

## 5. Artifact Inventory

| Path (relative to `work/frontier-wave2-20261023/hospitality-audio-card/`) | Description |
| :--- | :--- |
| [`index.html`](index.html) | Static mobile-first Arrival Soundcard UI, waveform player, captions, downloads, zero-storage customizer, and blinded A/B test harness |
| [`assets/arrival-soundcard.mp3`](assets/arrival-soundcard.mp3) | Mastered 48 kHz stereo MP3 (`65.11s`, `-16.0 LUFS`, `-1.8 dBTP`, `1,563,309 bytes`) |
| [`assets/arrival-soundcard.wav`](assets/arrival-soundcard.wav) | Mastered 48 kHz 16-bit stereo PCM WAV (`65.07s`, `-15.8 LUFS`, `-1.5 dBTP`, `12,493,710 bytes`) |
| [`assets/arrival-soundcard.vtt`](assets/arrival-soundcard.vtt) | WebVTT synchronized captions with speaker tags and soundscape cues |
| [`assets/arrival-soundcard-transcript.txt`](assets/arrival-soundcard-transcript.txt) | Accessible plain-text transcript with chapter timestamps and quick-reference arrival facts |
| [`assets/plain-text-welcome.txt`](assets/plain-text-welcome.txt) | Matched plain-text welcome control arm for blinded preference testing (8/8 fact parity) |
| [`assets/audio-provenance.json`](assets/audio-provenance.json) | Machine-readable synthesis recipe, chapter boundaries, 120-bar waveform envelope, and SHA-256 hashes |
| [`src/synthesize_audio.py`](src/synthesize_audio.py) | Deterministic offline synthesis & mastering pipeline (`kokoro-onnx` + `numpy`/`scipy` + `ffmpeg`) |
| [`src/validate_artifact.py`](src/validate_artifact.py) | Deterministic audio/content/parity validator + headless Chromium Playwright + Demonstrated-RED suite |
| [`validation/validation-report.json`](validation/validation-report.json) | Full machine-readable validation receipt |
| [`validation/mobile-arrival-soundcard.png`](validation/mobile-arrival-soundcard.png) | Headless Chromium mobile viewport (`390x844`) render proof |
| [`validation/desktop-overview.png`](validation/desktop-overview.png) | Headless Chromium desktop viewport (`1280x900`) full-page render proof |
| [`RIGHTS-AND-PROVENANCE.md`](RIGHTS-AND-PROVENANCE.md) | Source, licensing, fictional entity, and zero-storage privacy documentation |
| [`BUILD-RECEIPT.md`](BUILD-RECEIPT.md) | This build and verification receipt |

---

## 6. Deterministic Reproduction Commands

```bash
export TMPDIR=/root/openclaw-worker/workspace/work/frontier-wave2-20261023/hospitality-audio-card/.tmp
mkdir -p "$TMPDIR"

# 1. Regenerate audio, captions, transcript, plain-text control, and provenance JSON
python3 work/frontier-wave2-20261023/hospitality-audio-card/src/synthesize_audio.py

# 2. Run deterministic audio/loudness/parity checks, Demonstrated-RED suite, and headless browser validation
python3 work/frontier-wave2-20261023/hospitality-audio-card/src/validate_artifact.py

rm -rf "$TMPDIR"
```
