Skip to content
This repository was archived by the owner on Aug 8, 2026. It is now read-only.

Record why the damage panel prices at the report date - #76

Merged
mspinola merged 1 commit into
mainfrom
claude/amendment-live-pricing
Aug 6, 2026
Merged

Record why the damage panel prices at the report date#76
mspinola merged 1 commit into
mainfrom
claude/amendment-live-pricing

Conversation

@mspinola

@mspinola mspinola commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Why

Raised as a question about the /damage chart in cot-analyzer: is the plot using the most recent price available, and would using it make the chart more accurate? Measured, then decided as no change.

Recorded because the reasoning lived nowhere. "Use fresher data" is a reasonable-sounding suggestion and nothing in the code refuses it out loud, so the next session to ask would have had to re-derive the answer.

What the code does, measured

publish calls add_trigger_distance with no as_of, so the stamp is report_date.max(), and trigger_prices truncates the series before taking spot. add_risk_units reaches the same place by a different route (merge_asof(..., direction="backward")) and publishes sigma_date / sigma_staleness_days so the gap is inspectable rather than assumed.

The gap is not cosmetic. Panel anchored 2026-07-28, store running to 2026-08-04:

symbol store's latest close close actually used
GC 4152.60 4038.70
NG 2.68 2.66
ZC 442.25 458.50

What repricing would do

70 (market, side) pairs with a trigger on both dates:

median absolute change 1.742 sigma (p90 5.901, max 65.256)
cross the 1.5 close line 29 of 70, 41%
nearest lookback k changes 27 of 70
gains / loses a trigger entirely 6 / 6

That 41% is the argument against repricing, not for it. A quantity where two fifths of readings cross the threshold defining the quadrant column in five sessions is not a precise measurement being degraded by staleness. It is a noisy one, and refreshing it yields fresher noise.

Four reasons the anchor stands

  1. The pool would still be a week old, so vintage skew moves inside a row and lands on trigger_*_pool_agrees, which compares two signs that would then come from different dates.
  2. The history would break at its last point. A latest-price week cannot be rebuilt retrospectively without lookahead.
  3. Daily publishing stops being idempotent, which is the stated reason it runs daily against weekly data.
  4. D is price-dependent through C and I, so repricing the trigger alone splits one row across two vintages.

One expectation that did not survive

nearest_trigger measures reference-bar drift on 6C at 1.68x spot over 120 sessions, which invites the inference that most of the change in distance-to-trigger is bars rolling off rather than price moving.

Across 47 markets over this one week it is the other way round: 0.56x (|spot move| median 2.705%, |F* move| median 1.527%). Different measurements, so the docstring is left as it stands, but the entry states plainly that the reassuring version is not established and should not be quoted as though it were. That is the claim most likely to get repeated from memory.

Reproducer, declared absent

Not in docs/analysis/reproduce.py. Ad-hoc scripts against an unpinned store, and Norgate restates history on every roll, so the table will not reproduce exactly. Recorded at that fidelity deliberately: the decision rests on 41% being large, not on it being 41%.

Also

CLAUDE.md's amendments row listed E1-E3 and had already missed E4. It now carries E4 and E5.

566 passed, 93 skipped, ruff clean.

🤖 Generated with Claude Code

E5. Raised as a question about the /damage chart: is it using the most recent price,
and would that be more accurate? Measured, then decided as no change. Recorded because
the reasoning lived nowhere and "use fresher data" is a reasonable-sounding suggestion
that nothing in the code refuses out loud.

What it does: publish passes no as_of, so the stamp is report_date.max(), and
trigger_prices truncates the series before taking spot. add_risk_units reaches the same
place by a different route, merge_asof backward, and publishes sigma_date and
sigma_staleness_days so the gap is inspectable rather than assumed. The gap is not
cosmetic: on a panel anchored 2026-07-28 against a store running to 2026-08-04, gold is
2.8% away and corn 3.5% in the other direction.

What repricing would do, 70 (market, side) pairs with a trigger on both dates: median
absolute change 1.742 sigma, and 29 of 70 cross the 1.5 close line. That 41% is the
argument AGAINST repricing rather than for it. A quantity where two fifths of readings
cross the threshold defining the quadrant column in five sessions is not a precise
measurement being degraded by staleness, it is a noisy one, and refreshing it yields
fresher noise.

Four reasons the anchor stands, of which the second is the one that would be hardest to
undo: the pool would still be a week old, so the vintage skew moves inside a row and
lands on pool_agrees; the history would break at its last point, since a latest-price
week cannot be rebuilt retrospectively without lookahead; daily publishing stops being
idempotent, which is the stated reason it runs daily against weekly data; and D is
price-dependent through C and I, so repricing the trigger alone splits one row across
two vintages.

One expectation did not survive contact. The 1.68x reference-bar drift measured on 6C
over 120 sessions invites the inference that most of the change in distance-to-trigger
is bars rolling off rather than price moving. Across 47 markets over this one week it
is the other way round, 0.56x. Different measurements, so the docstring is left alone,
but the reassuring version is NOT established and should not be quoted as though it
were.

The reproducer is declared absent rather than implied: these came from ad-hoc scripts
against an unpinned store, and Norgate restates on every roll, so the table will not
reproduce exactly. Recorded at that fidelity deliberately, since the decision rests on
41% being large and not on it being 41%.

CLAUDE.md's amendments row listed E1-E3 and had already missed E4; it now carries both.

566 passed, 93 skipped, ruff clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola merged commit fde101a into main Aug 6, 2026
5 checks passed
@mspinola
mspinola deleted the claude/amendment-live-pricing branch August 6, 2026 02:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant