# Browser-Safe Audio Heuristics Report

- date: 2026-05-25
- integrations_pr: 739
- integrations_release_pr: 740
- proof_packs_version: @riddledc/riddle-proof-packs@0.6.4
- lilarcade_pr: 524
- lilarcade_deploy_commit: a5c5aadf7c0fca845df8a2478dc764ee43749705
- lilarcade_amplify_job: 702
- status: post_deploy_ready

## Claim

Neon can consume the reusable audio section-energy and loudness-style heuristics from Riddle Proof packs in browser app code without importing the Node-oriented proof-pack root surface.

## Catch

The first cleanup attempt imported the reusable helpers from `@riddledc/riddle-proof-packs`.

That passed the focused Node proof-contract tests, but the production browser build failed because the root package also exposes Node-oriented proof framework helpers. Vite tried to resolve Node modules from `@riddledc/riddle-proof`, then failed on:

```text
"fileURLToPath" is not exported by "__vite-browser-external"
```

That was a real package-boundary bug: the reusable heuristic existed, but the public import path was not safe for browser consumers.

## Fix

Integrations PR #739 added a browser-safe subpath:

```ts
import {
  compareAudioSectionEnergy,
  computeAudioSectionReviewMetric,
  estimateLoudnessStyleLufs,
} from "@riddledc/riddle-proof-packs/audio-mix-heuristics";
```

The trusted Changesets release PR #740 published `@riddledc/riddle-proof-packs@0.6.4`.

LilArcade PR #524 then:

- moved `@riddledc/riddle-proof-packs` into app dependencies
- imported only `@riddledc/riddle-proof-packs/audio-mix-heuristics`
- removed 259 lines of duplicated local section-energy and loudness-style helper code
- kept the Neon-specific proof contract and receipt summaries in the app

## Evidence

Validation passed:

- `pnpm --filter @riddledc/riddle-proof-packs test`
- trusted npm publish of `@riddledc/riddle-proof-packs@0.6.4`
- `npm view @riddledc/riddle-proof-packs version` returned `0.6.4`
- `node --test src/proof/__tests__/neonProofContract.test.mjs`
- `npm run build`
- `npm run test:sequencer` with 148 passing tests
- local built-app preliminary proof returned `preliminary_candidate_ready`
- Amplify job 702 deployed LilArcade PR #524
- production `post-deploy` preset returned `post_deploy_ready`

The local built-app proof packet still captured section-energy and loudness-style review details, recommended `guitar -0.05`, and preserved the proof/taste boundary.

The deployed post-deploy proof passed with:

- 6 available songs
- 6 proof-capable songs
- 19 sampled parts
- 22 sampled windows
- 2 active durable overrides
- 0 findings
- state restoration passing

## Boundary

This proves the reusable audio heuristic surface is consumable from browser app code and still produces reviewable proof packets. It does not prove subjective mix quality; section-energy and loudness-style metrics remain review aids.
