Skip to content

Exposure: the contributions table follows the Lookback control - #66

Merged
mspinola merged 1 commit into
mainfrom
claude/zealous-sutherland-b45608
Aug 24, 2026
Merged

Exposure: the contributions table follows the Lookback control#66
mspinola merged 1 commit into
mainfrom
claude/zealous-sutherland-b45608

Conversation

@mspinola

@mspinola mspinola commented Aug 24, 2026

Copy link
Copy Markdown
Owner

The headline, the band, the %ile scale and the caption all ranked over whatever the Lookback control resolved to. The contributions table under them ranked every member against all history whatever the control said, because contribution_table called expanding_pct_rank unconditionally. So on "52 weeks" the page said "higher than 97% of the last 52 weeks" three lines above a column headed "%ile" measured against twenty years, with both on screen at once and nothing on either saying they were different questions.

Live, Gold alone on Lookback 52 weeks:

before after
headline 62nd percentile of the last 52 weeks same
table row, %ile 99 61.5

Why threading it through rather than explaining it

The expanding rank has a real claim on this page. No unit here is stationary through time, and it is the only form that can say "the most ever". But that is an argument for keeping All history as the default, which it is, not for ignoring a control after the reader has moved it. Copy can describe two bases; it cannot make them comparable, and the question the table answers is "which market is driving the number in the headline".

Three columns move together or none of them do

Copy that goes false the moment the arithmetic lands

All in here rather than in a follow-up:

  • the dollar column's header tooltip, "Against all of it, whatever the Lookback control says", written one commit earlier and true when written
  • the table label, "Percentiles are each market against its own history"
  • the standing explanation, which told a reader who moved the control that the band moved with it and said nothing about the table

The label also absorbs the second imprecision #64 left for whoever next edited it: a member's "own history" is the weeks the SET covers, since aggregate_exposure restricts every member to the weeks the total can price. Gold reads 88 alone and 81 in a set starting in 2002 because Russell does. Both restrictions are now named, and the set clause is dropped on a single market where it has nothing to qualify.

Floor

cotmetrics[options]>=0.9.0, a correctness floor of the loudest kind: against 0.8.0 the keyword does not exist, the call raises TypeError on every render, and no setting of the control avoids it.

Stacking, now resolved

Was stacked on #64 and blocked on mspinola/cotmetrics#32. Both have merged, so this is rebuilt as a single commit on main (3d3f1c6) with no merge commits, and check_dep_floors.py is green: cotmetrics 0.9.0 satisfies '>=0.9.0'.

Verification

492 tests pass, ruff check src tests clean on 0.15.22, floors green. Run against the real cotmetrics 0.9.0 editable install with no PYTHONPATH shadowing. Verified against the live store by rendering the page callback headlessly rather than in a browser. Nothing about the layout changed, only text and which weeks the ranks run over.

Reasoning recorded in docs/design/positioning-report-view-ideas.md under "The Lookback control reaches the table (2026-08-24)".

🤖 Generated with Claude Code

@mspinola
mspinola force-pushed the claude/exposure-contracts-percentile branch from 7e4cada to 379bbeb Compare August 24, 2026 22:31
Base automatically changed from claude/exposure-contracts-percentile to main August 24, 2026 22:33
The headline, the band, the %ile scale and the caption all ranked over whatever
Lookback resolved to. The contributions table under them ranked every member
against all history whatever the control said, because contribution_table called
expanding_pct_rank unconditionally. So on "52 weeks" the page said "higher than
97% of the last 52 weeks" three lines above a column headed "%ile" measured
against twenty years, with both on screen at once and nothing on either saying
they were different questions. Live, Gold alone on 52 weeks: headline 62nd
percentile, table row 99. Now 62 and 61.5.

Threading the window through rather than explaining it in copy. The expanding
rank has a real claim on this page, since no unit here is stationary through
time and it is the only form that can say "the most ever", but that is an
argument for keeping All history as the DEFAULT, which it is, and not for
ignoring a control after the reader has moved it. Copy can describe two bases;
it cannot make them comparable, and the question the table answers is "which
market is driving the number in the headline".

Three columns move together or none of them do. The dollar percentiles ride the
`window` parameter cotmetrics 0.9.0 added to contribution_table, which is why
the floor moves with this: against 0.8.0 the keyword raises TypeError on every
render and no setting of the control avoids it. The Contracts %ile column from
#64 follows in the same change, since it was written to match whatever the
dollar columns did and moving one without the other puts the row back to mixing
histories by the other route.

The copy that goes false the moment the arithmetic lands, all in here rather
than in a follow-up: the dollar column's "Against all of it, whatever the
Lookback control says", the table label, and the standing explanation, which
told a reader who moved the control that the band moved with it and said nothing
about the table. The label also absorbs the second imprecision #64 left for
whoever next edited it, that a member's "own history" is the weeks the SET
covers (gold 88 alone, 81 in a set starting in 2002 because Russell does). Both
restrictions are named, and the set clause is dropped on a single market, where
it has nothing to qualify.

The default is asserted rather than left to a constant: attach_contracts_rank
without a window reads 0.91 on the fixture against 1.92 at 52 weeks and 3.85 at
26, so the expanding assertion discriminates, and the test now says so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola force-pushed the claude/zealous-sutherland-b45608 branch from 035e0ef to 0ea9a86 Compare August 24, 2026 22:34
@mspinola
mspinola merged commit 5456ee9 into main Aug 24, 2026
3 checks passed
@mspinola
mspinola deleted the claude/zealous-sutherland-b45608 branch August 24, 2026 22:36
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