# Songbook gig-mode JSON load check

Purpose: a tiny, public-safe check card for the 15-minute follow-up job to verify the songbook's starter-song loading path before a gig without touching accounts, secrets, router settings, deployment config, or payment/Wi-Fi decisions.

## Safe scope

- Verify read-only public assets only: `chords.system8.json`, `songs.json`, `app.js`, `sw.js`, and the browser homepage.
- Do not edit Netlify settings, provider credentials, payment links, router config, Wi-Fi details, private localStorage backups, or real setlists.
- Report only if canonical JSON, fallback JSON, offline/cache behaviour, tests, or browser console state changes.

## 1. Canonical JSON first

Expected healthy state:

1. Local `chords.system8.json` parses as JSON.
2. Local `songs.json` parses as JSON.
3. Both files match while `songs.json` remains the fallback seed file.
4. `app.js` tries `./chords.system8.json` before `./songs.json`.

Local commands from `/home/nk/chords-system8-live-site`:

```sh
npm test
python3 -m json.tool chords.system8.json >/tmp/chords-system8-json-load-canonical.json
python3 -m json.tool songs.json >/tmp/chords-system8-json-load-fallback.json
cmp -s chords.system8.json songs.json
```

## 2. Live canonical and fallback routes

Read-only live probe:

```sh
curl -fsS --max-time 20 https://chords.system8.com.au/chords.system8.json -o /tmp/chords-system8-live-canonical.json
curl -fsS --max-time 20 https://chords.system8.com.au/songs.json -o /tmp/chords-system8-live-fallback.json
python3 -m json.tool /tmp/chords-system8-live-canonical.json >/tmp/chords-system8-live-canonical.pretty.json
python3 -m json.tool /tmp/chords-system8-live-fallback.json >/tmp/chords-system8-live-fallback.pretty.json
cmp -s /tmp/chords-system8-live-canonical.json /tmp/chords-system8-live-fallback.json
```

Expected: both routes return HTTP 200 parseable JSON and match. If the canonical route fails but fallback works, the browser may still run, but this is reportable live-site state.

## 3. Browser/offline cache behaviour

Browser smoke path:

1. Start a temporary local server in this folder.
2. Open `http://127.0.0.1:<port>/`.
3. Confirm the homepage links this card, the cache manifest audit, offline rehearsal check, JSON consumer checklist, JSON failure copy, and JSON route status card.
4. Confirm the starter songs render without console errors.
5. Open this card through the served link and confirm it renders as text.
6. Stop the temporary server.

Service-worker expectations:

- `sw.js` precaches `./chords.system8.json`, `./songs.json`, and this check card.
- If network seed fetches fail after the app shell has been cached, saved browser songs and import/export controls should remain usable.
- A failed seed fetch must not wipe localStorage.

## Human-only gates

Keep these out of unattended checks: real van no-internet rehearsal, real phone scan, payment wording, Wi-Fi show/hide choice, private backup location, router access, VPS access, and any production deployment change.
