feat: name leftover-map length on leftover pairs (v2.12.25) - #533
Conversation
Persist leftover-map lengths ‖ξ‖ and ‖ζ‖ on leftover post–criterion pairs so leftover-map magnitude is not read as leftover-map distance. Fallback pairs omit length rather than inventing one.
|
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 #532. Issues #79 and #87 stay open. Synthetic fixtures only; NVIDIA_NIM_API_KEY only. |
seonghobae
left a comment
There was a problem hiding this comment.
Requesting independent Copilot review on exact head e01e911. This identity will not self-approve.
|
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 |
Drop unused OIDC import and unauthenticated AdminPanel that fail tsc (TS6192 / TS2322). AdminPanel stays authenticated-only.
… into feat/leftover-map-length-v21225
| assert closest.leftover_map_person_length == pytest.approx(0.0, abs=1e-9) | ||
| assert closest.leftover_map_item_length == pytest.approx(0.0, abs=1e-9) | ||
| assert farthest.leftover_map_person_length == pytest.approx(np.sqrt(2.0), rel=1e-6) | ||
| assert farthest.leftover_map_item_length == pytest.approx(np.sqrt(2.0), rel=1e-6) |
There was a problem hiding this comment.
🔴 Leftover-length test reads attributes that never exist
The new assertions read closest.leftover_map_person_length and leftover_map_item_length (plus the farthest pair), but LeftoverPair in leftover_pairs.py defines no such fields and this PR leaves that file untouched. Every run raises AttributeError and the test fails. The backend never computes or persists these lengths.
Prompt for agents
The added assertions in tests/test_period_report.py reference LeftoverPair.leftover_map_person_length and LeftoverPair.leftover_map_item_length, but these fields were never added to the LeftoverPair dataclass in lineageweave/leftover_pairs.py, and no code computes them. The PR (per ADR 0181 and its own description) is supposed to persist/compute the Euclidean lengths of the Gabriel person coordinate (norm of person_coord) and item coordinate (norm of item_coord) that produced the leftover-map distance, omitting them (None) when there is no complete-case leftover map. Implement this: add nullable length fields to LeftoverPair, compute them in leftover_pairs_from_residual (person_coord/item_coord are already available around leftover_pairs.py:90-91 where distance is computed; the fallback branch at leftover_pairs.py:99-114 has no coordinates so lengths should be None), thread them through _candidate_row/_pair_from_candidate, and update the report serialization/API and frontend wiring so the new columns and badges are actually populated. Otherwise the test suite fails with AttributeError.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Requesting independent Copilot/human review on exact head |
… into feat/leftover-map-length-v21225
|
Retry GitHub writes first this cycle. Exact head is now Independent of leftover stacks #481 #485 #518 #519 #521 #522 #527 #529 #530 #531 #532 #534. |
… into feat/leftover-map-length-v21225
d65cc7e
into
feat/leftover-map-cosine-v21224
| export function formatLeftoverMapLength(value: number | null | undefined): string | null { | ||
| if (value == null || !Number.isFinite(value) || value < 0) { | ||
| return null; | ||
| } | ||
| return value.toFixed(2); | ||
| } | ||
|
|
||
| export function formatLeftoverMapPersonLength(value: number | null | undefined): string | null { | ||
| const formatted = formatLeftoverMapLength(value); | ||
| return formatted === null ? null : `‖ξ‖ ${formatted}`; | ||
| } | ||
|
|
||
| export function formatLeftoverMapItemLength(value: number | null | undefined): string | null { | ||
| const formatted = formatLeftoverMapLength(value); | ||
| return formatted === null ? null : `‖ζ‖ ${formatted}`; | ||
| } |
There was a problem hiding this comment.
🔍 Frontend formatter not wired into UI
formatLeftoverMapLength and its person/item variants are exported and unit-tested, but no component imports them. The badges and i18n the PR describes are absent, so the formatter renders nothing to a buyer.
Was this helpful? React with 👍 or 👎 to provide feedback.
…econstruction-v21225 Resolves the migrate.sh allowlist conflict between this PR's own new migrations (0179-0182: inner product, cosine, length, reconstruction) and the 0173 fix that landed further up the leftover-map stack (PRs #530-#533, already merged) -- union of both sides' migration numbers. CHANGELOG.md merged cleanly this time (no reordering needed). Verified: 33 passed in tests/test_schema.py + tests/test_migration_replay.py, 6 passed in tests/test_leftover_pairs.py, against a fresh Postgres 16 instance with the full migration chain applied.
Buyer next action
After
make seed, leftover post–criterion pairs sit above the member list with leftover-map lengths ‖ξ‖ and ‖ζ‖ next to leftover-map distance d. Click the pair to open that post. The length badges are omitted when the pair has no complete-case leftover map (fallback rows do not invent magnitude). Origin coordinates persist length 0 because that is the measured leftover-map magnitude. Never invent leftover score or theta.A close leftover-map pair is not the same fact as leftover-map magnitude. Length names Gabriel vector length independently of Euclidean distance: origin close (d=0, ‖ξ‖=‖ζ‖=0) is not aligned leftover-map displacement (d=0 with positive length).
Scope (this PR only)
leftover_map_person_lengthandleftover_map_item_lengthon leftover pair rows‖ξ‖/‖ζ‖badges + named next action; i18n en/ko/zh/ja/viIndependent of leftover stacks already in review
Do not mix into:
Merge contract
e01e911c9dc4cd8eba69a7bc97c63bd76aa1d0f1APPROVErequired (Copilot or human who is not the author)