Skip to content

feat(slice-67g): correct and explainable dashboard numbers — tips, glossary, planned totals - #273

Merged
neomatrix369 merged 6 commits into
mainfrom
slice/67g-explainable-tips
Nov 6, 2026
Merged

neomatrix369 merged 6 commits into
mainfrom
slice/67g-explainable-tips

Conversation

@neomatrix369

@neomatrix369 neomatrix369 commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Glossary — GlossaryButton mounted on every screen via AppPageChrome; 10 fixed terms (Run, Planned runs, Configuration, Trial, Query result, Golden query/record, Similarity score, Lone run = 100, Observed vs planned, Est.) live in pure glossary.ts; Escape closes, focus returns
  • Detail + Stats tips — detailExplain.ts (10 pure explain functions) + estimateLabels.ts additions; StatTile renders one InfoTip per tile; VectorDbStatsPanel and ExperimentDetailScreen carry scope-annotated explanations
  • Explorer planned total — explorerPlan.ts maps sweep_plan → {plannedTotal, isBayesian, formula}; ExplorePanels header prints (N of M planned runs have results); FormulaLine replaces observedTotal; Explorer and Detail totals verified against 5 fixtures
  • List / Compare / Walkthru tips — explainLabels.ts for the Experiments list (count, pagination, Bayesian trials, delete-when-running); CompareScreen wires duplicates_collapsed + rankScope="group"; CrossStoreLeaderboard and ImprovementPanel carry score, rank, overlap and baseline tips
  • Determinism guard extended — deterministicNumbers.guard.test.ts covers all new pure modules and screens

Closes

Closes #315

Test plan

  • All 10 acceptance criteria from SLICE-67-EXPLAINABLE-NUMBERS.md satisfied
  • Frontend: 689 tests (57 files), coverage 97.4% / 93.2% / 98.5% / 98.6% (floors 95/90/95/95 ✓)
  • Backend: 1335 passed, 7 skipped
  • Pre-push hooks: passed (xenon + pytest + vitest + pip-audit)
  • Quality gates: all 12 steps exit 0

Sub-slice commits

Commit Stream Description
b49c8c5 67G-D Glossary button on every screen
cf73fd1 67G-A InfoTip explanations for Detail and Stats tiles
7cee8a5 67G-B Explorer planned-total from sweep_plan, retire observedTotal
dd4a78d 67G-C InfoTip tips for List, Compare, Walkthru screens

🤖 Generated with Claude Code

Complexity

Automatically refreshed by CI for product-code changes.

Scope Tool Result
Python Radon highest CC 40 (rank E), 901 blocks
JS/TS ESLint 19 function(s) above CC 10
JS/TS ESLint sonarjs 7 function(s) above cognitive 15
Functions above the JavaScript threshold
  • ExperimentDetailScreen.tsx:67 — CC 119
  • SearchExplorerScreen.tsx:39 — CC 39
  • ExplorePanels.tsx:454 — CC 29
  • LoadingFeedbackPanel.tsx:41 — CC 28
  • labels.ts:43 — CC 25
  • ExperimentsScreen.tsx:74 — CC 22
  • VectorDbStatsPanel.tsx:91 — CC 19
  • ExperimentControlButtons.tsx:54 — CC 14
  • ExperimentsScreen.tsx:480 — CC 14
  • loadWalkthruResults.ts:37 — CC 14
Functions above the cognitive-complexity threshold
  • ExperimentDetailScreen.tsx:67 — cognitive 59
  • LoadingFeedbackPanel.tsx:41 — cognitive 27
  • labels.ts:43 — cognitive 25
  • ExplorePanels.tsx:454 — cognitive 23
  • markdown.ts:59 — cognitive 20
  • SearchExplorerScreen.tsx:39 — cognitive 18
  • steps.ts:63 — cognitive 16

Allows rebuilding a single app container without restarting the DB or the
other service — useful when only one layer changed (e.g. frontend-only fix).

  ./start-services.sh rebuild server
  ./start-services.sh rebuild frontend
  ./start-services.sh rebuild all

Uses `docker compose build <svc>` + `up -d --no-deps <svc>` so the DB
container and sibling app containers are left untouched.
Add named pure-function explain sentences for every Detail and Stats
inventory row, wire them into StatTile/StatCard via the existing explain
prop, and render one tip per tile carrying both explain and hint text.

Changes:
- detailExplain.ts (new): totalExplain, successfulExplain, failedExplain,
  interruptedExplain, inProgressExplain, discardedExplain, notStartedExplain,
  durationExplain, bayesianTrialsExplain, exploreHint — fixed templates only
- detailExplain.test.ts (new): 14 GWT tests with full coverage
- estimateLabels.ts: add experimentsExplain, queryResultsExplain,
  dbUsedExplain, chunksEstimateExplain — each names scope (whole store)
- estimateLabels.test.ts: new describe for the four explain helpers
- StatTile.tsx: TileTips renders one InfoTip when explain or hint is set
- StatTile.test.tsx: one-tip-per-tile test
- VectorDbStatsPanel.tsx: explain on Experiments, Query Results, DB Used,
  Chunks (est. MB) tiles
- VectorDbStatsPanel.test.tsx: tooltip text verified per tile
- ExperimentDetailScreen.tsx: explain on all StatCards; Bayesian trials tip;
  Explore InfoTip replaces native title=; native title= removed where
  explanatory (truncation-aid uses kept)
- ExperimentDetailScreen.test.tsx: 2 new tests (partial Bayesian, running grid)
- deterministicNumbers.guard.test.ts: detailExplain.ts and StatTile.tsx
  added to PURE_MODULES guard
… retire observedTotal

- explorerPlan.ts: pure fn mapping sweep_plan → plannedTotal/isBayesian/formula/note;
  strategy from sweep_plan.search_strategy first, config.execution second; Bayesian M =
  planned_runs ?? bayesian_summary.planned_trials ?? run_count; grid M = full_grid_count
- explorerLabels.ts: pure fixed-template sentences — plannedResultsLine, tiedConfigCount
  (server tied_count preferred), tiedExplain, maxScoreExplain (normalisation note),
  queryAvgExplain, chunkAvgExplain, matchesExplain, resultsColumnExplain
- ExplorePanels: HyperparametersTab accepts plan/configsWithResults/topKFinal;
  header prints "(N of M planned runs have results)"; Cartesian line renders
  FormulaLine from plan.formula; native title= replaced by InfoTip on tied badge,
  score columns and config card; "combination" retired in favour of "configuration"
- SearchExplorerScreen: fetches getExperiment on mount; passes plan, configsWithResults
  and topKFinal to HyperparametersTab; N MATCHES span gets matchesExplain InfoTip
- plannedTotalAgreement.test.tsx: 5-fixture agreement test (grid/failed/partial/
  Bayesian/empty-padding) — Total tile equals Explorer M, no Detail/Explorer disagreement
- deterministicNumbers.guard.test.ts: explorerLabels.ts, explorerPlan.ts added to
  PURE_MODULES; SearchExplorerScreen.tsx added to SCREENS; 667 tests pass
…creens

Replace ambiguous native title= attributes with InfoTip components in
ExperimentsScreen, CompareScreen, CrossStoreLeaderboard and ImprovementPanel
so every count, rank and score value has an accessible explanation.

Key fixes:
- plannedRunCount() returns bayesian_summary.planned_trials for Bayesian
  sweeps (not run_count), eliminating planned-vs-executed ambiguity
- bayesianNotStartedCount avoids double subtraction; bayesianTotalsLine
  reused for the Bayesian sentence in the list row
- duplicates_collapsed wired from CompareResponse through dedupNote() so
  a silent dedup produces a visible sentence (0, 1, N, absent field handled)
- rankScope prop on CrossStoreLeaderboard distinguishes group rank (Compare)
  from export rank (Walkthru)
- storyTileExplain / storyRunsExplain explain percentage baselines and
  primary-store-only scope
- Pure modules explainLabels.ts and scoreLabels additions added to
  deterministicNumbers.guard.test.ts

All 689 frontend tests pass; coverage 97.4/93.2/98.5/98.6 (floors 95/90/95/95).
Backend 1335 passed. ruff and mypy clean. ESLint 0 warnings.
…etion

- CHANGELOG: 67G entry (Glossary, tips on every screen, Explorer planned total,
  List/Compare/Walkthru tips, determinism guard)
- PROGRESS: 67D/67E/67F/67G rows → ✅ COMPLETE with PR refs
- PROGRESS Decision Log: DECISIONS #315 (bundled PR strategy) and #316
  (one-tip-per-tile, "combination" → "configuration")
- GROWTH: 67F and 67G Abstraction Views deltas
@neomatrix369
neomatrix369 merged commit 9e917cc into main Nov 6, 2026
7 checks passed
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