# Offline OurAirports demo

`scripts/audit-demo.mbtx` reuses the revision demo's simulated keywords removal. It audits keeping/filling then dropping/revoking, retaining discarded source text and the revoked custom value, and verifies all 18 surviving columns, stale rejection and retry. No external source is added.

`scripts/combine-demo.mbtx` retains all source columns while simulating concurrent local/remote name edits on airport `6523`, alongside the existing missing `6524/review_owner`. It assigns these conflicts separately, combines the returned reviews, verifies exact CSV, and exercises disagreement/stale rejection and retry. No new external data is added.

`scripts/scope-demo.mbtx` uses the same structural fixtures for an explicit missing-cell assignment, invalid-scope/unknown-target rejection, recovery and exact replay. Data provenance and simulated edits remain as below; no additional external resource is incorporated.

`scripts/sheet-demo.mbtx` exports the structural fixture's missing-cell review as TSV, fills airport `6524`'s `review_owner=team-B`, and verifies the complete expected output. It rejects modified evidence, unused custom text and a stale nonconflicting municipality, then retries without modifying earlier bundles. Its narrow suffix edit handles this single known conflict; production inputs use the full TSV parser. All branch changes are simulated.

`scripts/tsv-demo.mbtx` converts the existing seven CSV fixtures to quoted TSV in a temporary directory, preserving every cell, then exercises merge, unresolved/malformed Git-driver preservation/retry, offline review and stale rejection. No new external data or code is incorporated.

Source: [OurAirports data mirror](https://github.com/davidmegginson/ourairports-data), commit [`ecead39624006017b34acf27a4b098c9cc8a4635`](https://github.com/davidmegginson/ourairports-data/tree/ecead39624006017b34acf27a4b098c9cc8a4635), retrieved 2026-10-11. [Pinned airports.csv](https://raw.githubusercontent.com/davidmegginson/ourairports-data/ecead39624006017b34acf27a4b098c9cc8a4635/airports.csv). The dataset is [public domain](https://ourairports.com/data/); the mirror uses [Unlicense](https://github.com/davidmegginson/ourairports-data/blob/ecead39624006017b34acf27a4b098c9cc8a4635/LICENSE).

All 19 source columns are retained for airport IDs `6523`, `323361` and `6524`. Original records are real public data. All branch changes below are **simulated**, not claims about actual changes at these airports.

1. `base.csv` contains the first two source records. `ours.csv` adds ` (reviewed name)` to airport 6523's name. `theirs.csv` sets its keywords to `simulated audit note`. `expected.csv` contains both edits, with rows sorted by the string key.
2. `structure-ours.csv` adds `review_owner=team-A` to both original rows. `structure-theirs.csv` adds the third real source row, airport 6524. Its intersection with `review_owner` is undefined, so merge fails with `MissingCell` rather than guessing a blank. `decisions.json` explicitly supplies `team-B`; `structure-expected.csv` is the final output.
3. `order-expected.csv` contains the independent edits while preserving base row order. `rename-ours.csv` retains the keyword edit from `theirs.csv` and renames only its `name` header to `airport_name`; paired with `ours.csv` as the other branch, `columns.json` declares the correspondence and `rename-expected.csv` retains both edits under the new header. Every source column remains represented. `scripts/rename-demo.mbtx` adds a further simulated name conflict in a temporary file to exercise offline resolution and recovery.

Run `moon run scripts/demo.mbtx` or `moon run scripts/demo.mbtx native`. The helper checks exact expected output, unresolved exit status, zero partial CSV, explicit review and invalid-key rejection, without network or private infrastructure. After downloading the pinned CSV, `moon run scripts/fixtures.mbtx PATH_TO_AIRPORTS_CSV` regenerates the fixtures. The helper deliberately extracts these known single-line records; the production CLI implements full quoted CSV parsing.

4. `identity-ours.csv` contains the reviewed-name edit and changes only source ID `6523` to `airport:6523`. The other branch retains its numeric ID and keyword edit. `rows.json` explicitly declares the retained record; `identity-expected.csv` preserves both edits and all 19 columns. `scripts/identity-demo.mbtx` adds a temporary concurrent name edit, reviews it at the output ID, rejects stale IDs and verifies Git driver collision/retry. The ID migration is simulated, not an OurAirports change.

5. `scripts/revision-demo.mbtx` creates a temporary branch from `structure-theirs.csv`, removing its final empty keywords column; the other branch is `theirs.csv` with its simulated keyword edit. The helper keeps the column, explicitly fills the new row, rejects a reversal until that dependent fill is explicitly revoked, then tests drop, undo, reopened review and stale-input rejection. All 18 surviving source columns remain intact after an explicit drop. This narrow fixture transformation handles only the pinned single-line records; arbitrary inputs use the production CSV parser.
