Skip to content

fix(analytics): reconcile KPI ledger numeric validity on protected main - #339

Closed
seonghobae wants to merge 2 commits into
mainfrom
fix/kpi-ledger-main-20260810
Closed

fix(analytics): reconcile KPI ledger numeric validity on protected main#339
seonghobae wants to merge 2 commits into
mainfrom
fix/kpi-ledger-main-20260810

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Objective

Reconstruct PR #330's fail-closed persisted KPI numeric-domain validation directly on the current protected-main baseline after #270 integrated.

Fresh exact state — 2026-08-10

  • exact source head: 1fb6382dcc5a64ea93bbf28f0b8efb1ac1d41150;
  • exact protected main: 55d7ae8647208e301f282350f076eeddaba61d11;
  • clean reconstruction: two changed files, mergeable and Ready;
  • exact-head CI 31389439496: success;
  • exact-head Security Scan 31389439807: success;
  • exact-head SAST Semgrep 31389440805: success;
  • exact-head fuzz 31389439662: success;
  • no automated check, comment, status, or model output is qualifying independent approval.

The exact two hunks are semantically identical to predecessor #330: finite [0,1] validation in rate, non-negative validation in nullableLong, and the same seven new invalid-ledger cases. The final blobs intentionally differ because this reconstruction preserves protected-main #270 changes around those methods instead of copying stale ancestry.

Contract preserved

Persisted conversionSuccessRate must be finite and inside [0.0, 1.0]; persisted p95TimeToPreviewMs, when present, must be non-negative. NaN, positive and negative infinity, out-of-domain rates, negative latency, and malformed numerics fail closed through the existing controlled invalid-line envelope. Valid historical finite evidence remains replayable. Invalid evidence is not clamped or silently discarded.

Scope / non-completion boundary

Changed files:

  1. src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java
  2. src/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java

This remains issue #329's bounded evidence-validity slice. It does not change KPI denominator semantics (#327/#338), tenant query authority (#326), authentication, persistence format, or canonical documentation. PR #305 remains the cross-cutting documentation owner.

Merge gate

Keep this exact head unchanged. Auto-merge may complete only after live repository protection still sees all required checks passing, zero valid unresolved findings, and the counted approving review from a qualifying independent reviewer with write access. Automated evidence is not approval.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e0eba6c8-baef-462a-9084-a74bc1bd1c00

📥 Commits

Reviewing files that changed from the base of the PR and between 55d7ae8 and 1fb6382.

📒 Files selected for processing (2)
  • src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java
  • src/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java

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.

@seonghobae
seonghobae marked this pull request as ready for review August 10, 2026 12:47
@seonghobae
seonghobae enabled auto-merge (squash) August 10, 2026 12:48

Copy link
Copy Markdown
Collaborator Author

@opencode-agent @cwl-noema-review Please independently review exact current head 1fb6382dcc5a64ea93bbf28f0b8efb1ac1d41150 against protected main 55d7ae8647208e301f282350f076eeddaba61d11. Exact-head CI 31389439496, Security Scan 31389439807, SAST 31389440805, and fuzz 31389439662 are successful. Verify finite [0,1] success-rate replay, non-negative optional p95 latency, fail-closed handling for NaN/infinities/out-of-domain values through the controlled invalid-line envelope, and preservation of valid historical evidence. Keep #338 denominator semantics and #326 tenant-query ownership separate. Advisory review only; do not mutate, count as human approval, merge, or weaken gates.

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