Skip to content

RPS V1 PR3: Wall Detective-pack — mini-charts inside HypothesisCard#148

Merged
jukka-matti merged 8 commits into
mainfrom
response-path-system-v1
May 9, 2026
Merged

RPS V1 PR3: Wall Detective-pack — mini-charts inside HypothesisCard#148
jukka-matti merged 8 commits into
mainfrom
response-path-system-v1

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

  • Closes spec §6 D12 gap chore(deps): bump pnpm/action-setup from 4.1.0 to 4.4.0 #1: I-Chart for numeric/date factor + MiniBoxplot for outcome·categorical-factor inside each HypothesisCard
  • Grows CARD_H 228→288 to host an 80px chart slot at top of body; existing rows shift down via parameterized constants (POST_CHART_Y, TAGGED_*, DEFAULT_*); decorative "Suspected mechanism" caption removed
  • New core helper deriveMiniChartConfig + useMiniChartData hook + MiniIChart/MiniBoxplot SVG components (display-only)
  • WallCanvas accepts rows / columnTypes / outcomeColumn; both apps thread from useProjectStore (rawData, detectColumns(rawData), outcome)

Scope cuts vs the master plan

  • Scatter (continuous-X) dropped from V1 — parser column-type union is 'numeric' | 'categorical' | 'date' | 'text'; no 'continuous-x' representation exists. Defer to follow-up.
  • Brushing + highlights deferred to PR-RPS-4. PR-RPS-3 mini-charts are display-only.
  • Hypothesis.outcomeColumn field NOT added; investigation-level outcome (from project store) drives boxplot Y-axis. Per holistic vision: investigation has one Y, hypotheses propose different Xs.

Architecture

Data flow: useProjectStore.rawData + outcomeWallCanvas props → <ChartSlot> (full-LOD only) → useMiniChartData (memoizes deriveMiniChartConfig + projects rows into values[] for I-Chart or groups[] for boxplot) → <MiniIChart> / <MiniBoxplot> / placeholder.

Decision logic in deriveMiniChartConfig:

  • condition undefined → placeholder reason='no-condition'
  • factor column missing from columnTypesplaceholder reason='unknown-column'
  • factor numeric | datei-chart
  • factor categorical + outcome → boxplot
  • factor categorical + no outcome → placeholder reason='no-outcome' ("Set outcome to enable chart")
  • factor textplaceholder reason='unsupported-type'

Test plan

  • pnpm test green (all packages)
  • pnpm --filter @variscout/ui build green
  • bash scripts/pr-ready-check.sh green
  • --chrome walk: numeric hub renders I-Chart; categorical hub with outcome renders Boxplot; categorical hub without outcome shows "Set outcome to enable chart"; medium LOD hides chart; dark mode line + boxplot still read

Spec / plan refs

jukka-matti and others added 7 commits May 9, 2026 17:38
Pure helper mapping Hypothesis.condition + column-type map + outcome →
{ kind: 'i-chart' | 'boxplot' | 'placeholder', factor, outcome }.

Consumed by useMiniChartData hook + HypothesisCard chart slot in
follow-up tasks (PR-RPS-3 Task 4–5).

