Skip to content

chore: superseded by current-base KPI ledger PR #339 - #330

Closed
seonghobae wants to merge 2 commits into
mainfrom
fix/kpi-ledger-numeric-evidence
Closed

chore: superseded by current-base KPI ledger PR #339#330
seonghobae wants to merge 2 commits into
mainfrom
fix/kpi-ledger-numeric-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Superseded by clean current-base reconstruction

Closed in favor of PR #339.

Fresh patch comparison proves PR #339 applies the same two bounded semantic hunks as this predecessor:

  • rate(...) rejects non-finite values and rates outside [0.0, 1.0];
  • nullableLong(...) rejects negative values;
  • the same NaN, positive/negative infinity, out-of-domain rate, and negative-latency regressions are added.

PR #339 applies those hunks to protected main 55d7ae8647208e301f282350f076eeddaba61d11, preserving #270-era ledger changes rather than copying stale file blobs. Its exact head 1fb6382dcc5a64ea93bbf28f0b8efb1ac1d41150 is GREEN on CI 31389439496, Security Scan 31389439807, SAST 31389440805, and fuzz 31389439662; auto-merge is enabled through normal protection.

Keeping both PRs would duplicate semantics, path ownership, checks, and review traffic. Issue #329 remains open until the protected replacement integrates; issue #327 and issue #326 remain separate.

@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: 56 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: 3be944a0-8e17-48dc-8716-4dcfc1df028d

📥 Commits

Reviewing files that changed from the base of the PR and between 83ec6f7 and 66c7afc.

📒 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 10:21
@seonghobae
seonghobae enabled auto-merge (squash) August 10, 2026 10:22

Copy link
Copy Markdown
Collaborator Author

@opencode-agent @cwl-noema-review Please independently review exact current head 66c7afc6eeb1e5862e414d14e7d236e275536082 against protected main 83ec6f7fe2b04bdcd28bf98ec350e41e55730a18. Exact-head CI 31378281640, Security Scan 31378281513, SAST Semgrep 31378281797, and fuzz 31378281561 are successful; no inline review thread is currently returned. Verify the bounded persisted-evidence integrity change: conversionSuccessRate replay must reject non-finite values and values outside [0,1], p95TimeToPreviewMs must reject negative persisted values, valid historical finite snapshots must continue to reload, and invalid evidence must fail through the existing controlled invalid-line contract rather than clamping or silent discard. Keep active #328 denominator semantics and issue #326 tenant-query ownership separate. Submit a formal review only for this exact head if supported; do not mutate the branch, merge, or weaken gates.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please review exact current head 66c7afc6eeb1e5862e414d14e7d236e275536082. Focus on fail-closed replay of NaN/infinities/out-of-domain rates/latency, compatibility with valid historical rows, and whether invalid evidence can still be clamped or silently discarded. Treat predecessor-head evidence as historical.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_head='66c7afc6eeb1e5862e414d14e7d236e275536082'
expected_main='83ec6f7fe2b04bdcd28bf98ec350e41e55730a18'

echo '== Checked-out revision =='
git rev-parse HEAD
git status --short
git cat-file -e "${expected_head}^{commit}"
git cat-file -e "${expected_main}^{commit}"
if [ "$(git rev-parse HEAD)" != "$expected_head" ]; then
  echo "ERROR: checked-out HEAD differs from requested exact head" >&2
  exit 2
fi

echo '== Merge-base and changed paths =='
base="$(git merge-base "$expected_main" "$expected_head")"
printf 'merge-base: %s\n' "$base"
git diff --name-status "$expected_main" "$expected_head"
git diff --check "$expected_main" "$expected_head"

echo '== Java file map =='
fd -t f -e java . | sort | rg 'KpiSnapshotLedger|KpiSnapshot|Ledger'

echo '== Production structure =='
prod="$(fd -t f -e java 'KpiSnapshotLedger.java' . | head -n 1)"
test="$(fd -t f -e java 'KpiSnapshotLedgerTest.java' . | head -n 1)"
printf 'production: %s\ntest: %s\n' "$prod" "$test"
ast-grep outline "$prod" --items all
ast-grep outline "$test" --items all

echo '== Exact-head diff =='
git diff --unified=80 "$expected_main" "$expected_head" -- "$prod" "$test"

echo '== Relevant replay and exception references =='
rg -n -C 5 --type java \
  'Double\.parseDouble|isFinite|conversionSuccessRate|p95TimeToPreviewMs|IllegalArgumentException|invalid.*line|Invalid.*line|read|load|replay|parse' \
  "$prod" "$test"

Length of output: 38341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_head='66c7afc6eeb1e5862e414d14e7d236e275536082'
prod='src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java'

echo '== Replay field mapping and load propagation =='
nl -ba "$prod" | sed -n '90,145p'
nl -ba "$prod" | sed -n '205,252p'

echo '== Snapshot record structure =='
record="$(fd -t f -e java 'KpiSnapshotRecord.java' src | head -n 1)"
printf '%s\n' "$record"
ast-grep outline "$record" --items all
nl -ba "$record" | sed -n '1,180p'

echo '== Ledger construction and exception handling call sites =='
rg -n -C 4 --type java \
  'new\s+KpiSnapshotLedger\s*\(|KpiSnapshotLedger\s*\(' \
  src/main src/test

echo '== Live pull request state =='
gh pr view 330 --repo ContextualWisdomLab/clearfolio \
  --json number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,reviewDecision,statusCheckRollup \
  --jq '{
    number, state, isDraft, headRefOid, baseRefOid, mergeStateStatus, reviewDecision,
    checks: [.statusCheckRollup[] | {name, status, conclusion}]
  }'

echo '== Requested commit identity =='
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$expected_head"

Length of output: 1536


🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_head='66c7afc6eeb1e5862e414d14e7d236e275536082'
prod='src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java'

echo '== Replay field mapping and load propagation =='
sed -n '90,145p' "$prod"
sed -n '205,252p' "$prod"

echo '== Snapshot record structure =='
record="$(fd -t f -e java 'KpiSnapshotRecord.java' src | head -n 1)"
printf '%s\n' "$record"
ast-grep outline "$record" --items all
sed -n '1,180p' "$record"

echo '== Ledger construction call sites =='
rg -n -C 4 --type java \
  'new\s+KpiSnapshotLedger\s*\(' \
  src/main src/test || true

echo '== Live pull request state =='
gh pr view 330 --repo ContextualWisdomLab/clearfolio \
  --json number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,reviewDecision,statusCheckRollup \
  --jq '{
    number, state, isDraft, headRefOid, baseRefOid, mergeStateStatus, reviewDecision,
    checks: [.statusCheckRollup[] | {name, status, conclusion}]
  }'

echo '== Requested commit identity =='
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$expected_head"

Length of output: 17379


@seonghobae Reviewed exact head 66c7afc6eeb1e5862e414d14e7d236e275536082 against main 83ec6f7fe2b04bdcd28bf98ec350e41e55730a18.

No findings in the requested scope.

  • replayLine sends conversionSuccessRate to rate.
  • rate rejects NaN, both infinities, and values outside [0.0, 1.0].
  • replayLine sends p95TimeToPreviewMs to nullableLong.
  • nullableLong preserves the null sentinel and rejects negative values.
  • Both invalid numeric paths throw the existing "kpi snapshot ledger contains an invalid line" exception.
  • The code does not clamp or discard invalid persisted evidence.
  • Valid finite rows and rows with a null p95 value continue to reload.
  • Focused tests cover all requested invalid numeric cases and valid reload compatibility.
  • The diff remains limited to the ledger and its focused tests. It does not change #328 denominator semantics or #326 tenant-query behavior.
  • Live PR metadata still reports the requested head and base. The listed Maven, SAST, security, and fuzz checks are successful.
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae seonghobae closed this Aug 10, 2026
auto-merge was automatically disabled August 10, 2026 12:47

Pull request was closed

@seonghobae seonghobae changed the title fix(analytics): reject invalid persisted KPI numerics chore: superseded by current-base KPI ledger PR #339 Aug 10, 2026
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