Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
98a29e4
feat(reports): leftover-map singular values on leftover-map compariso…
seonghobae Aug 31, 2026
f68cb0a
test(red): reconstruct comparison-graphic tick singular contract
seonghobae Sep 10, 2026
c5dd240
chore(stack): converge comparison tick singular lane on repaired parent
seonghobae Sep 11, 2026
486a86e
chore(stack): converge comparison tick singular lane on documented pa…
seonghobae Sep 11, 2026
f79c609
chore(stack): converge #869 onto repaired #868 head
seonghobae Sep 12, 2026
72e45e8
chore(stack): converge #869 onto repaired #868
seonghobae Sep 12, 2026
74bd946
chore(stack): converge #869 onto repaired ancestry
seonghobae Sep 13, 2026
468dcd6
chore(stack): converge #869 onto repaired #868
seonghobae Sep 15, 2026
6a19682
chore(stack): converge #869 onto repaired #868
seonghobae Sep 15, 2026
48149a4
merge: converge v2.85.0 onto current v2.84.0 parent
seonghobae Sep 15, 2026
49637c0
merge: converge v2.85.0 onto repaired v2.84.0 parent
seonghobae Sep 15, 2026
26b9ce4
chore(stack): converge #869 onto repaired #868
seonghobae Sep 15, 2026
732ad3b
chore(stack): converge #869 onto repaired #868
seonghobae Sep 15, 2026
7c26ba9
merge(reports): converge report-axis missingness repair into comparis…
seonghobae Sep 15, 2026
2bccac2
merge(reports): converge #869 onto #868 RED contract head
seonghobae Sep 15, 2026
2d8f8c3
chore(stack): converge current #868 into #869
seonghobae Sep 15, 2026
dc3b9fc
chore(stack): converge #869 on current #868
seonghobae Sep 15, 2026
a3c2fca
chore(stack): converge semantic RED harness onto #869
seonghobae Sep 16, 2026
0e57921
chore(stack): converge #868 product repair into #869
seonghobae Sep 16, 2026
29384d7
chore(stack): converge #869 on repaired report tick foundation
seonghobae Sep 16, 2026
e395e3f
fix(reports): project comparison tick singular evidence
seonghobae Sep 16, 2026
552e14e
merge: converge report tick singular wiring into comparison tick lane
seonghobae Sep 18, 2026
19f8670
test(reports): require comparison ticks to consume persisted singular…
seonghobae Sep 18, 2026
00e7bce
fix(reports): wire persisted singular evidence into comparison tick l…
seonghobae Sep 18, 2026
7db16d6
chore(stack): converge comparison tick contract repair from v2.84
seonghobae Sep 19, 2026
58e3eb5
merge: converge #869 on report contract repairs
seonghobae Sep 19, 2026
838dd8c
chore(stack): converge #869 onto #868 owner stack
seonghobae Sep 20, 2026
e553f8e
chore(stack): converge #869 onto repaired #868 head
seonghobae Sep 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions frontend/src/components/LeftoverMapPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import {
formatLeftoverMapPlotAxisSingular,
leftoverMapComparePlotAxisBadge,
leftoverMapComparePlotTickAxisBadge,
leftoverMapPlotTickAxisBadge,
leftoverSingularForAxis,
LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR,
Expand Down Expand Up @@ -362,20 +363,23 @@ export function LeftoverMapPlot({
{leftoverMapPlotAxisText(2, leftoverMapAxes, variant)}
</text>
{layout.ticks.map((tick) => {
const singular = leftoverSingularForAxis(leftoverMapAxes, tick.axis);
const reportTickBadge =
variant === "report"
? leftoverMapPlotTickAxisBadge(
tick.axis,
tick.label,
leftoverSingularForAxis(leftoverMapAxes, tick.axis),
)
? leftoverMapPlotTickAxisBadge(tick.axis, tick.label, singular)
: null;
const comparisonTickBadge =
variant === "comparison"
? leftoverMapComparePlotTickAxisBadge(tick.axis, tick.label, singular)
: null;
const tickAriaLabel =
variant === "comparison"
? `${t(LEFTOVER_MAP_COMPARE_PLOT_LABEL)}: ${tf(LEFTOVER_MAP_PLOT_TICK, {
axis: tick.axis,
value: tick.label,
})}`
? comparisonTickBadge !== null
? tf(comparisonTickBadge.template, comparisonTickBadge.values)
: `${t(LEFTOVER_MAP_COMPARE_PLOT_LABEL)}: ${tf(LEFTOVER_MAP_PLOT_TICK, {
axis: tick.axis,
value: tick.label,
})}`
: reportTickBadge !== null
? tf(reportTickBadge.template, reportTickBadge.values)
: tf(LEFTOVER_MAP_PLOT_TICK, { axis: tick.axis, value: tick.label });
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/leftoverMapPlotAxisSingular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export const LEFTOVER_MAP_COMPARE_AXIS_SHARE =
export const LEFTOVER_MAP_PLOT_TICK_SINGULAR =
"leftover-map axis {axis} tick {value} σ {singular}";

export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR =
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}";

export type LeftoverMapPlotAxisSingular = {
axis_index: LeftoverMapAxis["axis_index"];
leftover_singular_value?: LeftoverMapAxis["leftover_singular_value"] | null;
Expand Down Expand Up @@ -150,3 +153,19 @@ export function leftoverMapPlotTickAxisBadge(
values: { axis: axisIndex, value: tickLabel, singular },
};
}

/** Project finite persisted σ onto one comparison-graphic tick without inventing share evidence. */
export function leftoverMapComparePlotTickAxisBadge(
axisIndex: number,
tickLabel: string,
leftoverSingular: number | null | undefined,
): LeftoverMapCompareAxisBadge | null {
const singular = formatLeftoverMapPlotAxisSingular(leftoverSingular);
if (singular === null) {
return null;
}
return {
template: LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR,
values: { axis: axisIndex, value: tickLabel, singular },
};
}
37 changes: 37 additions & 0 deletions tests/test_grouping_comparison_graphic_tick_singular_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Executable contract for comparison-graphic tick singular-value captions."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
SINGULAR_SOURCE = ROOT / "frontend" / "src" / "leftoverMapPlotAxisSingular.ts"
PLOT_COMPONENT_SOURCE = ROOT / "frontend" / "src" / "components" / "LeftoverMapPlot.tsx"


def test_comparison_graphic_tick_keeps_persisted_singular_value_without_share() -> None:
"""A comparison tick may name valid persisted σ even when axis share is absent."""
assert SINGULAR_SOURCE.exists(), "singular-value axis helper is missing"
source = SINGULAR_SOURCE.read_text(encoding="utf-8")

assert "leftoverMapComparePlotTickAxisBadge" in source
assert "leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}" in source


def test_comparison_graphic_consumes_tick_singular_projection() -> None:
"""The buyer-visible comparison graphic must consume its persisted-σ tick projection."""
source = PLOT_COMPONENT_SOURCE.read_text(encoding="utf-8")

assert "leftoverMapComparePlotTickAxisBadge" in source
assert "tf(comparisonTickBadge.template, comparisonTickBadge.values)" in source


def test_comparison_graphic_tick_does_not_infer_sigma_or_share() -> None:
"""Invalid σ falls back to the comparison tick and tick captions never synthesize share."""
assert SINGULAR_SOURCE.exists(), "singular-value axis helper is missing"
source = SINGULAR_SOURCE.read_text(encoding="utf-8")

assert "formatLeftoverMapPlotAxisSingular" in source
assert "Number.isFinite" in source
assert "Math.sqrt" not in source
tail = source.split("leftoverMapComparePlotTickAxisBadge", 1)[-1][:1600]
assert "leftover_share" not in tail
Loading