Skip to content

feat(reports): preserve grouping comparison cross-share delta for serialized successor - #831

Draft
seonghobae wants to merge 26 commits into
feat/leftover-map-compare-axis-singular-v2510from
feat/leftover-map-compare-cross-share-v2530
Draft

feat(reports): preserve grouping comparison cross-share delta for serialized successor#831
seonghobae wants to merge 26 commits into
feat/leftover-map-compare-axis-singular-v2510from
feat/leftover-map-compare-cross-share-v2530

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve the valid grouping-comparison persisted cross-share x = 2R̂U / R² delta while serialized ancestry is repaired. Missing/non-finite x omits only that badge; finite zero and negative values remain explicit and are never clamped. UI/read-model composition only: no SQL, new measurement authority, theta, or invented score.

Current stack authority

#828 is promoted at 7b6dbbb99a09d0523bce43c6872bbd9fa382a43a as ADR0367/v2.54.0. #829 is the immediate active successor; r4 34098420270 starts directly from exact #828 and has passed exact-parent/live-head verification, semantic reconstruction, frozen graph installation, the realistic grouping-pair accessible-name RED, and its minimal causal fix. Full reconstructed GREEN/non-force product promotion is still required before #829 becomes the exact parent for #830.

#830 remains the next distinct valid delta and is based on the #829 product branch. Its historical ef5fcf63b6bcc2f6b451cb22b277116fb10fe138 / ADR0294/v2.51.0 identity is evidence only; it must reconstruct only the singular-value feature-origin delta after promoted #829. This #831 cross-share delta therefore waits behind exact promoted #830 and must not skip either predecessor.

