feat: name leftover-map cosine on leftover pairs (v2.12.24) - #532
Conversation
Persist leftover-map cosine on leftover post–criterion pairs so a close leftover-map pair is not read as leftover-map alignment. After make seed, closest/farthest pairs sit above the member list with cosine next to leftover-map distance d; click opens that post.
|
Merge contract on exact head This identity will not self-approve. Independent Independent of leftover stacks #481 #485 #518 #519 #521 #522 #527 #529 #530 #531. Issues #79 and #87 stay open. Synthetic fixtures only; NVIDIA_NIM_API_KEY only. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
seonghobae
left a comment
There was a problem hiding this comment.
Requesting independent Copilot review on exact head 459476c. This identity will not self-approve.
|
Retry write this cycle: exact head still |
Drop unused OIDC import and unauthenticated AdminPanel that fail tsc (TS6192 / TS2322). AdminPanel stays authenticated-only.
|
Retry GitHub writes first this cycle: writes work as seonghobae. Independent exact-head |
…v21223' into feat/leftover-map-cosine-v21224
| alter table report_leftover_pair | ||
| add column if not exists leftover_map_cosine numeric; |
There was a problem hiding this comment.
🟡 Cosine migration is never applied on any install path
The new migration is not added to the allowlist in docker/postgres-init/migrate.sh:20 and is not executed in scripts/seed_demo_data.py (which runs each migration file by name). The leftover_map_cosine column is therefore never created on the Compose stack or by make seed.
Prompt for agents
migrations/0180_report_leftover_map_cosine.sql is a new migration, but neither install path applies it. docker/postgres-init/migrate.sh applies only migrations whose filename prefix matches its case allowlist (line 20-21); 0180_* is absent, so the migration is skipped via the default `continue`. scripts/seed_demo_data.py applies migrations by executing each file by name (e.g. line 121 runs 0177_report_leftover_observed_expected.sql) and does not run 0180. As a result the leftover_map_cosine column is never created. Follow the sibling leftover-migration pattern: add 0180_* to the migrate.sh allowlist and add a cur.execute() for migrations/0180_report_leftover_map_cosine.sql in seed_demo_data.py alongside the other leftover migrations. Also check tests/test_migration_replay.py, which asserts prefixes such as 0177_* are present in the script.
Was this helpful? React with 👍 or 👎 to provide feedback.
| """Leftover pairs from the already-fitted GRM/GPCM main effects, with cosine.""" | ||
| probs = _category_probabilities(model, theta, fit) | ||
| expected = expected_category_matrix(matrix, probs) | ||
| return leftover_pairs_from_residual(post_ids, item_codes, matrix, expected) |
There was a problem hiding this comment.
🔍 Cosine feature is unimplemented beyond the migration and a util
The PR claims to persist, fetch, and seed leftover_map_cosine, but the backend never computes or stores it. leftover_pairs.py has no cosine field on LeftoverPair (it even computes an inner_product at leftover_pairs.py that is discarded), period_report.py only gains a docstring, and no api.ts/App.tsx change wires the badge. The frontend formatLeftoverMapCosine util and the GET contract in ADR 0180 therefore have no data source, so the cos badge never renders. Sibling leftover PRs (e.g. commit e05d63b) touched all of these files; this one does not.
Was this helpful? React with 👍 or 👎 to provide feedback.
…v21223' into feat/leftover-map-cosine-v21224
|
Retry GitHub writes first this cycle. Exact head is now Independent of leftover stacks #481 #485 #518 #519 #521 #522 #527 #529 #530 #531 #533 #534. |
…v21223' into feat/leftover-map-cosine-v21224
LEFTOVER_MAP_COSINE_ACTION was added to the required i18n coverage list (src/i18n.test.ts) with exact expected ko/zh/ja/vi output but never got a corresponding entry in TRANSLATIONS, so t()/tf() fell back to the untranslated English template for every locale. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GUcvhvimNVGqjFuD9f1fUa
d0247ca
into
feat/leftover-map-inner-product-v21223
Buyer next action
After
make seed, leftover post–criterion pairs sit above the member list with leftover-map cosine next to leftover-map distance d. Click the pair to open that post. Thecosbadge is omitted when the pair has no complete-case leftover map, or when a leftover-map vector sits at the origin (fallback / rank-0 rows do not invent alignment). Never invent leftover score or theta.A close leftover-map pair is not the same fact as leftover-map alignment. Cosine names scale-free Gabriel alignment independently of Euclidean distance.
Scope (this PR only)
leftover_map_cosineon leftover pair rowsleftover_map_cosinewhen complete-case ξ, ζ have non-zero normscosbadge + named next action; i18n en/ko/zh/ja/viIndependent of leftover stacks already in review
Do not mix into:
Merge contract
459476cb54e39ea8ee149e99146be7df682c8567APPROVErequired (Copilot or human who is not the author)