Skip to content

Land Norgate volume reconstruction + schema-v2 promotion on main#11

Merged
mspinola merged 3 commits into
mainfrom
feat/norgate-volume-reconstruction
Jul 14, 2026
Merged

Land Norgate volume reconstruction + schema-v2 promotion on main#11
mspinola merged 3 commits into
mainfrom
feat/norgate-volume-reconstruction

Conversation

@mspinola

Copy link
Copy Markdown
Owner

Lands the full Norgate volume reconstruction + schema-v2 promotion feature on main. These changes have been sitting on feat/norgate-volume-reconstruction (PR #10 merged the promotion into this branch, not into main), so main still has SCHEMA_VERSION = 1 and no volume= / schema_version() API.

⚠️ Why this is urgent

The consumers are already on their mains and depend on this API:

  • cot-analyzer main calls cotdata.get_prices(volume='reconstructed') and cotdata.schema_version().
  • Until this merges, cotdata main ↔ consumer main is inconsistent — a fresh checkout/install of cotdata main breaks both consumers (get_prices() has no volume= kwarg; schema_version doesn't exist).

Merging this restores consistency.

What's in it (3 commits)

  • Additive Norgate volume reconstruction (First/Second contract, point-in-time, Volume_Reconstructed / Volume_Source).
  • Schema-v2 promotion: get_prices(volume="front"|"reconstructed") intent view, schema_version() / require_schema(), SCHEMA_VERSION 1 → 2, docs + tests (31 passed).

After merge

Run a full norgate.update() producer pass (Windows) to re-write the store so manifest.json actually carries schema_version: 2. Until then schema_version() reads 1 and consumers behave exactly as pre-v2 (safe).

🤖 Generated with Claude Code

mspinola and others added 3 commits July 14, 2026 09:57
…sors)

Deliberate, versioned promotion of the additive reconstruction columns to a
usable default — kept separate from the additive commit so the default-changing
step is visible, not silent.

- get_prices(volume="front"|"reconstructed"): "front" (default) is byte-identical
  to the pre-v2 API; "reconstructed" serves reconstructed-with-per-row-raw-fallback
  in Volume plus a Volume_Source audit column. The fallback policy lives once, in
  the data layer, instead of being re-derived at every consumer call site.
- schema_version()/require_schema(): expose the manifest schema so consumers key
  cache invalidation on a real token instead of a column-presence heuristic.
- SCHEMA_VERSION 1 -> 2. Store is not actually v2 until a full producer pass
  re-writes it; see docs/plan_promote_reconstructed_volume.md for rollout order.
- README schema note; tests for the view, fallback, and schema guard (31 passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Promote reconstructed volume via schema v2 (intent view + accessors)
@mspinola
mspinola merged commit 14df8f6 into main Jul 14, 2026
4 of 5 checks passed
@mspinola
mspinola deleted the feat/norgate-volume-reconstruction branch July 14, 2026 16:13
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