GitHub base remains the immediate predecessor branch feat/leftover-map-compare-axis-singular-v2510 (#830), currently at its historical head until #830 converges. Parent movement must be adopted non-force before this PR reconstructs.

Accessibility finding carried forward

Historical frontend/src/App.tsx gives grouping-comparison pair buttons an explicit aria-label; descendant metric badges therefore do not automatically enter the actionable accessible name. #829 repairs that composition for its unexplained-share increment. During #831 reconstruction preserve that predecessor repair and append the localized finite cross-share value to the same parent button name; mark the duplicate visual cross-share badge aria-hidden. Missing/non-finite cross-share remains absent. Add a realistic role/name RED rather than a descendant-text-only assertion.

A broader pre-existing pair-list composition defect is tracked separately as #976. Do not widen this serialized comparison-strip lane into LeftoverPairList source work.

Product invariants

  • Missing or non-finite persisted x omits only the comparison cross-share badge and accessible-name suffix.
  • Finite zero remains 2R̂U/R² 0.00; finite negative values are shown rather than clamped.
  • Never derive x from , U, R, distance, plotted coordinates, reconstruction, residual, explained/unexplained shares, rank, coverage counts, or unused-axis count.
  • Inherit the full-visible-grouping authorization contract for persisted grouping aggregates; never recompute psychometric truth over the caller-visible subset.

Reconstruction / evidence boundary

After exact #830 promotion, choose the then-next unclaimed ADR/release identity against live authority, keep it Proposed while Draft, reconstruct the distinct historical delta on that exact parent, require realistic RED → minimal fix → full backend/frontend GREEN → lint/build/Storybook → clean non-force promotion, then obtain hosted exact-product-head security checks and qualifying independent approval. Canonical KO/EN/JA/ZH/VI/ES/DE/FR translation authority remains #922/#929/#932. No self-approval, force-push, destructive rebase, source-copy, psychometric reimplementation, or gate weakening.

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.

…ip (v2.50.0)

Caption persisted leftover-map reconstruction R̂ on GET /api/reports/compare/{period} leftover-pair buttons through formatLeftoverMapReconstruction (ADR 0293). Distinct aria-label Leftover map comparison reconstruction. Omit when R̂ is missing or non-finite. Do not invent R̂ from leftover-map distance or plotted coordinates. No SQL. No leftover score or theta.
…arison strip (v2.51.0)

Caption persisted leftover-map explained leftover share e on GET /api/reports/compare/{period} leftover-pair buttons through formatLeftoverMapExplainedShare (ADR 0294). Distinct aria-label Leftover map comparison explained leftover share. Omit when e is missing or non-finite. Do not invent e from R̂ and R. No SQL. No leftover score or theta.
…mparison strip (v2.52.0)

Caption persisted leftover-map unexplained leftover share s = U²/R² on
grouping comparison leftover-pair buttons through
formatLeftoverMapUnexplainedShare (ADR 0295). Distinct aria-label
Leftover map comparison unexplained leftover share. Missing or
non-finite s omits that badge and keeps e, R̂, d, and coverage notes.
Do not invent s from U and R. UI-only; no new columns.
…(v2.53.0)

Caption persisted leftover-map cross share x = 2R̂U/R² on grouping
comparison leftover-pair buttons through formatLeftoverMapCrossShare
(ADR 0296). Distinct aria-label Leftover map comparison cross share.
Missing or non-finite x omits that badge and keeps s, e, R̂, d, and
coverage notes. Do not invent x from R̂, U, and R. Finite negative
share is shown, never clamped. UI-only; no new columns.

Copy link
Copy Markdown
Contributor Author

Cycle probe 2026-08-31 ~00:50 KST. Writes work (comment/close/create-PR/push). Token still empty X-OAuth-Scopes; GitHub App Grok has contents/PR/issues write as seonghobae.

This PR (#831 / v2.53.0 / ADR 0296 / 2cefc0b) captions persisted leftover-map cross share x = 2R̂U/R² on grouping comparison leftover-pair buttons through formatLeftoverMapCrossShare. Distinct aria-label Leftover map comparison cross share. UI-only; no new columns. Missing or non-finite x omits that badge independently of s, e, , d, and coverage notes. A finite negative share is shown, never clamped. Do not invent x from , U, and R. When finite, e + s + x = 1 is now strip-auditable.

Verification: pnpm exec vitest run src/leftoverMapCrossShare.test.ts src/leftoverMapUnexplainedShare.test.ts src/leftoverMapExplainedShare.test.ts src/leftoverMapReconstruction.test.ts src/i18n.test.ts src/App.test.tsx — 6 files, 310 passed. pnpm exec oxlint on changed frontend files — 0 warnings, 0 errors.

Leave open for independent review. Do not squash-merge onto the leftover base. Do not self-approve. Copilot review is not independent APPROVE. Stacked onto #829 @ 4d82c28. Issues #79 and #87 stay open. #96 remains closed. Do not merge revert #808 without independent APPROVE.

Next buyer increment after this: leftover-map unexplained leftover U on the same grouping comparison leftover-pair buttons so U + R̂ = R is strip-auditable.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread frontend/src/App.tsx
Comment on lines +4087 to +4089
const crossShare = formatLeftoverMapCrossShare(
pair.leftover_map_cross_share,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Comparison cross share never appears

For real responses, formatLeftoverMapCrossShare receives undefined; the comparison payload never selects the persisted cross share. The badge only appears with mocked data.

Prompt for agents
Update backend/app/report_ingestion.py fetch_period_comparison so its leftover-pair query selects report_leftover_pair.leftover_map_cross_share and its response payload serializes that value as a nullable float. Add or extend backend comparison-endpoint tests to verify finite, zero, negative, null, and authorization-filtered values reach the frontend contract. Keep the frontend formatter as the fail-closed display boundary.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Queue cycle 2026-08-31T01:06KST: write probe. Leave open for independent review. Do not self-approve.

Copy link
Copy Markdown
Contributor Author

Cycle 2026-08-31T01:19 KST: write-retry on #831 (v2.53.0 leftover-map cross share). Independent APPROVE required; no self-approve. Next buyer gap continues from this head if checks/reviews allow.

Copy link
Copy Markdown
Contributor Author

Stacked #833 (feat/leftover-map-compare-unexplained-v2540 @ 18d89b4, v2.54.0 / ADR 0297) captions persisted leftover-map unexplained leftover U on the same grouping comparison leftover-pair buttons. Leave #831 open for independent APPROVE. Do not self-approve. Do not squash-merge this leftover base.

Copy link
Copy Markdown
Contributor Author

Cycle 2026-08-31 01:19 KST. Head 2cefc0b still has no independent collaborator APPROVE (Devin Review COMMENTED is not independent APPROVE). Leave open. Do not squash-merge. Do not self-approve.

Downstream: #833 (U / v2.54.0 on this head) then local residual R / v2.55.0. Parallel #832/#834 also stacked from this head. After independent review, retarget onto leftover-coordinates rather than squash-merging onto this leftover base.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parent-first/capacity finding: this PR is Ready while its base #829 remains an unmerged feature prerequisite and the live leftover-map foundation is still #802 with #811 Draft/conflicting. Preserve the cross-share delta and evidence, but this descendant has no current protected-main merge path. Return it to Draft so the prerequisite lane remains the only active validation lane; do not close, squash, or discard its ADR/product delta.

@seonghobae
seonghobae marked this pull request as draft September 5, 2026 13:24
Preserve both the repaired #816 parent lineage and #817 ADR 0286/product delta with a normal two-parent merge. No force-push, rebase, or product-authority change.
Preserve the #818 ADR 0287/product delta while inheriting the repaired #817 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #819 ADR 0288/product delta while inheriting current #818 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #821 ADR 0289/grouping-comparison delta while inheriting current #819 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #822 ADR 0290/product delta while inheriting current #821 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #824 ADR 0291/product delta while inheriting current #822 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #825 ADR 0292/product delta while inheriting current #824 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #826 ADR 0293/product delta while inheriting current #825 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #827 ADR 0294/product delta while inheriting current #826 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #829 ADR 0295/product delta while inheriting current #827 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Preserve #831 ADR 0296/product delta while inheriting current #829 ancestry through a normal two-parent merge. No force-push or destructive rebase.
seonghobae added a commit that referenced this pull request Sep 5, 2026
Preserve #833 ADR 0297/product delta while inheriting current #831 ancestry through a normal two-parent merge. No force-push or destructive rebase.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head stack-authority finding: live base already equals #829 exact 118500f73251eaaf717d5329b8fb6d9895196fe7, but the PR body still cites obsolete parent 4d82c28, predecessor verification, and historical retarget guidance. Preserve ADR 0296/product semantics and Draft state; make live parent/head/evidence authoritative and do not transfer predecessor tests.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-stack finding: #830 has been reopened because its distinct comparison-axis-singular delta was previously closed without merge or verified succession. This PR can no longer treat historical #829 as its final parent authority or ADR0296/v2.53.0 as reserved. Preserve the cross-share delta, stay Draft, and reconstruct after exact promoted #830 with a then-unclaimed ADR/release identity. Do not bypass the recovered valid delta or transfer historical verification.

@seonghobae seonghobae changed the title feat(reports): leftover-map cross share on grouping comparison strip (v2.53.0) feat(reports): preserve grouping comparison cross-share delta for serialized successor Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Fresh review finding on historical #831@8a12062cd8efef0c99abe794ef3e9f8dcbc31617: the grouping-comparison pair button has an explicit aria-label that stops at title/criterion, while reconstruction, explained share, unexplained share, and the new cross-share are rendered only as labelled descendant spans. Those persisted buyer-visible metrics are therefore not reliably included in the actionable accessible name. When this delta is reconstructed after #830, preserve the predecessor accessible-name repairs and append the localized finite cross-share value to the button name; mark duplicate visible metric badges aria-hidden. Add a regression that queries the button by the complete accessible name. This is a valid a11y repair finding, not a reason to close the cross-share delta.

@seonghobae
seonghobae changed the base branch from feat/leftover-map-compare-unexplained-share-v2520 to feat/leftover-map-compare-axis-singular-v2510 September 7, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant