feat: name leftover-map reconstruction on leftover pairs (v2.12.31) - #588
feat: name leftover-map reconstruction on leftover pairs (v2.12.31)#588seonghobae wants to merge 12 commits into
Conversation
Persist two-axis Gabriel reconstruction R̂ = ξ_{1:2} · ζ_{1:2} on
period leftover pairs so landed unexplained leftover U = R − R̂ stays
auditable as U + R̂ = R (ADR 0183). Reconstruction is the same internal
two-axis inner product already used for U; do not substitute the
centered R̃ reconstruction claimed by leftover stack #564.
After make seed, closest and farthest leftover pairs sit above the
member list with signed R̂ next to leftover-map distance d; click opens
that post. Missing or non-finite reconstruction omits the badge rather
than inventing a leftover score. Signed reconstruction is stored, never
clamped. Complete-case coverage (ADR 0168) stays independent.
Independent of leftover stacks #485, #518 (landed), #521, #537, #539,
#563, #564, and #579.
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (21)
📝 WalkthroughWalkthrough기간 보고서 leftover pair가 두 축 재구성값 ChangesLeftover map reconstruction
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to The change adds and displays leftover-map reconstruction values, while rollback requires the application to be downgraded before removing the new database column to avoid report-fetch failures. The PR is mergeable with explicit owner awareness and documented rollback sequencing. Sequence Diagram(s)sequenceDiagram
participant ReportIngestion
participant ReportLeftoverPair
participant API
participant LeftoverPairList
ReportIngestion->>ReportLeftoverPair: store leftover_map_reconstruction
API->>ReportLeftoverPair: read reconstruction
ReportLeftoverPair-->>API: return nullable reconstruction
API-->>LeftoverPairList: provide leftover pair data
LeftoverPairList->>LeftoverPairList: format and display R̂
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 86.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 16 files. (12 skipped: 12 unsupported.) ✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Author will not self-approve. Exact-head APPROVE required before squash-merge.
# Conflicts: # AGENTS.md # ARCHITECTURE.md # CLAUDE.md # docs/adr/0049-leftover-pair-report-ui.md
The prior merge of origin/main into this branch (91d8e4f) resolved the AGENTS.md/ARCHITECTURE.md/CLAUDE.md conflicts by dropping this PR's own leftover-map reconstruction documentation: - AGENTS.md reverted to "Two-axis reconstruction R̂ is not persisted", contradicting the shipped migration/ADR 0201 that persists it, and dropped ADR 0201 from the governing-ADR list. - ARCHITECTURE.md kept a redundant "0183 / 0201" pair (0183 is this repo's real, unrelated ADR 0183 "GNB four Korean chrome"; the stale 0183 leftover-map reference should have been renumbered to 0201, not kept alongside it). - CLAUDE.md's "Where the rest lives" pointer never got the ADR 0201 cross-reference added. Also finishes the ADR-number renumbering the PR's own history had started (docs/adr/0201-leftover-map-reconstruction.md is the actual ADR; ADR 0183 already belongs to a different, already-landed decision on main): fixes remaining stale "ADR 0183" citations in docs/adr/0003, the 2.12.31 CHANGELOG.d fragment, and the migration 0183 SQL header comment, all of which should cite ADR 0201. docs/adr/0049's own conflict resolution (0158 + 0201 amendments) was already correct and is unchanged.
|
Exact head |
…-v21231' into HEAD # Conflicts: # docs/adr/0182-leftover-map-unexplained.md
| } else if (reconstruction !== null) { | ||
| const signedReconstruction = | ||
| formatSignedLeftoverValue(pair.leftover_map_reconstruction ?? Number.NaN) ?? "—"; | ||
| nextAction = tf(LEFTOVER_MAP_RECONSTRUCTION_ACTION, { | ||
| value: signedReconstruction, | ||
| criterion, | ||
| }); | ||
| } else if (unexplained !== null) { | ||
| const signedUnexplained = | ||
| formatSignedLeftoverValue(pair.leftover_map_unexplained ?? Number.NaN) ?? "—"; |
There was a problem hiding this comment.
📝 Info: Reconstruction outranks unexplained in next-action order
The next-action fallback in LeftoverPairList inserts reconstruction above unexplained leftover (cross share → reconstruction → unexplained). New rows with both U and R̂ finite and no cross share now show the reconstruction message instead of the unexplained one. Matches ADR 0049's stated order.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
Persist leftover-map reconstruction
R̂ = ξ_{1:2} · ζ_{1:2}on period leftover pairs so landed unexplained leftoverU = R − R̂stays auditable asU + R̂ = R(ADR 0183).Why this is not #564
#564 persists a centered leftover-map reconstruction that recovers
R̃(ADR 0186 / v2.12.30). Landed ADR 0182 already definesU = R − R̂against the uncentered residualR = Y − Eand the same two-axis inner product used for distance. Substituting centeredR̃would breakU + R̂ = R.This PR keeps that internal
R̂and names it on the pair row. Do not mix with leftover stacks #485, #521, #537, #539, #563, #564, or #579. Coverage #518 already landed as ADR 0168.Buyer-visible change
After
make seed, closest and farthest leftover pairs sit above the member list with signedR̂next to leftover-map distanced; click opens that post. Missing or non-finite reconstruction omits the badge rather than inventing a leftover score. Signed reconstruction is stored, never clamped.Contract
Summary by CodeRabbit
새로운 기능
R̂을 저장하고 API와 보고서 화면에 표시합니다.개선 사항