Review pass 7 (2026-05-18)¶
| Date | 2026-05-18 |
| Reviewed | the state three days after 0.6.0 |
| Recorded in | the release notes of 0.7.0 |
| Implemented in | 0.7.0 (2026-05-26) |
| Overview | Audit history · Changelog |
The seventh review pass was a changelog-only pass; its code fixes shipped with 0.7.0 (regression tests tests/test_audit_pass7_fixes.py). Both blocks were published in the 0.7.0 release notes.
Where this text comes from
This page was moved verbatim from CHANGELOG.md when the release notes were
condensed in 2026.11.0 (source: commit 30a122d). Only the markup was adapted:
reST roles are rendered as code or math, relative links point to the current
pages, trailing whitespace is removed, and each block stands under a heading
that names where it was published.
Paths, test names and numbers are those of the time; the code has changed since.
Findings, published in the 0.7.0 release notes¶
Fixed (Backlog — seventh 2026-05-18 review pass)¶
The seventh audit pass was run on 2026-05-18, three days after the
0.6.0release (geosubpackage + concrete-encasement model). The entries below capture new findings that emerged either as a side-effect of the 0.6.0 surface (World.concrete_shell_correctionsregistry,OsmBuildingPlacement.footprint_at,geo.osmretry contract) or that have still not been addressed through six previous audit passes (missing API pages, ADR cross-references). Only the CHANGELOG is edited in this pass; no program code is touched.
docs/api/sources.md,boundary.md,references.md,validation.md,world.mdstill missing — seventh pass in a row. The0.6.0release addeddocs/api/geo.mdfor the new OSM subpackage but did not address the five long-standing missing pages flagged in pass 1 through pass 6.groundfield.world.World,groundfield.solver.sources,groundfield.solver.boundaryandgroundfield.validationare all part of the public__all__ofsrc/groundfield/__init__.py(confirmed on 2026-05-18) and the user has no rendered API documentation for any of them. The six-pass-in-a-row finding is therefore re-elevated; without a forcing CI gate it will reappear in the eighth pass.docs/api/index.mddoes not list the newGeo / OSMpage. The rendered API-reference index enumerates Soil, Geometry, Conductors, Solver, Coupling, Postprocess, Diagnostics, IO and Generators but is missing theGeo / OSMentry that the 0.6.0mkdocs.ymlnav added (api/geo.md). Drift between API overview prose and the rendered nav appeared on the same release that landed the subpackage — straightforward bullet-list addition.World.concrete_shell_correctionsregistry has no documented cleanup contract. Re-using a singleWorldacross multipleTnNetworkGenerator.buildcalls (the canonical parameter-sweep pattern) accumulates entries from previous builds in the same dict; the0.6.0release records the registry as a publicdict[str, float]but offers neither aworld.reset_concrete_corrections()helper nor a per-build invalidation hook on the generator side. AP1 Monte-Carlo studies that flipconcrete_rho_ohm_mper realisation will carry stale shell resistances from earlier samples into later ones unless the user knows to clear the dict by hand.OsmBuildingPlacement.footprint_at(i)lacks defensive bounds checking. The current implementation indexesself.footprints[i]directly; foriout of range CPython raises a bareIndexErrorwhose message does not name the placement, the requested index, or the available range. Wrap with an explicitraise IndexError(f"OsmBuildingPlacement: requested index {i} but only {n} footprints are available; check placement.n_buildings.")so the AP1 generator pipeline produces a self-describing failure instead of an opaque traceback atTnNetworkGenerator.buildtime.geo.osm.query_buildingsretry count is hardcoded as1. The docstring promises "one retry on429/504with exponential backoff" but no parameter is exposed for users working over flaky cellular / VPN links. Promote the retry count to amax_retries: int = 1keyword onquery_buildings/query_and_project; the default preserves current behaviour.groundfield.io.groundinsight.evaluate_specValueError class is not re-exported. Pass-5 widenedevaluate_specto raiseValueErroron non-canonical free symbols (and the Pass-5 Fixed block lists this as a public-surface improvement), but downstream code that wants to catch the new exception has no named class — it has to compare againststr(exc)substrings or fall back to the broadValueErrorparent. Define anEvaluateSpecError(ValueError)subclass ingroundfield.io.groundinsightand add it to the module__all__; follow-ongroundinsightconsumers will benefit from the typed surface.Conductor.lumped_series_resistance_ohmandStripElectrode.concrete_shell_coefficient_ohm_mare not JSON-round-tripped intests/test_concrete_encasement.py. The new test file covers the V2 Sunde-shell closed-form match, the V1 registry, the discriminator and the end-to-end OSM smoke, but does not assert that aWorldwith a populatedConductor.lumped_series_resistance_ohmorStripElectrode.concrete_shell_coefficient_ohm_msurvivesWorld.model_dump_json()→World.model_validate_json(...). Add a single test case so the persistence contract is locked in before users start sharing concrete-encasement-bearing world files across runs.- ADR cross-references are one-directional.
ADR-0011(OSM building footprints) referencesADR-0009(World generators) andADR-0012(Concrete encasement) referencesADR-0003(Distributed conductor) — but the target ADRs carry no reciprocal "See also" link. A maintainer reading ADR-0003 today sees no breadcrumb to the V1 lumped path that reuses its framework; same for ADR-0009 → ADR-0011. Bidirectional ADR linking is a one-line edit per file and prevents future architectural drift. docs/concepts.mdis silent on the lumped vs. distributed Sunde-shell trade-off. The 0.6.0 release added two implementation variants (concrete_model="lumped"vs."distributed") with materially different physics (V1 records the total shell resistance and injects a series resistance on the PEN drop; V2 augments the post-kernel diagonal per segment). The user-facingconcepts.mdpage describes neither variant nor the regime where each is preferred. AP1 readers reach the ADR-0012 file as a fallback, but the canonical "Concepts" page should carry a short decision-guide table.README.mddoes not mention0.6.0features. The README Roadmap and Features sections were not updated alongside the 0.6.0 release — neither thegeoextra, theBuildingFootprint/OsmBuildingPlacementexports nor the concrete-encasement model appear in the project description. AP1 reviewers landing on the GitHub page have no signal that the OSM and concrete-encasement features exist.- Notebooks
30..33are not wired into the docs nav. All four audit / OSM / concrete-encasement notebooks exist on disk and are referenced in the 0.6.0 CHANGELOG "Docs" block, butmkdocs.ymlonly loadsdocs/examples/*.md. Themkdocs-jupyterplugin is enabled (plugins: mkdocs-jupyterblock,execute: false), so adding aNotebooks:nav section under Examples is a four-line edit. Without it the notebook walkthroughs that the 0.6.0 changelog calls out are invisible to docs-site readers.
Docs (Backlog — seventh 2026-05-18 review pass)¶
docs/index.mdMigration callout for0.6.0. A short "Migrating from 0.5.x" section under the index — listing the new optionalgeoextra, the additiveconcrete_rho_ohm_mfield onFoundationElectrodeSpec, and the no-op default — would spare users a CHANGELOG dive on upgrade. Mirror the pattern that the 0.5 release introduced for the discriminatedSourceunion.docs/quickstart.mddoes not show the new exports. The page still ends atgf.create_engine(...).solve(world); the 0.6.0 exportsgf.BuildingFootprint,gf.OsmBuildingPlacement,gf.Projector,gf.query_buildings,gf.query_and_project,gf.OverpassErrorare not introduced anywhere in the quickstart flow. A short "Optional: OSM-driven footprints" appendix would close the gap.docs/performance.mdhas nogeocost section. The on-disk Overpass cache, the projection cost and the OMBR reduction are all new performance-relevant code paths in0.6.0. AP1 readers running long Monte-Carlo sweeps over 10–100 buildings need an order-of-magnitude estimate (current local: ~ms per footprint, network: ~hundreds of ms on cold cache) and an explicit pointer at the cache directory to clear between experiments.docs/api/geo.mdlacks the offline-fallback contract. The 0.6.0 page describes the live Overpass path and the cache layer but does not state the contract of the purely offline variant — the path throughBuildingFootprint+ manual centroid placement that does not importrequests/pyproj/shapely. A "Working offline" subsection that enumerates the no-dependency code path keeps the AP1 reproducible- computation guarantee visible.docs/adr/0003-distributed-conductor-model.mdanddocs/adr/0009-world-generators.mddo not yet referenceADR-0011andADR-0012. Same finding as the bidirectional ADR cross-reference Fixed-backlog entry above.
Tests (Backlog — seventh 2026-05-18 review pass)¶
- No JSON round-trip test for
Conductor.lumped_series_resistance_ohm. Tied to the ADR-0012 V1 persistence-contract Fixed-backlog entry above. - No JSON round-trip test for
StripElectrode.concrete_shell_coefficient_ohm_m. Tied to the ADR-0012 V2 persistence-contract Fixed-backlog entry above. - No regression test for
World.concrete_shell_correctionscleanup contract. Once a per-buildreset_concrete_corrections()helper (or aTnNetworkGenerator.build(reset_shell_corrections=True)keyword) lands, pin the contract with a two-build test that asserts the second build sees a clean registry. - No regression test for
OsmBuildingPlacement.footprint_at(i)out-of-range error message. Once the bounds check lands, pin the structured error string so the message does not regress to a bareIndexError. - No timing test for the
geo.osmcache. A trivial fixture that mocks the Overpass_postboundary, asserts a single POST per(origin, radius)tuple over fivequery_buildingsinvocations and checks the cache directory carries exactly one on-disk file is a one-screen test that would lock in the ADR-0011 reproducibility guarantee. - No
mkdocs build --stricttest. Sixth-pass entry remains open; seventh pass elevates it again because the newgeo.mdpage and the still-missingsources.md/boundary.md/references.md/validation.md/world.mdpages would all be flagged by--strictimmediately. Without the CI gate, the eighth audit pass will inevitably re-list the same five-page gap.
Roadmap candidates — seventh 2026-05-18 review pass¶
gf.show_versions()— same return-shape convention as the proposedgi.show_versions()andgm-cli doctor. Sixth-pass carried this; seventh pass re-emphasises the cross-repo contract:dict[str, str]with keyspackage,python,numpy,scipy,sympy,pydantic,polars,shapely,pyproj,requests(the last three reflect the newgeoextra) plus_meta = {timestamp, platform}.gf.docs.assert_api_pages_exist()— walk__all__and assert every public symbol has at least one mkdocstrings:::directive somewhere underdocs/api/. Companion to the proposedmkdocs build --strictCI gate. Six passes have flagged the missing-API-pages problem and seven passes the forcing-function lack; this is now the highest-leverage cross-repo roadmap item.gf.World.reset_concrete_corrections()— public helper matching the ADR-0012 V1 registry. Default behaviour stays additive; the helper is opt-in for parameter sweeps. Tie to the Fixed-backlog entry above.gf.geo.OverpassCache(path, max_age_s=...)— promote the current hidden$XDG_CACHE_HOME/groundfield/osm/directory to a configurable cache object. Users running CI builds want per-job cache control; AP1 Monte-Carlo runs want to pin the cache for reproducibility.- ADR-0013 — Cross-repo
show_versionsconvention. Bundle the three-reposhow_versionsproposal into a single ADR that lives ingroundfieldand is linked fromgroundinsight/groundmeas. Five passes have proposedshow_versions; the ADR is the forcing function that pins the return shape before any of the three packages ships its own implementation.
Released in 0.7.0 (2026-05-26)¶
Added (Audit pass 7 — implemented 2026-05-18)¶
groundfield.io.groundinsight.EvaluateSpecError— new typed exception (subclass ofValueError) raised byevaluate_specon malformed spec input. The class is re-exported at the top level asgroundfield.EvaluateSpecErrorand listed ingroundfield.__all__. Legacyexcept ValueErrorblocks keep working unchanged because the new class inherits fromValueError; downstreamgroundinsightconsumers can now catch the typed exception without greppingstr(exc)(closes the seventh 2026-05-18 audit pass "no named class for evaluate_spec failures" bullet).groundfield.World.reset_concrete_corrections()— explicit cleanup helper for the ADR-0012 V1 concrete-shell registry (world.py). Re-using a singleWorldacross multipleTnNetworkGenerator.buildcalls — the canonical AP1 Monte-Carlo pattern overconcrete_rho_ohm_m— previously accumulated stale entries in the publicWorld.concrete_shell_correctionsdict. The new method clears the registry and returns a shallow copy of the dropped entries, so callers can inspect or log them. Calling on a fresh world is an idempotent no-op. Closes the seventh 2026-05-18 audit pass "registry has no documented cleanup contract" bullet.OsmBuildingPlacement.footprint_at(i, strict=...)— opt-in defensive bounds check (geo/placement.py). Defaultstrict=Falsepreserves the v0.6.0 "out-of-range →None" contract thatTnNetworkGenerator.buildrelies on;strict=Trueraises a self-describingIndexErrorthat names the placement, the requested index, the filtered footprint count (aftermin_area_m2) and the raw list length. The placement also exposes a newOsmBuildingPlacement.n_footprintsproperty identical tolen(placement)so consumers can pre-flightiwithout invoking the dunder. Closes the seventh 2026-05-18 audit pass "footprint_at lacks defensive bounds checking" bullet.groundfield.geo.osm.query_buildings(..., max_retries=N)andquery_and_project(..., max_retries=N)— promote the previously hard-coded1retry to a keyword (geo/osm.py). Defaults to1, matching the historic v0.6.0 contract; users on flaky cellular / VPN links can raise it, CI pipelines that prefer fail-fast semantics can set0.max_retries < 0is rejected at the API boundary with a clearValueError. The module docstring and the_post_overpassinternal docstring are updated to match. Closes the seventh 2026-05-18 audit pass "retry count hardcoded as 1" bullet.
Tests (Audit pass 7 — implemented 2026-05-18)¶
tests/test_audit_pass7_fixes.py— 14 regression tests mapped 1:1 to the user-visible bullets above:EvaluateSpecErroris aValueErrorsubclass, is raised on missing / empty / unknown-symbol formulas, and is reachable from the top level (4 tests);World.reset_concrete_correctionsclears the registry, returns a defensive copy of the previous state, and is idempotent on a fresh world (3 tests);OsmBuildingPlacement.footprint_atkeeps the historicNonedefault, raises a structuredIndexErrorunderstrict=True(negative and out-of-range indices), the message carries the expected diagnostic tokens, and the newn_footprintsproperty trackslen(placement)aftermin_area_m2filtering (4 tests);query_buildingsaccepts and forwardsmax_retries, rejects negative values, defaults to1, andquery_and_projectexposes the same keyword on its signature (3 tests).
Notebooks (Audit pass 7 — implemented 2026-05-18)¶
notebooks/34_audit_pass7_fixes.ipynb— narrative walk-through of the four behaviour changes, one short section per fix. The notebook runs offline (no Overpass call) and uses synthetic footprints for the placement demo.
Docs (Audit pass 7 — implemented 2026-05-18)¶
docs/api/world.md,docs/api/sources.md,docs/api/boundary.md,docs/api/validation.md,docs/api/references.md— the five long-standing missing API-reference pages (flagged from pass 1 through pass 6) now exist as mkdocstrings stubs that render the module-level public surface. Wired intomkdocs.ymlnav under API reference. Closes the seven-pass-in-a-row backlog bullet.docs/api/index.md— the API-reference index now lists theGeo / OSMpage that was added in 0.6.0 but missing from the rendered index, alongside the five newly-added pages.docs/api/io.md— adds an "Errors" subsection that documents the newEvaluateSpecErrorclass and the typed-exception contract for downstreamgroundinsightconsumers.