Skip to content

perf(surveyFA): select the first minimum without sorting - #178

Draft
seonghobae wants to merge 14 commits into
masterfrom
bolt/optimize-which-min-5906114654608358685
Draft

perf(surveyFA): select the first minimum without sorting#178
seonghobae wants to merge 14 commits into
masterfrom
bolt/optimize-which-min-5906114654608358685

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Outcome

Replace names(sort(p_values))[1L] in the bounded surveyFA() recovery path with an internal first-minimum helper based on which.min() without changing the caller's missing-value normalization, thresholding, or variance fallback.

Behavioral contract

  • ordinary, tied, negative, normalized-missing, and empty named-vector cases compare the helper with the protected expression;
  • empty input explicitly preserves NA_character_ rather than relying on an empty which.min() subscript;
  • the helper changes only minimum selection; the estimator and psychometric arithmetic are untouched.

Scope repair and succession

Protected base is master@f87c2324f1686135e57d8730c1b0b9420874f300. Normal descendant 4ac94f31ccf8d6dd24fabe1029835a2a82ceb838 restores .jules/bolt.md byte-for-byte to the protected blob, so the effective delta is only R/surveyFA.R and tests/testthat/test-surveyFA.R. A local selector change is not repository-wide performance doctrine.

Fresh effective-delta audit of sibling #315 at b2f571d2819c65ad3f8c97a7fae8f99b92daf1d9 found no additional valid product contract beyond this selector change. Its .Rbuildignore/mockery/generated-doctrine deltas were unrelated or test-scaffolding-only, and its model-return integration assertions did not observe candidate selection or fallback behavior. #315 was therefore closed only after this exact Draft successor had inherited the valid semantic delta and a stronger direct equivalence contract. No predecessor GREEN or merge authority transferred.

Evidence boundary

The algorithmic scan removes the need to sort all candidate p-values, but no buyer-visible surveyFA() latency improvement or percentage speedup is established. Performance promotion requires representative/right-cleared recovery workloads under the same R/mirt/runtime state with repeated median/p95, allocation/GC, and profile evidence showing this selector is material.

Merge contract

Keep Draft until this unchanged exact head has terminal R CMD/test and applicable security/SAST/CodeQL checks, all valid review findings resolved, and qualifying independent current-head review. Do not transfer predecessor results, self-approve, source-neutral retrigger, weaken gates, force-push, or destructively rebase.

@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.

Copilot AI review requested due to automatic review settings July 26, 2026 19:12
@coderabbitai

coderabbitai Bot commented Jul 26, 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: Team

Run ID: d71d75bc-9b68-4aa4-bd32-e3a17db07353

📥 Commits

Reviewing files that changed from the base of the PR and between 2715319 and 4ac94f3.

📒 Files selected for processing (1)
  • tests/testthat/test-surveyFA.R

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


📝 Walkthrough

Walkthrough

이 변경은 이름이 지정된 벡터에서 최소값의 이름을 찾는 내부 헬퍼를 추가합니다. select_bad_item()은 이 헬퍼를 사용합니다. 관련 단위 테스트와 bounded recovery 테스트의 난수 시드를 갱신했습니다.

Changes

부적합 아이템 선택

Layer / File(s) Summary
최소값 선택 및 검증
R/surveyFA.R, tests/testthat/test-surveyFA.R
.minimum_named_value()가 최소값의 첫 번째 이름을 반환하고 빈 입력에서 NA_character_를 반환합니다. select_bad_item()은 전체 정렬 대신 이 헬퍼를 사용합니다. 테스트는 동률, 음수, 결측값, 빈 입력을 검증하며 bounded recovery 테스트에 난수 시드를 추가합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 4ac94

This replaces full p-value sorting with equivalent first-minimum selection and adds coverage for relevant edge cases. No current merge-blocking risk remains.

🚥 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 제목은 surveyFA의 성능 개선 핵심인 정렬 없이 최소값을 선택하는 변경을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/optimize-which-min-5906114654608358685

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.

Copilot AI 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.

Pull request overview

This PR optimizes surveyFA()’s “worst item” selection by replacing a full vector sort (names(sort(...))[1L]) with which.min() when choosing the minimum p-value item, reducing unnecessary O(N log N) work in a recovery loop.

Changes:

  • Replaced sort(...)[1]-style minimum selection with names(x)[which.min(x)] in surveyFA()’s p-value-based item selection.
  • Added a new surveyFA test case intended to cover the minimum-selection behavior.
  • Recorded the optimization rationale in .jules/bolt.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
