Skip to content
Open
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
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
## 2026-06-30 - Preserve NA handling when removing factor conversions
**Learning:** `levels(as.factor(x))` excludes missing responses from the category count, so a faster replacement must not count `NA` as an extra response category.
**Action:** Keep `na.omit(unique(x))` rather than plain `unique(x)` in response-category comparisons.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HIGH OpenCode could not establish approval sufficiency

  • Problem: the model pool exhausted without a valid current-head review control block, so this changed line cannot be approved from deterministic check state alone.
  • Impact: PR-intent mismatches, missing files, robustness bugs, UX/DX regressions, and CodeGraph-backed flow changes could be missed.
  • Fix: rerun OpenCode after model availability recovers, or add the missing source/test/docs/generated verification evidence needed for a source-backed approval.
  • Verification: rerun the OpenCode Review workflow and confirm it emits APPROVE or source-backed REQUEST_CHANGES for this head SHA.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HIGH OpenCode could not establish approval sufficiency

  • Problem: the model pool exhausted without a valid current-head review control block, so this changed line cannot be approved from deterministic check state alone.
  • Impact: PR-intent mismatches, missing files, robustness bugs, UX/DX regressions, and CodeGraph-backed flow changes could be missed.
  • Fix: rerun OpenCode after model availability recovers, or add the missing source/test/docs/generated verification evidence needed for a source-backed approval.
  • Verification: rerun the OpenCode Review workflow and confirm it emits APPROVE or source-backed REQUEST_CHANGES for this head SHA.

## 2026-06-30 - Cache vector-search indexes in R loops
**Learning:** Redundant `which()` array scans inside loops introduce unnecessary O(N) overhead during array subsetting, especially when accessing the exact same index multiple times within the loop body. In this codebase's common item loop, repeated `which(NewScaleParms$item == ...)` calls were a bottleneck.
**Action:** Cache the resulting index into a variable (e.g. `idx <- which(...)`) at the start of the relevant block and reuse it for all subsequent operations to avoid repeated O(N) penalty.
20 changes: 12 additions & 8 deletions R/aFIPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -723,19 +723,23 @@ autoFIPC <-
(length(na.omit(unique(newFormModel@Data$data[, newFormItemName]))) ==
length(na.omit(unique(oldFormModel@Data$data[, oldFormItemName]))))
) {
newItemName <- paste0(newformCommonItemNames[i])
oldItemName <- paste0(oldformCommonItemNames[i])
newIdx <- which(NewScaleParms$item == newItemName)
oldIdx <- which(OldScaleParms$item == oldItemName)
message(
'applying ',
paste0(newformCommonItemNames[i]),
newItemName,
' <<< ',
paste0(oldformCommonItemNames[i]),
oldItemName,
' as common item use'
)

message(
' Newform Parms: ',
paste0(
NewScaleParms[
which(NewScaleParms$item == paste0(newformCommonItemNames[i])),
newIdx,
"value"
],
' '
Expand All @@ -745,26 +749,26 @@ autoFIPC <-
' Oldform Parms: ',
paste0(
OldScaleParms[
which(OldScaleParms$item == paste0(oldformCommonItemNames[i])),
oldIdx,
"value"
],
' '
)
)

NewScaleParms[
which(NewScaleParms$item == paste0(newformCommonItemNames[i])),
newIdx,
"value"
] <-
OldScaleParms[
which(OldScaleParms$item == paste0(oldformCommonItemNames[i])),
oldIdx,
"value"
]
message(
' Linkedform Parms: ',
paste0(
NewScaleParms[
which(NewScaleParms$item == paste0(newformCommonItemNames[i])),
newIdx,
"value"
],
' '
Expand All @@ -773,7 +777,7 @@ autoFIPC <-
)

NewScaleParms[
which(NewScaleParms$item == paste0(newformCommonItemNames[i])),
newIdx,
"est"
] <-
FALSE
Expand Down
Loading