# Hungary (HU): migration notes

Internal record of the P5 migration from the old scripts to the producer: the discrepancies found, their causes, and who decided what. This is a dated record, so the numbers are as of the migration and not kept current. It is not shipped in the zip.

- **Issue:** pc-28e.7.24 (closed 2026-10-02)
- **Commit:** `6f33a9d` (worktree commit `bfb4191`, same content), landed in batch 2
- **Parity verdict:** `explained` (`row_order` ×1); signed off by the user
- **Producer:** `custom`, refresh disabled

## Sources

| Input | URL | Notes |
|---|---|---|
| GeoNames postal export | https://download.geonames.org/export/zip/HU.zip | The only input the old builder used. Magyar Posta and KSH have no confirmed redistribution licence (2026-08-29 audit) |

## Parity against the live zip (2026-10-02)

Rows: 3,571 live and 3,571 fresh, none only on one side, 0 changed cells. The one class is `row_order`: rows reordered within postal codes, consistent with GeoNames reordering its export. The agent took this from parity's classification and showed no example rows; it was not traced further.

The informational sample check against `https://postal.datahub.io/hu/hu.csv` came back `unexplained`. It is outside the gate and was not traced.

## Decisions

| Decision | By | Basis |
|---|---|---|
| Accept `row_order` | User, 2026-10-02 ("agree to all" to the batch 2 sign-off, session `2479b1c9-…`) | Recorded in `docs/parity/p5.md` |
| Remove row and distinct-code counts from README and descriptor | Orchestrator instruction (user's README counts rule) | Also dropped the stale `licence_status.decision` sentence |
| "83 of 16,020 places" (GeoNames gazetteer coverage of the járás tier) → "a small fraction of places" | Agent; kept by the orchestrator | It counts GeoNames gazetteer places, so it is volatile like row counts. The agent asked the user to confirm; the orchestrator kept it without putting the question to the user |
| README lead "all 20 counties plus Budapest" → "all 19 counties plus Budapest" | Agent; kept by the orchestrator | Matches the coverage section (19 megye + Budapest = 20 units) |
| `accuracy` wording admits undocumented values such as 3 | Orchestrator | Follow-up commit `5311ad3`, reported in the batch 2 summary |

## Transforms carried over

From `build_postal_codes_product.py`:
- `admin_code1` → ISO 3166-2:HU by adding `HU-`: GeoNames' 2-letter county code already is the ISO code (all 20 verified 2026-08-29). An unknown code is a `ProducerError`. `admin_name1` keeps the source text (e.g. pre-2020 "Csongrád").
- Literal "nan" → empty.
- `alternative_city_name` empty.
- The old asserts are now `ProducerError`s: 12-column HU rows, known county code, all 20 counties present, `admin_name2` still empty (so the járás gap gets revisited if GeoNames fills it), no float-style accuracy, unique (postal_code, place_name). No row-count assert.

## Open questions

- **Resolved (2026-10-05, pc-28e.7.60):** ATTRIBUTION.txt now says 19 counties. The counts stay for pc-hfz. Was: ATTRIBUTION.txt still says "3,571 rows" and "all 20 counties (megye) plus Budapest", which disagrees with the corrected README lead. It also cites the "16,020 populated-place entries" gazetteer figure. Left for the end-of-epic README/ATTRIBUTION sweep (pc-hfz).

## Provenance

Reconstructed 2026-10-05 from the agent transcript `2479b1c9-c4dd-47e5-be82-34ccf8d49a80/subagents/agent-ae9ed63aef9c52923.jsonl`, the orchestrator session `2479b1c9-…`, the commit messages and the bd close reason.