R/surveyFA.R Switches minimum p-value selection from sort() to which.min() inside the bounded recovery logic.
tests/testthat/test-surveyFA.R Adds a new test around bounded recovery / minimum-selection behavior (currently needs adjustments for determinism and clarity).
.jules/bolt.md Documents the “avoid sort for min/max” performance lesson and recommended pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/test-surveyFA.R Outdated
Comment thread tests/testthat/test-surveyFA.R Outdated
Comment thread R/surveyFA.R
Comment thread tests/testthat/test-surveyFA.R Outdated
Copilot AI review requested due to automatic review settings July 26, 2026 19:24

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

tests/testthat/test-surveyFA.R:90

  • This new test is non-deterministic because it relies on mirt::simdata() without setting a seed; it can become flaky across runs/architectures. Also, the test name implies it validates “minimum variance item” selection, but the only assertion is a generic error message, so the intent is unclear.

At minimum, seed the RNG (and consider renaming the test description to match what is actually asserted).

test_that("surveyFA correctly finds minimum variance item", {
  skip_if_not_installed("mirt")

  raw <- as.data.frame(
    mirt::simdata(

tests/testthat/test-surveyFA.R:119

  • This test does not actually validate the PR’s behavioral change (sort(...)[1L] -> which.min(...)) in the p-value selection path. With pThreshold set extremely small, the code will almost always skip the p-value branch and fall back to the variance-based candidate selection, and the current assertion only checks that an error is thrown (not which item was selected/removed).

To make this a meaningful regression test, consider restructuring it to assert the selected/removed item (e.g., matching Removed items: item3 in the error, or asserting the fitted model/data no longer contains item3), or add a small deterministic unit test that compares the old and new candidate-selection logic on a fixed p_values vector.

  expect_error(
    suppressWarnings(
      aFIPC::surveyFA(
        data = raw,
        autofix = TRUE,
        forceUIRT = TRUE,
        itemtype = "2PL",
        maxItemRemovals = 1,
        forceNormalEM = TRUE,
        SE = TRUE,
        pThreshold = 0.000000001
      )
    ),
    "could not estimate a valid model after bounded recovery attempts"
  )

Copilot AI review requested due to automatic review settings July 26, 2026 20:02

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

tests/testthat/test-surveyFA.R:90

  • This new test is non-deterministic because it relies on random mirt::simdata() output but does not set a seed. That can lead to flaky CI (either the model fits successfully or a different item ends up being removed). Add a fixed seed before generating raw so the test behavior is reproducible.
test_that("surveyFA correctly finds minimum variance item", {
  skip_if_not_installed("mirt")

  raw <- as.data.frame(
    mirt::simdata(

tests/testthat/test-surveyFA.R:104

  • The test name/comment says it validates that the minimum-variance item is selected, but the assertion only checks for a generic error substring. Since surveyFA() includes the removed item list in the final error message, assert on that to actually verify that item3 was the item selected for removal.
  # Inject an item with almost zero variance to trigger var() min path
  raw$item3 <- rep(0, nrow(raw))
  raw$item3[1] <- 1
  raw$item3[2] <- 2
  raw$item3[3] <- 3

@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 `@tests/testthat/test-surveyFA.R`:
- Around line 105-119: Update the surveyFA expect_error assertion to require
both the bounded-recovery failure message and “Removed items: item3”. Keep the
existing test setup unchanged so it directly verifies that the minimum-variance
fallback selected and removed item3, not merely that an error occurred.
- Around line 99-103: Update the item3 setup in the 2PL test to contain only
binary 0/1 responses, replacing the 2 and 3 assignments while preserving the
intended near-zero-variance scenario used to exercise the minimum-variance path.
🪄 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: 6d9c9c67-6fa6-43c6-b7b8-92f1052af1b0

📥 Commits

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

📒 Files selected for processing (6)
  • .Rbuildignore
  • .jules/bolt.md
  • R/surveyFA.R
  • test_dummy.R
  • test_validation.R
  • tests/testthat/test-surveyFA.R
💤 Files with no reviewable changes (2)
  • test_validation.R
  • test_dummy.R

Comment thread tests/testthat/test-surveyFA.R Outdated
Comment thread tests/testthat/test-surveyFA.R Outdated

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head f2e2da0a074cfda3cc6e6a4667d062a7e5d5dd44.

  • Head SHA: f2e2da0a074cfda3cc6e6a4667d062a7e5d5dd44

  • Workflow run: 31531229718

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-surveyFA.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-surveyFA.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 21631313d2496051b67bcc38895d41e564e63169
  • Workflow run: 32122438857
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 21631313d2496051b67bcc38895d41e564e63169.

  • Head SHA: 21631313d2496051b67bcc38895d41e564e63169

  • Workflow run: 32122438857

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

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"]
  Evidence --> S2["Test: test-surveyFA.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-surveyFA.R"]
  R2 --> V2["targeted test run"]
Loading

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 49aa3aeab4eba4484d80515580dea9bf99ff30e0.

  • Head SHA: 49aa3aeab4eba4484d80515580dea9bf99ff30e0

  • Workflow run: 31644052997

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Workflow: r.yml"]
  S2 --> I2["GitHub Actions review job"]
  I2 --> R2["Review risk: Workflow: r.yml"]
  R2 --> V2["actionlint plus required checks"]
  Evidence --> S3["Test: test-surveyFA.R"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test-surveyFA.R"]
  R3 --> V3["targeted test run"]
Loading

@seonghobae seonghobae changed the title ⚡ Bolt: 최솟값 검색 성능 최적화 (O(N log N) -> O(N)) perf(surveyFA): select the first minimum without sorting Aug 14, 2026
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 08:27

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2091a8e1399eb22258905bf8253e979861de07cf.

  • Head SHA: 2091a8e1399eb22258905bf8253e979861de07cf

  • Workflow run: 31835826428

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

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"]
  Evidence --> S2["Test: test-surveyFA.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-surveyFA.R"]
  R2 --> V2["targeted test run"]
Loading

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2091a8e1399eb22258905bf8253e979861de07cf.

  • Head SHA: 2091a8e1399eb22258905bf8253e979861de07cf

  • Workflow run: 31837808008

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

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"]
  Evidence --> S2["Test: test-surveyFA.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-surveyFA.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 14, 2026 20:52
seonghobae and others added 13 commits August 17, 2026 23:15
* `R/surveyFA.R`에서 가장 분산이 작은 항목(가장 작은 `p_value`)을 검색할 때 `names(sort(p_values))[1L]` 대신 `names(p_values)[which.min(p_values)]`를 사용하도록 수정.
* 이 변경을 통해 O(N log N) 시간 복잡도를 갖는 정렬 연산을 생략하고 O(N)의 선형 탐색으로 최적화함.
* 최적화 기법에 대한 교훈을 `.jules/bolt.md`에 문서화함.
* `surveyFA` 최솟값 분산 항목 탐색 로직에 대한 테스트 케이스 추가 및 커버리지 개선 (100% test pass).
* `R/surveyFA.R`에서 가장 분산이 작은 항목(가장 작은 `p_value`)을 검색할 때 `names(sort(p_values))[1L]` 대신 `names(p_values)[which.min(p_values)]`를 사용하도록 수정.
* 이 변경을 통해 O(N log N) 시간 복잡도를 갖는 정렬 연산을 생략하고 O(N)의 선형 탐색으로 최적화함.
* R CMD check에서 발생하던 "Non-standard files/directories found at top level" 경고를 해결하기 위해 사용되지 않는 `test_dummy.R`, `test_validation.R`, `.semgrepignore` 파일 삭제.
* `surveyFA` 최솟값 분산 항목 탐색 로직에 대한 테스트 케이스 추가 및 커버리지 개선 (100% test pass).
* `R/surveyFA.R`에서 가장 분산이 작은 항목(가장 작은 `p_value`)을 검색할 때 `names(sort(p_values))[1L]` 대신 `names(p_values)[which.min(p_values)]`를 사용하도록 수정.
* 이 변경을 통해 O(N log N) 시간 복잡도를 갖는 정렬 연산을 생략하고 O(N)의 선형 탐색으로 최적화함.
* R CMD check에서 발생하던 "Non-standard files/directories found at top level" 경고를 해결하기 위해 사용되지 않는 `test_dummy.R`, `test_validation.R` 파일 삭제.
* semgrep 검사에서 `packrat/` 디렉터리를 무시하도록 `.semgrepignore` 생성. 해당 파일을 R 패키징에서 무시하도록 `.Rbuildignore`에 추가.
* `surveyFA` 최솟값 분산 항목 탐색 로직에 대한 테스트 케이스 추가 및 커버리지 개선 (100% test pass).
@cursor
cursor Bot force-pushed the bolt/optimize-which-min-5906114654608358685 branch from 2091a8e to 2163131 Compare August 17, 2026 23:15

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 21631313d2496051b67bcc38895d41e564e63169.

  • Head SHA: 21631313d2496051b67bcc38895d41e564e63169

  • Workflow run: 32122438857

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

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"]
  Evidence --> S2["Test: test-surveyFA.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-surveyFA.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep labels Aug 22, 2026
@seonghobae
seonghobae marked this pull request as draft September 6, 2026 12:02
@seonghobae seonghobae removed the status: needs-review Open pull request requiring current-head review or checks label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance priority: medium Normal-priority or P2 work status: draft type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants