feat: add --full flag to force a complete reconstructed-volume rebuild#17
Merged
Conversation
The reconstruction fetch is incremental: when the store already carries Volume_Reconstructed, it only recomputes a trailing 60-day window. That's right for nightly data updates but wrong after a reconstruction *logic* change — the by-volume-rank fix — which needs every historical row recomputed. A plain `cotdata-update --prices` would leave old rows (e.g. GC's understated history) on the previous algorithm. Add full=True to norgate.update / _reconstruct_volume and a --full CLI flag that resets the incremental bound to epoch, forcing a from-scratch rebuild. Default behavior (incremental) is unchanged. Test: full=True issues the individual-contract fetch with start_date=1970-01-01 even when the store already has recent Volume_Reconstructed. Operational note: after the by-rank fix, the store must be rebuilt with `cotdata-update --prices --full` on the Windows/norgatedata producer before consumers see corrected volume. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The reconstruction fetch in
_reconstruct_volumeis incremental: when the store already carriesVolume_Reconstructed, it only recomputes a trailing 60-day window (right for nightly data updates). After the by-volume-rank fix (#16), that's not enough — every historical row must be recomputed under the new algorithm, or old rows (e.g. GC's understated history) stay on the previous logic. A plaincotdata-update --priceswould silently leave them wrong.What
norgate.update(symbols, full=False)/_reconstruct_volume(..., full=False)—full=Trueresets the incremental bound to epoch, forcing a from-scratch rebuild.cotdata-update --fullCLI flag.Test:
full=Trueissues the individual-contract fetch withstart_date=1970-01-01even when the store already has recentVolume_Reconstructed. Suite: 33 passed.Operational follow-up
After this merges, the store must be rebuilt with
cotdata-update --prices --fullon the Windows/norgatedata producer before consumers see corrected volume. Then re-run the flow-engine regression to confirm GC's rec/front ratio recovers toward >= 1.0.🤖 Generated with Claude Code