Skip to content

feat(wire): S4/#109 — §5 GAUL sidecar builder + delivery/parity invariant#119

Merged
Polichinel merged 2 commits into
developmentfrom
feat/hop-b-s4-sidecar
Jul 20, 2026
Merged

feat(wire): S4/#109 — §5 GAUL sidecar builder + delivery/parity invariant#119
Polichinel merged 2 commits into
developmentfrom
feat/hop-b-s4-sidecar

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Story S4 of epic #105.

What

  • unfao/wire/sidecar.pybuild_sidecar(lookup, gids) / write_sidecar(...) -> (name, sha256): pyarrow-only; lookup injected (DIP); restricted to the declared gid set, absent gid fails loud (§5.2 — geography never silently vanishes); 10 columns with priogrid_id first; *_code always float64, missing codes as NaN values (canonical-byte match); dictionary strings flattened; ascending rows. Column SSOT: gaul_schema.
  • delivery/parity.pyassert_gid_set_parity (§5.2), pandas-free, names missing/extra gids; lands under the existing delivery/ design-contract enforcement automatically.

AC (all met)

  • Synthetic lookup shaped like the REAL one (int64+null codes, dictionary strings) → output byte-equals the fixture sidecar; sha matches.
  • Real gaul_lookup.parquet property tests: pinned schema, float64 codes, plain strings, subset+ascending.
  • Parity raises naming offenders both directions.
  • Suite green: 229 passed. (One bug caught by the byte oracle during dev: coords were being cast to string — exactly the class of error §10 exists to catch.)

Closes #109. Epic #105 · Tracking #114.

🤖 Generated with Claude Code

Polichinel and others added 2 commits July 20, 2026 02:07
build_sidecar: pyarrow-only, lookup injected (DIP — production passes the
ADR-011 gaul_lookup table, tests inject synthetic); restricted to the declared
forecast gid set with absent-gid fail-loud (§5.2 direction); 10-column pinned
schema with priogrid_id as a real first column, *_code always float64 with
missing codes as NaN VALUES (matching canonical bytes), dictionary strings
flattened, rows ascending. Column lists come from gaul_schema (SSOT), never
restated. delivery/parity.py: assert_gid_set_parity names the symmetric
difference; separate file from coverage.py (different closure: wire contract
vs region product).

Byte parity proven against the fixture sidecar via a synthetic lookup shaped
like the REAL one (int64-with-null codes, dictionary strings) — proving the
casts, not echoing the output.

Part of epic #105. Closes #109.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit 7c12fd1 into development Jul 20, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/hop-b-s4-sidecar branch July 20, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant