Skip to content

⚡ Bolt: R 데이터 프레임 연산 및 팩터 변환 병목 최적화 - #183

Open
seonghobae wants to merge 4 commits into
masterfrom
bolt/r-optimization-7499257258458993733
Open

⚡ Bolt: R 데이터 프레임 연산 및 팩터 변환 병목 최적화#183
seonghobae wants to merge 4 commits into
masterfrom
bolt/r-optimization-7499257258458993733

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

💡 What

  • R 데이터 프레임 연산 과정에서 발생하던 메서드 디스패치 오버헤드 및 O(N) 메모리 할당/복사 오버헤드를 최적화했습니다.
  • as.factor를 통한 자동 레벨 추론을 factor를 활용한 사전 레벨 정의로 교체했습니다.

🎯 Why

  • 반복문 내에서 데이터를 조회 및 수정하거나 열 이름을 가져오는 경우, 2차원 서브셋팅 방식과 자동 레벨 추론은 불필요한 연산과 메모리 복사를 발생시켜 전체 성능을 저하시켰습니다.

📊 Impact

  • 메서드 디스패치 과정이 제거되고 2차원 탐색의 중복이 줄어듦에 따라 반복문에 의한 속도 저하를 방지할 수 있습니다.
  • 불필요한 벡터 할당 및 복사 오버헤드가 발생하지 않습니다.

🔬 Measurement

  • Rscript -e "devtools::test()"를 통해 모든 테스트가 통과하는지 확인하여 성능 향상 및 기능의 무결성을 검증합니다.

PR created automatically by Jules for task 7499257258458993733 started by @seonghobae

Summary by CodeRabbit

  • 문서

    • R 데이터 처리 성능을 개선하기 위한 벡터 서브셋팅, 열 이름 매칭, 명시적 팩터 레벨 지정 권장 사항을 추가했습니다.
  • 빌드 개선

    • 빌드 산출물에서 불필요한 검사 및 설정 파일이 제외되도록 했습니다.

- 2차원 데이터 프레임 할당(df[idx, 'col'] <- val)을 직접적인 벡터 서브셋팅(df$col[idx] <- val)으로 대체하여 메서드 디스패치 오버헤드 제거
- colnames(df[cols])를 이용한 불필요한 서브셋 생성 방식을 intersect(colnames(df), cols)로 변경하여 O(N) 메모리 복사 및 스캔 방지
- as.factor() 내 자동 레벨 추론을 사전에 정의된 factor(..., levels=c(...)) 방식으로 대체하여 성능 향상
- .jules/bolt.md에 배운 내용 기록
@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 Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

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: 2d2ec31f-80ff-4c58-bab5-710c35ba9895

📥 Commits

Reviewing files that changed from the base of the PR and between d6abb76 and 5df0361.

📒 Files selected for processing (1)
  • .Rbuildignore

📝 Walkthrough

Walkthrough

R 데이터프레임 연산 최적화 지침을 문서에 추가하고, .Rbuildignore에 semgrep 설정 및 테스트 파일 제외 패턴을 추가했습니다.

Changes

R 최적화 지침

Layer / File(s) Summary
데이터프레임 최적화 지침
.jules/bolt.md
2차원 할당 대신 벡터 서브셋팅, 열 이름 교집합, 명시적 팩터 레벨 사용 방법을 문서화했습니다.

R 패키지 빌드 제외 설정

Layer / File(s) Summary
빌드 제외 패턴
.Rbuildignore
.semgrepignore, test_dummy.R, test_validation.R을 빌드 산출물에서 제외하도록 패턴을 추가했습니다.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 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 데이터 프레임 연산과 팩터 변환 성능 최적화를 핵심 변경 사항으로 잘 요약한 제목입니다.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/r-optimization-7499257258458993733

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@R/aFIPC.R`:
- Around line 623-624: Validate column-name matches before constructing
newFormColNames and oldFormColNames in both intersect() locations. Use match()
results to detect any missing common item names and immediately stop() with an
appropriate error; do not silently retain partial lists or allow IPD/link
processing to continue with incomplete common-item constraints.
- Around line 861-867: Update forceNormalZeroOne so the link model mean is fixed
at zero: after disabling estimation for NewScaleParms$est[new_mean11_idx],
assign 0 to NewScaleParms$value[new_mean11_idx]. Keep the existing OldScaleParms
assignment unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b4f90f81-e7a8-41cc-aca3-2df10369bef0

📥 Commits

Reviewing files that changed from the base of the PR and between 35e4498 and b2e6fc1.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • R/aFIPC.R

Comment thread R/aFIPC.R Outdated
Comment thread R/aFIPC.R Outdated
- 2차원 데이터 프레임 할당(df[idx, 'col'] <- val)을 직접적인 벡터 서브셋팅(df$col[idx] <- val)으로 대체하여 메서드 디스패치 오버헤드 제거
- colnames(df[cols])를 이용한 불필요한 서브셋 생성 방식을 intersect(colnames(df), cols)로 변경하여 O(N) 메모리 복사 및 스캔 방지
- as.factor() 내 자동 레벨 추론을 사전에 정의된 factor(..., levels=c(...)) 방식으로 대체하여 성능 향상
- .jules/bolt.md에 배운 내용 추가
- .Rbuildignore에 .semgrepignore 예외 추가

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
aFIPC.Rcheck/tests/testthat/test-surveyFA.R (1)

1-85: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

R CMD check 산출물 디렉터리(aFIPC.Rcheck/)가 저장소에 커밋되어 테스트 파일이 중복 관리되고 있습니다.

aFIPC.Rcheck/R CMD check 실행 시 생성되는 산출물로, 00_pkg_src/(소스 사본)과 tests/(복사본)에 동일한 파일이 중복 존재합니다. 이 상태에서는 어느 쪽이 정본인지 불분명하고, 한쪽만 수정하면 두 사본이 조용히 갈라집니다. 실제 정본은 저장소 루트의 R/, tests/testthat/이어야 합니다.

  • aFIPC.Rcheck/tests/testthat/test-surveyFA.R#L1-L85: 이 사본을 삭제하고 루트 tests/testthat/test-surveyFA.R만 유지하세요.
  • aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R#L1-L80: 이 사본을 삭제하고 루트 tests/testthat/test-optimization-equivalence.R만 유지하세요.
  • aFIPC.Rcheck/tests/testthat/test-autoFIPC.R#L1-L91: 이 사본을 삭제하고 루트 tests/testthat/test-autoFIPC.R만 유지하세요.

.gitignore*.Rcheck/를 추가하고 git rm -r --cached aFIPC.Rcheck로 추적을 해제하는 것을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/tests/testthat/test-surveyFA.R` around lines 1 - 85, Remove the
generated aFIPC.Rcheck copies at aFIPC.Rcheck/tests/testthat/test-surveyFA.R
(lines 1-85), aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R (lines
1-80), and aFIPC.Rcheck/tests/testthat/test-autoFIPC.R (lines 1-91), retaining
the corresponding root tests/testthat files as the canonical versions. Add
*.Rcheck/ to .gitignore and untrack the existing aFIPC.Rcheck directory.
🧹 Nitpick comments (10)
.Rbuildignore (1)

