Skip to content

feat(reports): leftover observed on grouping comparison strip (v2.56.0) - #836

Draft
seonghobae wants to merge 2 commits into
feat/leftover-map-compare-residual-v2550from
feat/leftover-map-compare-observed-v2560
Draft

feat(reports): leftover observed on grouping comparison strip (v2.56.0)#836
seonghobae wants to merge 2 commits into
feat/leftover-map-compare-residual-v2550from
feat/leftover-map-compare-observed-v2560

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Caption leftover observed Y on grouping comparison leftover-pair buttons through formatLeftoverMapObserved (ADR 0299 / v2.56.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 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 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, and grouping comparison leftover-pair buttons that match leftover observed Y on the pair row; click a post marker or a pair button opens that post.
  • A missing or non-finite Y omits that leftover-map comparison observed badge and keeps 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 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 Y 0.00 when that persisted observed response is finite. A finite negative leftover is shown, never clamped. Do not invent Y from R and E, leftover-map distance, plotted coordinates, leftover residual, 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.
  • UI-only; no SQL; no new columns. Distinct aria-label Leftover map comparison observed. Copy is the same Y {n.nn} formatter as the pair-row badge. The strip does not gain the leftover-map graphic. Never invent a leftover score. Never invent a theta. Do not persist leftover-map inner product, cosine, or length.
  • Stacked onto leftover residual on grouping comparison leftover-pair buttons (feat/leftover-map-compare-residual-v2550 / feat(reports): leftover residual on grouping comparison strip (v2.55.0) #835 @ a825c33). Leave this PR open for independent review. Do not squash-merge onto the unprotected leftover base. Do not self-approve. After independent review, retarget onto leftover-coordinates (feat/leftover-map-coordinates-v2240 / feat(reports): persist leftover-map coordinates (v2.24.0) #782) rather than squash-merging here.

Verification

  • pnpm exec vitest run src/leftoverObservedExpected.test.ts src/leftoverResidual.test.ts src/leftoverMapUnexplained.test.ts src/leftoverMapUnexplainedShare.test.ts src/leftoverMapCrossShare.test.ts src/leftoverMapExplainedShare.test.ts src/leftoverMapReconstruction.test.ts src/i18n.test.ts src/App.test.tsx: 9 files, 336 passed.
  • pnpm exec oxlint on changed frontend files: 0 warnings, 0 errors.
  • PostgreSQL period-report compare tests were not executed here (UI-only; no schema change).

Evidence boundary

Authenticated PostgreSQL API and k6 runtime acceptance are not claimed. No real records or credentials. Synthetic fixtures only.

Independent approval is required. No self-approval, admin bypass, or force push.

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.


Devin Review

Caption leftover observed Y on grouping comparison leftover-pair
buttons through formatLeftoverMapObserved (ADR 0299). 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
Y on the pair row; click a post marker or a pair button opens that post. A missing
or non-finite Y omits that leftover-map comparison observed badge and
keeps leftover residual R when finite. A finite negative leftover is shown,
never clamped. Do not invent Y from R and E. 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.
@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.

Copy link
Copy Markdown
Contributor Author

Cycle 2026-08-31 01:42 KST. Head ada0c86. Independent collaborator APPROVE required. Copilot/Devin COMMENTED is not independent APPROVE. Only collaborator is seonghobae — no second human reviewer to request.

Leave this PR open. Do not squash-merge onto the unprotected leftover base (#835). Do not self-approve. After independent review, retarget onto leftover-coordinates (feat/leftover-map-coordinates-v2240 / #782) rather than squash-merging here.

Next increment on this head: leftover expected E on grouping comparison leftover-pair buttons. Synthetic fixtures only. NVIDIA_NIM_API_KEY only. Do not merge revert #808 without independent APPROVE.

@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 2 potential issues.

Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Formatter preserves valid edge values

formatLeftoverMapObserved keeps zero and finite negatives while rejecting missing or non-finite values. Its result cannot suppress neighboring badges.

(Refers to this code)

Devin Review

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

Comment thread frontend/src/App.tsx
pair.leftover_map_unexplained,
);
const residual = formatLeftoverMapResidual(pair.leftover_residual);
const observed = formatLeftoverMapObserved(pair.observed_response);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Observed comparison badges never appear

Real comparison responses omit observed_response in fetch_period_comparison, so formatLeftoverMapObserved always receives undefined. Every new Y badge stays hidden.

Prompt for agents
The frontend now renders pair.observed_response in frontend/src/App.tsx, but backend/app/report_ingestion.py fetch_period_comparison does not select observed_response from report_leftover_pair or serialize it into comparison leftover_pairs. Extend that comparison query and payload to carry the persisted nullable value without deriving it from residual or expected response. Add comparison-endpoint coverage using a real fetch_period_comparison-shaped payload, including finite, null, and zero values, so frontend mocks cannot mask future API omissions.
Devin Review

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

Copy link
Copy Markdown
Contributor Author

Cycle 2026-08-31 01:45 KST. Head ada0c86. Leftover expected E (ADR 0300 / v2.57.0) is stacked as #837 (feat/leftover-map-compare-expected-v2570 @ e6638a8). Leave both open. Independent APPROVE still missing. Do not squash-merge. Do not self-approve.

Preserve #836 ADR 0299/product delta while inheriting current #835 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 #837 ADR 0300/product delta while inheriting current #836 ancestry through a normal two-parent merge. No force-push or destructive rebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant