Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ba58c21
feat(reports): leftover-map axis share on leftover-map comparison lef…
seonghobae Aug 31, 2026
e8c0c90
test(red): reconstruct comparison-strip tick-share contract
seonghobae Sep 11, 2026
537ec70
chore(stack): converge #874 onto repaired #873 head
seonghobae Sep 12, 2026
b2e45da
chore(stack): converge #874 onto repaired #873
seonghobae Sep 12, 2026
ac531c4
chore(stack): converge #874 onto repaired ancestry
seonghobae Sep 13, 2026
5d23fb1
chore(stack): converge #874 onto repaired #873
seonghobae Sep 15, 2026
2b49e32
chore(stack): converge #874 onto repaired #873
seonghobae Sep 15, 2026
eb051da
merge: converge v2.90.0 onto current v2.89.0 parent
seonghobae Sep 15, 2026
7dac592
merge: converge v2.90.0 onto repaired v2.89.0 parent
seonghobae Sep 15, 2026
c5abdfc
chore(stack): converge #874 onto repaired #873
seonghobae Sep 15, 2026
f237769
chore(stack): converge #874 onto repaired #873
seonghobae Sep 15, 2026
d4afa56
merge(reports): converge report-axis missingness repair into comparis…
seonghobae Sep 15, 2026
344e3df
merge(reports): converge #874 onto #873 RED contract head
seonghobae Sep 15, 2026
da862b3
chore(stack): converge current #873 into #874
seonghobae Sep 15, 2026
e75f5ff
chore(stack): converge #874 on current #873
seonghobae Sep 15, 2026
4888b1b
chore(stack): converge semantic RED harness onto #874
seonghobae Sep 16, 2026
a3eff4a
chore(stack): converge #873 product repair into #874
seonghobae Sep 16, 2026
6998deb
chore(stack): converge #874 on repaired tick foundation
seonghobae Sep 16, 2026
8494fb3
chore(stack): converge #874 on repaired comparison tick foundation
seonghobae Sep 16, 2026
35dc795
chore(stack): converge #874 on repaired comparison-strip tick foundation
seonghobae Sep 16, 2026
6a2b076
chore(stack): converge #874 on repaired report-axis tick foundation
seonghobae Sep 16, 2026
d9ab663
chore(stack): converge #874 on repaired comparison tick share foundation
seonghobae Sep 16, 2026
f8298af
fix(reports): compose comparison strip tick share independently
seonghobae Sep 16, 2026
adce3dd
chore(stack): converge #874 on repaired report tick share foundation
seonghobae Sep 16, 2026
6ddde3d
chore(stack): converge #874 on repaired #873 contracts
seonghobae Sep 16, 2026
d749cdb
test(reports): align comparison tick singular/share contract
seonghobae Sep 16, 2026
3a19148
Merge parent #873 test-only coverage delta into #874
seonghobae Sep 17, 2026
02eeb4b
merge: converge buyer-visible tick evidence into comparison-strip sha…
seonghobae Sep 18, 2026
43fbfd8
chore(stack): converge v2.84 comparison tick contract repair
seonghobae Sep 19, 2026
164ec8e
merge: converge #874 on report contract repairs
seonghobae Sep 19, 2026
7192a97
chore(stack): converge #874 onto #873 owner stack
seonghobae Sep 20, 2026
abb9d2c
chore(reports): converge #874 onto repaired #873 ancestry
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
28 changes: 24 additions & 4 deletions frontend/src/leftoverMapPlotAxisSingular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE =
export const LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR =
"leftover map comparison leftover axis {axis} tick {value} σ {singular}";

export const LEFTOVER_MAP_COMPARE_AXIS_TICK_SHARE =
"leftover map comparison leftover axis {axis} tick {value} {share}%";

export const LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR_SHARE =
"leftover map comparison leftover axis {axis} tick {value} σ {singular} {share}%";

export type LeftoverMapPlotAxisSingular = {
axis_index: LeftoverMapAxis["axis_index"];
leftover_singular_value?: LeftoverMapAxis["leftover_singular_value"] | null;
Expand Down Expand Up @@ -213,18 +219,32 @@ export function leftoverMapComparePlotTickAxisBadge(
};
}

/** Project finite persisted σ onto one comparison-strip tick without inventing share evidence. */
/** Compose persisted comparison-strip tick σ/share without deriving either field. */
export function leftoverMapCompareAxisTickBadge(
axisIndex: number,
tickLabel: string,
leftoverSingular: number | null | undefined,
leftoverShare?: LeftoverMapAxis["leftover_share"] | null,
): LeftoverMapCompareAxisBadge | null {
const singular = formatLeftoverMapPlotAxisSingular(leftoverSingular);
if (singular === null) {
const share = formatLeftoverMapPlotAxisShare(leftoverShare);
if (singular === null && share === null) {
return null;
}
if (singular === null) {
return {
template: LEFTOVER_MAP_COMPARE_AXIS_TICK_SHARE,
values: { axis: axisIndex, value: tickLabel, share: share as string },
};
}
if (share === null) {
return {
template: LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR,
values: { axis: axisIndex, value: tickLabel, singular },
};
}
return {
template: LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR,
values: { axis: axisIndex, value: tickLabel, singular },
template: LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR_SHARE,
values: { axis: axisIndex, value: tickLabel, singular, share },
};
}
29 changes: 29 additions & 0 deletions tests/test_grouping_comparison_strip_tick_share_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Executable contract for comparison-strip axis tick share captions."""

from pathlib import Path


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


def test_comparison_strip_tick_keeps_axis_share_independent_of_singular() -> None:
"""A comparison-strip tick may name persisted share when singular evidence is absent."""
assert SINGULAR_SOURCE.exists(), "comparison-strip axis projection helper is missing"
source = SINGULAR_SOURCE.read_text(encoding="utf-8")

assert "leftoverMapCompareAxisTickBadge" in source
assert "leftover map comparison leftover axis {axis} tick {value} {share}%" in source
assert "leftover map comparison leftover axis {axis} tick {value} σ {singular} {share}%" in source


def test_comparison_strip_tick_never_infers_share_from_singular() -> None:
"""Share-only, singular-only, combined, and empty states remain persisted-data decisions."""
assert SINGULAR_SOURCE.exists(), "comparison-strip axis projection helper is missing"
source = SINGULAR_SOURCE.read_text(encoding="utf-8")

assert "Number.isFinite" in source
assert "leftover_share" in source
assert "formatLeftoverMapPlotAxisSingular" in source
assert "Math.sqrt" not in source
assert "Math.max" not in source
19 changes: 12 additions & 7 deletions tests/test_grouping_comparison_strip_tick_singular_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ def test_comparison_strip_axis_tick_keeps_persisted_singular_value_without_share


def test_comparison_strip_axis_tick_does_not_infer_sigma_or_share() -> None:
"""Invalid σ falls back to the comparison-axis tick and no counterpart is synthesized."""
"""Comparison-strip ticks compose persisted σ/share without deriving either field."""
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("leftoverMapCompareAxisTickBadge", 1)[-1][:1600]
assert "leftover_share" not in tail
helper = source.split("export function leftoverMapCompareAxisTickBadge", 1)[-1]

assert "formatLeftoverMapPlotAxisSingular" in helper
assert "formatLeftoverMapPlotAxisShare" in helper
assert "leftoverSingular" in helper
assert "leftoverShare" in helper
assert "LEFTOVER_MAP_COMPARE_AXIS_TICK_SHARE" in helper
assert "LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR_SHARE" in helper
assert "Math.sqrt" not in helper
assert "Math.max" not in helper
assert "Math.min" not in helper
Loading