From e6638a8e1d93b89376c004c60db9f016e03f00e0 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sun, 30 Aug 2026 16:43:44 +0000 Subject: [PATCH] feat(reports): leftover expected on grouping comparison strip (v2.57.0) Caption leftover expected E on grouping comparison leftover-pair buttons through formatLeftoverMapExpected (ADR 0300). After make seed, closest and farthest leftover pairs sit above the member list with the Gabriel biplot of already-named coordinates and grouping comparison leftover-pair buttons that match E on the pair row; click a post marker or a pair button opens that post. A missing or non-finite E omits that leftover-map comparison expected badge and keeps leftover observed Y when finite. A finite negative leftover is shown, never clamped. Do not invent E from Y and R. UI-only; no new columns. Never invent a leftover score or a theta. Jeon, M., Jin, I. H., Schweinberger, M., & Baugh, S. (2021). Mapping unobserved item-respondent interactions: A latent space item response model with interaction map. Psychometrika, 86(2), 378-403. Gabriel, K. R. (1971). The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58(3), 453-467. --- AGENTS.md | 10 +- ARCHITECTURE.md | 7 +- .../2.57.0-leftover-map-compare-expected.md | 16 ++ CHANGELOG.md | 52 +++++ CLAUDE.md | 2 +- .../adr/0300-leftover-map-compare-expected.md | 216 ++++++++++++++++++ docs/product-technical-gap-baseline.md | 17 ++ frontend/package.json | 2 +- frontend/src/App.test.tsx | 26 +++ frontend/src/App.tsx | 11 + frontend/src/components/LeftoverPairList.tsx | 3 +- frontend/src/i18n.test.ts | 14 ++ frontend/src/i18n.ts | 4 + frontend/src/leftoverMapPlotLayout.ts | 5 +- frontend/src/leftoverObservedExpected.test.ts | 6 + frontend/src/leftoverObservedExpected.ts | 3 + pyproject.toml | 2 +- 17 files changed, 387 insertions(+), 9 deletions(-) create mode 100644 CHANGELOG.d/2.57.0-leftover-map-compare-expected.md create mode 100644 docs/adr/0300-leftover-map-compare-expected.md diff --git a/AGENTS.md b/AGENTS.md index d17ae311b..4944e8279 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -273,7 +273,7 @@ stops startup instead of leaving a healthy-looking partial schema, and application code must not compensate for a missing table. Period leftover pairs (ADR 0017 / 0018 / 0048 / 0049 / 0119 / 0158 / 0162 / -0163 / 0164 / 0182 / 0185 / 0201 / 0233 / 0266 / 0267 / 0268 / 0269 / 0270 / 0271 / 0272 / 0273 / 0274 / 0275 / 0276 / 0277 / 0278 / 0279 / 0280 / 0281 / 0282 / 0283 / 0284 / 0285 / 0286 / 0287 / 0288 / 0289 / 0290 / 0291 / 0292 / 0293 / 0294 / 0295 / 0296 / 0297 / 0298 / 0299) are computed in `lineageweave/leftover_pairs.py` from the +0163 / 0164 / 0182 / 0185 / 0201 / 0233 / 0266 / 0267 / 0268 / 0269 / 0270 / 0271 / 0272 / 0273 / 0274 / 0275 / 0276 / 0277 / 0278 / 0279 / 0280 / 0281 / 0282 / 0283 / 0284 / 0285 / 0286 / 0287 / 0288 / 0289 / 0290 / 0291 / 0292 / 0293 / 0294 / 0295 / 0296 / 0297 / 0298 / 0299 / 0300) are computed in `lineageweave/leftover_pairs.py` from the residual after a real GRM/GPCM score, never invented. Distances are Euclidean on the two-dimensional Gabriel leftover map; missing cells stay out of the factorization. Closest and farthest post–criterion pairs @@ -458,6 +458,12 @@ compares leftover pairs can match the pair-row `Y` badge; a missing or non-finit `Y` omits that leftover-map comparison observed badge and does not invent `Y` from `R` and `E` or from leftover-map distance. The strip does not gain the leftover-map graphic. +ADR 0300 captions grouping comparison leftover-pair buttons with persisted leftover +expected `E` through formatLeftoverMapExpected so a buyer who +compares leftover pairs can match the pair-row `E` badge; a missing or non-finite +`E` omits that leftover-map comparison expected badge and does not invent +`E` from `Y` and `R` or from leftover-map distance. The strip does not gain the +leftover-map graphic. When `R`, `R̂`, `U`, `x`, `s`, and `e` are finite, `e + s + x = 1`. When `Y`, `E`, and `R` are finite, `Y − E = R`. When `R`, `R̂`, and `U` are @@ -494,6 +500,8 @@ Grouping comparison leftover residual (ADR 0298) captions grouping comparison le buttons with persisted leftover residual `R`. Grouping comparison leftover observed (ADR 0299) captions grouping comparison leftover-pair buttons with persisted leftover observed `Y`. +Grouping comparison leftover expected (ADR 0300) captions grouping comparison leftover-pair +buttons with persisted leftover expected `E`. Item complete-case coverage (ADR 0282) captions the leftover-map graphic with how many scored criteria entered the map. Item complete-case coverage on the pair list (ADR 0285) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 3278beca8..d2e752dc4 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -689,6 +689,8 @@ ADR 0298 captions grouping comparison leftover-pair buttons with persisted lefto residual `R` through formatLeftoverMapResidual. ADR 0299 captions grouping comparison leftover-pair buttons with persisted leftover observed `Y` through formatLeftoverMapObserved. +ADR 0300 captions grouping comparison leftover-pair buttons with persisted leftover +expected `E` through formatLeftoverMapExpected. Click a post marker or a pair button opens that post. Those ADRs are the normative mathematical, storage, and display contracts. Leftover-map axis share @@ -715,8 +717,9 @@ incomplete item coverage (ADR 0292), leftover-map reconstruction `R̂` (ADR 0295), leftover-map cross share `x` (ADR 0296), leftover-map unexplained leftover `U` (ADR 0297), leftover residual `R` -(ADR 0298), and leftover observed `Y` -(ADR 0299); +(ADR 0298), leftover observed `Y` +(ADR 0299), and leftover expected `E` +(ADR 0300); `POST .../rebuild` scores every grouping kind (post_admin). `make seed` folds A-100/B-200 Event Lineage fixtures (and the Riverbend calendar post) that already have constructed IRT cells into the same shared diff --git a/CHANGELOG.d/2.57.0-leftover-map-compare-expected.md b/CHANGELOG.d/2.57.0-leftover-map-compare-expected.md new file mode 100644 index 000000000..2f5fbbd97 --- /dev/null +++ b/CHANGELOG.d/2.57.0-leftover-map-compare-expected.md @@ -0,0 +1,16 @@ +## 2.57.0 — Leftover expected on grouping comparison strip pair rows + +- Caption leftover expected `E` on grouping comparison strip leftover-pair + buttons through formatLeftoverMapExpected (ADR 0300). After `make seed`, + closest and farthest leftover pairs sit above the member list with grouping + comparison leftover-pair buttons that match leftover expected `E` on the + pair row; click a post marker or a pair button opens that post. A missing + or non-finite `E` omits that leftover-map comparison expected badge and + keeps leftover observed `Y` when finite, leftover residual `R` when finite, + leftover-map unexplained leftover `U` when finite, leftover-map cross share + `x` when finite, leftover-map unexplained leftover share `s` when finite, + leftover-map explained leftover share `e` when finite, leftover-map + reconstruction `R̂` when finite, leftover-map distance `d`, plus the strip + coverage notes. Do not invent `E` from `Y` and `R`. A finite negative leftover + is shown, never clamped. The strip does not gain the leftover-map graphic. + Never invent a leftover score. Never invent a theta. No new columns. diff --git a/CHANGELOG.md b/CHANGELOG.md index b81a34b29..f800abb60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,58 @@ All notable changes to this project are documented here. Format follows ### Added +- Period leftover pairs now caption grouping comparison leftover-pair + buttons with persisted leftover expected `E` through + formatLeftoverMapExpected (ADR 0300 / v2.57.0). After `make seed`, + closest and farthest leftover pairs sit above the member list with the + Gabriel biplot of already-named coordinates, leftover-map axis share when + finite, axis ticks that match `ξ (x, y) ζ (x, y)` on the pair row, pair + segments that match `d` on the pair row, pair segments that match `R̂` on + the pair row, pair segments that match `R̂²/R²` on the pair row, pair + segments that match `U²/R²` on the pair row, pair segments that match + `2R̂U/R²` on the pair row, pair segments that match `U` on the pair row, + pair segments that match `R` on the pair row, pair segments that match + `Y` on the pair row, pair segments that match `E` on the pair row, pair + segments that match leftover-map rank on the pair row, a plot caption + that matches leftover-map complete-case coverage above the pair list, a + plot caption that matches leftover-map item complete-case coverage, a + plot caption that matches leftover-map incomplete post coverage, a plot + caption that matches leftover-map incomplete item coverage, a pair-list + note that matches leftover-map post complete-case coverage, a pair-list + note that matches leftover-map item complete-case coverage, a pair-list + note that matches leftover-map incomplete post coverage, a pair-list + note that matches leftover-map incomplete item coverage, a grouping + comparison note that matches leftover-map post complete-case coverage, + a grouping comparison note that matches leftover-map item + complete-case coverage, a grouping comparison note that matches + leftover-map incomplete post coverage, a grouping comparison note + that matches leftover-map incomplete item coverage, grouping comparison + leftover-pair buttons that match leftover-map reconstruction `R̂` on the + pair row, grouping comparison leftover-pair buttons that match + leftover-map explained leftover share `e` on the pair row, grouping + comparison leftover-pair buttons that match leftover-map unexplained + leftover share `s` on the pair row, grouping comparison leftover-pair + buttons that match leftover-map cross share `x` on the pair row, + grouping comparison leftover-pair buttons that match leftover-map + unexplained leftover `U` on the pair row, grouping comparison leftover-pair + buttons that match leftover residual `R` on the pair row, grouping + comparison leftover-pair buttons that match leftover observed `Y` on the + pair row, and grouping comparison leftover-pair buttons that match leftover + expected `E` on the pair row; click a post marker or a pair button opens + that post. A missing or non-finite `E` omits that leftover-map comparison + expected badge and keeps leftover observed `Y` when finite, leftover residual + `R` when finite, leftover-map unexplained leftover `U` when finite, + leftover-map cross share `x` when finite, leftover-map unexplained leftover + share `s` when finite, leftover-map explained leftover share `e` when finite, + leftover-map reconstruction `R̂` when finite, leftover-map distance `d`, + plus the strip coverage notes. Do not invent `E` from `Y` and `R`, leftover-map + distance, plotted coordinates, leftover residual, leftover-map reconstruction, + leftover-map unexplained leftover, leftover-map rank, leftover-map post + coverage, leftover-map item coverage, leftover-map incomplete post coverage, + leftover-map incomplete item coverage, or the count of unused axes. A finite + negative leftover is shown, never clamped. The strip does not gain the + leftover-map graphic. Never invent a leftover score or a theta. No new columns. + - Period leftover pairs now caption grouping comparison leftover-pair buttons with persisted leftover observed `Y` through formatLeftoverMapObserved (ADR 0299 / v2.56.0). After `make seed`, diff --git a/CLAUDE.md b/CLAUDE.md index 6866e7e13..7e85d2649 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,7 +49,7 @@ cutoff. Global Ask optional `knowledge_cutoff` uses the same cover Create/start endpoint rules (ADR 0017 / 0021), tie-vs-miss similarity (ADR 0026), R&R catalog ids (ADR 0019 / 0027), leftover pairs -(ADR 0048–0164 / 0182 / 0185 / 0201 / 0233 / 0266 / 0267 / 0268 / 0269 / 0270 / 0271 / 0272 / 0273 / 0274 / 0275 / 0276 / 0277 / 0278 / 0279 / 0280 / 0281 / 0282 / 0283 / 0284 / 0285 / 0286 / 0287 / 0288 / 0289 / 0290 / 0291 / 0292 / 0293 / 0294 / 0295 / 0296 / 0297 / 0298 / 0299), occupational construct catalog search +(ADR 0048–0164 / 0182 / 0185 / 0201 / 0233 / 0266 / 0267 / 0268 / 0269 / 0270 / 0271 / 0272 / 0273 / 0274 / 0275 / 0276 / 0277 / 0278 / 0279 / 0280 / 0281 / 0282 / 0283 / 0284 / 0285 / 0286 / 0287 / 0288 / 0289 / 0290 / 0291 / 0292 / 0293 / 0294 / 0295 / 0296 / 0297 / 0298 / 0299 / 0300), occupational construct catalog search (ADR 0257), the text-channel embedding swap and cosine clamp (ADR 0190), per-edge channel-score persistence (ADR 0195), token-backed status notices (ADR 0220), diff --git a/docs/adr/0300-leftover-map-compare-expected.md b/docs/adr/0300-leftover-map-compare-expected.md new file mode 100644 index 000000000..657df5920 --- /dev/null +++ b/docs/adr/0300-leftover-map-compare-expected.md @@ -0,0 +1,216 @@ +# ADR 0300 — Name leftover expected on grouping comparison strip pair rows + +**Decision status:** Accepted +**Date:** 2026-08-31 + +Amends leftover pairs on the grouping comparison strip +([ADR 0149](0149-leftover-pairs-on-comparison-strip.md)), leftover observed `Y` / +expected `E` ([ADR 0163](0163-leftover-observed-expected.md)), leftover expected on +pair segments ([ADR 0279](0279-leftover-map-segment-expected.md)), leftover observed +on grouping comparison strip pair rows +([ADR 0299](0299-leftover-map-compare-observed.md)), leftover residual +on grouping comparison strip pair rows +([ADR 0298](0298-leftover-map-compare-residual.md)), leftover-map unexplained leftover +on grouping comparison strip pair rows +([ADR 0297](0297-leftover-map-compare-unexplained.md)), leftover-map cross share +on grouping comparison strip pair rows +([ADR 0296](0296-leftover-map-compare-cross-share.md)), leftover-map unexplained +leftover share on grouping comparison strip pair rows +([ADR 0295](0295-leftover-map-compare-unexplained-share.md)), leftover-map +explained leftover share on grouping comparison strip pair rows +([ADR 0294](0294-leftover-map-compare-explained-share.md)), leftover-map +reconstruction on grouping comparison strip pair rows +([ADR 0293](0293-leftover-map-compare-reconstruction.md)), leftover-map +incomplete item coverage on the grouping comparison strip +([ADR 0292](0292-leftover-map-compare-incomplete-item.md)), leftover-map +incomplete post coverage on the grouping comparison strip +([ADR 0291](0291-leftover-map-compare-incomplete-post.md)), leftover-map item +complete-case coverage on the grouping comparison strip +([ADR 0290](0290-leftover-map-compare-item-coverage.md)), leftover-map +complete-case coverage on the grouping comparison strip +([ADR 0289](0289-leftover-map-compare-coverage.md)), leftover residual +disclosure ([ADR 0162](0162-leftover-residual-disclosure.md)), leftover residual +on pair segments ([ADR 0277](0277-leftover-map-segment-residual.md)), leftover +observed on pair segments ([ADR 0278](0278-leftover-map-segment-observed.md)), +leftover-map unexplained leftover persistence ([ADR 0182](0182-leftover-map-unexplained.md)), +and leftover-map reconstruction persistence +([ADR 0201](0201-leftover-map-reconstruction.md)). Independent of leftover-map +post complete-case coverage fail-closed on the pair list +([ADR 0288](0288-leftover-map-list-post-coverage-helper.md)), leftover-map +incomplete item coverage on the pair list +([ADR 0287](0287-leftover-map-list-incomplete-item.md)), leftover-map incomplete +post coverage on the pair list +([ADR 0286](0286-leftover-map-list-incomplete-post.md)), leftover-map item +complete-case coverage on the pair list +([ADR 0285](0285-leftover-map-list-item-coverage.md)), leftover-map incomplete +item coverage on the graphic display +([ADR 0284](0284-leftover-map-plot-incomplete-item.md)), leftover-map incomplete +post coverage on the graphic display +([ADR 0283](0283-leftover-map-plot-incomplete.md)), leftover-map item +complete-case coverage on the graphic display +([ADR 0282](0282-leftover-map-plot-item-coverage.md)), leftover-map complete-case +coverage on the graphic display +([ADR 0281](0281-leftover-map-plot-coverage.md)), leftover-map rank on pair +segments ([ADR 0280](0280-leftover-map-segment-rank.md)), leftover-map +unexplained leftover on pair segments +([ADR 0276](0276-leftover-map-segment-unexplained-leftover.md)), leftover-map +cross share on pair segments ([ADR 0275](0275-leftover-map-segment-cross-share.md)), +leftover-map unexplained leftover share on pair segments +([ADR 0274](0274-leftover-map-segment-unexplained-share.md)), leftover-map +explained leftover share on pair segments +([ADR 0273](0273-leftover-map-segment-explained-share.md)), leftover-map +reconstruction on pair segments +([ADR 0272](0272-leftover-map-segment-reconstruction.md)), leftover-map +distance on pair segments ([ADR 0271](0271-leftover-map-segment-distance.md)), +leftover-map coordinate ticks ([ADR 0270](0270-leftover-map-coordinate-ticks.md)), +leftover-map axis share on the graphic display +([ADR 0269](0269-leftover-map-axis-share-plot.md)), leftover-map rank +persistence ([ADR 0164](0164-leftover-map-rank.md)), leftover-map +cross share persistence ([ADR 0185](0185-leftover-map-cross-share.md)), leftover-map +unexplained leftover share persistence +([ADR 0233](0233-leftover-map-unexplained-share.md)), leftover-map explained leftover +share persistence ([ADR 0266](0266-leftover-map-explained-share.md)), and leftover-map +axis share persistence ([ADR 0148](0148-leftover-map-axis-share.md)). + +## Context + +ADR 0163 already persists observed category `Y` and expected +`E[Y|θ, item]` on leftover pair rows. ADR 0049 already names that expected +response on the period-report pair list. ADR 0279 already names it on leftover-map +graphic-display pair segments. ADR 0299 already captions persisted leftover observed +`Y` on grouping comparison leftover-pair buttons. The strip pair button still does +not name `E`, so a buyer who compares leftover pairs can treat leftover observed +`Y`, leftover residual `R`, leftover-map unexplained leftover `U`, leftover-map +cross share `x`, leftover-map unexplained leftover share `s`, leftover-map explained +leftover share `e`, leftover-map reconstruction `R̂`, or leftover-map distance `d` +as the IRT main-effect expectation even after the pair list and graphic already +name `E`. When `Y`, `E`, and `R` are finite, `Y − E = R`; hiding `E` on the strip +lets that identity vanish without a next action. + +This increment captions persisted leftover expected on each grouping comparison +leftover-pair button through formatLeftoverMapExpected. It does not add columns. +It does not recompute `E` from `Y` and `R`, leftover-map distance, plotted +coordinates, leftover residual, leftover observed, leftover-map reconstruction, +leftover-map explained leftover share, leftover-map unexplained leftover share, +leftover-map cross share, or leftover-map unexplained leftover. It does not persist +leftover-map inner product, cosine, or length as separate columns. Do not invent a +leftover score. Do not invent a theta. + +The dashboard stack already used neighbouring leftover facts under other +numbers. This protected increment uses **0300** so it does not collide with +leftover observed on grouping comparison strip pair rows (0299), leftover residual +on grouping comparison strip pair rows (0298), leftover-map unexplained leftover +on grouping comparison strip pair rows (0297), leftover-map cross share on grouping +comparison strip pair rows (0296), leftover-map unexplained leftover share on grouping +comparison strip pair rows (0295), leftover-map explained leftover share on grouping +comparison strip pair rows (0294), leftover-map reconstruction on grouping comparison +strip pair rows (0293), leftover expected on pair segments (0279), leftover observed +on pair segments (0278), leftover observed `Y` / expected `E` (0163), leftover residual +on pair segments (0277), leftover residual disclosure (0162), leftover-map unexplained +leftover on pair segments (0276), leftover-map unexplained leftover persistence (0182), +leftover-map reconstruction on pair segments (0272), leftover-map reconstruction +persistence (0201), or the dashboard stacks. + +## Decision + +On the grouping comparison strip, caption each leftover pair button with +the same persisted leftover expected formatter as the pair-row `E` badge, next +to leftover observed `Y`, leftover residual `R`, leftover-map unexplained leftover +`U`, leftover-map cross share `x`, leftover-map unexplained leftover share `s`, +leftover-map explained leftover share `e`, leftover-map reconstruction `R̂`, and +leftover-map distance `d`. Use the distinct accessible name +`Leftover map comparison expected` so the strip badge is not the graphic caption +(`leftover expected {label}`). A missing or non-finite `E` omits that leftover-map +comparison expected badge and keeps leftover observed `Y` when finite, leftover +residual `R` when finite, leftover-map unexplained leftover `U` when finite, +leftover-map cross share `x` when finite, leftover-map unexplained leftover share +`s` when finite, leftover-map explained leftover share `e` when finite, leftover-map +reconstruction `R̂` when finite, leftover-map distance `d`, the strip leftover-map +post coverage note, leftover-map item coverage note, leftover-map incomplete post +note, leftover-map incomplete item note, leftover pairs, and any leftover-map +captions on the pair list and graphic. Rank-0 origin cells still name `E 0.00` +when that persisted expected response is finite. A finite negative leftover is +shown, never clamped. Do not invent `E` from `Y` and `R`, leftover-map distance, +plotted coordinates, leftover residual, leftover observed, leftover-map +reconstruction, leftover-map unexplained leftover, leftover-map explained leftover +share, leftover-map unexplained leftover share, leftover-map cross share, +leftover-map rank, leftover-map post coverage, leftover-map item coverage, +leftover-map incomplete post coverage, leftover-map incomplete item coverage, or +the count of unused axes. Do not add the leftover-map graphic to the strip. Click +a leftover pair on the strip to open that post. + +Do not add SQL. Do not edit shipped migrations. Do not persist inner +product, cosine, or length as separate columns. Do not invent a leftover +score. Do not invent a theta. + +## Consequences + +After `make seed`, the grouping comparison strip names persisted leftover-map +post complete-case coverage, persisted leftover-map item complete-case +coverage, persisted leftover-map incomplete post coverage, and persisted +leftover-map incomplete item coverage on each grouping row when +leftoverMapCoverageCounts / leftoverMapItemCoverageCounts / +leftoverMapIncompletePostCount / leftoverMapIncompleteItemCount return usable +integers, then names leftover pairs with leftover-map distance `d`, persisted +leftover-map reconstruction `R̂` when finite, persisted leftover-map +explained leftover share `e` when finite, persisted leftover-map unexplained +leftover share `s` when finite, persisted leftover-map cross share `x` +when finite, persisted leftover-map unexplained leftover `U` when finite, +persisted leftover residual `R` when finite, persisted leftover observed +`Y` when finite, and persisted leftover expected `E` when finite. +Closest and farthest leftover pairs still sit above the member +list with the leftover-map graphic display; click a post marker or a pair +button opens that post. +Hidden posts stay hidden. When `Y`, `E`, and `R` are finite, `Y − E = R`. +When `R`, `R̂`, and `U` are finite, `U + R̂ = R`. +When `R`, `R̂`, `U`, `x`, `s`, and `e` are finite, `e + s + x = 1`. + +## Related + +Independent of leftover interaction-map persistence, leftover-criterion +evaluation landing, leftover residual disclosure, leftover-map +complete-case coverage persistence, leftover-map axis share persistence, +leftover pairs on the grouping comparison strip, leftover-map complete-case +coverage on the grouping comparison strip, leftover-map item complete-case +coverage on the grouping comparison strip, leftover-map incomplete post +coverage on the grouping comparison strip, leftover-map incomplete item +coverage on the grouping comparison strip, leftover-map reconstruction on +grouping comparison strip pair rows, leftover-map explained leftover share +on grouping comparison strip pair rows, leftover-map unexplained leftover +share on grouping comparison strip pair rows, leftover-map cross share on +grouping comparison strip pair rows, leftover-map unexplained leftover on +grouping comparison strip pair rows, leftover residual on grouping +comparison strip pair rows, leftover observed on grouping comparison strip +pair rows, leftover-map inner product, leftover-map cosine, leftover-map +length, leftover-map graphic display, leftover residual on pair segments, +leftover observed on pair segments, leftover expected on pair segments, +leftover-map unexplained leftover on pair segments, leftover-map unexplained +leftover persistence, leftover-map cross share on pair segments, leftover-map +cross share persistence, leftover-map unexplained leftover share on pair +segments, leftover-map unexplained leftover share persistence, leftover-map +explained leftover share on pair segments, leftover-map explained leftover +share persistence, leftover-map reconstruction on pair segments, leftover-map +reconstruction persistence, leftover-map item complete-case coverage on the +graphic display, leftover-map item complete-case coverage on the pair list, +leftover-map incomplete post coverage on the graphic display, leftover-map +incomplete post coverage on the pair list, leftover-map incomplete item +coverage on the graphic display, leftover-map incomplete item coverage on the +pair list, and leftover-map post complete-case coverage fail-closed on the +pair list. + +## References + +Jeon, M., Jin, I. H., Schweinberger, M., & Baugh, S. (2021). Mapping +unobserved item–respondent interactions: A latent space item response +model with interaction map. *Psychometrika, 86*(2), 378–403. +https://doi.org/10.1007/s11336-021-09762-5 +(LSIRM interaction `−γ‖ξ_j − ζ_i‖` after main effects +`α_j − β_i`; typically `p = 2` for the interaction map. Leftover expected of +the leftover cell is persisted `E[Y|θ, item]` after IRT main effects. +Grouping comparison leftover expected names that persisted expectation on the +strip pair row only when formatLeftoverMapExpected returns a usable badge. +When finite, `Y − E = R`.) + +Gabriel, K. R. (1971). The biplot graphic display of matrices with +application to principal component analysis. *Biometrika, 58*(3), +453–467. https://doi.org/10.1093/biomet/58.3.453 diff --git a/docs/product-technical-gap-baseline.md b/docs/product-technical-gap-baseline.md index cdb28e3c5..ecaecac1d 100644 --- a/docs/product-technical-gap-baseline.md +++ b/docs/product-technical-gap-baseline.md @@ -1,5 +1,22 @@ # Product & Technical Gap Baseline +> Exact-head loop overlay: 2026-08-31 01:45 KST. Protected `main` is +> `cb187cadee5fb6c46d8a944815ccc154a1e028d1`. Writes work. Do not +> self-approve. #836 leftover observed `Y` on grouping comparison +> leftover-pair buttons (v2.56.0 / ADR 0299) is `ada0c86`, stacked on +> #835 @ `a825c33`. Next buyer increment on this cycle: leftover expected +> `E` on grouping comparison leftover-pair buttons (ADR 0300 / v2.57.0) +> delivered locally on `feat/leftover-map-compare-expected-v2570`. Caption +> each strip leftover-pair button through formatLeftoverMapExpected with +> distinct aria-label `Leftover map comparison expected`. UI-only; no new +> columns. Missing or non-finite `E` omits that badge independently of +> `Y`, `R`, `U`, `x`, `s`, `e`, `R̂`, `d`, and coverage notes. Do not invent +> `E` from `Y` and `R`. A finite negative leftover is shown, never +> clamped. Stack onto #836. Leave open for independent review. Do not +> squash-merge. Issues #79 and #87 stay open. #96 is already closed. Do +> not merge #808 without independent APPROVE. + + > Exact-head loop overlay: 2026-08-31 01:40 KST. Protected `main` is > `cb187cadee5fb6c46d8a944815ccc154a1e028d1`. Writes work. Do not > self-approve. #835 leftover residual `R` on grouping comparison diff --git a/frontend/package.json b/frontend/package.json index 4f0158ad8..bc6359902 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "2.56.0", + "version": "2.57.0", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 94524dbc9..fbeb990df 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -938,6 +938,7 @@ describe("App, authenticated", () => { leftover_map_cross_share: 0.12, leftover_map_unexplained: 0.05, observed_response: 2.4, + expected_response: 2.0, }, ], leftover_map_coverage: { @@ -4449,6 +4450,21 @@ describe("App, authenticated", () => { "Leftover map comparison observed", ), ).toHaveLength(1); + expect( + within(screen.getByLabelText("Grouping comparison")).queryByLabelText( + /leftover expected/, + ), + ).not.toBeInTheDocument(); + expect( + within(screen.getByLabelText("Grouping comparison")).getByLabelText( + "Leftover map comparison expected", + ), + ).toHaveTextContent("E 2.00"); + expect( + within(screen.getByLabelText("Grouping comparison")).getAllByLabelText( + "Leftover map comparison expected", + ), + ).toHaveLength(1); expect( screen.getByRole("button", { name: /open leftover closest pair from comparison: specification revision requested/i, @@ -4489,6 +4505,11 @@ describe("App, authenticated", () => { name: /open leftover closest pair from comparison: specification revision requested/i, }), ).not.toHaveTextContent("Y "); + expect( + screen.getByRole("button", { + name: /open leftover closest pair from comparison: specification revision requested/i, + }), + ).not.toHaveTextContent("E "); expect( screen.getByRole("button", { name: "Compare Business unit (PU): Demo Report High, mean θ 0.81" }), ).toHaveTextContent("mean θ 0.81"); @@ -4543,6 +4564,11 @@ describe("App, authenticated", () => { name: /open leftover closest pair from comparison: public post/i, }), ).toHaveTextContent("Y 2.40"); + expect( + screen.getByRole("button", { + name: /open leftover closest pair from comparison: public post/i, + }), + ).toHaveTextContent("E 2.00"); await waitFor(() => expect(fetchMock).toHaveBeenCalledWith( expect.stringContaining("/api/reports/thread_group/2026-W02"), diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e902b82ee..b89f26cd5 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -162,7 +162,9 @@ import { LEFTOVER_MAP_COMPARE_RESIDUAL_LABEL, } from "./leftoverResidual"; import { + formatLeftoverMapExpected, formatLeftoverMapObserved, + LEFTOVER_MAP_COMPARE_EXPECTED_LABEL, LEFTOVER_MAP_COMPARE_OBSERVED_LABEL, } from "./leftoverObservedExpected"; import "./App.css"; @@ -4104,6 +4106,7 @@ function ReportsPanel({ ); const residual = formatLeftoverMapResidual(pair.leftover_residual); const observed = formatLeftoverMapObserved(pair.observed_response); + const expected = formatLeftoverMapExpected(pair.expected_response); return (
  • ) : null} + {expected ? ( + + {expected} + + ) : null}
  • ); diff --git a/frontend/src/components/LeftoverPairList.tsx b/frontend/src/components/LeftoverPairList.tsx index dd141db18..89e6e123b 100644 --- a/frontend/src/components/LeftoverPairList.tsx +++ b/frontend/src/components/LeftoverPairList.tsx @@ -98,7 +98,8 @@ export type LeftoverPairListProps = { * buttons, not this pair list. ADR 0298 names persisted leftover residual on * grouping comparison leftover-pair buttons, not this pair list. ADR 0299 names * persisted leftover observed on grouping comparison leftover-pair buttons, not - * this pair list. Every badge still + * this pair list. ADR 0300 names persisted leftover expected on grouping + * comparison leftover-pair buttons, not this pair list. Every badge still * renders together before opening the named post. */ export function LeftoverPairList({ diff --git a/frontend/src/i18n.test.ts b/frontend/src/i18n.test.ts index 11ad098af..9b1325123 100644 --- a/frontend/src/i18n.test.ts +++ b/frontend/src/i18n.test.ts @@ -88,6 +88,7 @@ describe("i18n", () => { "Leftover map comparison unexplained leftover", "Leftover map comparison residual", "Leftover map comparison observed", + "Leftover map comparison expected", "Leftover-map graphic item coverage", "Leftover map item coverage", "Leftover map incomplete posts", @@ -519,6 +520,19 @@ describe("i18n", () => { }, ); + it.each([ + ["ko", "잔여 지도 비교 기대"], + ["zh", "残差地图比较期望"], + ["ja", "残差マップの比較期待"], + ["vi", "Kỳ vọng so sánh bản đồ phần dư"], + ] as const)( + "formats leftover map comparison expected label in %s", + (locale, expected) => { + setLocale(locale); + expect(t("Leftover map comparison expected")).toBe(expected); + }, + ); + it.each([ ["ko", "잔여 지도 그림 기준 포함 범위"], ["zh", "残差图图形准则覆盖范围"], diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index af8853f9f..11e99703e 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -279,6 +279,7 @@ const TRANSLATIONS: Partial>> = { "Leftover map comparison unexplained leftover": "잔여 지도 비교 미설명 잔여", "Leftover map comparison residual": "잔여 지도 비교 잔여", "Leftover map comparison observed": "잔여 지도 비교 관측", + "Leftover map comparison expected": "잔여 지도 비교 기대", "Leftover map item coverage": "잔여 지도 기준 포함 범위", "Leftover map incomplete posts": "잔여 지도 불완전 글", "Leftover map incomplete items": "잔여 지도 불완전 기준", @@ -896,6 +897,7 @@ const TRANSLATIONS: Partial>> = { "Leftover map comparison unexplained leftover": "残差地图比较未解释残差", "Leftover map comparison residual": "残差地图比较残差", "Leftover map comparison observed": "残差地图比较观测", + "Leftover map comparison expected": "残差地图比较期望", "Leftover map item coverage": "残差地图准则覆盖范围", "Leftover map incomplete posts": "残差地图不完整帖文", "Leftover map incomplete items": "残差地图不完整准则", @@ -1534,6 +1536,7 @@ const TRANSLATIONS: Partial>> = { "Leftover map comparison unexplained leftover": "残差マップの比較未説明残差", "Leftover map comparison residual": "残差マップの比較残差", "Leftover map comparison observed": "残差マップの比較観測", + "Leftover map comparison expected": "残差マップの比較期待", "Leftover map item coverage": "残差マップの基準対象範囲", "Leftover map incomplete posts": "残差マップの不完全投稿", "Leftover map incomplete items": "残差マップの不完全基準", @@ -2151,6 +2154,7 @@ const TRANSLATIONS: Partial>> = { "Leftover map comparison unexplained leftover": "Phần dư chưa giải thích so sánh", "Leftover map comparison residual": "Phần dư so sánh bản đồ phần dư", "Leftover map comparison observed": "Quan sát so sánh bản đồ phần dư", + "Leftover map comparison expected": "Kỳ vọng so sánh bản đồ phần dư", "Leftover map item coverage": "Phạm vi tiêu chí bản đồ phần dư", "Leftover map incomplete posts": "Bài không đầy đủ trên bản đồ phần dư", "Leftover map incomplete items": "Tiêu chí không đầy đủ trên bản đồ phần dư", diff --git a/frontend/src/leftoverMapPlotLayout.ts b/frontend/src/leftoverMapPlotLayout.ts index b86341f4b..c775f4a73 100644 --- a/frontend/src/leftoverMapPlotLayout.ts +++ b/frontend/src/leftoverMapPlotLayout.ts @@ -26,8 +26,9 @@ * (ADR 0295), grouping comparison leftover-map cross share * (ADR 0296), grouping comparison leftover-map unexplained leftover * (ADR 0297), grouping comparison leftover residual - * (ADR 0298), and grouping comparison leftover observed - * (ADR 0299) caption the pair list or the grouping comparison strip, + * (ADR 0298), grouping comparison leftover observed + * (ADR 0299), and grouping comparison leftover expected + * (ADR 0300) caption the pair list or the grouping comparison strip, * not this graphic layout. */ diff --git a/frontend/src/leftoverObservedExpected.test.ts b/frontend/src/leftoverObservedExpected.test.ts index 258a69184..561a599b4 100644 --- a/frontend/src/leftoverObservedExpected.test.ts +++ b/frontend/src/leftoverObservedExpected.test.ts @@ -4,6 +4,7 @@ import { formatLeftoverMapObserved, formatLeftoverObservedExpected, LEFTOVER_MAP_COMPARE_OBSERVED_LABEL, + LEFTOVER_MAP_COMPARE_EXPECTED_LABEL, } from "./leftoverObservedExpected"; describe("formatLeftoverObservedExpected", () => { @@ -56,4 +57,9 @@ describe("formatLeftoverMapExpected", () => { expect(formatLeftoverMapExpected(Number.NaN)).toBeNull(); expect(formatLeftoverMapExpected(Number.POSITIVE_INFINITY)).toBeNull(); }); + + it("keeps the grouping comparison expected label distinct from the graphic expected label", () => { + expect(LEFTOVER_MAP_COMPARE_EXPECTED_LABEL).toBe("Leftover map comparison expected"); + expect(LEFTOVER_MAP_COMPARE_EXPECTED_LABEL).not.toBe("leftover expected {label}"); + }); }); diff --git a/frontend/src/leftoverObservedExpected.ts b/frontend/src/leftoverObservedExpected.ts index 9ffc91f3f..a647dae15 100644 --- a/frontend/src/leftoverObservedExpected.ts +++ b/frontend/src/leftoverObservedExpected.ts @@ -3,6 +3,9 @@ export const LEFTOVER_MAP_COMPARE_OBSERVED_LABEL = "Leftover map comparison observed"; +export const LEFTOVER_MAP_COMPARE_EXPECTED_LABEL = + "Leftover map comparison expected"; + export function formatLeftoverObservedExpected( observed: number | null | undefined, expected: number | null | undefined, diff --git a/pyproject.toml b/pyproject.toml index 09a2849c2..12ed84b43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lineageweave" -version = "2.56.0" +version = "2.57.0" description = "Reconstructs git-branch-style lineage DAGs from scattered short records using multi-channel score fusion and LLM adjudication." readme = "README.md" license = { text = "MIT" }