25-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

R CMD check 생성물을 제거하고 VCS ignore를 별도로 설정하세요.

aFIPC.Rcheck/ 아래 파일들은 현재 소스에서 재생성되는 결과물입니다. .Rbuildignore는 패키지 빌드용 설정이므로 Git 추적을 막지 않습니다.

  • .Rbuildignore#L25-L25: .semgrepignore 제외 패턴은 유지하되, aFIPC.Rcheck/는 VCS ignore에 추가하세요.
  • aFIPC.Rcheck/aFIPC/Meta/Rd.rds#L1-L2: 생성된 RDS 파일을 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/features.rds#L1-L1: 생성된 메타데이터를 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/hsearch.rds#L1-L1: 생성된 도움말 인덱스를 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/links.rds#L1-L1: 생성된 링크 메타데이터를 제거하세요.
  • aFIPC.Rcheck/aFIPC/help/paths.rds#L1-L1: 생성된 도움말 경로 인덱스를 제거하세요.
  • aFIPC.Rcheck/tests/testthat.Rout#L1-L275: 특정 환경의 실행 로그를 제거하고 CI에서 테스트를 재실행하세요.
  • aFIPC.Rcheck/00_pkg_src/aFIPC/.semgrepignore#L1-L1: Rcheck 소스 스냅샷의 중복 복사본을 제거하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.Rbuildignore at line 25, Keep the existing .semgrepignore exclusion in
.Rbuildignore, add aFIPC.Rcheck/ to the VCS ignore configuration, and remove all
generated Rcheck artifacts: the listed Meta and help RDS files,
tests/testthat.Rout, and the duplicated 00_pkg_src/aFIPC/.semgrepignore
snapshot; CI should regenerate and run the tests.
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R (2)

61-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

set.seed() 누락으로 테스트가 비결정적입니다.

Line 3의 첫 번째 테스트와 달리 여기서는 시드가 고정되지 않아 rbinom() 결과가 매 실행마다 달라집니다. 현재는 itemtype = "not_a_model"이 항상 실패하므로 통과하겠지만, 회귀 테스트의 재현성을 위해 시드를 고정하는 편이 좋습니다.

