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
7 changes: 4 additions & 3 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
## 2026-06-25 - Avoid N+1 API blocking in PR checks
**Learning:** In backend processing scripts, synchronous iterations calling an external service, such as fetching `restMergeableState` per PR, cause N+1 API bottlenecks and stall pipeline execution linearly. This matters for PR schedulers handling multiple PRs.
**Action:** Use `concurrent.futures.ThreadPoolExecutor` for independent network calls in a loop when there are multiple items, keep empty and single-item inputs on the cheaper serial path, and bound `max_workers` to avoid API rate limits.
## 2026-06-25 - Avoid N+1 API blocking in PR checks
**Learning:** In backend processing scripts, synchronous iterations calling an external service, such as fetching `restMergeableState` per PR, cause N+1 API bottlenecks and stall pipeline execution linearly. This matters for PR schedulers handling multiple PRs.
**Action:** Use `concurrent.futures.ThreadPoolExecutor` for independent network calls in a loop when there are multiple items, keep empty and single-item inputs on the cheaper serial path, and bound `max_workers` to avoid API rate limits.
## 2024-05-19 - Pre-compile Regex Patterns in Loop-called Functions
**Learning:** In `scripts/ci/pr_review_merge_scheduler.py`, the `scrub_sensitive_data` function was repeatedly compiling multiple regex patterns via `re.sub` for every log line or text scrubbed. This incurs measurable overhead due to cache lookups and object recreation in tightly looped string processing.
**Action:** When using multiple regex replacements inside functions that are called frequently or process large amounts of text, define and pre-compile the regex objects at the module level (e.g., `SENSITIVE_DATA_SCRUB_PATTERNS`) and iterate over them using `pattern.sub()`.
Expand All @@ -43,3 +40,7 @@
## 2026-07-09 - Avoid N+1 API blocking in SBOM aggregator
**Learning:** The `collect_inventories` function in `scripts/ci/sbom_inventory_aggregator.py` was fetching SBOMs from the GitHub dependency graph synchronously for every repository in the organization. For large organizations (up to 500 repos), this N+1 network/CLI bottleneck significantly stalled the aggregation workflow.
**Action:** Use `concurrent.futures.ThreadPoolExecutor` to fetch SBOMs concurrently when multiple repositories are provided, bounded by a `max_workers` limit (e.g., 10) to avoid overwhelming the CLI/API, while preserving the fast serial path for single-item inputs.

## 2024-05-24 - [대용량 로그 스캔 시 정규표현식 실행 전 O(N) 서브스트링 검증 선행]
**Learning:** `classify_testthat_failure`에서 테스트 실패 내역이 없는 2MB 로그 파일을 대상으로 정규표현식을 실행하면 약 20ms가 소요되지만, 단순 문자열 검색은 약 1ms만 소요됩니다. 문자열 존재 여부가 정규표현식 매칭의 전제 조건일 때, 콜드 패스(Cold Path)에서 순서 최적화는 매우 큰 성능 차이를 만듭니다.
**Action:** 대용량 텍스트 입력(CI 로그 등)에서 복잡한 정규표현식을 파싱하기 전에 항상 빠른 O(N) 문자열 존재 여부 확인을 먼저 수행하십시오.
20 changes: 2 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
# Changelog

All notable changes to the organization automation repository are documented in
this file. The format follows Keep a Changelog, and versioned releases follow
Semantic Versioning where the repository publishes a release.
# CHANGELOG

## [Unreleased]

### Added

- Added a trusted pull-request comment router for `@cwl-noema-review` and review-only `@opencode-agent` dispatches, with an organization sweep, exact-head receipts, repository allowlisting, fixed runners, immutable checkout pins, and a permanent 100% statement/branch/docstring quality gate.
- Added exact-base `uv.lock` materialization that reconstructs standalone nested projects with a checksum-pinned official `uv` exporter, isolated frozen/offline execution, strict exact-pin and SHA-256 output validation, and complete Python 3.10/3.14 quality evidence.

### Fixed

- Bounded the Strix quality self-test's deterministic timeout fixtures to 3-second process and 5-second fake-sleep budgets so exact-head policy evidence completes inside the existing job limit without changing production Strix scanner timeouts, providers, credentials, or review semantics.
- Allowed commas and ASCII parentheses in the bounded Strix changed-file path policy so legal tracked Packrat fixtures can receive exact-head security analysis, while rejecting raw `..` components before normalization and keeping controls, backslashes, whitespace ambiguity, and shell punctuation fail-closed.
- Bound each review-agent invocation key to the wrapper's complete canonical payload, including the base branch and requesting actor; altered fields with a valid-format key now fail before durable-leader election or forwarding, and wrapper write permission is job-scoped.
- Bound both trusted-uv quality jobs to `github.event.pull_request.head.sha` and added a permanent two-checkout regression contract so exact-head compatibility, coverage, docstring, and compilation claims cannot silently measure GitHub's generated pull-request merge revision.
- Made Strix treat only a single LiteLLM provider-error line containing NVIDIA NIM context and model-catalog 404 evidence as cross-model fallback evidence, rejecting cross-line signal assembly and provider-like target source literals; moved the public default to Nemotron 3 Super 120B and added a second NVIDIA hosted candidate before GitHub Models without neutralizing reported vulnerabilities.
- ⚡ Bolt: 성능 향상 - 대용량 로그 스캔 시 정규표현식 실행 전 O(N) 서브스트링 검증 선행
Comment on lines +1 to +4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

기존 문서를 보존하고 새 항목만 추가하세요.

두 파일 모두 기존 내용을 삭제하고 새 항목만 남깁니다. 이 변경은 릴리스 이력과 기존 엔지니어링 학습을 잃게 합니다.

  • CHANGELOG.md#L1-L4: 기존 Keep a Changelog 설명과 Added/Fixed 항목을 복원하고 새 최적화 항목을 Unreleased 아래에 추가하세요.
  • .jules/bolt.md#L43-L46: 기존 정규식 사전 컴파일 학습을 유지하고 새 O(N) 문자열 검색 학습을 별도 항목으로 추가하세요.
📍 Affects 2 files
  • CHANGELOG.md#L1-L4 (this comment)
  • .jules/bolt.md#L43-L46
🤖 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 `@CHANGELOG.md` around lines 1 - 4, Restore the existing Keep a Changelog
content plus its Added and Fixed sections in CHANGELOG.md (lines 1-4), then
retain the new optimization entry under Unreleased. In .jules/bolt.md (lines
43-46), preserve the existing regex precompilation lesson and add the O(N)
substring-search lesson as a separate entry; do not replace either document’s
prior content.

7 changes: 6 additions & 1 deletion scripts/ci/r_coverage_peer_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ def classify_testthat_failure(
if any(not PACKAGE_NAME_RE.fullmatch(name) for name in allowed_missing):
return False
allowed_packages.update(allowed_missing)

# ⚡ Bolt: Fast-path rejection before running expensive regex on potentially 2MB logs
if "Error: Test failures" not in text:
return False

summaries = FAIL_SUMMARY_RE.findall(text)
if not summaries or "Error: Test failures" not in text:
if not summaries:
return False
failure_count = int(summaries[-1])
if failure_count <= 0:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_r_coverage_peer_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,8 @@ def test_script_entrypoint_returns_cli_status(
runpy.run_path(str(script), run_name="__main__")

assert raised.value.code == 1

def test_classify_testthat_failure_returns_false_no_summaries():
"""Ensure it handles logs missing summary matches but containing the test string."""
text = "Error: Test failures something else missing package 'test'"
assert gate.classify_testthat_failure(text, "test") is False
Loading