Skip to content

/categories flows: the Flow view, level markers, state strip and the week in words - #141

Closed
mspinola wants to merge 3 commits into
claude/cot-flows-heatmap-panelfrom
claude/cot-flows-strip-markers
Closed

mspinola wants to merge 3 commits into
claude/cot-flows-heatmap-panelfrom
claude/cot-flows-strip-markers

Conversation

@mspinola

Copy link
Copy Markdown
Owner

PR 3 of the plan in cotmetrics docs/design/cot-flows.md (mspinola/cotmetrics#51): the state strip, the level markers and the week in words, on /categories. Stacked on #140 (base claude/cot-flows-heatmap-panel), and like it a draft until mspinola/cotmetrics#52 merges, because it reads columns cotmetrics 0.15.0 adds; the cotmetrics half of this PR is the third commit on #52. The view computes none of what it draws.

What it adds

  • The Flow view, a third Layout choice beside Overlay and Small multiples, which is the Cowork mockup (cotmetrics docs/analysis/2026-09-26-cot-view-proposed-gold.png): price with open interest, every selected cohort's flow z with the counterparty row and the level markers, and every cohort's positioning index shaded above 80 and below 20 (the triangles' cutoffs, shaded here only), as three full-width panels on one time axis. The plot selector and Cols grey out while it is chosen. The plan had claimed small multiples already gave this layout; it did not, and that is corrected in the plan.
  • Level markers. A triangle on each flow cell whose active flow (|z| > 1) left the top of the range (up, prior week's index above 80) or the bottom (down, below 20), from cotmetrics' Flow Level Mark. The level is the page's own range index one week earlier, so it is the level the Positioning Index panel draws; the marked cell's hover adds "from level 86 of the 26-week range". Context for reading a cell only: the cutoffs are the Cowork mockup's, unsearched, and the level x flow cells behind them were descriptive and on gold alone.
  • Small multiples, flow column: the counterparty directly under the cohorts. Where it is one cohort already drawn (DOW and most TFF markets, the report defaults) that row is titled "(counterparty)" instead of being repeated; a multi-member composite (Gold) gets its own one-row heatmap. Then, on state-eligible markets, a three-lane strip of the opinion cohorts' signs, with a tick lane above it on the split weeks (all three active, not all agreeing). TFF equities, rates and crypto get no strip row rather than an empty one.
  • The week in words (components/flow_copy.py, store-free) under the graph: positions as of the weekday and date, each opinion cohort's net change with both legs and its z, the marked level, the counterparty always (members, and whether measured for the market or the report default), the cohorts on neither side, the sum-to-zero line, and the state as "a vocabulary label, not a signal" or why there is none (ADR-0005, via state_eligible).

Copy rules, held by tests over every week of the test frame: none of the Home board's ranking words, nothing about what follows a state or a flow from an extreme (the state's pre-registered test failed the gauntlet in mspinola/cotmetrics#50), "signal" only as "not a signal", no em dash, and no release date (the resolved one lives in cotdata's vintage store; the derived one is wrong on holiday weeks).

What the running app decided (recorded in the plan): the plan's line-only box around a split week is the whole cell at one to two pixels a week and painted solid bars over the lanes, so it became a tick lane above them; and plotly.js draws only subplots some trace references, so the empty cells beside the flow column lost their axes, their row label and the bottom row's dates until each got a trace with no points.

Review (one independent pass over both repos, verified on 13 real markets): the prior-week level aligns exactly and sum-to-zero is exact on every week. Fixed from it: the caption contradicted its own sum-to-zero line where a cohort is measured into both sides (Other Reportable on silver, copper, orange juice), now said explicitly; the clientside autoscale flipped the strip on a zoom to the start of history, now it leaves heatmap axes alone; z and level rounding could contradict the words at the cutoffs; level_marks in cotmetrics aligned mismatched indexes to all NA, now it raises; the strip hover lost its redundant date line (about half a megabyte on gold); plus wording by roles source, no ADR citation in public copy, and tests that could pass vacuously.

Verification

Merge order: cotmetrics #51, #52, then #140, then this one (retarget to main after #140 squash-merges).

🤖 Generated with Claude Code

mspinola and others added 3 commits September 26, 2026 18:18
… words

PR 3 of cotmetrics docs/design/cot-flows.md, stacked on the Weekly Flow panel.
Reads the level and divergent-state columns cotmetrics 0.15.0 adds (#52);
computes none of them.

- Level markers: a triangle on each flow cell whose active flow left the top
  (up) or bottom (down) of the range, from cotmetrics' Flow Level Mark, and
  "from level 86 of the 26-week range" in that cell's hover. The level is the
  page's own range index one week earlier, so it is the level the Positioning
  Index panel draws. Hover skipped on the markers (the cell carries it).
- Facet context rows under price when the flow panel is selected: the
  counterparty composite as its own one-row heatmap, and on state-eligible
  markets a three-lane strip of the opinion cohorts' signs with a tick lane
  above it marking the split weeks (DIVERGENT_FLOW_STATES). TFF equities,
  rates and crypto get no strip row, not an empty one.
- components/flow_copy.py: the latest week under the graph in sentences: each
  opinion cohort's net change with both legs and z, the marked level, the
  counterparty always (members and whether measured or the report default),
  the cohorts on neither side, the sum-to-zero line, the state as a vocabulary
  label or why there is none. No release date and no forward-looking word,
  held by tests over every week of the test frame.

Two things the running app decided: a line-only box around a split week is
the whole cell at one to two pixels a week and painted over the lanes, so it
became a tick lane above them; and plotly.js drops a subplot no trace
references, which took the blank cells' row labels and the bottom row's dates
with it, so those cells get a trace with no points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…all multiples

Counterparty placement (asked for after reading DOW): a one-cohort counterparty
that is already a row is no longer repeated as a composite row at the bottom;
its own row is titled "(counterparty)". A multi-member composite, or a single
member switched off, gets its row directly under the cohorts, with the strip
after it and price and open interest last. frame is now required by the facet
shape helpers, since the rows depend on the market.

From the review:
- Caption: a cohort measured into the counterparty that is also an opinion
  cohort (Other Reportable on silver, copper, orange juice) is said to be
  counted on both sides, so the printed figures no longer contradict the
  sum-to-zero line. z prints to two decimals and "inside one sd" reads the
  cotmetrics sign; the level prints to one decimal and is worded from the mark
  ("above 80" / "below 20"), so 19.6 cannot read as "20, the bottom". Default
  roles are worded by source (unstable vs not measured). No ADR citation in
  public copy. A masked newest report is said so. A key to the triangles ends
  the caption. A None lookback header no longer raises.
- clientside autoscale leaves every axis carrying a heatmap alone: fitting the
  strip paired lane numbers with report dates and flipped it on a zoom to the
  start of history.
- Strip hover drops the date line the unified header already shows (about half
  a megabyte on gold); the flow hover's level prints to one decimal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A third Layout option beside Overlay and Small multiples: price with open
interest (dotted, secondary axis), every selected cohort's flow with the
counterparty row and the level markers, and every cohort's positioning index,
as three full-width panels on one time axis with dates under the bottom one.
The index panel is shaded above 80 and below 20 here only, as the key to the
triangles above it; the panel title names the triangles and the range. The plot
selector and Cols are greyed out while it is chosen, since the figure is fixed.
The caption renders under it as under the flow panel.

The heatmap draws with no cell gap in this view: at full width a one-pixel gap
a week read as a comb rather than as runs of colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mspinola

Copy link
Copy Markdown
Owner Author

Superseded by #140. The scope was cut back to PR 1 and PR 2 of cotmetrics docs/design/cot-flows.md (the handoff's "Scope, restated" block): the Flow view now lives on #140 with cotmetrics' collapsed rows and the mockup's decile markers; the state strip, the week-in-words caption and the small-multiples flow rows are out of scope.

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