Spaces:
Sleeping
Sleeping
Commit History
-
test: use production period and period_basis shapes in the consensus fixtures
Four rulings on this branch trace to fixtures that were self-consistent but did not match production. Two instances survived: - tests/test_forecast_store.py wrote period_basis "quarterly"; production (ingestion/edgar.py:547) writes "quarter". Ruling 4 already established that the wrong vocabulary would have kept the gate shut forever. - period labels of shape "2027Q3" throughout the new consensus tests, where production writes "Q32027". Ruling 5 and Ruling 10 both had to correct this same shape in real code. Neither is a false pass today: the gate does pure string equality and both sides of each fixture carried the same wrong shape. That is precisely what makes them dangerous -- add label parsing to the gate later and these keep passing against a shape production never emits. Also swept the annual fixture's bare "2027" to "FY2027", the label production actually writes for a 10-K row. The paragraph in test_next_period.py's docstring rationalising the divergence is deleted ra…b83f15d -
fix: derive snapshot period_basis from provider code, match reported vocabulary
Three review findings on the live-snapshot capture: - Move the storage.forecast_store import inside the try block so record_consensus_snapshot's "never raises" docstring promise actually covers every line of the function. - Stop hardcoding period_basis="quarterly". ingestion/edgar.py:547 writes "annual"/"quarter" on the reported side, so the mismatched vocabulary made analytics/consensus.py's period_basis equality check fail on every single record, permanently defeating the alignment gate this sub-project exists to open. - Derive period_basis per metric from that metric's own provider_period_code ("0q"/"+1q" -> "quarter", "0y" -> "annual", anything else or missing -> None) instead of assuming quarterly regardless of which period yfinance actually returned. A None period_basis is archived, not dropped -- it fails closed at the gate on its own. Also corrects the Task 2 fixture in tests/test_consensus_alignment.py, which built both sides of the comparison with the sa…ab6771b -
feat: add fail-closed consensus alignment gate
481f37b