Repository navigation
Description
Epic: #85 · S6 · [CROSS-REPO-GATED] · blocked · depends on #88, faoapi #45, register C-40
Background
This is the step that actually propagates (N,S) to FAO. Today _save writes object-dtype df.to_parquet (unfao.py:298,309) to Appwrite, and views-faoapi reads it (pd.read_parquet → to_array_columns decodes object-dtype cells → numpy → build_prediction_frame). The forecast parquet is a wire contract vpp cannot change unilaterally.
Work (gated — coordinated two-sided cutover)
- vpp
_save: emit the forecast as a views-frames arrow sample-frame (views_frames.io.arrow.save— flat columnartime/unit/sample/value) instead of object-dtype parquet. - views-faoapi: ingest via
arrow.load→PredictionFrameinstead ofpd.read_parquet→to_array_columns→build_prediction_frame.
Acceptance criteria
- Forecast delivery carries
(N,S)uncollapsed as an arrow sample-frame; faoapi reconstructs thePredictionFrame. - On S=1 inputs the reconstructed output is identical to today's point delivery (regression).
- Cutover is coordinated (faoapi can read the new format before vpp stops writing the old).
Parity / validation
Dual-write / golden-file during cutover: emit both legacy object-dtype parquet and the arrow sample-frame; assert faoapi's reconstructed PredictionFrame is array-equal from both. S1's conformance harness is the shared contract both repos test against.
Dependencies / gate
Blocked on: S3 (interior already a PredictionFrame), faoapi #45 (consumer half + ADR-046 amendment), and register C-40. Never change the emitted wire before faoapi can read it.
Files
views_postprocessing/unfao/managers/unfao.py (_save); coordinated changes in views-faoapi (tracked there). Target API: views_frames.io.arrow.
Review amendment (expert-code-review, 2026-06-28) — wire I/O behind a sink adapter
Emit the arrow sample-frame through a small delivery sink adapter the manager _save calls, not inline to_parquet/arrow.save in the method.
- Why: same SRP/DIP reason as S3 (S3 — forecast convert-at-the-door (internal PredictionFrame) #88) — keep representation/I/O out of the manager god-method (register C-40 thin-shell). The sink adapter is the symmetric counterpart to S3's source adapter.
- Acceptance criteria addition:
- Outbound arrow serialization lives behind a delivery sink adapter;
_savecalls it.
- Outbound arrow serialization lives behind a delivery sink adapter;
Activity
docs(risk-register): cross-link C-40 to the pandas-migration epic (#85)
Polichinel commentedon Jul 2, 2026
Scope update per the wire contract (views-platform/views-models#149 (comment: Sampled-Forecast Wire Contract v1, 2026-07-03)): the gate on faoapi is now bounded by a ratified format.
views_frames.io.arrowfile per (target, month) — per-month sharding is mandated (a single-file full-draw artifact is ~9.5 GB/target andarrow.loadhas no mmap; sharding is the mitigation on both counts).views_framesKV header's openmetadatadict (frame_type,sample_count,dtype,spatial_level,target,sharding, provenance).delivery/draws.py(§6) runs before every upload here.docs(risk-register): C-40 — wire contract v1 posted; S6/#45 circular …
docs(wire-contract): v1.3 DRAFT — author's post-reconciliation verifi…
Polichinel commentedon Jul 15, 2026
Contract ADOPTED as ADR-013 (views-postprocessing/docs/ADRs/013_sampled_forecast_wire_contract.md); see the adoption comment on views-platform/views-models#149 (2026-07-15). This story (S6, the sink adapter) is now spec'd by §4: per-(target,month) arrow shards, the run manifest last (§4.2, one per run spanning targets), the geo sidecar (§5), store documents under the pinned
name(§4.1a — note the explicit obligation: the forecast document's name changes from ensemble-name to the pinned consumer name in this leg), after the §6draws.pypolicy gate. Still gated on #88 (S3) and coordinated with faoapi#100 — but the format question this story was blocked on is settled.docs(adr-013): §4.2a — recommended home for the target-set config (co…
docs+test(adr-013): proceed-safety audit — upload-disabled-by-default…
Polichinel commentedon Jul 19, 2026
Superseded by epic #105 (ADR-013 Hop-B sink leg). This issue's scope — forecast outbound as a views-frames arrow wire behind a sink adapter — is carried, refined, and extended there (per-month shards #108, run manifest #110, sidecar #109, composed sink + §6 gate + upload interlock #112), per the adopted contract
docs/ADRs/013_sampled_forecast_wire_contract.md§4. The blockers recorded here are restructured: the faoapi format question is settled by ADR-013; live upload is gated on faoapi C-161 (production deploy), enforced in code by the upload-disabled-by-default interlock. Closing.🤖 Generated with Claude Code