💚 제안 수정
 test_that("surveyFA reports bounded recovery exhaustion when unrecoverable", {
   skip_if_not_installed("mirt")
+  set.seed(20260703)
 
   raw <- as.data.frame(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R` around lines 61
- 70, Set a deterministic random seed at the start of the “surveyFA reports
bounded recovery exhaustion when unrecoverable” test before the rbinom() calls,
matching the seeded setup used by the earlier test while leaving the existing
test behavior unchanged.

34-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

skip_if_not_installed("mirt") 없이 aFIPC::surveyFA를 호출합니다.

Line 34-39와 Line 41-59는 mirt 가드가 없습니다. 검증 오류는 mirt 호출 이전에 발생하므로 현재는 동작하지만, aFIPC 패키지 로드 자체가 mirtImports로 요구한다면 일관성을 위해 동일한 가드를 두는 편이 안전합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R` around lines 34
- 39, 테스트에서 mirt 설치 여부를 확인하는 가드가 누락되어 있습니다. test-surveyFA.R의 unsupported-input 및
관련 surveyFA 테스트 블록 시작 부분에 skip_if_not_installed("mirt")를 추가해 mirt가 없을 때 테스트를
건너뛰도록 하세요.
aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R (1)

889-889: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

패키지 함수 내 무조건적인 print() 호출은 verbose 옵션 뒤로 두는 편이 좋습니다.

Line 121, 642-643, 730-731, 889의 print()는 사용자가 억제할 수 없는 표준 출력입니다. message()로 바꾸거나 verbose 인자로 제어하면 R CMD check 및 스크립트 사용성이 개선됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R` at line 889, Update the
unconditional print calls in the package functions, including the one printing
NewScaleParms and the calls at the other referenced locations, so output is
controlled by the existing verbose option or uses message() instead of standard
output. Preserve the current diagnostic content while allowing users to suppress
it.
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R (2)

39-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

na.omitstats::na.omit으로 명시하세요.

aFIPC.R Line 773은 stats::na.omit을 사용합니다. 테스트에서도 네임스페이스를 맞추는 편이 일관적이며, stats가 부착되지 않은 실행 환경에서도 안전합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`
at line 39, Update the anonymous function in the optimization equivalence test
to call stats::na.omit explicitly instead of the unqualified na.omit, matching
the namespace-qualified usage in aFIPC.R while preserving the existing
unique-and-length behavior.

37-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

테스트가 실제 구현이 아닌 테스트 파일 내 재구현을 검증합니다.

new_idiom/legacy_idiomaFIPC.R의 코드를 호출하지 않고 테스트 안에서 다시 작성한 표현식입니다. 따라서 aFIPC.R의 실제 가드가 바뀌어도 이 테스트는 계속 통과하며, 주석(Line 3-6)이 주장하는 "회귀 가드" 역할을 하지 못합니다.

또한 두 idiom은 x가 이미 factor이고 미사용 레벨을 포함한 경우 결과가 달라집니다(levels()는 미사용 레벨도 셈). 실제 newFormModel@Data$data 열이 factor로 들어올 수 있다면 이 케이스를 벡터 목록에 추가해 주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`
around lines 37 - 50, Update the optimization-equivalence test to invoke the
actual implementation in aFIPC.R rather than reimplementing the new and legacy
expressions locally, so changes to its guard are covered by the regression
assertion. Preserve comparisons against the expected result and legacy behavior,
and add a vector case where x is a factor with unused levels to verify the
intended handling of factor-valued newFormModel@Data$data columns.
aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R (3)

207-216: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

suppressWarnings()가 안쪽에 있어 PV_Q1* 폴백이 도달 불가능합니다.

suppressWarnings(mirt::itemfit(...))tryCatch의 표현식 내부에 있으므로 경고는 바깥 warning = 핸들러까지 전파되지 않습니다. 결과적으로 Line 210-215의 PV_Q1* 대체 경로는 죽은 코드입니다. 경고 기반 폴백을 의도했다면 suppressWarnings를 제거하고, S_X2 결과가 사용 불가할 때만 폴백하도록 하세요.

♻️ 제안 리팩터
     fit_df <- tryCatch(
-      suppressWarnings(mirt::itemfit(fitted_model, fit_stats = "S_X2")),
+      mirt::itemfit(fitted_model, fit_stats = "S_X2"),
       error = function(e) NA,
       warning = function(w) {
         tryCatch(
-          mirt::itemfit(fitted_model, fit_stats = "PV_Q1*"),
+          suppressWarnings(mirt::itemfit(fitted_model, fit_stats = "PV_Q1*")),
           error = function(err) NA
         )
       }
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 207 - 216, Update
the fit_df tryCatch flow around mirt::itemfit so warnings from the S_X2 attempt
reach the warning handler by removing the inner suppressWarnings call. Preserve
the PV_Q1* fallback in the warning handler, and ensure it is used only when the
S_X2 result is unavailable due to a warning or error.

253-261: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

methods는 base 함수명을 가립니다.

utils::methods()와 이름이 충돌하며, 이 파일은 methods 패키지 기능도 사용하는 맥락이라 혼동을 줍니다. estimator_order 같은 이름을 권장합니다.

♻️ 제안 리팩터
-  methods <- c("QMCEM", "EM", "MHRM")
+  estimator_order <- c("QMCEM", "EM", "MHRM")
   if (forceNormalEM) {
-    methods <- c("EM", "QMCEM", "MHRM")
+    estimator_order <- c("EM", "QMCEM", "MHRM")
   } else if (forceMHRM) {
-    methods <- c("MHRM", "QMCEM", "EM")
+    estimator_order <- c("MHRM", "QMCEM", "EM")
   } else if (unstable) {
-    methods <- c("QMCEM", "MHRM", "EM")
+    estimator_order <- c("QMCEM", "MHRM", "EM")
   }

for (method_name in methods)(Line 265)도 함께 변경이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 253 - 261, Rename
the local methods vector to estimator_order throughout the surrounding surveyFA
logic, including its initial assignment, all forceNormalEM/forceMHRM/unstable
branches, and the loop currently iterating with method_name in methods. Preserve
the existing estimator ordering and behavior.

174-193: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

MHRM 재시도에 백오프나 시드 변화가 없어 3회 모두 동일하게 실패합니다.

fit_args가 고정이고 GenRandomPars = FALSE이므로, 결정론적 실패(예: 잘못된 itemtype) 시 동일한 호출을 3회 반복하며 시간만 소모합니다. 첫 실패가 결정론적 오류인지 판단하거나, 재시도 시 GenRandomPars = TRUE로 시작점을 바꾸는 편이 유효합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 174 - 193, Update
the MHRM retry loop in the method_name == "MHRM" branch so retries do not repeat
the same deterministic call with fixed starting conditions. Distinguish
deterministic argument errors such as invalid itemtype and stop retrying them,
or enable varied starting parameters by setting GenRandomPars = TRUE for
subsequent attempts while preserving the existing three-attempt limit and
warning behavior.
aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R (1)

1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

실제 동작 검증을 추가하세요.

이 파일은 내부 R 파일을 source()하기만 하므로, 문법·로드 오류 외에는 회귀를 검출하지 못합니다. autoFIPC()surveyFA()의 입력 검증 및 주요 결과를 tests/testthat/ 아래의 assertion 기반 테스트로 옮기거나 보완하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R` around lines 1 - 2, 보완용 테스트를
tests/testthat/ 아래에 추가해 autoFIPC()와 surveyFA()의 실제 동작을 검증하세요. 입력 검증의 기대 동작과 주요
결과를 assertion으로 확인하고, 단순히 R 파일을 source()하는 aFIPC/test_dummy.R에 의존하지 않도록 구성하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION`:
- Line 4: 패키지 메타데이터와 런타임 출력의 버전을 일치시키세요. DESCRIPTION의 Version과 aFIPC.R의 aFIPC
출력에서 의도한 동일한 버전 값을 사용하도록 수정하고, 설치 후 버전 식별이 일관되게 유지되는지 확인하세요.
- Line 1: Remove all generated R CMD check artifacts from aFIPC.Rcheck,
including the listed DESCRIPTION, LICENSE, NAMESPACE, README.md,
test_validation.R, testthat.R, startup.Rs, aFIPC-Ex.R, and aFIPC-Ex.Rout files;
add *.Rcheck/ to the ignore rules and remove any already tracked artifacts from
version control.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R`:
- Around line 639-647: Update the IPDData construction around IPDItemCount and
the oldformYDataK/newformXDataK assignments to handle zero matched items without
generating the invalid 1:0 sequence, and preserve a zero-column data frame. Also
force the subset operations to retain data-frame/matrix dimensions when exactly
one item matches, so both assignments remain shape-compatible.
- Around line 87-91: Restrict the itemtype validation in autoFIPC to require a
scalar length-1 value, since downstream scalar conditions such as itemtype
comparisons assume one type; remove the per-item length allowance in the
validation near nItems. Update the affected existing tests, including the
expected error message in test-autoFIPC.R, to match the narrowed validation.
- Around line 850-851: Update the linkedFormData assignment near the Bolt cache
in the mirt model setup so column-name selection works for both data frames and
matrices: use two-dimensional column indexing with the existing
colnames(newFormModel@Data$data), preserving the selected columns and their
names. Keep the cached subset behavior unchanged and ensure the resulting object
remains suitable for ncol(linkedFormData) and the subsequent mirt() call.
- Around line 784-797: Validate the cached indices in the code using
newScaleParmsItemIdxCache and oldScaleParmsItemIdxCache before the Linkedform
assignment. Preserve which()’s no-op behavior by skipping the update when either
lookup is missing, and only assign when newIdx and oldIdx have matching lengths
to prevent invalid recycling.
- Around line 615-619: Update the IPDgroup factor construction near IPDgroup so
its levels preserve the existing reference-group order rather than forcing
c('oldForm', 'newForm'); ensure mirt::multipleGroup() continues using the
intended first level as the reference group and preserves the existing IPD/DIF
results.
- Around line 856-867: Update the mean-parameter selector in forceNormalZeroOne
to use MEAN_1 instead of MEAN_11, matching the other branches so the
corresponding mean value is fixed to zero. Keep the covariance handling and
existing estimation flags unchanged.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R`:
- Around line 83-92: Update the response_data column subsetting in surveyFA to
use drop = FALSE, preserving a data-frame result when exactly one non-constant
response column remains. Keep the existing nrow/ncol guard so it raises the
intended surveyFA validation error.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_validation.R`:
- Around line 1-3: Move the validation logic from test_validation.R into
tests/testthat/test-validation.R so devtools::test() runs it automatically, and
replace the print-based success check with appropriate testthat assertions. If
it is intended only as a one-off script instead, relocate it to a clearly named
tools directory outside the test suite.

In
`@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-fixed-parameter-calibration.R`:
- Around line 1-123: Remove the tracked R CMD check artifacts under
aFIPC.Rcheck/ while preserving the three source tests in
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/:
test-fixed-parameter-calibration.R (1-123), test-package-api.R (1-42), and
test-sentinel-validation.R (1-37). Add aFIPC.Rcheck/ to .gitignore, and remove
the duplicate generated copies from aFIPC.Rcheck/tests/testthat/:
test-fixed-parameter-calibration.R (1-123), test-package-api.R (1-42), and
test-sentinel-validation.R (1-37).

In `@aFIPC.Rcheck/aFIPC/DESCRIPTION`:
- Around line 18-19: Remove the generated aFIPC.Rcheck/ directory and its R CMD
check artifacts from the repository, including the packaged DESCRIPTION
metadata. Keep only the actual source files under version control and configure
or use CI artifacts for storing future check results.

In `@aFIPC.Rcheck/aFIPC/html/R.css`:
- Line 127: 커밋 대상에서 생성 산출물인 aFIPC.Rcheck/ 디렉터리를 제외하도록 처리하세요. 생성 결과를 보존해야 하는 경우에는
R.css의 font-family 선언에서 Courier New를 따옴표로 감싸 Stylelint의 font-family-name-quotes
규칙을 만족시키세요.

---

Outside diff comments:
In `@aFIPC.Rcheck/tests/testthat/test-surveyFA.R`:
- Around line 1-85: Remove the generated aFIPC.Rcheck copies at
aFIPC.Rcheck/tests/testthat/test-surveyFA.R (lines 1-85),
aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R (lines 1-80), and
aFIPC.Rcheck/tests/testthat/test-autoFIPC.R (lines 1-91), retaining the
corresponding root tests/testthat files as the canonical versions. Add *.Rcheck/
to .gitignore and untrack the existing aFIPC.Rcheck directory.

---

Nitpick comments:
In @.Rbuildignore:
- Line 25: Keep the existing .semgrepignore exclusion in .Rbuildignore, add
aFIPC.Rcheck/ to the VCS ignore configuration, and remove all generated Rcheck
artifacts: the listed Meta and help RDS files, tests/testthat.Rout, and the
duplicated 00_pkg_src/aFIPC/.semgrepignore snapshot; CI should regenerate and
run the tests.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R`:
- Line 889: Update the unconditional print calls in the package functions,
including the one printing NewScaleParms and the calls at the other referenced
locations, so output is controlled by the existing verbose option or uses
message() instead of standard output. Preserve the current diagnostic content
while allowing users to suppress it.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R`:
- Around line 207-216: Update the fit_df tryCatch flow around mirt::itemfit so
warnings from the S_X2 attempt reach the warning handler by removing the inner
suppressWarnings call. Preserve the PV_Q1* fallback in the warning handler, and
ensure it is used only when the S_X2 result is unavailable due to a warning or
error.
- Around line 253-261: Rename the local methods vector to estimator_order
throughout the surrounding surveyFA logic, including its initial assignment, all
forceNormalEM/forceMHRM/unstable branches, and the loop currently iterating with
method_name in methods. Preserve the existing estimator ordering and behavior.
- Around line 174-193: Update the MHRM retry loop in the method_name == "MHRM"
branch so retries do not repeat the same deterministic call with fixed starting
conditions. Distinguish deterministic argument errors such as invalid itemtype
and stop retrying them, or enable varied starting parameters by setting
GenRandomPars = TRUE for subsequent attempts while preserving the existing
three-attempt limit and warning behavior.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R`:
- Around line 1-2: 보완용 테스트를 tests/testthat/ 아래에 추가해 autoFIPC()와 surveyFA()의 실제
동작을 검증하세요. 입력 검증의 기대 동작과 주요 결과를 assertion으로 확인하고, 단순히 R 파일을 source()하는
aFIPC/test_dummy.R에 의존하지 않도록 구성하세요.

In
`@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`:
- Line 39: Update the anonymous function in the optimization equivalence test to
call stats::na.omit explicitly instead of the unqualified na.omit, matching the
namespace-qualified usage in aFIPC.R while preserving the existing
unique-and-length behavior.
- Around line 37-50: Update the optimization-equivalence test to invoke the
actual implementation in aFIPC.R rather than reimplementing the new and legacy
expressions locally, so changes to its guard are covered by the regression
assertion. Preserve comparisons against the expected result and legacy behavior,
and add a vector case where x is a factor with unused levels to verify the
intended handling of factor-valued newFormModel@Data$data columns.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R`:
- Around line 61-70: Set a deterministic random seed at the start of the
“surveyFA reports bounded recovery exhaustion when unrecoverable” test before
the rbinom() calls, matching the seeded setup used by the earlier test while
leaving the existing test behavior unchanged.
- Around line 34-39: 테스트에서 mirt 설치 여부를 확인하는 가드가 누락되어 있습니다. test-surveyFA.R의
unsupported-input 및 관련 surveyFA 테스트 블록 시작 부분에 skip_if_not_installed("mirt")를 추가해
mirt가 없을 때 테스트를 건너뛰도록 하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b638b772-0ecd-4e12-869f-27393c5af1d3

📥 Commits

Reviewing files that changed from the base of the PR and between b2e6fc1 and d6abb76.

⛔ Files ignored due to path filters (3)
  • aFIPC.Rcheck/00check.log is excluded by !**/*.log
  • aFIPC.Rcheck/00install.out is excluded by !**/*.out
  • aFIPC.Rcheck/aFIPC-Ex.pdf is excluded by !**/*.pdf
📒 Files selected for processing (50)
  • .Rbuildignore
  • aFIPC.Rcheck/00_pkg_src/aFIPC/.semgrepignore
  • aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION
  • aFIPC.Rcheck/00_pkg_src/aFIPC/LICENSE
  • aFIPC.Rcheck/00_pkg_src/aFIPC/NAMESPACE
  • aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/README.md
  • aFIPC.Rcheck/00_pkg_src/aFIPC/man/autoFIPC.Rd
  • aFIPC.Rcheck/00_pkg_src/aFIPC/man/surveyFA.Rd
  • aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/test_validation.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-autoFIPC.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-fixed-parameter-calibration.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-package-api.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-sentinel-validation.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R
  • aFIPC.Rcheck/aFIPC-Ex.R
  • aFIPC.Rcheck/aFIPC-Ex.Rout
  • aFIPC.Rcheck/aFIPC/DESCRIPTION
  • aFIPC.Rcheck/aFIPC/INDEX
  • aFIPC.Rcheck/aFIPC/LICENSE
  • aFIPC.Rcheck/aFIPC/Meta/Rd.rds
  • aFIPC.Rcheck/aFIPC/Meta/features.rds
  • aFIPC.Rcheck/aFIPC/Meta/hsearch.rds
  • aFIPC.Rcheck/aFIPC/Meta/links.rds
  • aFIPC.Rcheck/aFIPC/Meta/nsInfo.rds
  • aFIPC.Rcheck/aFIPC/Meta/package.rds
  • aFIPC.Rcheck/aFIPC/NAMESPACE
  • aFIPC.Rcheck/aFIPC/R/aFIPC
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdb
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdx
  • aFIPC.Rcheck/aFIPC/help/AnIndex
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdb
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdx
  • aFIPC.Rcheck/aFIPC/help/aliases.rds
  • aFIPC.Rcheck/aFIPC/help/paths.rds
  • aFIPC.Rcheck/aFIPC/html/00Index.html
  • aFIPC.Rcheck/aFIPC/html/R.css
  • aFIPC.Rcheck/tests/startup.Rs
  • aFIPC.Rcheck/tests/testthat.R
  • aFIPC.Rcheck/tests/testthat.Rout
  • aFIPC.Rcheck/tests/testthat/test-autoFIPC.R
  • aFIPC.Rcheck/tests/testthat/test-fixed-parameter-calibration.R
  • aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R
  • aFIPC.Rcheck/tests/testthat/test-package-api.R
  • aFIPC.Rcheck/tests/testthat/test-sentinel-validation.R
  • aFIPC.Rcheck/tests/testthat/test-surveyFA.R

Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/test_validation.R Outdated
Comment thread aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-fixed-parameter-calibration.R Outdated
Comment thread aFIPC.Rcheck/aFIPC/DESCRIPTION Outdated
Comment thread aFIPC.Rcheck/aFIPC/html/R.css Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
aFIPC.Rcheck/tests/testthat/test-surveyFA.R (1)

1-85: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

R CMD check 산출물 디렉터리(aFIPC.Rcheck/)가 저장소에 커밋되어 테스트 파일이 중복 관리되고 있습니다.

aFIPC.Rcheck/R CMD check 실행 시 생성되는 산출물로, 00_pkg_src/(소스 사본)과 tests/(복사본)에 동일한 파일이 중복 존재합니다. 이 상태에서는 어느 쪽이 정본인지 불분명하고, 한쪽만 수정하면 두 사본이 조용히 갈라집니다. 실제 정본은 저장소 루트의 R/, tests/testthat/이어야 합니다.

  • aFIPC.Rcheck/tests/testthat/test-surveyFA.R#L1-L85: 이 사본을 삭제하고 루트 tests/testthat/test-surveyFA.R만 유지하세요.
  • aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R#L1-L80: 이 사본을 삭제하고 루트 tests/testthat/test-optimization-equivalence.R만 유지하세요.
  • aFIPC.Rcheck/tests/testthat/test-autoFIPC.R#L1-L91: 이 사본을 삭제하고 루트 tests/testthat/test-autoFIPC.R만 유지하세요.

.gitignore*.Rcheck/를 추가하고 git rm -r --cached aFIPC.Rcheck로 추적을 해제하는 것을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/tests/testthat/test-surveyFA.R` around lines 1 - 85, Remove the
generated aFIPC.Rcheck copies at aFIPC.Rcheck/tests/testthat/test-surveyFA.R
(lines 1-85), aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R (lines
1-80), and aFIPC.Rcheck/tests/testthat/test-autoFIPC.R (lines 1-91), retaining
the corresponding root tests/testthat files as the canonical versions. Add
*.Rcheck/ to .gitignore and untrack the existing aFIPC.Rcheck directory.
🧹 Nitpick comments (10)
.Rbuildignore (1)

25-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

R CMD check 생성물을 제거하고 VCS ignore를 별도로 설정하세요.

aFIPC.Rcheck/ 아래 파일들은 현재 소스에서 재생성되는 결과물입니다. .Rbuildignore는 패키지 빌드용 설정이므로 Git 추적을 막지 않습니다.

  • .Rbuildignore#L25-L25: .semgrepignore 제외 패턴은 유지하되, aFIPC.Rcheck/는 VCS ignore에 추가하세요.
  • aFIPC.Rcheck/aFIPC/Meta/Rd.rds#L1-L2: 생성된 RDS 파일을 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/features.rds#L1-L1: 생성된 메타데이터를 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/hsearch.rds#L1-L1: 생성된 도움말 인덱스를 제거하세요.
  • aFIPC.Rcheck/aFIPC/Meta/links.rds#L1-L1: 생성된 링크 메타데이터를 제거하세요.
  • aFIPC.Rcheck/aFIPC/help/paths.rds#L1-L1: 생성된 도움말 경로 인덱스를 제거하세요.
  • aFIPC.Rcheck/tests/testthat.Rout#L1-L275: 특정 환경의 실행 로그를 제거하고 CI에서 테스트를 재실행하세요.
  • aFIPC.Rcheck/00_pkg_src/aFIPC/.semgrepignore#L1-L1: Rcheck 소스 스냅샷의 중복 복사본을 제거하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.Rbuildignore at line 25, Keep the existing .semgrepignore exclusion in
.Rbuildignore, add aFIPC.Rcheck/ to the VCS ignore configuration, and remove all
generated Rcheck artifacts: the listed Meta and help RDS files,
tests/testthat.Rout, and the duplicated 00_pkg_src/aFIPC/.semgrepignore
snapshot; CI should regenerate and run the tests.
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R (2)

61-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

set.seed() 누락으로 테스트가 비결정적입니다.

Line 3의 첫 번째 테스트와 달리 여기서는 시드가 고정되지 않아 rbinom() 결과가 매 실행마다 달라집니다. 현재는 itemtype = "not_a_model"이 항상 실패하므로 통과하겠지만, 회귀 테스트의 재현성을 위해 시드를 고정하는 편이 좋습니다.

💚 제안 수정
 test_that("surveyFA reports bounded recovery exhaustion when unrecoverable", {
   skip_if_not_installed("mirt")
+  set.seed(20260703)
 
   raw <- as.data.frame(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R` around lines 61
- 70, Set a deterministic random seed at the start of the “surveyFA reports
bounded recovery exhaustion when unrecoverable” test before the rbinom() calls,
matching the seeded setup used by the earlier test while leaving the existing
test behavior unchanged.

34-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

skip_if_not_installed("mirt") 없이 aFIPC::surveyFA를 호출합니다.

Line 34-39와 Line 41-59는 mirt 가드가 없습니다. 검증 오류는 mirt 호출 이전에 발생하므로 현재는 동작하지만, aFIPC 패키지 로드 자체가 mirtImports로 요구한다면 일관성을 위해 동일한 가드를 두는 편이 안전합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R` around lines 34
- 39, 테스트에서 mirt 설치 여부를 확인하는 가드가 누락되어 있습니다. test-surveyFA.R의 unsupported-input 및
관련 surveyFA 테스트 블록 시작 부분에 skip_if_not_installed("mirt")를 추가해 mirt가 없을 때 테스트를
건너뛰도록 하세요.
aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R (1)

889-889: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

패키지 함수 내 무조건적인 print() 호출은 verbose 옵션 뒤로 두는 편이 좋습니다.

Line 121, 642-643, 730-731, 889의 print()는 사용자가 억제할 수 없는 표준 출력입니다. message()로 바꾸거나 verbose 인자로 제어하면 R CMD check 및 스크립트 사용성이 개선됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R` at line 889, Update the
unconditional print calls in the package functions, including the one printing
NewScaleParms and the calls at the other referenced locations, so output is
controlled by the existing verbose option or uses message() instead of standard
output. Preserve the current diagnostic content while allowing users to suppress
it.
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R (2)

39-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

na.omitstats::na.omit으로 명시하세요.

aFIPC.R Line 773은 stats::na.omit을 사용합니다. 테스트에서도 네임스페이스를 맞추는 편이 일관적이며, stats가 부착되지 않은 실행 환경에서도 안전합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`
at line 39, Update the anonymous function in the optimization equivalence test
to call stats::na.omit explicitly instead of the unqualified na.omit, matching
the namespace-qualified usage in aFIPC.R while preserving the existing
unique-and-length behavior.

37-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

테스트가 실제 구현이 아닌 테스트 파일 내 재구현을 검증합니다.

new_idiom/legacy_idiomaFIPC.R의 코드를 호출하지 않고 테스트 안에서 다시 작성한 표현식입니다. 따라서 aFIPC.R의 실제 가드가 바뀌어도 이 테스트는 계속 통과하며, 주석(Line 3-6)이 주장하는 "회귀 가드" 역할을 하지 못합니다.

또한 두 idiom은 x가 이미 factor이고 미사용 레벨을 포함한 경우 결과가 달라집니다(levels()는 미사용 레벨도 셈). 실제 newFormModel@Data$data 열이 factor로 들어올 수 있다면 이 케이스를 벡터 목록에 추가해 주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`
around lines 37 - 50, Update the optimization-equivalence test to invoke the
actual implementation in aFIPC.R rather than reimplementing the new and legacy
expressions locally, so changes to its guard are covered by the regression
assertion. Preserve comparisons against the expected result and legacy behavior,
and add a vector case where x is a factor with unused levels to verify the
intended handling of factor-valued newFormModel@Data$data columns.
aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R (3)

207-216: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

suppressWarnings()가 안쪽에 있어 PV_Q1* 폴백이 도달 불가능합니다.

suppressWarnings(mirt::itemfit(...))tryCatch의 표현식 내부에 있으므로 경고는 바깥 warning = 핸들러까지 전파되지 않습니다. 결과적으로 Line 210-215의 PV_Q1* 대체 경로는 죽은 코드입니다. 경고 기반 폴백을 의도했다면 suppressWarnings를 제거하고, S_X2 결과가 사용 불가할 때만 폴백하도록 하세요.

♻️ 제안 리팩터
     fit_df <- tryCatch(
-      suppressWarnings(mirt::itemfit(fitted_model, fit_stats = "S_X2")),
+      mirt::itemfit(fitted_model, fit_stats = "S_X2"),
       error = function(e) NA,
       warning = function(w) {
         tryCatch(
-          mirt::itemfit(fitted_model, fit_stats = "PV_Q1*"),
+          suppressWarnings(mirt::itemfit(fitted_model, fit_stats = "PV_Q1*")),
           error = function(err) NA
         )
       }
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 207 - 216, Update
the fit_df tryCatch flow around mirt::itemfit so warnings from the S_X2 attempt
reach the warning handler by removing the inner suppressWarnings call. Preserve
the PV_Q1* fallback in the warning handler, and ensure it is used only when the
S_X2 result is unavailable due to a warning or error.

253-261: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

methods는 base 함수명을 가립니다.

utils::methods()와 이름이 충돌하며, 이 파일은 methods 패키지 기능도 사용하는 맥락이라 혼동을 줍니다. estimator_order 같은 이름을 권장합니다.

♻️ 제안 리팩터
-  methods <- c("QMCEM", "EM", "MHRM")
+  estimator_order <- c("QMCEM", "EM", "MHRM")
   if (forceNormalEM) {
-    methods <- c("EM", "QMCEM", "MHRM")
+    estimator_order <- c("EM", "QMCEM", "MHRM")
   } else if (forceMHRM) {
-    methods <- c("MHRM", "QMCEM", "EM")
+    estimator_order <- c("MHRM", "QMCEM", "EM")
   } else if (unstable) {
-    methods <- c("QMCEM", "MHRM", "EM")
+    estimator_order <- c("QMCEM", "MHRM", "EM")
   }

for (method_name in methods)(Line 265)도 함께 변경이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 253 - 261, Rename
the local methods vector to estimator_order throughout the surrounding surveyFA
logic, including its initial assignment, all forceNormalEM/forceMHRM/unstable
branches, and the loop currently iterating with method_name in methods. Preserve
the existing estimator ordering and behavior.

174-193: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

MHRM 재시도에 백오프나 시드 변화가 없어 3회 모두 동일하게 실패합니다.

fit_args가 고정이고 GenRandomPars = FALSE이므로, 결정론적 실패(예: 잘못된 itemtype) 시 동일한 호출을 3회 반복하며 시간만 소모합니다. 첫 실패가 결정론적 오류인지 판단하거나, 재시도 시 GenRandomPars = TRUE로 시작점을 바꾸는 편이 유효합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R` around lines 174 - 193, Update
the MHRM retry loop in the method_name == "MHRM" branch so retries do not repeat
the same deterministic call with fixed starting conditions. Distinguish
deterministic argument errors such as invalid itemtype and stop retrying them,
or enable varied starting parameters by setting GenRandomPars = TRUE for
subsequent attempts while preserving the existing three-attempt limit and
warning behavior.
aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R (1)

1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

실제 동작 검증을 추가하세요.

이 파일은 내부 R 파일을 source()하기만 하므로, 문법·로드 오류 외에는 회귀를 검출하지 못합니다. autoFIPC()surveyFA()의 입력 검증 및 주요 결과를 tests/testthat/ 아래의 assertion 기반 테스트로 옮기거나 보완하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R` around lines 1 - 2, 보완용 테스트를
tests/testthat/ 아래에 추가해 autoFIPC()와 surveyFA()의 실제 동작을 검증하세요. 입력 검증의 기대 동작과 주요
결과를 assertion으로 확인하고, 단순히 R 파일을 source()하는 aFIPC/test_dummy.R에 의존하지 않도록 구성하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION`:
- Line 4: 패키지 메타데이터와 런타임 출력의 버전을 일치시키세요. DESCRIPTION의 Version과 aFIPC.R의 aFIPC
출력에서 의도한 동일한 버전 값을 사용하도록 수정하고, 설치 후 버전 식별이 일관되게 유지되는지 확인하세요.
- Line 1: Remove all generated R CMD check artifacts from aFIPC.Rcheck,
including the listed DESCRIPTION, LICENSE, NAMESPACE, README.md,
test_validation.R, testthat.R, startup.Rs, aFIPC-Ex.R, and aFIPC-Ex.Rout files;
add *.Rcheck/ to the ignore rules and remove any already tracked artifacts from
version control.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R`:
- Around line 639-647: Update the IPDData construction around IPDItemCount and
the oldformYDataK/newformXDataK assignments to handle zero matched items without
generating the invalid 1:0 sequence, and preserve a zero-column data frame. Also
force the subset operations to retain data-frame/matrix dimensions when exactly
one item matches, so both assignments remain shape-compatible.
- Around line 87-91: Restrict the itemtype validation in autoFIPC to require a
scalar length-1 value, since downstream scalar conditions such as itemtype
comparisons assume one type; remove the per-item length allowance in the
validation near nItems. Update the affected existing tests, including the
expected error message in test-autoFIPC.R, to match the narrowed validation.
- Around line 850-851: Update the linkedFormData assignment near the Bolt cache
in the mirt model setup so column-name selection works for both data frames and
matrices: use two-dimensional column indexing with the existing
colnames(newFormModel@Data$data), preserving the selected columns and their
names. Keep the cached subset behavior unchanged and ensure the resulting object
remains suitable for ncol(linkedFormData) and the subsequent mirt() call.
- Around line 784-797: Validate the cached indices in the code using
newScaleParmsItemIdxCache and oldScaleParmsItemIdxCache before the Linkedform
assignment. Preserve which()’s no-op behavior by skipping the update when either
lookup is missing, and only assign when newIdx and oldIdx have matching lengths
to prevent invalid recycling.
- Around line 615-619: Update the IPDgroup factor construction near IPDgroup so
its levels preserve the existing reference-group order rather than forcing
c('oldForm', 'newForm'); ensure mirt::multipleGroup() continues using the
intended first level as the reference group and preserves the existing IPD/DIF
results.
- Around line 856-867: Update the mean-parameter selector in forceNormalZeroOne
to use MEAN_1 instead of MEAN_11, matching the other branches so the
corresponding mean value is fixed to zero. Keep the covariance handling and
existing estimation flags unchanged.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R`:
- Around line 83-92: Update the response_data column subsetting in surveyFA to
use drop = FALSE, preserving a data-frame result when exactly one non-constant
response column remains. Keep the existing nrow/ncol guard so it raises the
intended surveyFA validation error.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_validation.R`:
- Around line 1-3: Move the validation logic from test_validation.R into
tests/testthat/test-validation.R so devtools::test() runs it automatically, and
replace the print-based success check with appropriate testthat assertions. If
it is intended only as a one-off script instead, relocate it to a clearly named
tools directory outside the test suite.

In
`@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-fixed-parameter-calibration.R`:
- Around line 1-123: Remove the tracked R CMD check artifacts under
aFIPC.Rcheck/ while preserving the three source tests in
aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/:
test-fixed-parameter-calibration.R (1-123), test-package-api.R (1-42), and
test-sentinel-validation.R (1-37). Add aFIPC.Rcheck/ to .gitignore, and remove
the duplicate generated copies from aFIPC.Rcheck/tests/testthat/:
test-fixed-parameter-calibration.R (1-123), test-package-api.R (1-42), and
test-sentinel-validation.R (1-37).

In `@aFIPC.Rcheck/aFIPC/DESCRIPTION`:
- Around line 18-19: Remove the generated aFIPC.Rcheck/ directory and its R CMD
check artifacts from the repository, including the packaged DESCRIPTION
metadata. Keep only the actual source files under version control and configure
or use CI artifacts for storing future check results.

In `@aFIPC.Rcheck/aFIPC/html/R.css`:
- Line 127: 커밋 대상에서 생성 산출물인 aFIPC.Rcheck/ 디렉터리를 제외하도록 처리하세요. 생성 결과를 보존해야 하는 경우에는
R.css의 font-family 선언에서 Courier New를 따옴표로 감싸 Stylelint의 font-family-name-quotes
규칙을 만족시키세요.

---

Outside diff comments:
In `@aFIPC.Rcheck/tests/testthat/test-surveyFA.R`:
- Around line 1-85: Remove the generated aFIPC.Rcheck copies at
aFIPC.Rcheck/tests/testthat/test-surveyFA.R (lines 1-85),
aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R (lines 1-80), and
aFIPC.Rcheck/tests/testthat/test-autoFIPC.R (lines 1-91), retaining the
corresponding root tests/testthat files as the canonical versions. Add *.Rcheck/
to .gitignore and untrack the existing aFIPC.Rcheck directory.

---

Nitpick comments:
In @.Rbuildignore:
- Line 25: Keep the existing .semgrepignore exclusion in .Rbuildignore, add
aFIPC.Rcheck/ to the VCS ignore configuration, and remove all generated Rcheck
artifacts: the listed Meta and help RDS files, tests/testthat.Rout, and the
duplicated 00_pkg_src/aFIPC/.semgrepignore snapshot; CI should regenerate and
run the tests.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R`:
- Line 889: Update the unconditional print calls in the package functions,
including the one printing NewScaleParms and the calls at the other referenced
locations, so output is controlled by the existing verbose option or uses
message() instead of standard output. Preserve the current diagnostic content
while allowing users to suppress it.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R`:
- Around line 207-216: Update the fit_df tryCatch flow around mirt::itemfit so
warnings from the S_X2 attempt reach the warning handler by removing the inner
suppressWarnings call. Preserve the PV_Q1* fallback in the warning handler, and
ensure it is used only when the S_X2 result is unavailable due to a warning or
error.
- Around line 253-261: Rename the local methods vector to estimator_order
throughout the surrounding surveyFA logic, including its initial assignment, all
forceNormalEM/forceMHRM/unstable branches, and the loop currently iterating with
method_name in methods. Preserve the existing estimator ordering and behavior.
- Around line 174-193: Update the MHRM retry loop in the method_name == "MHRM"
branch so retries do not repeat the same deterministic call with fixed starting
conditions. Distinguish deterministic argument errors such as invalid itemtype
and stop retrying them, or enable varied starting parameters by setting
GenRandomPars = TRUE for subsequent attempts while preserving the existing
three-attempt limit and warning behavior.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R`:
- Around line 1-2: 보완용 테스트를 tests/testthat/ 아래에 추가해 autoFIPC()와 surveyFA()의 실제
동작을 검증하세요. 입력 검증의 기대 동작과 주요 결과를 assertion으로 확인하고, 단순히 R 파일을 source()하는
aFIPC/test_dummy.R에 의존하지 않도록 구성하세요.

In
`@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R`:
- Line 39: Update the anonymous function in the optimization equivalence test to
call stats::na.omit explicitly instead of the unqualified na.omit, matching the
namespace-qualified usage in aFIPC.R while preserving the existing
unique-and-length behavior.
- Around line 37-50: Update the optimization-equivalence test to invoke the
actual implementation in aFIPC.R rather than reimplementing the new and legacy
expressions locally, so changes to its guard are covered by the regression
assertion. Preserve comparisons against the expected result and legacy behavior,
and add a vector case where x is a factor with unused levels to verify the
intended handling of factor-valued newFormModel@Data$data columns.

In `@aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R`:
- Around line 61-70: Set a deterministic random seed at the start of the
“surveyFA reports bounded recovery exhaustion when unrecoverable” test before
the rbinom() calls, matching the seeded setup used by the earlier test while
leaving the existing test behavior unchanged.
- Around line 34-39: 테스트에서 mirt 설치 여부를 확인하는 가드가 누락되어 있습니다. test-surveyFA.R의
unsupported-input 및 관련 surveyFA 테스트 블록 시작 부분에 skip_if_not_installed("mirt")를 추가해
mirt가 없을 때 테스트를 건너뛰도록 하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b638b772-0ecd-4e12-869f-27393c5af1d3

📥 Commits

Reviewing files that changed from the base of the PR and between b2e6fc1 and d6abb76.

⛔ Files ignored due to path filters (3)
  • aFIPC.Rcheck/00check.log is excluded by !**/*.log
  • aFIPC.Rcheck/00install.out is excluded by !**/*.out
  • aFIPC.Rcheck/aFIPC-Ex.pdf is excluded by !**/*.pdf
📒 Files selected for processing (50)
  • .Rbuildignore
  • aFIPC.Rcheck/00_pkg_src/aFIPC/.semgrepignore
  • aFIPC.Rcheck/00_pkg_src/aFIPC/DESCRIPTION
  • aFIPC.Rcheck/00_pkg_src/aFIPC/LICENSE
  • aFIPC.Rcheck/00_pkg_src/aFIPC/NAMESPACE
  • aFIPC.Rcheck/00_pkg_src/aFIPC/R/aFIPC.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/R/surveyFA.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/README.md
  • aFIPC.Rcheck/00_pkg_src/aFIPC/man/autoFIPC.Rd
  • aFIPC.Rcheck/00_pkg_src/aFIPC/man/surveyFA.Rd
  • aFIPC.Rcheck/00_pkg_src/aFIPC/test_dummy.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/test_validation.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-autoFIPC.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-fixed-parameter-calibration.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-optimization-equivalence.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-package-api.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-sentinel-validation.R
  • aFIPC.Rcheck/00_pkg_src/aFIPC/tests/testthat/test-surveyFA.R
  • aFIPC.Rcheck/aFIPC-Ex.R
  • aFIPC.Rcheck/aFIPC-Ex.Rout
  • aFIPC.Rcheck/aFIPC/DESCRIPTION
  • aFIPC.Rcheck/aFIPC/INDEX
  • aFIPC.Rcheck/aFIPC/LICENSE
  • aFIPC.Rcheck/aFIPC/Meta/Rd.rds
  • aFIPC.Rcheck/aFIPC/Meta/features.rds
  • aFIPC.Rcheck/aFIPC/Meta/hsearch.rds
  • aFIPC.Rcheck/aFIPC/Meta/links.rds
  • aFIPC.Rcheck/aFIPC/Meta/nsInfo.rds
  • aFIPC.Rcheck/aFIPC/Meta/package.rds
  • aFIPC.Rcheck/aFIPC/NAMESPACE
  • aFIPC.Rcheck/aFIPC/R/aFIPC
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdb
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdx
  • aFIPC.Rcheck/aFIPC/help/AnIndex
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdb
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdx
  • aFIPC.Rcheck/aFIPC/help/aliases.rds
  • aFIPC.Rcheck/aFIPC/help/paths.rds
  • aFIPC.Rcheck/aFIPC/html/00Index.html
  • aFIPC.Rcheck/aFIPC/html/R.css
  • aFIPC.Rcheck/tests/startup.Rs
  • aFIPC.Rcheck/tests/testthat.R
  • aFIPC.Rcheck/tests/testthat.Rout
  • aFIPC.Rcheck/tests/testthat/test-autoFIPC.R
  • aFIPC.Rcheck/tests/testthat/test-fixed-parameter-calibration.R
  • aFIPC.Rcheck/tests/testthat/test-optimization-equivalence.R
  • aFIPC.Rcheck/tests/testthat/test-package-api.R
  • aFIPC.Rcheck/tests/testthat/test-sentinel-validation.R
  • aFIPC.Rcheck/tests/testthat/test-surveyFA.R
🛑 Comments failed to post (1)
aFIPC.Rcheck/aFIPC/Meta/nsInfo.rds (1)

1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

aFIPC.Rcheck/ 전체를 저장소에서 제거하세요.

이 파일들은 R CMD check와 패키지 설치 과정에서 자동 생성되는 메타데이터·lazy-load·도움말 산출물입니다. CI가 재생성할 수 있으므로 커밋하면 stale 바이너리와 비검토 가능 파일만 저장소에 남습니다.

  • aFIPC.Rcheck/aFIPC/Meta/nsInfo.rds#L1-L1: 생성된 네임스페이스 메타데이터를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/Meta/package.rds#L1-L5: 생성된 패키지 메타데이터를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/R/aFIPC#L1-L27: 생성된 설치 로더를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdb#L1-L145: 생성된 함수 lazy-load 데이터베이스를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdx#L1-L2: 생성된 함수 lazy-load 인덱스를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdb#L1-L14: 생성된 도움말 데이터베이스를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdx#L1-L1: 생성된 도움말 인덱스를 삭제하세요.
  • aFIPC.Rcheck/aFIPC/help/aliases.rds#L1-L1: 생성된 도움말 alias 메타데이터를 삭제하세요.

.gitignore.Rcheck/를 추가하고, 현재 추적 중인 산출물은 삭제하는 방식으로 정리하는 것이 적절합니다.

권장 설정
+# .gitignore
+.Rcheck/
📍 Affects 8 files
  • aFIPC.Rcheck/aFIPC/Meta/nsInfo.rds#L1-L1 (this comment)
  • aFIPC.Rcheck/aFIPC/Meta/package.rds#L1-L5
  • aFIPC.Rcheck/aFIPC/R/aFIPC#L1-L27
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdb#L1-L145
  • aFIPC.Rcheck/aFIPC/R/aFIPC.rdx#L1-L2
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdb#L1-L14
  • aFIPC.Rcheck/aFIPC/help/aFIPC.rdx#L1-L1
  • aFIPC.Rcheck/aFIPC/help/aliases.rds#L1-L1

- 2차원 데이터 프레임 할당(df[idx, 'col'] <- val)을 직접적인 벡터 서브셋팅(df$col[idx] <- val)으로 대체하여 메서드 디스패치 오버헤드 제거
- colnames(df[cols])를 이용한 불필요한 서브셋 생성 방식을 intersect(colnames(df), cols)로 변경하여 O(N) 메모리 복사 및 스캔 방지
- as.factor() 내 자동 레벨 추론을 사전에 정의된 factor(..., levels=c(...)) 방식으로 대체하여 성능 향상
- .jules/bolt.md에 배운 내용 추가
- R build 시 NOTE를 유발하는 숨김 파일 예외 처리를 위해 .Rbuildignore에 .semgrepignore 예외 추가
- 2차원 데이터 프레임 할당(df[idx, 'col'] <- val)을 직접적인 벡터 서브셋팅(df$col[idx] <- val)으로 대체하여 메서드 디스패치 오버헤드 제거
- colnames(df[cols])를 이용한 불필요한 서브셋 생성 방식을 intersect(colnames(df), cols)로 변경하여 O(N) 메모리 복사 및 스캔 방지
- as.factor() 내 자동 레벨 추론을 사전에 정의된 factor(..., levels=c(...)) 방식으로 대체하여 성능 향상
- .jules/bolt.md에 배운 내용 추가
- R build 시 NOTE를 유발하는 숨김 파일 예외 처리를 위해 .Rbuildignore에 .semgrepignore, test_dummy.R, test_validation.R 예외 추가

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 5df0361e1550f83ab930b0e8bf780f5ebdf4bf82.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 5df0361e1550f83ab930b0e8bf780f5ebdf4bf82
  • Workflow run: 30388703854
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 5df0361e1550f83ab930b0e8bf780f5ebdf4bf82.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
Loading

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