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
Conversation
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>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Raised as a question about the
/damagechart incot-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
publishcallsadd_trigger_distancewith noas_of, so the stamp isreport_date.max(), andtrigger_pricestruncates the series before taking spot.add_risk_unitsreaches the same place by a different route (merge_asof(..., direction="backward")) and publishessigma_date/sigma_staleness_daysso the gap is inspectable rather than assumed.The gap is not cosmetic. Panel anchored 2026-07-28, store running to 2026-08-04:
What repricing would do
70 (market, side) pairs with a trigger on both dates:
kchangesThat 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
trigger_*_pool_agrees, which compares two signs that would then come from different dates.Dis price-dependent throughCandI, so repricing the trigger alone splits one row across two vintages.One expectation that did not survive
nearest_triggermeasures 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