Skip to content

ADR-011 assessment and D-06 resolution#19

Merged
Polichinel merged 3 commits into
developmentfrom
feature/adr-011-precomputed-lookup
Jun 4, 2026
Merged

ADR-011 assessment and D-06 resolution#19
Polichinel merged 3 commits into
developmentfrom
feature/adr-011-precomputed-lookup

Conversation

@Polichinel
Copy link
Copy Markdown
Collaborator

Summary

Documentation-only PR. No source code changes. Adds the ADR-011 implementation assessment and resolves the D-06 schema question.

ADR-011 Implementation Assessment (docs/ADR-011_implementation_assessment.md)

Comprehensive analysis of what's needed to replace the runtime mapper with a precomputed lookup table:

  • What we know: algorithm verified correct (falsification campaign Layer 2), FAO contract confirmed (area-majority), datafactory has centroid-based GAUL data, views-faoapi passes columns through unmodified
  • What we don't know: never seen the full pipeline run with real data (no LFS, no Appwrite, no views-pipeline-core in test env)
  • Complete data flow diagrams for both historical (datafactory → postprocessor → Appwrite → views-faoapi → FAO) and forecast (Appwrite prod_forecasts → postprocessor → Appwrite unfao → views-faoapi → FAO) streams
  • 4 approaches analyzed with pros/cons: precompute in repo, add to datafactory, use centroid from factory, hybrid
  • Recommendation: build alongside (don't replace), verify on real data before switching

D-06 Resolution

Investigated views-faoapi code. Definitive finding: views-faoapi does NOT rename columns. The postprocessor's country_iso_a3, admin1_gaul1_code, pg_xcoord reach FAO as-is via dataframe_to_dict(). The column renaming from Release Note 01 Topic C (UN M49, ADM1_CODE, lat) was never implemented in any repo. This is a real schema gap, but it belongs in views-faoapi to fix, not here.

Risk Register Updates

  • D-06 moved to Resolved Disagreements with definitive evidence
  • C-24 updated with D-06 findings: gap is real, fix belongs in views-faoapi

GitHub Issues Created

9 issues (#10-#18) covering every actionable risk register concern:

Test plan

  • No source code changes — documentation only
  • All 88 tests still pass (no code modified)
  • Risk register counts verified
  • Every open register concern mapped to a GitHub issue or contingent on ADR-011

🤖 Generated with Claude Code

Polichinel and others added 3 commits June 3, 2026 16:40
Documents what we know vs don't know, the core risk (can't verify
output without LFS/Appwrite/views-pipeline-core), 4 prerequisites
for safe implementation, and 4 possible approaches with pros/cons.

Recommendation: build alongside (additive), don't replace, verify
with real data before switching. Or wait for infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major additions:
- views-faoapi identified as the Appwrite-to-FAO bridge (answers D-06)
- Complete data flow diagrams for both historical and forecast streams
- Forecast stream is completely independent of datafactory — mapper needed for both
- Viewser-to-datafactory migration history and nokgi semantic difference
- orange_ensemble ghost reference (views-models #77)
- Option C (factory GAUL columns) doesn't solve the forecast stream
- Option D (hybrid) creates inconsistency between historical and forecast
- Cross-repo risk register entries affecting this repo
- Recommendation: read views-faoapi first, build alongside second

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rmed

Investigation of views-faoapi confirms:
- FAOApiManager passes postprocessor columns through unmodified
- dataframe_to_dict() serves raw records, no renaming
- FAO_PGMDataset._METADATA_COLS hardcodes postprocessor column names
- The column renaming from RN01 Topic C was never implemented
- FAO receives country_iso_a3, admin1_gaul1_code, pg_xcoord —
  NOT the contract-specified UN M49, ADM1_CODE, lat

D-06 resolved as Possibility B: genuine gap, not this repo's fix.
C-24 updated: renaming belongs in views-faoapi, not postprocessor.
Assessment document Section 7 rewritten with definitive findings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Polichinel Polichinel merged commit 03669cb into development Jun 4, 2026
3 of 4 checks passed
@Polichinel Polichinel deleted the feature/adr-011-precomputed-lookup branch June 4, 2026 09:05
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