Skip to content

fix(kpi): restack provenance JSON byte integrity on 26de1c main - #337

Closed
seonghobae wants to merge 4 commits into
mainfrom
fix/kpi-provenance-json-integrity-26de1c
Closed

fix(kpi): restack provenance JSON byte integrity on 26de1c main#337
seonghobae wants to merge 4 commits into
mainfrom
fix/kpi-provenance-json-integrity-26de1c

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Rebuild only #335's strict production-KPI provenance byte-integrity hardening onto the current protected-main lineage after #333 advanced main. No predecessor CI, review, scanner, coverage, model/status, production-KPI, release, deployment, legal-rights, or acquisition authority transfers.

Exact construction

  • protected main at the final pre-write refetch: 26de1c3ab69106900410f6ceb18420109bfd9f8f;
  • source PR fix(kpi): restack provenance JSON byte integrity on d8bdcf main #335 exact unchanged head at the final pre-write refetch: 57f1f229c16ef845f6ad8ff943eafde3d829c06a;
  • successor exact head: a05ae76ada81db78278309aedbc2bdf09101fa41;
  • parent is exactly the protected-main SHA above;
  • net scope is exactly two paths: scripts/kpi-gate.mjs and test/kpi-provenance-json-integrity.test.ts;
  • successor blobs are exact source-head blobs 2ce57ef368f36a196645c94948dad3f2476ca5a0 and c8a072efd12f86c826c0b6d98b506ecee9817c76.

The only protected-main movement since #335's base is #333's coverage-truthfulness slice (src/index.ts plus two focused coverage tests), with no overlap on this KPI provenance slice. Immediately before construction the protected scripts/kpi-gate.mjs blob remained 12363af16b4168efef2fd0e45bae6086d968bdf2, and the focused provenance-integrity test path remained absent.

KPI provenance integrity contract

Strict provenance remains raw bytes until fatal UTF-8 decoding and rejects escape-equivalent duplicate decoded JSON object names before JSON.parse or production-source identity, collection timestamp, record count, SHA-256/byte-size, verified snapshot, final identity, and least-authority KPI child-process decisions. Existing production-source/provenance binding remains unchanged.

This hardens evidence parsing only. It does not synthesize or claim a real 30-day production KPI window.

Evidence boundary

Keep Draft until this unchanged exact head receives fresh terminal-success application ci, reviewer-ci, protected-base-eligible central Security Scan, configured exact 100% owned production statement/branch/function/line coverage with realistic tests, and zero valid unresolved findings. Pending, queued, skipped, absent, neutral, failed, cancelled, stale, predecessor, status-only, model-only, or rate-limited evidence is non-passing.

Immediately before Ready or merge, independently re-resolve protected main, exact head/base/ancestry, workflow checkout SHAs, formal reviews/threads, live rulesets, exact central Security Scan revision/triggers/base filters/thresholds, releases, and active-writer state.

No force update, gate weakening, synthetic KPI/release/deployment/legal evidence, reviewer/secret invention, outbound-license choice, repair/self-modifying workflow, or acquisition-ready claim is introduced.

Supersedes #335 only after fresh exact-head verification and protected integration. Related: #3, #84.

Summary by CodeRabbit

  • 버그 수정

    • KPI provenance JSON 처리 시 잘못된 UTF-8 인코딩을 감지하고 명확히 실패하도록 개선했습니다.
    • 중복된 JSON 키가 포함된 경우 KPI 게이트가 실패하도록 보완했습니다.
  • 테스트

    • 잘못된 UTF-8 및 중복 키가 포함된 provenance 파일에 대한 검증 테스트를 추가했습니다.
    • KPI 게이트의 관련 코드가 테스트 커버리지에 포함되었습니다.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 41 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: 97c5f90e-d895-44ad-877e-6deb3aad1322

📥 Commits

Reviewing files that changed from the base of the PR and between abcd18a and 3073c08.

📒 Files selected for processing (1)
  • test/kpi-gate-production-coverage.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 96792118-cbcc-447e-b8eb-6cd3045732b1

📥 Commits

Reviewing files that changed from the base of the PR and between 26de1c3 and abcd18a.

📒 Files selected for processing (3)
  • scripts/kpi-gate.mjs
  • test/kpi-provenance-json-integrity.test.ts
  • vitest.config.ts

📝 Walkthrough

Walkthrough

KPI 게이트가 provenance JSON을 fatal UTF-8로 디코딩하고 중복 키를 검사합니다. 잘못된 UTF-8과 중복 키 입력은 검증 실패를 반환합니다. 관련 테스트와 커버리지 대상도 추가되었습니다.

Changes

KPI provenance 무결성

Layer / File(s) Summary
엄격한 provenance 파싱
scripts/kpi-gate.mjs
provenance 파일을 fatal UTF-8 방식으로 디코딩합니다. JSON 파싱 전에 중복 키를 검사합니다. 검증 오류를 별도로 반환합니다.
무결성 검증 테스트와 커버리지
test/kpi-provenance-json-integrity.test.ts, vitest.config.ts
중복 키와 잘못된 UTF-8 입력이 상태 코드 1과 provenance 오류를 반환하는지 검증합니다. scripts/kpi-gate.mjs를 커버리지 대상에 추가합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to abcd1

This PR makes a localized change to preserve provenance JSON byte integrity and reject duplicate decoded names; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

  • ContextualWisdomLab/noema#324: 다른 스크립트와 데이터 영역에서 중복 JSON 키 사전 검증과 관련 테스트를 추가합니다.

Sequence Diagram(s)

sequenceDiagram
  participant KPI 게이트
  participant Provenance 파일
  participant TextDecoder
  participant 중복 키 검사기
  KPI 게이트->>Provenance 파일: provenance 바이트 읽기
  KPI 게이트->>TextDecoder: fatal UTF-8 디코딩
  TextDecoder-->>KPI 게이트: 디코딩 결과 또는 오류
  KPI 게이트->>중복 키 검사기: JSON 중복 키 검사
  중복 키 검사기-->>KPI 게이트: 검사 결과
  KPI 게이트-->>KPI 게이트: 오류 입력이면 검증 실패 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 provenance JSON의 바이트 무결성 수정과 main 재적용을 명확히 설명하며 변경 사항과 직접 관련됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/kpi-provenance-json-integrity-26de1c

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 14, 2026 21:46

Copy link
Copy Markdown
Contributor Author

Superseded by clean current-line successor #348, which preserves the exact KPI provenance integrity implementation and current coverage inventory without replaying stale configuration. Closing this predecessor; its prior evidence does not transfer.

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