Skip to content

docs(adr): S6 — the ontology describes the code, and the claims are now checked - #164

Merged
Polichinel merged 1 commit into
developmentfrom
feat/s6-correct-ontology-docs
Aug 1, 2026
Merged

Polichinel merged 1 commit into
developmentfrom
feat/s6-correct-ontology-docs

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Closes #154 · Epic #148 · Register C-67 closed

The problem

ADR-012 is what a clone's authors will read as the specification. Two of its claims were false, and both described exactly the structures a clone must decide about:

claim reality when written
"the thin UNFAOPostProcessorManager" 636 lines holding two of everything
"the single pandas-aware module (unfao/extraction.py)" pandas in three modules

Both drifted the same way: the ADR described where a migration was going, the migration stopped one step short, and nobody re-read it.

Both are true again — but that is not the fix

Manager is 406 lines; pandas has exactly one importer (contract/enrichment.py). Being true is not the fix. Being checkable is.

Rewritten

  • ADR-012's ontology table against the three-package structure, each category naming the package it lives in — plus new rows for the wire mechanism, artifact builders, external facts, launch declarations and the partner product, categories that existed in code but not in the ontology.
  • ADR-002's layering illustration, which still named unfao/extraction.py as the seam (deleted in S3 — Collapse the two extraction seams into one #151), plus the one-way dependency rule unfao/ → contract/ → delivery/.
  • The manager CIC, which documented _historical_dataframe, LEGACY_FORECAST_FILTERS and a ForecastIdentityError that no longer exist.

Corrections are marked in place, so a reader of the old claims can see what changed and when.

Four guards, each mutation-tested

tests/test_doc_accuracy.py now checks: pandas has exactly one importer · views_pipeline_core has exactly one importer (the property keeping C-40's blast radius one file wide) · the manager stays under 450 lines · contract/ does not import the partner.

I introduced a deliberate violation for each and confirmed it fails, then reverted:

+ from views_postprocessing.unfao import product   → test_contract_package_does_not_import_the_partner  FAILED
+ import pandas as pd                              → test_pandas_has_exactly_one_importer               FAILED

A doc test that cannot fail is not a test, and this repo has now been bitten twice by prose nobody could verify. Same remedy that closed the C-48–C-55 ADR-013 series.

Verification

ruff clean · 301 passed, 41 xfailed · the 5 failures are the known local pyarrow byte-parity tests; CI authoritative.

Register: 71 concerns, 26 open, 45 resolved.

🤖 Generated with Claude Code

…ow checked

Closes #154; closes register C-67. Epic #148.

ADR-012 twice described an intended end state as if it were the code: it called
the manager 'the THIN UNFAOPostProcessorManager' when it was 636 lines holding
two of everything, and 'the SINGLE pandas-aware module (unfao/extraction.py)'
when pandas lived in three. Both drifted the same way — the ADR described where a
migration was going, the migration stopped one step short, and nobody re-read it.

Both claims are true again (manager 406 lines; pandas has exactly one importer,
contract/enrichment.py). But being true is not the fix — being CHECKABLE is.

Rewritten:
- ADR-012's ontology table, against the three-package structure, with each
  category naming the package it lives in. New rows for the wire mechanism,
  artifact builders, external facts, launch declarations and the partner product
  — categories that existed in code but not in the ontology.
- ADR-002's layering illustration, which still named unfao/extraction.py as the
  seam (deleted in #151), plus the one-way dependency rule the split establishes.
- The manager CIC, which documented _historical_dataframe, LEGACY_FORECAST_FILTERS
  and a ForecastIdentityError that no longer exist.

Four guards added to test_doc_accuracy.py: pandas has exactly one importer,
views_pipeline_core has exactly one importer (the property that keeps C-40's
blast radius one file wide), the manager stays under 450 lines, and contract/
does not import the partner.

Each was MUTATION-TESTED — a deliberate violation introduced and confirmed to
fail, then reverted. A doc test that cannot fail is not a test, and this repo has
now been bitten twice by prose nobody could verify.

The corrections are marked in place rather than quietly applied, so a reader of
the old claims can see what changed and when.

ruff clean; 301 passed, 5 known local pyarrow byte-parity failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit 71f0d33 into development Aug 1, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/s6-correct-ontology-docs branch August 1, 2026 00:52
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