Skip to content

fix(icci): validate confidence level before model processing - #127

Closed
seonghobae wants to merge 12 commits into
masterfrom
sentinel-input-validation-7203446828146000551
Closed

fix(icci): validate confidence level before model processing#127
seonghobae wants to merge 12 commits into
masterfrom
sentinel-input-validation-7203446828146000551

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

범위

icci()의 공개 입력 conf.level을 모델 객체 처리 전에 검증합니다. 허용 계약은 길이 1의 numeric 값이면서 유한한 (0, 1) 범위입니다. 잘못된 입력은 call 정보를 노출하지 않는 일정한 오류로 종료합니다.

이 변경은 보안 취약점/DoS 수정으로 승격하지 않습니다. 확인된 결함은 잘못된 confidence-level 입력이 더 깊은 모델 처리나 수치 계산까지 흘러갈 수 있는 입력 계약·오류 결정성 문제입니다.

Verified successor close — 2026-09-07 UTC

Fresh close-time authority는 protected master@b62bf9ac928988a4b988fc3efb0adfb88549fef2, 이 PR의 live exact head 8274b193e7e48622e3c8140e6d0d1cd9191efc39입니다. Protected-base effective delta는 .jules/sentinel.md 제거, R/icci.Rconf.level admission guard, tests/testthat/test_icci_conf_level.R입니다.

Canonical successor #126 exact head 5a4be4cc5e231dc14155b611b4396ec631d5083a가 유효 product semantic을 완전히 승계합니다. #126은 같은 exported icci() 경계에서 scalar numeric (0,1) 계약과 call.=FALSE를 유지하면서 numeric(0), non-scalar, NA/NaN, ±Inf, 0/1, out-of-range, character, NULL을 모델 처리 전에 검증하고, 여기에 vuongtest()nested/adj 계약까지 추가합니다. 이 PR의 current test는 실제 MASS model fitting을 거치는 5개 case로 더 약합니다. Branch-local .jules/sentinel.md 제거는 protected repository authority의 삭제이므로 승계할 유효 delta로 보지 않습니다. 제출된 review나 inline review thread도 없습니다.

따라서 단순 중복 Close가 아니라 verified complete succession 예외로 닫습니다. #126의 current-head checks/reviews는 별도 merge authority이며 이 PR의 predecessor evidence는 전용하지 않습니다. #126이 merge 전에 semantic/test contract를 잃으면 이 close 판단을 무효로 보고 successor/reopen 경로로 복구해야 합니다.

No force push, destructive rebase, self-approval, gate weakening, source-neutral CI retrigger, predecessor-evidence transfer.

@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: bbb130ec-890e-451f-8419-c3ce1b89b5fa

📥 Commits

Reviewing files that changed from the base of the PR and between ed4a268 and 86e27e7.

📒 Files selected for processing (1)
  • .jules/sentinel.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

icci()conf.level을 검증합니다. 값이 단일 숫자가 아니거나 결측이거나 0과 1 사이가 아니면 오류를 발생시킵니다. 관련 보안 수정 사항도 기록합니다.

Changes

신뢰수준 검증

Layer / File(s) Summary
conf.level 유효성 검증
R/icci.R, .jules/sentinel.md
conf.level이 단일 숫자이고 결측이 아니며 0과 1 사이인지 확인합니다. 유효하지 않은 값에는 호출 스택 없이 오류를 발생시킵니다. 검증 변경 사항을 보안 수정 로그에 기록합니다.

Estimated code review effort: 1 (사소함) | ~5분

Merge Risk: ⚪ Minimal · up to 86e27

icci() now rejects invalid confidence levels before interval computation, preventing malformed inputs from reaching model processing. The validation behavior is in place with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 icci()conf.level 입력 검증을 모델 처리 전에 추가한 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-input-validation-7203446828146000551

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 draft September 7, 2026 07:06
@seonghobae seonghobae changed the title 🛡️ Sentinel: [security improvement] Add input validation to conf.level fix(icci): validate confidence level before model processing Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please review exact head 52e2d281d1eeeed2c47e3eadfb73f364c5493d56 against master@b62bf9ac928988a4b988fc3efb0adfb88549fef2. Scope is only R/icci.R plus tests/testthat/test_icci_conf_level.R; the generated .jules/sentinel.md delta was removed. Treat this as an input-contract/error-determinism change, not a security/DoS claim.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="b62bf9ac928988a4b988fc3efb0adfb88549fef2"
head="52e2d281d1eeeed2c47e3eadfb73f364c5493d56"

