Skip to content

feat: add --full flag to force a complete reconstructed-volume rebuild#17

Merged
mspinola merged 1 commit into
mainfrom
feat/producer-full-rebuild-flag
Jul 14, 2026
Merged

feat: add --full flag to force a complete reconstructed-volume rebuild#17
mspinola merged 1 commit into
mainfrom
feat/producer-full-rebuild-flag

Conversation

@mspinola

@mspinola mspinola commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Why

The reconstruction fetch in _reconstruct_volume is incremental: when the store already carries Volume_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 plain cotdata-update --prices would silently leave them wrong.

What

  • norgate.update(symbols, full=False) / _reconstruct_volume(..., full=False)full=True resets the incremental bound to epoch, forcing a from-scratch rebuild.
  • cotdata-update --full CLI flag.
  • Default (incremental) behavior unchanged.

Test: full=True issues the individual-contract fetch with start_date=1970-01-01 even when the store already has recent Volume_Reconstructed. Suite: 33 passed.

Operational follow-up

After this merges, the store must be rebuilt with cotdata-update --prices --full on 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

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>
@mspinola
mspinola merged commit ddf30d0 into main Jul 14, 2026
5 checks passed
@mspinola
mspinola deleted the feat/producer-full-rebuild-flag branch July 20, 2026 16:17
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