Skip to content

docs(0286): re-price the coarse history after the 1m drain - #353

Merged
karczuRF merged 3 commits into
developfrom
docs/0286_coarse-reprice-step-in-runbook
Sep 25, 2026
Merged

karczuRF merged 3 commits into
developfrom
docs/0286_coarse-reprice-step-in-runbook

Conversation

@karczuRF

Copy link
Copy Markdown
Collaborator

What

Adds step 7b-2 to docs/runbooks/0286-reingest-history.md. It re-prices the coarse history after the phase-3 re-ingest.

Why

After phase 3, every re-ingested row has close_usd = 0. The enrichment worker re-prices price_ohlcv_1m only. The coarse sweep covers only the last two months. That means every 15m/1h/4h/1d/1w/1M row older than two months would stay at zero for good.

How

The step runs the existing coarse-repair tool in its normal fill-the-zeros mode, with no reset flags, over the whole history on all six coarse tables. The runbook orders it like this:

  • It starts once the 1m drain is finished (frontier gauge at 0).
  • A dry run comes first.
  • It runs one table at a time, from fine to coarse.
  • A per-tier after-check counts the remaining zero rows older than two months and splits them by cause: reachable_left must be ~0, and every other column is an explained residue.

It also updates acceptance item 5 in §8 to cover the coarse tiers.

Docs only. No code changes.

Enrichment prices only price_ohlcv_1m and the coarse sweep looks back two
months, so after phase 3 every coarse row older than that kept
close_usd = 0. Add step 7b-2: a full-range plain coarse-repair over all six
coarse tables once the 1m drain is finished, with a dry run first and a
per-tier after-check that splits the remaining zeros by cause.
karczuRF added a commit that referenced this pull request Sep 25, 2026
Runbook §7b-2 (PR #353) re-prices all six coarse tiers after the 1m drain. 0286 gains the per-tier criterion; 0148 is archived as completed.
Steps 3 and 5 and the drill-down ran as the CH host's default user over
ssh and docker exec, with full write access on a host shared with BE.
They now run from fishuser-hero through a chadmin curl helper as
prices_admin. The FREEZE rationale is replaced: the tool's snapshot lands
in shadow/, which no mTLS identity can restore from, so --skip-snapshot
stays and the sole-copy exception uses a backup table instead.
The frontier gauge reads 0 while re-ingested months are still marked
exhausted, so gate the start on every 1m month being confirmed after
the last re-ingest too, with the frontier rewind to skip the 7-day wait.

The enriched-0 STOP now skips 1w/1M months the daily MVs already
re-rolled from a priced 1d, and re-runs. The cutoff is fixed in step 1
so a run crossing a month boundary still checks the same range. The
un-re-ingested backup moves after chadmin is defined and fails loudly.
The rollback states per table what it rebuilds.
@karczuRF
karczuRF merged commit e382bd4 into develop Sep 25, 2026
4 checks passed
karczuRF added a commit that referenced this pull request Sep 25, 2026
The drain-finished criterion now needs the frontier-table check as well as the gauge, matching runbook §7b-2 as merged.
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