Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-07-28 - R 언어에서 공지된 값의 팩터 생성 시 레벨 명시적 할당을 통한 최적화
**Learning:** R에서 알려진 구조의 데이터를 `as.factor(c(rep('A', N), rep('B', M)))` 형태로 팩터로 변환하면 내부적으로 전체 벡터를 스캔하여 레벨을 추론하는 오버헤드가 발생합니다.
**Action:** `factor(rep(c('A', 'B'), c(N, M)), levels = c('A', 'B'))`와 같이 레벨을 명시적으로 설정하여 오버헤드를 회피하고 O(1) 수준의 팩터 생성을 달성해야 합니다.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
^\.jules(/.*)?$
^\.trivyignore\.yaml$
^trivy\.yaml$
^\.Jules(/.*)?$
^\.jules(/.*)?$
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Lint GitHub workflows
run: |
ACTIONLINT_VERSION="1.7.10"
ACTIONLINT_VERSION="1.7.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "actionlint 버전 선언:"
rg -n 'ACTIONLINT_VERSION=' .github/workflows

echo "YAML anchor/alias 사용 위치:"
rg -n --glob '*.yml' --glob '*.yaml' \
  '(^|[[:space:]])&[A-Za-z0-9_-]+|(^|[[:space:]])\*[A-Za-z0-9_-]+' \
  .github/workflows || true

Repository: ContextualWisdomLab/aFIPC

Length of output: 359


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- code-quality.yml ---'
sed -n '25,55p' .github/workflows/code-quality.yml

printf '%s\n' '--- security-audit.yml ---'
sed -n '28,58p' .github/workflows/security-audit.yml

printf '%s\n' '--- actionlint references and workflow YAML features ---'
rg -n -i 'actionlint|anchor|alias|^[[:space:]]*&[A-Za-z0-9_-]+|^[[:space:]]*\*[A-Za-z0-9_-]+' \
  .github/workflows .github 2>/dev/null || true

printf '%s\n' '--- repository workflow files ---'
git ls-files '.github/workflows/*'

Repository: ContextualWisdomLab/aFIPC

Length of output: 6506


🌐 Web query:

Official rhysd/actionlint release notes for v1.7.10 and v1.7.1, including the underlying release dates and changes

💡 Result:

The official release details for actionlint versions 1.7.10 and 1.7.1 are as follows: v1.7.10 Release Date: December 30, 2025 [1][2] Changes: - Added support for YAML anchors and aliases (&anchor and *anchor) in workflow files [1][2]. - Implemented checks for unused and undefined anchors [1][2]. v1.7.1 Release Date: May 28, 2024 [1][3] Changes: - Added support for the ubuntu-24.04 runner label [1][3][4]. - Removed support for deprecated runner labels macos-10 and windows-2016 [3][4]. - Updated document URLs in help output and the playground to use specific version tags instead of the main branch [1][3][4]. - Fixed an issue with actionlint recognizing ghcr.io or docker.io images in Docker action metadata files without the docker:// scheme [4][5]. - Updated the project's color theme [4][5].

Citations:


actionlint 버전을 1.7.10으로 통일하세요.

두 워크플로가 서로 다른 actionlint 버전을 사용합니다. 현재 YAML anchor/alias는 없지만, 버전 차이로 검사 결과가 달라질 수 있습니다. 호환성 요구가 없다면 .github/workflows/code-quality.yml1.7.10을 사용하세요.

🤖 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 @.github/workflows/code-quality.yml at line 37, Update the ACTIONLINT_VERSION
value in the code-quality workflow from 1.7.1 to 1.7.10 so all workflows use the
same actionlint version.

ACTIONLINT_FILE="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
ACTIONLINT_BASE_URL="https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}"
curl -sSLo "$ACTIONLINT_FILE" "${ACTIONLINT_BASE_URL}/${ACTIONLINT_FILE}"
Expand Down
18 changes: 0 additions & 18 deletions .jules/bolt.md

This file was deleted.

7 changes: 0 additions & 7 deletions .jules/palette.md

This file was deleted.

4 changes: 0 additions & 4 deletions .jules/sentinel.md

This file was deleted.