git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"

echo '--- scoped name-status ---'
git diff --name-status "$base" "$head" -- R/icci.R tests/testthat/test_icci_conf_level.R

echo '--- scoped diff ---'
git diff --no-ext-diff --unified=80 "$base" "$head" -- R/icci.R tests/testthat/test_icci_conf_level.R

echo '--- R/icci.R outline at head ---'
git show "${head}:R/icci.R" > /tmp/icci.R
ast-grep outline /tmp/icci.R --items all || true

echo '--- R/icci.R at head ---'
nl -ba /tmp/icci.R | sed -n '1,280p'

echo '--- focused test file at head ---'
if git cat-file -e "${head}:tests/testthat/test_icci_conf_level.R" 2>/dev/null; then
  git show "${head}:tests/testthat/test_icci_conf_level.R" > /tmp/test_icci_conf_level.R
  ast-grep outline /tmp/test_icci_conf_level.R --items all || true
  nl -ba /tmp/test_icci_conf_level.R | sed -n '1,280p'
else
  echo 'File not present at requested head.'
fi

echo '--- conf.level references in R and tests at head ---'
git grep -n -E 'conf\.level|icci[[:space:]]*\(' "$head" -- R tests/testthat || true

Length of output: 8826


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="b62bf9ac928988a4b988fc3efb0adfb88549fef2"
head="52e2d281d1eeeed2c47e3eadfb73f364c5493d56"

echo '--- remaining R/icci.R at requested head ---'
git show "${head}:R/icci.R" | awk 'NR >= 130 && NR <= 260 { printf "%4d  %s\n", NR, $0 }'

echo '--- testthat files that call icci() at requested head ---'
git grep -l -E '\bicci[[:space:]]*\(' "$head" -- 'tests/testthat/*.R' | while IFS= read -r file; do
  echo "--- $file ---"
  git show "${head}:${file}" | grep -n -E -C 4 '\bicci[[:space:]]*\(' || true
done

echo '--- testthat version constraints and configuration ---'
for file in DESCRIPTION tests/testthat.R; do
  if git cat-file -e "${head}:${file}" 2>/dev/null; then
    echo "--- $file ---"
    git show "${head}:${file}"
  fi
done

echo '--- assertions used by the new test elsewhere ---'
git grep -n -E 'expect_s3_class|conditionCall|conditionMessage' "$head" -- tests DESCRIPTION || true

echo '--- diff check restricted to specified paths ---'
git diff --check "$base" "$head" -- R/icci.R tests/testthat/test_icci_conf_level.R

Length of output: 6047


@seonghobae Reviewed the exact requested commit range and scope.

No defects found.

The validation runs before model processing. It rejects invalid scalar, type, missing, infinite, and bounds cases. The test verifies the fixed error message and the absence of a call in the error condition. I could not run the R test suite in this environment.

⚠️ 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.

@google-labs-jules

Copy link
Copy Markdown

@coderabbitai review

Please review exact head 52e2d281d1eeeed2c47e3eadfb73f364c5493d56 against master@b62bf9ac928988a4b988fc3efb0adfb88549fef2. Scope is only R/icci.R plus tests/testthat/test_icci_conf_level.R; the generated .jules/sentinel.md delta was removed. Treat this as an input-contract/error-determinism change, not a security/DoS claim.

Acknowledged. I've removed the .jules/sentinel.md file since the scope is limited to R/icci.R and tests/testthat/test_icci_conf_level.R, and treated this as an input-contract/error-determinism change. I also added a test file in tests/testthat/test_icci_conf_level.R to ensure the invalid inputs trigger errors as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug priority: medium Normal-priority or P2 work type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant