Skip to content

feat(frames): dense-grid fill primitive — reindex_fill + cartesian + conformance law (ADR-026) → v1.10.0 - #204

Merged
Polichinel merged 1 commit into
developmentfrom
feat/dense-grid-fill
Jul 27, 2026
Merged

feat(frames): dense-grid fill primitive — reindex_fill + cartesian + conformance law (ADR-026) → v1.10.0#204
Polichinel merged 1 commit into
developmentfrom
feat/dense-grid-fill

Conversation

@Polichinel

Copy link
Copy Markdown
Contributor

Closes #203.

What

The structural dense-grid fill primitive the faoapi ingestion edge is blocked on (views-platform/views-faoapi#242; receipt: faoapi dense_grid.py:3"views-frames has no fill primitive"). Design reviewed via an 8-lens expert review before implementation (verdict: sound, three amendments adopted — keyword-only fill_value, duplicate-input validation in cartesian, the published law).

  • frame.reindex_fill(other, *, fill_value) on all three sibling frames (WET per ADR-011): align to a target index with no superset requirement — present rows pass through bit-exact, absent rows get the caller's fill (keyword-only + required, ADR-009; NaN legal). The result's index is the target (shared, immutable). Owns the -1-sentinel scatter once — a consumer hand-rolling values[pos] silently picks the last row for absent cells (the silent-corruption class this leaf exists to remove).
  • SpatioTemporalIndex.cartesian(times, units, level): canonical time-major dense product index from explicit arrays only (faoapi's last-step-entity rule + C-87 check stay consumer-side); fails loud on duplicated inputs (a duplicated product input manufactures duplicate rows → undefined joins, C-21).
  • assert_reindex_fill_law in the published conformance suite (ADR-016): result index == target row-for-row; present rows bit-exact; absent rows == fill (NaN-safe); superset ⇒ degenerates to reindex.

Governance

ADR-026 (incl. rejected alternatives: reindex mode-kwarg [D-09 precedent], index-only, decline, derivation rule [C-52 camel's nose]); 4 CIC updates; ADR index + README banner/chronicle + CHANGELOG [1.10.0]; register: C-71 new (grid-scale allocation awareness, Tier 3), C-21 inheritance note, C-32 stale tip_mass residual corrected to 0.25. Additive MINOR under ADR-018; CONFORMANCE_FLOOR stays 1.0.0.

Verification

  • ruff check clean; mypy src/ strict green on 3.10 and 3.11
  • pytest --cov --cov-fail-under=100: green, 100% line+branch (27 new tests: green/beige/red incl. NaN fill, empty self/target, duplicate targets, level mismatch, and 3 adversarial lying-implementation tests for the law per C-51)
  • validate_docs.sh PASSED (banner guard v1.10 ~ 1.10.0 OK)

Secondary ask from #203 (confirm select/reindex/cross_level_align cover the FAO joins): confirmed — the only genuine structural gap was the fill itself; no other primitive added. faoapi's delegation + pandas removal is verified consumer-side in faoapi #242 (never from this repo).

🤖 Generated with Claude Code

…assert_reindex_fill_law (ADR-026, #203) → v1.10.0

Adds the structural dense-grid fill the faoapi ingestion edge is blocked on
(faoapi #242; receipt: dense_grid.py:3 'views-frames has no fill primitive'):

- frame.reindex_fill(other, *, fill_value) on all three siblings (WET,
  ADR-011): align with NO superset requirement — present rows bit-exact,
  absent rows filled (keyword-only, required; NaN legal); result index IS
  the target; owns the -1-sentinel scatter once (a hand-rolled values[pos]
  silently picks the last row for absent cells).
- SpatioTemporalIndex.cartesian(times, units, level): time-major dense
  product index, explicit arrays only (derivation rules stay consumer
  policy); fails loud on duplicated inputs (C-21).
- assert_reindex_fill_law joins the published conformance suite (ADR-016).
- Governance: ADR-026 (+ rejected alternatives: reindex mode-kwarg,
  index-only, decline), 4 CIC updates, register C-71 (grid-scale
  allocation awareness) + C-21 inheritance note.

Additive MINOR per ADR-018; CONFORMANCE_FLOOR stays 1.0.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit a4f2279 into development Jul 27, 2026
7 checks passed
@Polichinel
Polichinel deleted the feat/dense-grid-fill branch July 27, 2026 16:40
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.

Add a dense-grid fill primitive (unblocks pandas-free FAO ingestion)

1 participant