Skip to content

S2 — Write the role & seams orientation doc #72

Closed

Description

@Polichinel

Epic: #70 · S2 · documentation · depends on #71

Background

The single highest-value gap: no document explains the repo's role relative to the platform, or its internal seams. The accurate picture currently lives only in register C-40, code docstrings, and a views-models postmortem. This story creates the orientation doc a newcomer should read first — the one that would have prevented the un_fao postmortem's multi-attempt investigation.

Work

Create docs/architecture/role_and_seams.md (final path per S1) covering:

  • Platform topology: datafactory (producer) → pipeline-core (framework) → views-postprocessing (post-forecast delivery) → views-faoapi (serving API). Dependency direction is one-way down; pipeline-core does not import vpp (verified: 0 imports; the only mentions are comments asserting no cycle).
  • What vpp is: it is-a pipeline-core postprocessor — subclasses PostprocessorManager + ForecastingModelManager (Template Method; execute() lives in the base and calls back into vpp's _read/_transform/_validate/_save). It fills the post-forecast lifecycle slot with delivery + input-integrity, not statistics. Statistics live downstream: collapse in faoapi (views_frames_summarize); reconciliation in views_frames_reconcile.
  • The seams:
    • views_postprocessing/delivery/ = representation-free invariants (primitives only) ↔ views_postprocessing/unfao/extraction.py = the pandas seam that feeds them. The manager calls the invariants, never inherits them.
    • the inherited pandas base (ViewsDataLoader, PGMDataset) and the C-40 gate — why a frame can't go end-to-end yet.
    • the draws / uncertainty contract: vpp must carry (N, S) samples uncollapsed; collapse happens once, downstream (FAO delivery path is point/DataFrame-based — won't carry rusty_bucket's pooled draws #45). Contrast the native (N, S) frame vs pandas object-dtype list-in-cell.
  • A simple diagram of the read → enrich → validate → clip → save flow and where each seam sits.

Acceptance criteria

Validation / testing

  • Cross-check every structural claim against code: unfao/managers/unfao.py (inheritance + stages), delivery/ + unfao/extraction.py (the seam), register C-40.
  • The S6 guardrail will later assert this doc has no deleted-symbol references and no dead links.

Dependencies

  • Depends on S1 (IA decides this doc's path + responsibility). Blocks S3 and S4 (they link/align to it).

Notes

  • Source material already written: register C-40, the un_fao pre/post-run postmortems (views-models reports/un_fao_delivery_*_postmortem.md), and this epic's investigation.

Activity

  1. added
    documentation
    story
    on Jun 27, 2026
  2. added a commit that references this issue on Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationstory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions