-
Notifications
You must be signed in to change notification settings - Fork 1
feat: persist leftover observed Y and expected E (v2.12.20) #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 8 commits into
feat/oidc-return-remember-login-v21219
from
feat/leftover-pair-observed-expected-v21220
Aug 23, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1bd45fc
feat: persist leftover observed Y and expected E (v2.12.20)
seonghobae a30bb28
Repair inherited login build boundary
seonghobae df18ed6
Move leftover evidence contract to ADR 0177
seonghobae cb5b21f
Merge remote-tracking branch 'origin/feat/board-source-detail-state-f…
seonghobae 435992d
fix: show leftover Y and E after stacking onto the workspace branch
seonghobae 13d95e1
Merge remote-tracking branch 'origin/feat/oidc-return-remember-login-…
seonghobae b5657cf
fix(leftover-observed-expected): wire missing migration and translations
seonghobae 9f703c0
fix(migrations): union 0173 into the migrate.sh allowlist
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ## 2.12.20 — Leftover observed Y and expected E | ||
|
|
||
| - Persist observed `Y` and expected `E[Y|θ, item]` on leftover | ||
| post–criterion pairs (ADR 0177). Residual stays `R = Y − E`. After | ||
| `make seed`, closest and farthest leftover pairs sit above the member | ||
| list with `Y` and `E` next to leftover-map distance `d`; click opens | ||
| that post. Omit the badge when either value is missing. Never invent | ||
| a leftover score or a theta. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # ADR 0177 — Persist observed Y and expected E on leftover pairs | ||
|
|
||
| **Decision status:** Accepted | ||
| **Date:** 2026-08-24 | ||
|
|
||
| Amends [ADR 0048](0048-persist-lsirm-leftover-pairs.md) and | ||
| [ADR 0049](0049-leftover-pair-report-ui.md). | ||
|
|
||
| ## Context | ||
|
|
||
| ADR 0048 already persists leftover-map distance and leftover residual | ||
| `R = Y − E[Y|θ, item]` on `report_leftover_pair`. ADR 0049 already | ||
| renders closest and farthest pairs above the member list and opens the | ||
| named post. Residual disclosure without naming `Y` and `E` leaves a | ||
| reader unable to tell whether a leftover cell is a high observed | ||
| response or a low expected category after IRT main effects. | ||
|
|
||
| Jeon et al. (2021, eq. 3) leftover interaction is `−γ‖ξ_p − ζ_i‖`. | ||
| Gabriel (1971) supplies the leftover-map coordinates from a residual | ||
| biplot of `R`. `R` is not an invented leftover score: it is the | ||
| observed category minus the already-fitted expected category. Those | ||
| two inputs must travel with the pair row. | ||
|
|
||
| This increment does not persist leftover-map coordinates, does not | ||
| change leftover-map axis count, does not name complete-case coverage, | ||
| and does not land Post quality on the leftover criterion. | ||
|
|
||
| The unprotected-stack ADR for the same leftover-pair fact was 0163. This | ||
| protected-main reconstruction uses **0177** so it does not collide | ||
| with any current open-head ADR. | ||
|
|
||
| ## Decision | ||
|
|
||
| Each leftover pair names: | ||
|
|
||
| 1. `observed_response` — the observed category `Y` for that | ||
| post–criterion cell; | ||
| 2. `expected_response` — `E[Y|θ, item]` from the already-fitted | ||
| GRM/GPCM main effects; | ||
| 3. `leftover_residual`, which must equal `Y − E` within `1e-6`. | ||
|
|
||
| Migration `0177` is the single source of both columns on every | ||
| install path, fresh or existing -- shipped migrations (`0001`/`0012`) | ||
| are never edited after the fact. It adds them as nullable so older | ||
| leftover rows keep distance and residual without fabricating `Y` or | ||
| `E`. The pair button shows | ||
| `Y {observed} · E {expected}` next to leftover-map distance `d` when | ||
| both values are finite. The next action remains ADR 0049: | ||
| `Open {post}, then read Post quality criterion {criterion}.` Omit the | ||
| `Y` / `E` badge when either value is missing or non-finite. Do not | ||
| invent a leftover score. Do not invent a theta. | ||
|
|
||
| ## Consequences | ||
|
|
||
| `GET /api/reports/{grouping}/{period}` returns `observed_response` | ||
| and `expected_response`. After `make seed`, closest and farthest | ||
| leftover pairs sit above the member list with named `Y` and `E`; | ||
| click opens that post. Hidden posts stay hidden. | ||
|
|
||
| ## Related | ||
|
|
||
| Independent of leftover interaction-map persistence, leftover-criterion | ||
| evaluation landing, leftover residual UI extraction, leftover-map | ||
| complete-case coverage, leftover-map axis share, leftover pairs on the | ||
| grouping comparison strip, and two-axis leftover-map distance. | ||
|
|
||
| ## References | ||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 PR description cites ADR 0170 but code ships 0177
The description repeatedly names ADR/migration 0170, but the code consistently uses 0177 (migration file,
migrate.shgate, ADR doc, seed, tests, AGENTS.md). Code is internally consistent; the description is stale. Confirm 0177 is the intended non-colliding number.Was this helpful? React with 👍 or 👎 to provide feedback.