Co-Authored-By: ruflo <ruv@ruv.net>
- outcome guard: !outcome → outcome == null (don't swallow empty string)
- new test: empty-children AND → placeholder reason 'no-factor'
- strengthen date-leaf test: full toEqual instead of kind-only
- drop call-site comment naming useMiniChartData / HypothesisCard

Co-Authored-By: ruflo <ruv@ruv.net>
Display-only sparkline rendering numeric values as a line with a dashed
mean centerline. Theme-aware via useChartTheme (colors.mean line,
chrome.labelMuted centerline). No interaction; brushing comes in PR-RPS-4.

Co-Authored-By: ruflo <ruv@ruv.net>
…isCard

Display-only boxplot rendering one box per categorical group; falls back
to deterministic-jittered dots for groups under MIN_BOXPLOT_VALUES (7),
matching BoxplotBase convention. Theme-aware via useChartTheme.

Jitter PRNG seeded by category hash (mulberry32 + FNV-1a) — never
Math.random, per deterministic-stats rule (ADR-069).

Co-Authored-By: ruflo <ruv@ruv.net>
- New @variscout/hooks: useMiniChartData(hub, rows, columnTypes, outcome)
  memoizes deriveMiniChartConfig + projects rows into i-chart values[] or
  boxplot groups[] per category
- HypothesisCard CARD_H 228→288 to host an 80px chart slot at the top of
  the body (y=64 .. y=144). Inner <ChartSlot> component renders MiniIChart
  / MiniBoxplot / placeholder via <foreignObject>; full LOD only.
- Existing tag/readiness/clue rows shift down via parameterized constants
  (POST_CHART_Y); decorative "Suspected mechanism" caption removed.
- TAGGED_READINESS_Y gap fixed to 8px (was 6px) to pass layout-separation
  test; HypothesisCard.test.tsx updated to drop removed caption assertion.

Closes spec §6 D12 gap #1 — Wall Detective-pack mini-charts inside
hypothesis cards. Display-only; brushing comes in PR-RPS-4.

Co-Authored-By: ruflo <ruv@ruv.net>
Comments narrating old values / referencing task numbers belong in PR
descriptions, not source. Pure removals; no behaviour change.

Co-Authored-By: ruflo <ruv@ruv.net>
…for mini-charts

WallCanvas now accepts rows / columnTypes / outcomeColumn props and forwards
them to each HypothesisCard, populating the chart slot introduced in the
prior commit. Both apps thread the data from useProjectStore: rawData,
detectColumns(rawData) → ColumnTypeMap, and outcome. Also fixes missing vi
import in MiniBoxplot.test.tsx (pre-existing test error from Task 3).

Co-Authored-By: ruflo <ruv@ruv.net>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Ready Ready Preview, Comment May 9, 2026 4:10pm
variscout_website Ready Ready Preview, Comment May 9, 2026 4:10pm

Frame top is hubY-40 and cards extend to hubY+CARD_H; with CARD_H now 288
the prior 260px frame ended 68px above card bottom, clipping cards when
groupByTributary is on. 348 = CARD_H(288) + 60 to leave 20px of clearance
below the card row.

Co-Authored-By: ruflo <ruv@ruv.net>
@jukka-matti jukka-matti merged commit d0ad3d4 into main May 9, 2026
3 checks passed
@jukka-matti jukka-matti deleted the response-path-system-v1 branch May 9, 2026 16:11
jukka-matti added a commit that referenced this pull request May 13, 2026
…80, log shipment

All 10 PRs of Response Path System V1 merged on main 2026-05-09 → 2026-05-13
(#144 / #147 / #148 / #149 / #150 / #151 / #152 / #153 / #154 / #155). This
commit syncs tracking docs that the squash merges left stale:

- docs/roadmap.md: PR-RPS-9 + PR-RPS-10 SHIPPED rows; flip §3 to "10 of 10";
  free up ADR-080 slot from the 8f canvas viewport item (taken by Sustainment)
- docs/decision-log.md: pin "2026-05-13 — RPS V1 SHIPPED — full lifecycle live"
- docs/07-decisions/adr-080-sustainment-auto-fire-pattern.md (new): document
  the Sustainment-shaped lifecycle pattern (auto-fire + Inbox prompt +
  signoff tier gate) as a pattern reference for future response-path
  lifecycles, per plan §PR-RPS-9 ledger line 2231
- docs/07-decisions/index.md: add rows 078 / 079 / 080 (078+079 also weren't
  indexed when shipped)
- Spec + plan frontmatter: draft/active → delivered, last-reviewed 2026-05-13

Co-Authored-By: ruflo <ruv@ruv.net>
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