Port the Norgate producer tests §7.1 left behind - #13
Merged
Conversation
§7.1 brought the provider across from cotdata but not its tests. The suite here covers what is a pure function -- _finals_ready_by_date, _check_roll_gaps, _volume_passthrough, _targets -- and, since #12, the finals gate end to end. What nothing covered is the code that only runs when update() drives it. cotdata still had those tests, so the gap was invisible until §7.5 went to delete them: that deletion is the moment the behaviours stop being tested anywhere. Ported, adapted to the tier-aware store (write_bars(sym, df, domain=, source=, tier=) where cotdata had write_prices(sym, tier, df, source=)): * reconstruction attaches its columns without disturbing front-month Volume * First/Second are picked by VOLUME RANK, not expiry order (the GC/SI case) * an incremental run keeps rows it did not re-fetch, including 'raw' ones * full=True really does bypass the trailing window, checked at the fetch * update() writes both stored tiers, from the right suffixed symbols * update()/update_metadata() abort BEFORE any fetch when NDU is down * an all-null spec row is skipped rather than persisted Two go beyond a straight port, both because a guard that fails open is worse than no guard. The NDU probe raising is now asserted to read as unreachable, and the finals gate is asserted to compare dates whatever form it is handed -- its two sides arrive as a datetime and a manifest string, which is an input-shape case test_cli_finals.py does not reach because it drives the gate already normalised. Scoped with symbols=["ES"] against the real registry rather than a mocked all_symbols, so the tests drive the same selection path production does. ruff clean, 152 pass and 12 skip (141 + the 11 here).
mspinola
force-pushed
the
claude/require-final-gate
branch
from
August 9, 2026 13:41
1654b22 to
84a3417
Compare
mspinola
marked this pull request as ready for review
August 9, 2026 13:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
§7.1 brought the Norgate provider across from cotdata but not its tests. The suite here covers what is a pure function —
_finals_ready_by_date,_check_roll_gaps,_volume_passthrough,_targets— and, since #12, the finals gate end to end. Nothing covers the code that only runs whenupdate()drives it.cotdata still had those tests, so the gap was invisible. It surfaced when cotdata#105 (ADR-0007 §7.5) went to delete them: that deletion is the moment these behaviours stop being tested anywhere.
A file-count check would have missed this entirely. The test files existed on both sides. Diffing the test names gave zero overlap across 30 deleted tests — which reads like a naming difference and was, underneath, a real coverage gap.
What is covered now
Volumerawfull=Truereally does bypass the trailing window — checked at the fetch, which is what proves itupdate()writes both stored tiers, from the right suffixed symbols (&ES_CCBthen&ES)update()/update_metadata()abort before any fetch when NDU is downTwo that go beyond a straight port
Both because a guard that fails open is worse than no guard:
norgatedatafails in unusual ways; a probe that blows up must not be read as a pass.test_cli_finals.py, which drives the gate with those already normalised.Notes
Scoped with
symbols=["ES"]against the real registry rather than a mockedall_symbols, so the tests drive the same selection path production does.norgatedatais mocked intosys.modules, so this runs on any OS.Verification
ruff check src tests scriptsclean.MARKETDATA_NO_NETWORK=1 pytest tests/— 152 passed, 12 skipped (141 onmain+ the 11 here).