9 changes: 5 additions & 4 deletions R/aFIPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,12 @@ autoFIPC <-
#IPD
if (checkIPD == T) {
# config
# ⚡ Bolt: Explicitly define levels to bypass automatic factor level inference overhead
IPDgroup <-
as.factor(c(
rep('oldForm', nrow(oldformYDataK)),
rep('newForm', nrow(newformXDataK))
))
factor(
rep(c('oldForm', 'newForm'), c(nrow(oldformYDataK), nrow(newformXDataK))),
levels = c('oldForm', 'newForm')
)
Comment on lines +615 to +620

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 6 'IPDgroup|multipleGroup|ref\.group|newForm|oldForm' .

Repository: ContextualWisdomLab/aFIPC

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- relevant implementation ---'
sed -n '612,725p' R/aFIPC.R

printf '%s\n' '--- mirt multipleGroup documentation/source references ---'
rg -n -C 4 'reference group|ref\.group|first group|group levels|levels\(group\)|multipleGroup <-|multipleGroup\s*<-' \
  packrat R inst man docs 2>/dev/null | head -n 240

printf '%s\n' '--- factor behavior and package metadata ---'
rg -n -C 3 'as.factor|factor\(|IPDgroup|multipleGroup' R tests DESCRIPTION README.md 2>/dev/null | head -n 240

Repository: ContextualWisdomLab/aFIPC

Length of output: 4160


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- available runtimes ---'
command -v R || true
command -v Rscript || true

printf '%s\n' '--- mirt package files ---'
fd -i 'multiple|group' packrat 2>/dev/null | head -n 120

printf '%s\n' '--- package documentation and source text ---'
rg -n -i -C 5 'multipleGroup|ref\.group|reference group|first group' \
  packrat/lib 2>/dev/null | head -n 300 || true

Repository: ContextualWisdomLab/aFIPC

Length of output: 28515


🌐 Web query:

mirt multipleGroup first group reference group factor levels ref.group documentation

💡 Result:

In the mirt package for R, the multipleGroup function determines the reference group based on the factor levels of the provided grouping variable [1][2][3]. Specifically, the first level of the factorized grouping variable is automatically treated as the reference group [1][4]. If you supply a character vector as the group argument, mirt will automatically transform it into a factor variable [1][3][4]. Because factor levels are typically ordered alphabetically by default in R, the group name that comes first alphabetically will be selected as the reference group unless you explicitly set the levels of the factor before passing it to the function [1][3][4]. To specify a different reference group, you should convert your grouping variable to a factor and use the relevel function or manually define the levels so that the desired reference group is the first level [1][3][4]. In terms of model identification, the reference group is typically constrained (e.g., latent means fixed to 0) while parameters in focal groups are estimated relative to it, particularly when using invariance constraints like free_means or free_var [3][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

source = Path("R/aFIPC.R").read_text()
match = re.search(
    r"IPDgroup\s*<-\s*factor\s*\(\s*"
    r"rep\(c\('([^']+)',\s*'([^']+)'\).*?"
    r"levels\s*=\s*c\('([^']+)',\s*'([^']+)'\)",
    source,
    re.S,
)
if not match:
    raise SystemExit("IPDgroup factor expression not found")

rep_levels = match.group(1, 2)
explicit_levels = match.group(3, 4)
default_levels = tuple(sorted(set(rep_levels)))

print("rep levels:", rep_levels)
print("R-default-equivalent sorted levels:", default_levels)
print("explicit levels:", explicit_levels)
print("default first level:", default_levels[0])
print("explicit first level:", explicit_levels[0])
print("explicit order preserves default order:", explicit_levels == default_levels)
print("IPDgroup passed to multipleGroup:", "group = IPDgroup" in source)
PY

Repository: ContextualWisdomLab/aFIPC

Length of output: 441


IPDgroup의 factor 수준 순서를 c('newForm', 'oldForm')으로 복원하세요.

현재 순서는 기존 factor() 기본 동작과 다릅니다. IPDgroupmirt::multipleGroup()group 인자로 전달되며, 첫 번째 수준이 reference group이므로 기준 그룹과 추정 결과의 해석이 바뀔 수 있습니다. levels(result$IPDData$IPDgroup)과 reference-group 결과를 확인하는 회귀 테스트도 추가하세요.

🤖 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 `@R/aFIPC.R` around lines 615 - 620, Update the factor levels in the IPDgroup
construction to c('newForm', 'oldForm') so multipleGroup() uses newForm as the
reference group, and add regression coverage verifying
levels(result$IPDData$IPDgroup) and the resulting reference-group
interpretation.

IPDItemCount <- 0

# IPD target item checking
Expand Down
Loading