From 7a6c0384f4d82544541b6af70cf178c51ed60d62 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Mon, 31 Aug 2026 09:59:52 +0000 Subject: [PATCH] feat(reports): leftover-map graphic leftover-map axis origin ticks independently of leftover-map axis share and leftover-map singular values (v2.100.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caption leftover-map graphic leftover-map axis origin ticks through leftoverMapPlotTickAxisBadge independently of leftover-map axis share and leftover-map singular values (ADR 0343). Distinct accessible name leftover-map axis {axis} origin tick {value}. Rank-0 unused axes still name leftover-map origin 0.00. Share and singular omit independently. leftoverMapComparePlotTickAxisBadge stays leftover-map comparison graphic leftover-map axis tick keys. Do not invent leftover-map origin from leftover-map axis share or σ_k. Do not mix #877. UI-only. No SQL. Never invent a leftover score or a theta. --- AGENTS.md | 7 ++ ARCHITECTURE.md | 2 + ...0.0-leftover-map-plot-tick-origin-badge.md | 16 ++++ CHANGELOG.md | 14 +++ CLAUDE.md | 2 +- .../0327-leftover-map-plot-tick-axis-badge.md | 3 + ...0332-leftover-map-plot-tick-share-badge.md | 3 + ...-map-compare-list-criterion-coordinates.md | 3 + ...343-leftover-map-plot-tick-origin-badge.md | 91 +++++++++++++++++++ docs/product-technical-gap-baseline.md | 9 ++ frontend/package.json | 2 +- .../src/components/LeftoverMapPlot.test.tsx | 8 +- frontend/src/components/LeftoverMapPlot.tsx | 4 + frontend/src/i18n.test.ts | 34 +++++++ frontend/src/i18n.ts | 28 ++++++ frontend/src/leftoverMapAxisBadge.ts | 2 + .../src/leftoverMapPlotAxisSingular.test.ts | 43 ++++++++- frontend/src/leftoverMapPlotAxisSingular.ts | 35 ++++++- frontend/src/leftoverMapPlotLayout.ts | 3 + pyproject.toml | 2 +- 20 files changed, 296 insertions(+), 15 deletions(-) create mode 100644 CHANGELOG.d/2.100.0-leftover-map-plot-tick-origin-badge.md create mode 100644 docs/adr/0343-leftover-map-plot-tick-origin-badge.md diff --git a/AGENTS.md b/AGENTS.md index b59185c85..51a620c65 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -826,6 +826,11 @@ post leftover-map person coordinates stay `leftover map comparison leftover pair criterion leftover-map item coordinates stay `leftover pair leftover-map criterion {label} at ζ {item}` this increment. Leftover-map graphic leftover-map criterion markers stay `leftover-map criterion {label} at ζ {item}` this increment. Leftover-map comparison graphic leftover-map criterion markers stay `leftover map comparison graphic leftover-map criterion {label} at ζ {item}` this increment. +ADR 0343 captions leftover-map graphic leftover-map axis origin ticks with leftover-map origin when leftoverMapPlotTickAxisBadge +returns a leftover-map origin tick caption independently of leftover-map axis share and leftover-map singular values. Distinct accessible name +`leftover-map axis {axis} origin tick {value}`. Rank-0 unused axes still name leftover-map origin `0.00`. Share and singular omit independently. +Do not invent leftover-map origin from leftover-map axis share or leftover-map singular values `σ_k`. leftoverMapComparePlotTickAxisBadge stays +`leftover map comparison graphic leftover-map axis {axis} tick {value}` this increment. 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 @@ -999,6 +1004,8 @@ Leftover-map comparison leftover-pair leftover-map criterion leftover-map item c (ADR 0342) captions leftover-map comparison leftover-pair leftover-map criterion with persisted leftover-map item coordinates when leftoverMapCompareListCriterionBadge returns a usable leftover-map comparison leftover-pair leftover-map criterion leftover-map item coordinate caption. +Leftover-map graphic leftover-map axis origin ticks independently of leftover-map axis share and leftover-map singular values +(ADR 0343) captions leftover-map graphic leftover-map axis origin ticks when leftoverMapPlotTickAxisBadge returns a leftover-map origin tick caption. 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 e2676db12..de29e411a 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -809,6 +809,8 @@ person coordinate caption independently of leftover-map comparison leftover-pair ADR 0342 captions leftover-map comparison leftover-pair leftover-map criterion with persisted leftover-map item coordinates when leftoverMapCompareListCriterionBadge returns a usable leftover-map comparison leftover-pair leftover-map criterion leftover-map item coordinate caption independently of leftover-map comparison leftover-pair leftover-map post leftover-map person coordinates. +ADR 0343 captions leftover-map graphic leftover-map axis origin ticks when leftoverMapPlotTickAxisBadge +returns a leftover-map origin tick caption independently of leftover-map axis share and leftover-map singular values. 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 diff --git a/CHANGELOG.d/2.100.0-leftover-map-plot-tick-origin-badge.md b/CHANGELOG.d/2.100.0-leftover-map-plot-tick-origin-badge.md new file mode 100644 index 000000000..0bc5a238a --- /dev/null +++ b/CHANGELOG.d/2.100.0-leftover-map-plot-tick-origin-badge.md @@ -0,0 +1,16 @@ +## 2.100.0 — Leftover-map origin on leftover-map graphic leftover-map axis ticks independently of leftover-map axis share and leftover-map singular values + +- Caption leftover-map graphic leftover-map axis origin ticks through leftoverMapPlotTickAxisBadge + independently of leftover-map axis share and leftover-map singular values (ADR 0343). After `make seed`, leftover-map graphic leftover-map + axis origin ticks name leftover-map origin when leftoverMapPlotTickIsOrigin returns true. Distinct accessible name + `leftover-map axis {axis} origin tick {value}`. Rank-0 unused axes still name leftover-map origin `0.00`. Share and + singular omit independently as + `leftover-map axis {axis} origin tick {value} σ {singular}`, + `leftover-map axis {axis} origin tick {value} {share}%`, and + `leftover-map axis {axis} origin tick {value} σ {singular} {share}%`. + Non-origin leftover-map graphic leftover-map axis ticks stay + `leftover-map axis {axis} tick {value}`. leftoverMapComparePlotTickAxisBadge stays + `leftover map comparison graphic leftover-map axis {axis} tick {value}` + this increment. Do not invent leftover-map origin from leftover-map axis share or leftover-map singular values `σ_k`. + Do not mix #877. A finite negative leftover is shown, never clamped. Never invent a leftover score. + Never invent a theta. No new columns. diff --git a/CHANGELOG.md b/CHANGELOG.md index 907517f2c..ab2db20ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,20 @@ All notable changes to this project are documented here. Format follows ### Added +- Period leftover pairs now caption leftover-map graphic leftover-map axis origin ticks + through leftoverMapPlotTickAxisBadge independently of leftover-map axis share and leftover-map singular values (ADR 0343 / v2.100.0). After `make seed`, leftover-map graphic leftover-map + axis origin ticks name leftover-map origin when leftoverMapPlotTickIsOrigin returns true. Distinct accessible name + `leftover-map axis {axis} origin tick {value}`. Rank-0 unused axes still name leftover-map origin `0.00`. Share and + singular omit independently as + `leftover-map axis {axis} origin tick {value} σ {singular}`, + `leftover-map axis {axis} origin tick {value} {share}%`, and + `leftover-map axis {axis} origin tick {value} σ {singular} {share}%`. + Non-origin leftover-map graphic leftover-map axis ticks stay + `leftover-map axis {axis} tick {value}`. leftoverMapComparePlotTickAxisBadge stays + `leftover map comparison graphic leftover-map axis {axis} tick {value}` + this increment. Do not invent leftover-map origin from leftover-map axis share or leftover-map singular values `σ_k`. + Do not mix #877. A finite negative leftover is shown, never clamped. Never invent a leftover score or a theta. No new columns. + - Period leftover pairs now caption leftover-map comparison leftover-pair leftover-map criterion with persisted leftover-map item coordinates through leftoverMapCompareListCriterionBadge independently of leftover-map comparison leftover-pair leftover-map post leftover-map person coordinates (ADR 0342 / v2.99.0). After `make seed`, diff --git a/CLAUDE.md b/CLAUDE.md index 1e7abb757..b019dedc5 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 / 0300 / 0301 / 0302 / 0303 / 0304 / 0305 / 0306 / 0307 / 0308 / 0309 / 0310 / 0311 / 0312 / 0313 / 0314 / 0315 / 0316 / 0317 / 0318 / 0319 / 0320 / 0321 / 0322 / 0323 / 0324 / 0325 / 0326 / 0327 / 0328 / 0329 / 0330 / 0331 / 0332 / 0333 / 0334 / 0335 / 0336 / 0337 / 0338 / 0339 / 0340 / 0341 / 0342), 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 / 0301 / 0302 / 0303 / 0304 / 0305 / 0306 / 0307 / 0308 / 0309 / 0310 / 0311 / 0312 / 0313 / 0314 / 0315 / 0316 / 0317 / 0318 / 0319 / 0320 / 0321 / 0322 / 0323 / 0324 / 0325 / 0326 / 0327 / 0328 / 0329 / 0330 / 0331 / 0332 / 0333 / 0334 / 0335 / 0336 / 0337 / 0338 / 0339 / 0340 / 0341 / 0342 / 0343), 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/0327-leftover-map-plot-tick-axis-badge.md b/docs/adr/0327-leftover-map-plot-tick-axis-badge.md index 01852a09d..71317de17 100644 --- a/docs/adr/0327-leftover-map-plot-tick-axis-badge.md +++ b/docs/adr/0327-leftover-map-plot-tick-axis-badge.md @@ -3,6 +3,9 @@ **Decision status:** Accepted **Date:** 2026-08-31 +**Amended by:** [ADR 0343](0343-leftover-map-plot-tick-origin-badge.md) +(leftover-map origin on leftover-map graphic leftover-map axis ticks independently of leftover-map axis share and leftover-map singular values) + Amends leftover-map coordinate ticks on the leftover-map graphic ([ADR 0270](0270-leftover-map-coordinate-ticks.md)), leftover-map singular values on leftover-map graphic-display axes diff --git a/docs/adr/0332-leftover-map-plot-tick-share-badge.md b/docs/adr/0332-leftover-map-plot-tick-share-badge.md index 6212b74dd..ac5dfa294 100644 --- a/docs/adr/0332-leftover-map-plot-tick-share-badge.md +++ b/docs/adr/0332-leftover-map-plot-tick-share-badge.md @@ -3,6 +3,9 @@ **Decision status:** Accepted **Date:** 2026-08-31 +**Amended by:** [ADR 0343](0343-leftover-map-plot-tick-origin-badge.md) +(leftover-map origin on leftover-map graphic leftover-map axis ticks independently of leftover-map axis share and leftover-map singular values) + Amends leftover-map graphic leftover-map axis tick leftover-map singular values independently of leftover-map axis share ([ADR 0327](0327-leftover-map-plot-tick-axis-badge.md)), leftover-map diff --git a/docs/adr/0342-leftover-map-compare-list-criterion-coordinates.md b/docs/adr/0342-leftover-map-compare-list-criterion-coordinates.md index 0d7900c55..8041d1dad 100644 --- a/docs/adr/0342-leftover-map-compare-list-criterion-coordinates.md +++ b/docs/adr/0342-leftover-map-compare-list-criterion-coordinates.md @@ -3,6 +3,9 @@ **Decision status:** Accepted **Date:** 2026-08-31 +**Amended by:** [ADR 0343](0343-leftover-map-plot-tick-origin-badge.md) +(leftover-map origin on leftover-map graphic leftover-map axis ticks independently of leftover-map axis share and leftover-map singular values) + Amends leftover-map coordinates ([ADR 0267](0267-leftover-map-coordinates.md)) and leftover-map coordinates on grouping comparison strip pair rows ([ADR 0302](0302-leftover-map-compare-coordinates.md)). Independent of leftover-map diff --git a/docs/adr/0343-leftover-map-plot-tick-origin-badge.md b/docs/adr/0343-leftover-map-plot-tick-origin-badge.md new file mode 100644 index 000000000..415c0896c --- /dev/null +++ b/docs/adr/0343-leftover-map-plot-tick-origin-badge.md @@ -0,0 +1,91 @@ +# ADR 0343 — Name leftover-map origin on leftover-map graphic leftover-map axis ticks independently of leftover-map axis share and leftover-map singular values + +**Decision status:** Accepted +**Date:** 2026-08-31 + +Amends leftover-map coordinate ticks +([ADR 0270](0270-leftover-map-coordinate-ticks.md)), leftover-map graphic leftover-map axis ticks leftover-map singular values +([ADR 0327](0327-leftover-map-plot-tick-axis-badge.md)), and leftover-map graphic leftover-map axis ticks leftover-map axis share +([ADR 0332](0332-leftover-map-plot-tick-share-badge.md)). Independent of leftover-map +comparison leftover-pair leftover-map criterion leftover-map item coordinates independently of leftover-map comparison leftover-pair leftover-map post leftover-map person coordinates +([ADR 0342](0342-leftover-map-compare-list-criterion-coordinates.md)). Independent of leftover-map +comparison graphic leftover-map axis origin ticks (do not mix #877). + +## Context + +ADR 0270 already names leftover-map graphic leftover-map axis ticks +`leftover-map axis {axis} tick {value}`. ADR 0327 already names leftover-map +singular values `σ_k` on those ticks. ADR 0332 already names leftover-map +axis share on those ticks. Rank-0 unused axes still persist leftover-map +origin `0.00` (`formatSignedLeftoverValue(0)` emits no plus). Origin ticks +still interpolate leftover-map origin only through leftover-map tick keys. +Share and singular omit independently. A finite negative leftover is shown, +never clamped. Do not invent leftover-map origin from leftover-map axis share +or leftover-map singular values `σ_k`. leftoverMapComparePlotTickAxisBadge stays +`leftover map comparison graphic leftover-map axis {axis} tick {value}` +this increment. + +This increment names leftover-map graphic leftover-map axis origin ticks as +leftoverMapPlotTickAxisBadge. Leftover-map graphic leftover-map axis origin ticks stay +`leftover-map axis {axis} origin tick {value}` +when leftoverMapPlotTickIsOrigin returns true, so they stay distinct from leftover-map +graphic leftover-map axis ticks +`leftover-map axis {axis} tick {value}` +and leftover-map comparison graphic leftover-map axis ticks +`leftover map comparison graphic leftover-map axis {axis} tick {value}`. +Share and singular still omit independently: +`leftover-map axis {axis} origin tick {value} σ {singular}`, +`leftover-map axis {axis} origin tick {value} {share}%`, and +`leftover-map axis {axis} origin tick {value} σ {singular} {share}%`. +It does not add columns. Do not invent a leftover score. Do not invent a theta. + +This protected increment uses **0343** so it does not collide with leftover-map +item coordinates on leftover-map comparison leftover pair leftover-map criterion independently of leftover-map comparison leftover pair leftover-map post leftover-map person coordinates +(0342) or leftover-map comparison graphic leftover-map axis origin ticks (#877). + +## Decision + +On leftover-map graphic leftover-map axis ticks, caption leftover-map origin +when leftoverMapPlotTickIsOrigin returns true. Rank-0 unused axes still name leftover-map +origin `0.00`. Share and singular omit independently of leftover-map origin. +Non-origin ticks stay leftover-map tick keys. leftoverMapComparePlotTickAxisBadge, +leftoverMapCompareAxisTickBadge, and leftoverMapAxisTickBadge do not name leftover-map +origin this increment. + +Do not add SQL. Do not edit shipped migrations. Do not invent a leftover +score. Do not invent a theta. + +## Consequences + +After `make seed`, leftover-map graphic leftover-map axis origin ticks name +leftover-map origin independently of leftover-map axis share and leftover-map +singular values. Rank-0 unused axes still name leftover-map origin `0.00`. +leftoverMapComparePlotTickAxisBadge stays leftover-map comparison graphic leftover-map +axis tick keys. leftover-map graphic leftover-map axis ticks leftover-map singular values +independently of leftover-map axis share (ADR 0327) and leftover-map graphic leftover-map +axis ticks leftover-map axis share independently of leftover-map singular values +(ADR 0332) remain. + +## Related + +Independent of leftover-map comparison leftover-pair leftover-map criterion leftover-map item coordinates independently of leftover-map +comparison leftover-pair leftover-map post leftover-map person coordinates +([ADR 0342](0342-leftover-map-compare-list-criterion-coordinates.md)). Independent of leftover-map +graphic leftover-map axis ticks leftover-map axis share independently of leftover-map +singular values ([ADR 0332](0332-leftover-map-plot-tick-share-badge.md)). Independent of leftover-map +graphic leftover-map axis ticks leftover-map singular values independently of leftover-map +axis share ([ADR 0327](0327-leftover-map-plot-tick-axis-badge.md)). Independent of leftover-map +coordinate ticks ([ADR 0270](0270-leftover-map-coordinate-ticks.md)). + +## References + +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 + +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.) diff --git a/docs/product-technical-gap-baseline.md b/docs/product-technical-gap-baseline.md index 40c935680..788679361 100644 --- a/docs/product-technical-gap-baseline.md +++ b/docs/product-technical-gap-baseline.md @@ -1,5 +1,14 @@ # Product & Technical Gap Baseline +> Exact-head loop overlay: 2026-08-31 18:55 KST. Protected `main` is +> `cb187cadee5fb6c46d8a944815ccc154a1e028d1`. Writes work. Do not +> self-approve. #884 leftover-map item coordinates on leftover-map comparison leftover pair leftover-map +> criterion independently of leftover-map comparison leftover pair leftover-map post leftover-map person coordinates (v2.99.0 / ADR 0342) is +> `bcbb7ce`, stacked on #883 @ `bdd48e2`. Independent APPROVE is missing. Next buyer increment on this cycle: leftover-map graphic leftover-map +> axis origin ticks independently of leftover-map axis share and leftover-map singular values as leftoverMapPlotTickAxisBadge (ADR 0343 / v2.100.0) delivered locally on +> `feat/leftover-map-plot-tick-origin-badge-v21000`. Distinct accessible name +> `leftover-map axis {axis} origin tick {value}`. Rank-0 unused axes still name leftover-map origin `0.00`. Share and singular omit independently. leftoverMapComparePlotTickAxisBadge stays leftover-map comparison graphic leftover-map axis tick keys. Do not invent leftover-map origin from leftover-map axis share or `σ_k`. Do not mix #877. Stack onto #884. Leave open for independent review. Do not squash-merge. Do not self-approve. Issues #79 and #87 stay open. Do not merge #808 without independent APPROVE. + > Exact-head loop overlay: 2026-08-31 18:50 KST. Protected `main` is > `cb187cadee5fb6c46d8a944815ccc154a1e028d1`. Writes work. Do not > self-approve. #883 leftover-map person coordinates on leftover-map comparison leftover-pair leftover-map diff --git a/frontend/package.json b/frontend/package.json index cd5927230..b67a46e63 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "2.99.0", + "version": "2.100.0", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/components/LeftoverMapPlot.test.tsx b/frontend/src/components/LeftoverMapPlot.test.tsx index e00e80e00..f17cf0535 100644 --- a/frontend/src/components/LeftoverMapPlot.test.tsx +++ b/frontend/src/components/LeftoverMapPlot.test.tsx @@ -73,7 +73,7 @@ describe("LeftoverMapPlot", () => { expect(screen.getByText("leftover-map axis 2")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map axis 1 tick +0.50")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map axis 2 tick −0.02")).toBeInTheDocument(); - expect(screen.getByLabelText("leftover-map axis 1 tick 0.00")).toBeInTheDocument(); + expect(screen.getByLabelText("leftover-map axis 1 origin tick 0.00")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map distance d 0.12")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map distance d 1.84")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map reconstruction R̂ +0.25")).toBeInTheDocument(); @@ -176,9 +176,11 @@ describe("LeftoverMapPlot", () => { expect(screen.queryByLabelText("Criterion ζ sales-lead")).not.toBeInTheDocument(); expect(screen.getByText("leftover-map axis 1 σ 0.00 (0%)")).toBeInTheDocument(); expect(screen.getByText("leftover-map axis 2 σ 0.00 (0%)")).toBeInTheDocument(); - expect(screen.getAllByLabelText("leftover-map axis 1 tick 0.00 σ 0.00 0%").length).toBeGreaterThan(0); + expect(screen.getAllByLabelText("leftover-map axis 1 origin tick 0.00 σ 0.00 0%").length).toBeGreaterThan(0); expect(screen.queryByLabelText("leftover-map axis 1 tick 0.00")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("leftover-map axis 1 origin tick 0.00")).not.toBeInTheDocument(); expect(screen.queryByLabelText("leftover-map axis 1 tick 0.00 σ 0.00")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("leftover-map axis 1 origin tick 0.00 σ 0.00")).not.toBeInTheDocument(); expect(screen.queryByLabelText("leftover-map axis 1 tick +1.00")).not.toBeInTheDocument(); expect(screen.getByLabelText("leftover-map distance d 0.00")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map reconstruction R̂ 0.00")).toBeInTheDocument(); @@ -222,7 +224,7 @@ describe("LeftoverMapPlot", () => { />, ); expect(screen.getByLabelText("leftover-map axis 1 tick +0.50 σ 1.84")).toBeInTheDocument(); - expect(screen.getByLabelText("leftover-map axis 1 tick 0.00 σ 1.84")).toBeInTheDocument(); + expect(screen.getByLabelText("leftover-map axis 1 origin tick 0.00 σ 1.84")).toBeInTheDocument(); expect(screen.getByLabelText("leftover-map axis 2 tick −0.02")).toBeInTheDocument(); expect(screen.queryByLabelText("leftover-map axis 1 tick +0.50")).not.toBeInTheDocument(); expect(screen.queryByText(/leftover-map axis 1 tick \+0\.50 \(82%\)/)).not.toBeInTheDocument(); diff --git a/frontend/src/components/LeftoverMapPlot.tsx b/frontend/src/components/LeftoverMapPlot.tsx index 2855eebeb..720f1c5c5 100644 --- a/frontend/src/components/LeftoverMapPlot.tsx +++ b/frontend/src/components/LeftoverMapPlot.tsx @@ -281,6 +281,10 @@ function leftoverMapPlotPostText( * ADR 0332 fail-closes leftover-map graphic leftover-map axis ticks leftover-map * axis share through leftoverMapPlotTickAxisBadge independently of leftover-map * singular values. + * ADR 0343 fail-closes leftover-map graphic leftover-map axis origin ticks through + * leftoverMapPlotTickAxisBadge independently of leftover-map axis share and leftover-map + * singular values. leftoverMapComparePlotTickAxisBadge does not name leftover-map origin + * this increment. * Never invent a leftover score. */ export function LeftoverMapPlot({ diff --git a/frontend/src/i18n.test.ts b/frontend/src/i18n.test.ts index a4a17689b..03c0fd107 100644 --- a/frontend/src/i18n.test.ts +++ b/frontend/src/i18n.test.ts @@ -83,6 +83,10 @@ describe("i18n", () => { "leftover-map axis {axis} tick {value} σ {singular}", "leftover-map axis {axis} tick {value} {share}%", "leftover-map axis {axis} tick {value} σ {singular} {share}%", + "leftover-map axis {axis} origin tick {value}", + "leftover-map axis {axis} origin tick {value} σ {singular}", + "leftover-map axis {axis} origin tick {value} {share}%", + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%", "leftover-map distance {label}", "leftover-map reconstruction {label}", "leftover-map explained leftover share {label}", @@ -1328,6 +1332,36 @@ describe("i18n", () => { }, ); + it.each([ + ["ko", "잔여 지도 축 1 원점 눈금 0.00"], + ["zh", "残差图轴 1 原点刻度 0.00"], + ["ja", "残差マップ軸 1 原点目盛 0.00"], + ["vi", "vạch gốc trục bản đồ phần dư 1 0.00"], + ] as const)("formats leftover-map graphic leftover-map axis origin ticks in %s", (locale, expected) => { + setLocale(locale); + expect(tf("leftover-map axis {axis} origin tick {value}", { axis: 1, value: "0.00" })).toBe(expected); + }); + + it.each([ + ["ko", "잔여 지도 축 1 원점 눈금 0.00 σ 0.00 0%"], + ["zh", "残差图轴 1 原点刻度 0.00 σ 0.00 0%"], + ["ja", "残差マップ軸 1 原点目盛 0.00 σ 0.00 0%"], + ["vi", "vạch gốc trục bản đồ phần dư 1 0.00 σ 0.00 0%"], + ] as const)( + "formats leftover-map graphic leftover-map axis origin ticks leftover-map singular values and leftover-map axis share in %s", + (locale, expected) => { + setLocale(locale); + expect( + tf("leftover-map axis {axis} origin tick {value} σ {singular} {share}%", { + axis: 1, + value: "0.00", + singular: "0.00", + share: "0", + }), + ).toBe(expected); + }, + ); + it.each([ ["ko", "잔여 지도 거리 d 0.12"], ["zh", "残差图距离 d 0.12"], diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 824ac57ef..fc8877263 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -687,6 +687,13 @@ const TRANSLATIONS: Partial>> = { "leftover-map axis {axis} tick {value} {share}%": "잔여 지도 축 {axis} 눈금 {value} {share}%", "leftover-map axis {axis} tick {value} σ {singular} {share}%": "잔여 지도 축 {axis} 눈금 {value} σ {singular} {share}%", + "leftover-map axis {axis} origin tick {value}": "잔여 지도 축 {axis} 원점 눈금 {value}", + "leftover-map axis {axis} origin tick {value} σ {singular}": + "잔여 지도 축 {axis} 원점 눈금 {value} σ {singular}", + "leftover-map axis {axis} origin tick {value} {share}%": + "잔여 지도 축 {axis} 원점 눈금 {value} {share}%", + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%": + "잔여 지도 축 {axis} 원점 눈금 {value} σ {singular} {share}%", "leftover-map distance {label}": "잔여 지도 거리 {label}", "leftover-map reconstruction {label}": "잔여 지도 재구성 {label}", "leftover-map explained leftover share {label}": "잔여 지도 설명 잔여 점유율 {label}", @@ -1376,6 +1383,13 @@ const TRANSLATIONS: Partial>> = { "leftover-map axis {axis} tick {value} {share}%": "残差图轴 {axis} 刻度 {value} {share}%", "leftover-map axis {axis} tick {value} σ {singular} {share}%": "残差图轴 {axis} 刻度 {value} σ {singular} {share}%", + "leftover-map axis {axis} origin tick {value}": "残差图轴 {axis} 原点刻度 {value}", + "leftover-map axis {axis} origin tick {value} σ {singular}": + "残差图轴 {axis} 原点刻度 {value} σ {singular}", + "leftover-map axis {axis} origin tick {value} {share}%": + "残差图轴 {axis} 原点刻度 {value} {share}%", + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%": + "残差图轴 {axis} 原点刻度 {value} σ {singular} {share}%", "leftover-map distance {label}": "残差图距离 {label}", "leftover-map reconstruction {label}": "残差图重建 {label}", "leftover-map explained leftover share {label}": "残差图已解释残差份额 {label}", @@ -2069,6 +2083,13 @@ const TRANSLATIONS: Partial>> = { "leftover-map axis {axis} tick {value} {share}%": "残差マップ軸 {axis} 目盛 {value} {share}%", "leftover-map axis {axis} tick {value} σ {singular} {share}%": "残差マップ軸 {axis} 目盛 {value} σ {singular} {share}%", + "leftover-map axis {axis} origin tick {value}": "残差マップ軸 {axis} 原点目盛 {value}", + "leftover-map axis {axis} origin tick {value} σ {singular}": + "残差マップ軸 {axis} 原点目盛 {value} σ {singular}", + "leftover-map axis {axis} origin tick {value} {share}%": + "残差マップ軸 {axis} 原点目盛 {value} {share}%", + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%": + "残差マップ軸 {axis} 原点目盛 {value} σ {singular} {share}%", "leftover-map distance {label}": "残差マップ距離 {label}", "leftover-map reconstruction {label}": "残差マップ再構成 {label}", "leftover-map explained leftover share {label}": "残差マップ説明済み残差割合 {label}", @@ -2767,6 +2788,13 @@ const TRANSLATIONS: Partial>> = { "leftover-map axis {axis} tick {value} {share}%": "vạch trục bản đồ phần dư {axis} {value} {share}%", "leftover-map axis {axis} tick {value} σ {singular} {share}%": "vạch trục bản đồ phần dư {axis} {value} σ {singular} {share}%", + "leftover-map axis {axis} origin tick {value}": "vạch gốc trục bản đồ phần dư {axis} {value}", + "leftover-map axis {axis} origin tick {value} σ {singular}": + "vạch gốc trục bản đồ phần dư {axis} {value} σ {singular}", + "leftover-map axis {axis} origin tick {value} {share}%": + "vạch gốc trục bản đồ phần dư {axis} {value} {share}%", + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%": + "vạch gốc trục bản đồ phần dư {axis} {value} σ {singular} {share}%", "leftover-map distance {label}": "khoảng cách bản đồ phần dư {label}", "leftover-map reconstruction {label}": "tái dựng bản đồ phần dư {label}", "leftover-map explained leftover share {label}": "phần dư giải thích bản đồ phần dư {label}", diff --git a/frontend/src/leftoverMapAxisBadge.ts b/frontend/src/leftoverMapAxisBadge.ts index 51db097a6..2f7686c41 100644 --- a/frontend/src/leftoverMapAxisBadge.ts +++ b/frontend/src/leftoverMapAxisBadge.ts @@ -22,6 +22,8 @@ * axis share as leftoverMapCompareAxisTickBadge, not this helper. * ADR 0334 names leftover-map leftover-axis ticks leftover-map axis share * as leftoverMapAxisTickBadge independently of leftover-map singular values. + * ADR 0343 captions leftover-map graphic leftover-map axis origin ticks as + * leftoverMapPlotTickAxisBadge, not this helper. */ import type { LeftoverMapAxis } from "./api"; diff --git a/frontend/src/leftoverMapPlotAxisSingular.test.ts b/frontend/src/leftoverMapPlotAxisSingular.test.ts index 86c4010ba..ba98ec0e1 100644 --- a/frontend/src/leftoverMapPlotAxisSingular.test.ts +++ b/frontend/src/leftoverMapPlotAxisSingular.test.ts @@ -7,6 +7,7 @@ import { leftoverMapComparePlotTickAxisBadge, leftoverMapPlotAxisBadge, leftoverMapPlotTickAxisBadge, + leftoverMapPlotTickIsOrigin, leftoverSingularForAxis, LEFTOVER_MAP_COMPARE_AXIS_CAPTION, LEFTOVER_MAP_COMPARE_AXIS_LABEL, @@ -24,6 +25,10 @@ import { LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE, LEFTOVER_MAP_PLOT_AXIS_SINGULAR, LEFTOVER_MAP_PLOT_AXIS_SINGULAR_SHARE, + LEFTOVER_MAP_PLOT_ORIGIN_TICK, + LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE, + LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR, + LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE, LEFTOVER_MAP_PLOT_TICK_SHARE, LEFTOVER_MAP_PLOT_TICK_SINGULAR, LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE, @@ -330,11 +335,18 @@ describe("leftover-map graphic leftover-map axis tick leftover-map singular valu }); }); - it("names rank-0 zero leftover-map singular values on leftover-map graphic leftover-map axis ticks", () => { + it("names rank-0 leftover-map origin ticks independently of leftover-map singular values", () => { expect(leftoverMapPlotTickAxisBadge(1, "0.00", 0)).toEqual({ - key: LEFTOVER_MAP_PLOT_TICK_SINGULAR, + key: LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR, values: { axis: 1, value: "0.00", singular: "0.00" }, }); + expect(leftoverMapPlotTickAxisBadge(1, "0.00", null)).toEqual({ + key: LEFTOVER_MAP_PLOT_ORIGIN_TICK, + values: { axis: 1, value: "0.00" }, + }); + expect(leftoverMapPlotTickIsOrigin("0.00")).toBe(true); + expect(leftoverMapPlotTickIsOrigin("+0.50")).toBe(false); + expect(leftoverMapPlotTickIsOrigin("+0.00")).toBe(false); }); it("omits leftover-map singular values independently of leftover-map axis share", () => { @@ -383,6 +395,12 @@ describe("leftover-map graphic leftover-map axis tick leftover-map singular valu expect(leftoverMapPlotTickAxisBadge(1, "+0.50", 1.84).key).not.toBe( leftoverMapComparePlotTickAxisBadge(1, "+0.50", 1.84).key, ); + expect(leftoverMapPlotTickAxisBadge(1, "0.00", 1.84).key).not.toBe( + leftoverMapComparePlotTickAxisBadge(1, "0.00", 1.84).key, + ); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK).toBe("leftover-map axis {axis} origin tick {value}"); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK).not.toBe(LEFTOVER_MAP_PLOT_TICK); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR).not.toBe(LEFTOVER_MAP_PLOT_TICK_SINGULAR); expect(LEFTOVER_MAP_PLOT_TICK_SHARE).toBe("leftover-map axis {axis} tick {value} {share}%"); expect(LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE).toBe( "leftover-map axis {axis} tick {value} σ {singular} {share}%", @@ -690,15 +708,22 @@ describe("leftover-map graphic leftover-map axis tick leftover-map axis share", expect(leftoverMapPlotTickAxisBadge(1, "+0.50", null, 0.82).values.singular).toBeUndefined(); }); - it("names rank-0 zero leftover-map axis share on leftover-map graphic leftover-map axis ticks", () => { + it("names rank-0 leftover-map origin ticks independently of leftover-map axis share and leftover-map singular values", () => { expect(leftoverMapPlotTickAxisBadge(1, "0.00", 0, 0)).toEqual({ - key: LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE, + key: LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE, values: { axis: 1, value: "0.00", singular: "0.00", share: "0" }, }); expect(leftoverMapPlotTickAxisBadge(1, "0.00", null, 0)).toEqual({ - key: LEFTOVER_MAP_PLOT_TICK_SHARE, + key: LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE, values: { axis: 1, value: "0.00", share: "0" }, }); + expect(leftoverMapPlotTickAxisBadge(1, "0.00", 0, null)).toEqual({ + key: LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR, + values: { axis: 1, value: "0.00", singular: "0.00" }, + }); + expect(leftoverMapComparePlotTickAxisBadge(1, "0.00", 0, 0).key).toBe( + LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE, + ); }); it("omits leftover-map axis share independently of leftover-map singular values", () => { @@ -746,6 +771,14 @@ describe("leftover-map graphic leftover-map axis tick leftover-map axis share", expect(LEFTOVER_MAP_PLOT_TICK_SHARE).not.toBe(LEFTOVER_MAP_PLOT_TICK_SINGULAR); expect(LEFTOVER_MAP_PLOT_TICK_SHARE).not.toBe(LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE); expect(LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE).not.toBe(LEFTOVER_MAP_PLOT_TICK_SINGULAR); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE).toBe( + "leftover-map axis {axis} origin tick {value} {share}%", + ); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE).toBe( + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%", + ); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE).not.toBe(LEFTOVER_MAP_PLOT_TICK_SHARE); + expect(LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE).not.toBe(LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE); expect(LEFTOVER_MAP_PLOT_TICK_SHARE).not.toBe(LEFTOVER_MAP_COMPARE_PLOT_TICK_SHARE); expect(LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE).not.toBe(LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE); expect(LEFTOVER_MAP_PLOT_TICK_SHARE).not.toBe(LEFTOVER_MAP_PLOT_AXIS_SHARE); diff --git a/frontend/src/leftoverMapPlotAxisSingular.ts b/frontend/src/leftoverMapPlotAxisSingular.ts index 1085fabe6..e46d339dc 100644 --- a/frontend/src/leftoverMapPlotAxisSingular.ts +++ b/frontend/src/leftoverMapPlotAxisSingular.ts @@ -29,6 +29,11 @@ * ADR 0334 names leftover-map leftover-axis ticks leftover-map * axis share as leftoverMapAxisTickBadge independently of leftover-map * singular values. + * ADR 0343 names leftover-map graphic leftover-map axis origin ticks as + * leftoverMapPlotTickAxisBadge independently of leftover-map axis share and + * leftover-map singular values. leftoverMapComparePlotTickAxisBadge, + * leftoverMapCompareAxisTickBadge, and leftoverMapAxisTickBadge do not name + * leftover-map origin this increment. */ import type { LeftoverMapAxis } from "./api"; @@ -41,6 +46,7 @@ import { LEFTOVER_MAP_COMPARE_PLOT_TICK, LEFTOVER_MAP_PLOT_TICK, } from "./leftoverMapPlotLayout"; +import { formatSignedLeftoverValue } from "./leftoverMapUnexplained"; export const LEFTOVER_MAP_PLOT_AXIS_SINGULAR = "leftover-map axis {axis} σ {value}"; @@ -62,6 +68,18 @@ export const LEFTOVER_MAP_PLOT_TICK_SHARE = export const LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE = "leftover-map axis {axis} tick {value} σ {singular} {share}%"; +export const LEFTOVER_MAP_PLOT_ORIGIN_TICK = + "leftover-map axis {axis} origin tick {value}"; + +export const LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR = + "leftover-map axis {axis} origin tick {value} σ {singular}"; + +export const LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE = + "leftover-map axis {axis} origin tick {value} {share}%"; + +export const LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE = + "leftover-map axis {axis} origin tick {value} σ {singular} {share}%"; + export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR = "leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}"; @@ -132,6 +150,11 @@ export function formatLeftoverMapPlotAxisSingular( return leftoverSingular.toFixed(2); } +export function leftoverMapPlotTickIsOrigin(tickLabel: string): boolean { + const originLabel = formatSignedLeftoverValue(0); + return originLabel !== null && tickLabel === originLabel; +} + export function leftoverMapPlotAxisBadge( axisIndex: number, leftoverSingular: number | null | undefined, @@ -209,23 +232,27 @@ export function leftoverMapPlotTickAxisBadge( ): LeftoverMapCompareAxisBadge { const singular = formatLeftoverMapPlotAxisSingular(leftoverSingular); const percent = formatLeftoverMapPlotAxisShare(leftoverShare); + const origin = leftoverMapPlotTickIsOrigin(tickLabel); if (singular === null && percent === null) { - return { key: LEFTOVER_MAP_PLOT_TICK, values: { axis: axisIndex, value: tickLabel } }; + return { + key: origin ? LEFTOVER_MAP_PLOT_ORIGIN_TICK : LEFTOVER_MAP_PLOT_TICK, + values: { axis: axisIndex, value: tickLabel }, + }; } if (singular === null && percent !== null) { return { - key: LEFTOVER_MAP_PLOT_TICK_SHARE, + key: origin ? LEFTOVER_MAP_PLOT_ORIGIN_TICK_SHARE : LEFTOVER_MAP_PLOT_TICK_SHARE, values: { axis: axisIndex, value: tickLabel, share: percent }, }; } if (singular !== null && percent === null) { return { - key: LEFTOVER_MAP_PLOT_TICK_SINGULAR, + key: origin ? LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR : LEFTOVER_MAP_PLOT_TICK_SINGULAR, values: { axis: axisIndex, value: tickLabel, singular }, }; } return { - key: LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE, + key: origin ? LEFTOVER_MAP_PLOT_ORIGIN_TICK_SINGULAR_SHARE : LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE, values: { axis: axisIndex, value: tickLabel, singular: singular as string, share: percent as string }, }; } diff --git a/frontend/src/leftoverMapPlotLayout.ts b/frontend/src/leftoverMapPlotLayout.ts index 74da067e2..8e322d6fd 100644 --- a/frontend/src/leftoverMapPlotLayout.ts +++ b/frontend/src/leftoverMapPlotLayout.ts @@ -147,6 +147,9 @@ * item coordinates ζ through leftoverMapCompareListCriterionBadge independently of leftover-map * comparison leftover-pair leftover-map post leftover-map person coordinates ξ, not leftover-map * pair-list leftover-map criterion leftover-map item coordinates. + * ADR 0343 fail-closes leftover-map graphic leftover-map axis origin ticks through + * leftoverMapPlotTickAxisBadge independently of leftover-map axis share and leftover-map + * singular values, not leftover-map comparison graphic leftover-map axis ticks. */ import { formatLeftoverMapCoordinatePair } from "./leftoverMapCoordinates"; diff --git a/pyproject.toml b/pyproject.toml index 8a0596b01..38c5515bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lineageweave" -version = "2.99.0" +version = "2.100.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" }