Skip to content

feat: measure leftover-map distances on two Gabriel axes (v2.12.18) - #522

Closed
seonghobae wants to merge 3 commits into
mainfrom
feat/leftover-map-two-axis-distance-v21218
Closed

feat: measure leftover-map distances on two Gabriel axes (v2.12.18)#522
seonghobae wants to merge 3 commits into
mainfrom
feat/leftover-map-two-axis-distance-v21218

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Buyer next action

After make seed, leftover closest/farthest pairs remain above the period-report member list. Click a pair to open that post. Distance is now Euclidean on the two-axis Jeon/Gabriel interaction map, not on every residual SVD component.

A rank-3 synthetic residual proves leftover_distance matches the two-axis map and differs from the full-rank norm. Rank-1 fixtures preserve the same result because the unused axis pads with zero. Never invent a leftover score or theta.

Why this is independent

Schema / UI

No new table. leftover_distance on existing report_leftover_pair now means two-axis Euclidean distance. Buyer pair list still sits above members; click still opens that post.

Merge contract

Independent exact-head APPROVE required. Do not self-approve. Squash-merge only with independent APPROVE + exact-head required success.

Tests

tests/test_leftover_pairs.py — 10 passed locally (rank-3 two-axis vs full-rank, rank-0 pad, sparse missing-not-zero, nonfinite fallback, empty mask).

Papers

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


Open in Devin Review

Jeon leftover interaction is a two-dimensional person–item map.
Closest and farthest leftover_distance now use the two leading
Gabriel axes; hidden SVD components after the second no longer
change persisted distance. Rank-0 and rank-1 maps pad unused
axes with zero. Missing cells stay out of the factorization.

Independent of leftover-map coordinates (#481), coverage (#518),
axis share (#519), comparison-strip reuse (#521), and residual
disclosure (#502). Does not invent a leftover score or a theta.
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 53 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1eca399-20ca-4786-ab82-0c09df62ed0b

📥 Commits

Reviewing files that changed from the base of the PR and between ef6f5a5 and c298a70.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • AGENTS.md
  • ARCHITECTURE.md
  • CHANGELOG.d/2.12.18-leftover-map-two-dimensional-distance.md
  • CHANGELOG.md
  • docs/adr/0048-persist-lsirm-leftover-pairs.md
  • docs/adr/0166-leftover-map-two-dimensional-distance.md
  • frontend/package.json
  • frontend/src/App.tsx
  • lineageweave/leftover_pairs.py
  • pyproject.toml
  • tests/test_leftover_pairs.py

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[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Write probe (2026-08-24 cycle). Not a review. Independent exact-head APPROVE still required. Do not self-approve. Do not squash-merge until independent APPROVE + exact-head required success. Issues #79 and #87 stay open. Not mixing leftover stacks #481/#485/#518/#519/#521.

Copy link
Copy Markdown
Contributor Author

Queue 2026-08-24T04:13 KST: independent exact-head APPROVE still required on 2ab9680. Do not self-approve. Squash-merge only with independent APPROVE + exact-head required success. Issues #79 and #87 stay open.

Copy link
Copy Markdown
Contributor Author

Cycle retry 2026-08-24T04:13KST.

Writes work this cycle (MCP + gh as seonghobae). #96 already closed as weaker duplicate of #91. Do not self-approve this head.

Exact head 2ab96809:

  • Full test suite: success
  • Semgrep OSS / SAST / Analyze: success
  • Frontend lint + test: success
  • Frontend Build: failure (this is the required-gate blocker; Storybook skipped)
  • Strix: in progress at last poll
  • Independent exact-head APPROVE: none. Devin COMMENT only. Collaborator set is only the author, so no second human can be requested from this token.

Will repair the frontend build on this branch and push a new head. Squash-merge remains blocked until independent APPROVE + exact-head required success on that new head. Issues #79 and #87 stay open.

Copy link
Copy Markdown
Contributor Author

Follow-up 2026-08-24T04:24KST.

Writes work. Exact leftover head remains 2ab96809 (v2.12.18 two-axis distance). Frontend Build failure on this PR is the protected main login shell (App.tsx unused OIDC imports + AdminPanel accessToken: string | undefined), not leftover science.

Repaired independently as #525 (951d10eb, v2.12.19) from main @ ef6f5a5. Do not mix that login-return commit into this leftover branch. Do not self-approve either head. Issues #79 and #87 stay open.

Copy link
Copy Markdown
Contributor Author

Cycle retry 2026-08-23T20:17Z: write-path probe (close/comment/review/push). Independent exact-head APPROVE still required. This identity will not self-approve or squash-merge.

Copy link
Copy Markdown
Contributor Author

Queue cycle 2026-08-24T05:16 KST: exact head 2ab96809. Independent APPROVE still required — not self-approving. Do not mix leftover Y/E (reconstructing closed #511 onto protected main as v2.12.20 / ADR 0170). #79 and #87 stay open.

seonghobae added a commit that referenced this pull request Aug 23, 2026
* feat: persist leftover observed Y and expected E (v2.12.20)

After seed, leftover closest/farthest pairs sit above the member list
with observed Y and expected E[Y|θ, item] next to leftover-map distance
d. Click opens that post. Residual stays R = Y − E (Jeon et al., 2021
eq. 3; Gabriel 1971; ADR 0170). Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), and two-axis distance (#522).
Issues #79 and #87 stay open.

* Repair inherited login build boundary

* Move leftover evidence contract to ADR 0177

* fix: show leftover Y and E after stacking onto the workspace branch

Merge #490 without force-push. Keep ADR 0049 next-action copy and name
observed Y and expected E on leftover pair buttons. Replay migration
0177 on existing volumes.

* fix(leftover-observed-expected): wire missing migration and translations

Two genuine gaps in this PR's own diff, unrelated to any merge conflict:

1. backend/tests/test_api.py and tests/test_schema.py never applied
   migration 0177_report_leftover_observed_expected.sql in their test
   DB fixtures, even though report_ingestion.py already inserts into
   the observed_response/expected_response columns it adds. Every
   period-report test that touches leftover pairs failed with
   UndefinedColumnError.

2. frontend/src/i18n.ts never got the ko/zh/ja/vi translations for
   the two leftover-map-rank action strings that
   frontend/src/leftoverMapRank.ts (added downstream, in the PR that
   bases on this one) references — t()/tf() fall back to the raw
   English key for every locale, failing the i18n test suite in the
   whole downstream chain.

Verified: 1035 Python tests pass, 362 frontend tests pass, build/lint
clean.
seonghobae added a commit that referenced this pull request Aug 24, 2026
* feat: persist leftover observed Y and expected E (v2.12.20)

After seed, leftover closest/farthest pairs sit above the member list
with observed Y and expected E[Y|θ, item] next to leftover-map distance
d. Click opens that post. Residual stays R = Y − E (Jeon et al., 2021
eq. 3; Gabriel 1971; ADR 0170). Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), and two-axis distance (#522).
Issues #79 and #87 stay open.

* Repair inherited login build boundary

* Move leftover evidence contract to ADR 0177

* feat: name leftover-map rank on leftover pairs (v2.12.21)

After seed, leftover closest/farthest pairs sit above the member list
with leftover-map rank next to leftover-map distance d. Click opens
that post. Rank is the count of Gabriel singular values above the
floor (Jeon et al., 2021 eq. 3; Gabriel 1971; ADR 0171). Rank 0 names
no leftover structure. Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), two-axis distance (#522), and
observed Y / expected E (#527). Issues #79 and #87 stay open.

* Move leftover-map rank contract to ADR 0172

ADR 0171 is already used by analysis-run status same clock (#524).
Keep leftover-map rank independent: ADR 0172 and migration 0172.
Shipped 0001 / 0012 stay untouched.

* fix: restore frontend build on leftover-map PR

Drop unused OIDC import and unauthenticated AdminPanel that fail tsc
(TS6192 / TS2322). AdminPanel stays authenticated-only.

* fix: show leftover Y and E after stacking onto the workspace branch

Merge #490 without force-push. Keep ADR 0049 next-action copy and name
observed Y and expected E on leftover pair buttons. Replay migration
0177 on existing volumes.

* fix: keep leftover-map rank after stacking onto leftover Y/E

Merge stacked #527 without force-push. Persist leftover_map_rank with
observed Y and expected E, and name rank on leftover pair buttons.
seonghobae added a commit that referenced this pull request Aug 24, 2026
)

* feat: persist leftover observed Y and expected E (v2.12.20)

After seed, leftover closest/farthest pairs sit above the member list
with observed Y and expected E[Y|θ, item] next to leftover-map distance
d. Click opens that post. Residual stays R = Y − E (Jeon et al., 2021
eq. 3; Gabriel 1971; ADR 0170). Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), and two-axis distance (#522).
Issues #79 and #87 stay open.

* Repair inherited login build boundary

* Move leftover evidence contract to ADR 0177

* feat: name leftover-map rank on leftover pairs (v2.12.21)

After seed, leftover closest/farthest pairs sit above the member list
with leftover-map rank next to leftover-map distance d. Click opens
that post. Rank is the count of Gabriel singular values above the
floor (Jeon et al., 2021 eq. 3; Gabriel 1971; ADR 0171). Rank 0 names
no leftover structure. Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), two-axis distance (#522), and
observed Y / expected E (#527). Issues #79 and #87 stay open.

* Move leftover-map rank contract to ADR 0172

ADR 0171 is already used by analysis-run status same clock (#524).
Keep leftover-map rank independent: ADR 0172 and migration 0172.
Shipped 0001 / 0012 stay untouched.

* feat: name leftover residual on period-report pair rows (v2.12.22)

After seed, leftover closest/farthest pairs sit above the member list
with signed leftover residual R next to leftover-map distance d. Click
opens that post. Residual is R = Y − E[Y|θ, item] (Jeon et al., 2021
eq. 3; Gabriel 1971; ADR 0178). A non-finite residual is an em dash.
Never invent a leftover score or theta.

Independent of leftover persist-map (#481), criterion landing (#485),
complete-case coverage (#518), leftover-map axis share (#519),
comparison-strip leftover pairs (#521), two-axis distance (#522),
observed Y / expected E (#527), and leftover-map rank (#529). Issues
#79 and #87 stay open.

* fix: restore frontend build on leftover residual disclosure

Drop unused OIDC import and unauthenticated AdminPanel that fail tsc
(TS6192 / TS2322). Login matches the workspace branch: AdminPanel is
authenticated-only.

* fix: restore frontend build on leftover-map PR

Drop unused OIDC import and unauthenticated AdminPanel that fail tsc
(TS6192 / TS2322). AdminPanel stays authenticated-only.

* fix: show leftover Y and E after stacking onto the workspace branch

Merge #490 without force-push. Keep ADR 0049 next-action copy and name
observed Y and expected E on leftover pair buttons. Replay migration
0177 on existing volumes.

* fix: keep leftover-map rank after stacking onto leftover Y/E

Merge stacked #527 without force-push. Persist leftover_map_rank with
observed Y and expected E, and name rank on leftover pair buttons.
@seonghobae
seonghobae enabled auto-merge August 24, 2026 01:24
- The unauthenticated Log in handler now calls returnUrlFromLocation()
  then rememberOidcReturnUrl() before signinRedirect, per ADR 0109, so a
  shared /?post= link still opens that post after enterprise SSO. The
  previously unused oidcReturnUrl import is now load-bearing.
- AdminPanel renders only when accessToken is a string; the OIDC access
  token is string | undefined before isAuthenticated narrowing.
devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 04:40
# Conflicts:
#	AGENTS.md
#	ARCHITECTURE.md
#	CHANGELOG.md
#	docs/adr/0048-persist-lsirm-leftover-pairs.md
#	frontend/src/App.tsx
#	lineageweave/leftover_pairs.py
#	tests/test_leftover_pairs.py

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

Open in Devin Review

@seonghobae
seonghobae enabled auto-merge August 24, 2026 05:30
@github-actions

Copy link
Copy Markdown
Contributor

자동 정리: base 대비 실제 변경(diff)이 0건이라 이 PR을 닫습니다. 변경을 추가한 뒤 reopen하세요.

@github-actions github-actions Bot closed this Aug 24, 2026
auto-merge was automatically disabled August 24, 2026 05:58

Pull request was closed

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