Skip to content

chore: enforce python docstring coverage#42

Closed
seonghobae wants to merge 5 commits into
developfrom
feat/issue-40-docstring-gate-v2
Closed

chore: enforce python docstring coverage#42
seonghobae wants to merge 5 commits into
developfrom
feat/issue-40-docstring-gate-v2

Conversation

@seonghobae

@seonghobae seonghobae commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a repo-local Python docstring gate to the existing quickcheck and CI path without introducing a new dependency
  • document the new 100% docstring expectation and fill the missing docstrings across tracked Python scripts and analysis-engine tests
  • derive packaged desktop binary names from target triples so Windows cross-build packaging stays correct on non-Windows hosts

Verification

  • npm run check:python-docstrings
  • ./scripts/harness/quickcheck.sh
📝 Walkthrough

Walkthrough

services/analysis-engine과 저장소 파이썬 검사 파이프라인에 100% 도큐스트링 요구를 추가하고, 린트 스크립트와 테스트 기대값을 업데이트했습니다. 기능적 동작 변화는 없고 문서화와 검증 확장이 주된 내용입니다.

Changes

Cohort / File(s) Summary
Architecture
ARCHITECTURE.md
services/analysis-engine, 해당 테스트 및 저장소 소유 Python 스크립트에 대해 100% 도큐스트링 요구 추가.
NPM / Linting
package.json
check:python-docstrings 스크립트 추가(ruff D100–D107) 및 lint 체인에 통합.
Repo Checks (scripts/checks)
scripts/checks/security_gates.py, scripts/checks/verify_docs.py, scripts/checks/verify_github_bootstrap_policy.py, scripts/checks/verify_security_notes.py, scripts/checks/verify_supply_chain.py
모듈/함수 도큐스트링 추가만 적용(로직·제어흐름 변경 없음).
Release Packaging Script
scripts/release/package_desktop_artifact.py
다수 함수에 도큐스트링 추가; expected_binary_pathBANDSCOPE_TARGET_TRIPLE 기반 플랫폼/타겟 처리 언급(기능 보존).
Analysis Engine Source
services/analysis-engine/src/bandscope_analysis/health.py
HealthReport TypedDict에 도큐스트링 추가(문서화).
Tests — Analysis Engine
services/analysis-engine/tests/...
services/analysis-engine/tests/conftest.py, services/analysis-engine/tests/test_api.py, services/analysis-engine/tests/test_health.py, services/analysis-engine/tests/test_supply_chain_policy.py
모듈·함수 도큐스트링 추가 및 health/api 테스트에 pipeline_stages 키 검증 항목 확장.
Tests — Release Packaging
services/analysis-engine/tests/test_release_packaging.py
타겟 트리플 기반 경로/윈도우 실행파일명, macOS 매핑, 아키텍처 인식 매니페스트 검증 테스트 추가 및 설명 보강.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
도큐스트링 밭에 글이 피어나네,
한 문단씩 뜻을 속삭이며 자라네.
린트가 와서 꼼꼼히 세어보니,
모든 함수가 이야길 들려주네.
토끼가 껑충, 축하의 당근을 드려요 🥕

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ff6f61c5-bdf3-4cc5-8e47-662b942c3aa9

📥 Commits

Reviewing files that changed from the base of the PR and between 206955b and 2115e39.

📒 Files selected for processing (2)
  • scripts/release/package_desktop_artifact.py
  • services/analysis-engine/tests/test_release_packaging.py

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 문서화

    • Python 전반에 걸쳐 docstring이 대폭 보강되어 서비스, 모듈·클래스·함수·테스트 설명이 추가되었습니다.
    • 헬스 페이로드 문서화가 강화되어 상태 응답에 파이프라인 단계 정보가 포함됩니다.
  • 테스트

    • 릴리스 패키징 및 헬스/API 관련 테스트가 확장되어 플랫폼·타깃별 아티팩트·경로 시나리오가 추가되었습니다.
  • 작업

    • Docstring 검사가 린트 파이프라인에 통합되어 자동으로 실행됩니다.

Walkthrough

저장소 전반에 Python 도큐스트링(ruff D100–D107) 100% 요구를 문서화하고 package.jsoncheck:python-docstrings 스크립트를 추가해 린트 체인에 포함시켰으며, 여러 스크립트·모듈·테스트에 모듈·함수 도큐스트링을 삽입했습니다. 기능 동작에는 변경이 없습니다.

Changes

Cohort / File(s) Summary
Architecture
ARCHITECTURE.md
Python 도큐스트링 100% 요구(ruff D100–D107) 문서화 및 적용 범위 명시.
NPM / Linting
package.json
check:python-docstrings 스크립트 추가(ruff D100–D107) 및 기존 lint 스크립트에 통합.
Repo Checks (scripts/checks)
scripts/checks/security_gates.py, scripts/checks/verify_docs.py, scripts/checks/verify_github_bootstrap_policy.py, scripts/checks/verify_security_notes.py, scripts/checks/verify_supply_chain.py
모듈·함수 레벨 도큐스트링 추가(로직·제어흐름 미변경).
Release Packaging Script
scripts/release/package_desktop_artifact.py
다수 함수 도큐스트링 추가; expected_binary_path 등에서 BANDSCOPE_TARGET_TRIPLE 참조 방식 문서화(동작 유지).
Analysis Engine Source
services/analysis-engine/src/bandscope_analysis/health.py
HealthReport TypedDict에 도큐스트링 추가(문서화).
Tests — Analysis Engine
services/analysis-engine/tests/...
services/analysis-engine/tests/conftest.py, services/analysis-engine/tests/test_api.py, services/analysis-engine/tests/test_health.py, services/analysis-engine/tests/test_supply_chain_policy.py
모듈·함수 도큐스트링 추가 및 health/api 테스트에서 pipeline_stages 검증 항목 확장.
Tests — Release Packaging
services/analysis-engine/tests/test_release_packaging.py
타겟 트리플 기반 아티팩트 식별 및 바이너리 경로 처리에 대한 테스트 추가·보강(Windows 확장자, macOS 매핑 등).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
도큐스트링 밭에 글이 피었네,
함수마다 속삭이는 작은 초원,
린트가 모두 세어 정성껏 안아주니,
코드도 마음도 한결 밝아지네.
당근 한 입, 깡총 축하 인사 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 'chore: enforce python docstring coverage'은 변경 사항의 주요 목적인 Python 도큐스트링 커버리지 강제화를 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 도큐스트링 게이트 추가, 누락된 도큐스트링 채우기, 데스크톱 바이너리 패키징 개선 등 변경 사항과 직접적으로 관련된 세부 정보를 제공합니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/issue-40-docstring-gate-v2

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

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ARCHITECTURE.md`:
- Line 86: Update the docstring gate description in ARCHITECTURE.md so it
matches the actual check implemented by the repository's
"check:python-docstrings" script (which enforces Ruff D100–D107): state that
100% docstring coverage is required for tracked packages, modules, classes,
nested classes, functions, methods (including magic methods like __init__),
tests under services/analysis-engine, and repo-owned Python scripts; reference
the Ruff rules D100–D107 and the package.json script name to make the policy
unambiguous.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: b5c7b84b-cf75-4eef-8d5e-caae4dcdd282

📥 Commits

Reviewing files that changed from the base of the PR and between 6435b74 and fd6f733.

📒 Files selected for processing (1)
  • ARCHITECTURE.md

Comment thread ARCHITECTURE.md Outdated
@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/release/package_desktop_artifact.py`:
- Around line 61-76: expected_binary_path() currently uses
BANDSCOPE_TARGET_TRIPLE to pick the binary name, but artifact_identity() still
uses the host platform to form the archive name, causing mismatched archive
names during cross-builds; update artifact_identity() to derive
BANDSCOPE_ARTIFACT_OS and BANDSCOPE_ARTIFACT_ARCH from BANDSCOPE_TARGET_TRIPLE
when that env var is present (use the same mapping logic used in
expected_binary_path() to map "windows"/"apple-darwin"/others to artifact OS and
arch), and if BANDSCOPE_TARGET_TRIPLE is not set and BANDSCOPE_ARTIFACT_OS/ARCH
are missing, raise an explicit error so packaging fails fast rather than
producing a misleading archive name; reference expected_binary_path,
artifact_identity, BANDSCOPE_TARGET_TRIPLE, BANDSCOPE_ARTIFACT_OS, and
BANDSCOPE_ARTIFACT_ARCH when making the change.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 7d03208e-3e6f-44b8-9854-be7babf3437d

📥 Commits

Reviewing files that changed from the base of the PR and between 7d404d2 and fd6f733.

📒 Files selected for processing (14)
  • ARCHITECTURE.md
  • package.json
  • scripts/checks/security_gates.py
  • scripts/checks/verify_docs.py
  • scripts/checks/verify_github_bootstrap_policy.py
  • scripts/checks/verify_security_notes.py
  • scripts/checks/verify_supply_chain.py
  • scripts/release/package_desktop_artifact.py
  • services/analysis-engine/src/bandscope_analysis/health.py
  • services/analysis-engine/tests/conftest.py
  • services/analysis-engine/tests/test_api.py
  • services/analysis-engine/tests/test_health.py
  • services/analysis-engine/tests/test_release_packaging.py
  • services/analysis-engine/tests/test_supply_chain_policy.py

Comment on lines 61 to 76
def expected_binary_path(repo_root: Path) -> Path:
system = normalized_platform()
"""Return the expected desktop binary path for the selected target triple."""
target_triple = os.environ.get("BANDSCOPE_TARGET_TRIPLE")
if target_triple and "windows" in target_triple:
system = "windows"
elif target_triple and "apple-darwin" in target_triple:
system = "macos"
else:
system = normalized_platform()
binary_name = (
"bandscope-desktop.exe" if system == "windows" else "bandscope-desktop"
)
target_root = repo_root / "apps" / "desktop" / "src-tauri" / "target"
if target_triple := os.environ.get("BANDSCOPE_TARGET_TRIPLE"):
if target_triple:
target_root = target_root / target_triple
return target_root / "release" / binary_name

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether package_desktop_artifact.py is ever invoked with
# BANDSCOPE_TARGET_TRIPLE but without BANDSCOPE_ARTIFACT_OS / BANDSCOPE_ARTIFACT_ARCH.

rg -n -C3 'package_desktop_artifact\.py|BANDSCOPE_TARGET_TRIPLE|BANDSCOPE_ARTIFACT_OS|BANDSCOPE_ARTIFACT_ARCH'

Repository: seonghobae/bandscope

Length of output: 9738


🏁 Script executed:

#!/bin/bash
# Read the test that checks Windows target on non-Windows host (lines 56-76)
sed -n '56,76p' services/analysis-engine/tests/test_release_packaging.py

Repository: seonghobae/bandscope

Length of output: 784


🏁 Script executed:

#!/bin/bash
# Read the full main() function to see how binary path and artifact identity are used together
sed -n '107,150p' scripts/release/package_desktop_artifact.py

Repository: seonghobae/bandscope

Length of output: 1415


🏁 Script executed:

#!/bin/bash
# Check if there's any validation logic around BANDSCOPE_TARGET_TRIPLE and artifact overrides
grep -n "raise\|ValueError\|AssertionError\|if.*BANDSCOPE_TARGET_TRIPLE" scripts/release/package_desktop_artifact.py

Repository: seonghobae/bandscope

Length of output: 346


타깃 트리플과 아티팩트 식별자가 분리된 상태에서 교차 빌드 시 아카이브 이름 불일치 위험

expected_binary_path()BANDSCOPE_TARGET_TRIPLE로 올바른 바이너리 이름(.exe 등)을 선택하지만, artifact_identity()는 계속 호스트 플랫폼 값으로 archive_name을 생성합니다. BANDSCOPE_ARTIFACT_OSBANDSCOPE_ARTIFACT_ARCH를 설정하지 않은 채로 Windows 타깃 트리플로 macOS 호스트에서 패키징하면, 아카이브 파일명은 "macos"를 포함하지만 내용은 Windows 바이너리가 될 수 있습니다. 타깃 트리플에서 식별자를 함께 유도하거나, 교차 빌드 시 두 환경변수 누락을 명시적으로 실패 처리해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/release/package_desktop_artifact.py` around lines 61 - 76,
expected_binary_path() currently uses BANDSCOPE_TARGET_TRIPLE to pick the binary
name, but artifact_identity() still uses the host platform to form the archive
name, causing mismatched archive names during cross-builds; update
artifact_identity() to derive BANDSCOPE_ARTIFACT_OS and BANDSCOPE_ARTIFACT_ARCH
from BANDSCOPE_TARGET_TRIPLE when that env var is present (use the same mapping
logic used in expected_binary_path() to map "windows"/"apple-darwin"/others to
artifact OS and arch), and if BANDSCOPE_TARGET_TRIPLE is not set and
BANDSCOPE_ARTIFACT_OS/ARCH are missing, raise an explicit error so packaging
fails fast rather than producing a misleading archive name; reference
expected_binary_path, artifact_identity, BANDSCOPE_TARGET_TRIPLE,
BANDSCOPE_ARTIFACT_OS, and BANDSCOPE_ARTIFACT_ARCH when making the change.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
scripts/release/package_desktop_artifact.py (1)

47-58: ⚠️ Potential issue | 🔴 Critical

교차 빌드 시 아카이브/매니페스트 식별자가 여전히 호스트 기준입니다.

expected_binary_path()BANDSCOPE_TARGET_TRIPLE을 반영하지만 artifact_identity()는 아직 호스트의 normalized_platform()/normalized_architecture()를 사용합니다. 그래서 예를 들어 macOS 호스트에서 Windows triple로 패키징하면 zip/manifest 이름은 macos-*로 남고 내용물만 Windows 바이너리가 되어 릴리스 추적성이 깨집니다. artifact_identity()도 target triple에서 platform/arch를 유도하거나, 교차 빌드에서 BANDSCOPE_ARTIFACT_OSBANDSCOPE_ARTIFACT_ARCH가 없으면 즉시 실패시켜야 합니다.

수정 방향 예시
 def artifact_identity() -> dict[str, str]:
     """Build the archive and manifest names for the current artifact target."""
     git_sha = os.environ.get("GITHUB_SHA", "local")[:12]
-    target_platform = normalized_platform()
-    target_arch = normalized_architecture()
+    target_platform, target_arch = resolved_artifact_target()
     suffix = f"bandscope-{target_platform}-{target_arch}-{git_sha}"
def resolved_artifact_target() -> tuple[str, str]:
    target_triple = os.environ.get("BANDSCOPE_TARGET_TRIPLE")
    if target_triple:
        arch = target_triple.split("-", 1)[0]
        platform_name = (
            "windows"
            if "windows" in target_triple
            else "macos"
            if "apple-darwin" in target_triple
            else "linux"
        )
        normalized_arch = (
            "arm64" if arch in {"aarch64", "arm64"}
            else "amd64" if arch in {"x86_64", "amd64"}
            else arch
        )
        return platform_name, normalized_arch

    if (
        "BANDSCOPE_ARTIFACT_OS" not in os.environ
        or "BANDSCOPE_ARTIFACT_ARCH" not in os.environ
    ):
        raise ValueError(
            "Set BANDSCOPE_TARGET_TRIPLE or both "
            "BANDSCOPE_ARTIFACT_OS and BANDSCOPE_ARTIFACT_ARCH"
        )

    return normalized_platform(), normalized_architecture()

Also applies to: 61-76

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/release/package_desktop_artifact.py` around lines 47 - 58,
artifact_identity() currently uses host
normalized_platform()/normalized_architecture(), causing archive/manifest names
to mismatch cross-builds; update artifact_identity() to derive platform/arch
from the target triple or explicit env vars (like BANDSCOPE_TARGET_TRIPLE or
BANDSCOPE_ARTIFACT_OS/BANDSCOPE_ARTIFACT_ARCH) similar to expected_binary_path()
— implement a helper (e.g., resolved_artifact_target()) that parses
BANDSCOPE_TARGET_TRIPLE into a normalized platform ("windows"/"macos"/"linux")
and arch ("arm64"/"amd64"/etc.), have artifact_identity() call that helper to
build suffix/archive_name/manifest_name, and if neither the triple nor both
artifact env vars are present, raise an error immediately to fail fast during
cross-builds.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/checks/security_gates.py`:
- Line 1: The module docstring claims it scans "tracked" files but the
implementation uses Path(".").rglob("*") (see Path(".").rglob) which iterates
the whole working tree; update the code to make behavior and docs consistent:
either change the top-level docstring to state it scans the entire workspace, or
change the file-collection logic to only include tracked files (e.g., replace
Path(".").rglob("*") usage with a git-tracked file list via subprocess/gitpython
or filter by tracked paths returned from `git ls-files`) and ensure functions
that rely on that list (the file iteration loop) use the new tracked-only list.

In `@scripts/checks/verify_security_notes.py`:
- Around line 39-40: Update the main() docstring to accurately reflect that the
function returns a failing exit code not only when the "Security Notes" section
itself is missing, but also when required subsections inside that section are
absent (i.e., the presence and completeness of mandatory sub-sections checked
later in the function such as those validated in the block around lines checking
for required sub-sections). Mention the specific behavior: it fails for a
missing Security Notes section or for missing required subsections, so readers
of the code understand the full validation performed by main().

---

Duplicate comments:
In `@scripts/release/package_desktop_artifact.py`:
- Around line 47-58: artifact_identity() currently uses host
normalized_platform()/normalized_architecture(), causing archive/manifest names
to mismatch cross-builds; update artifact_identity() to derive platform/arch
from the target triple or explicit env vars (like BANDSCOPE_TARGET_TRIPLE or
BANDSCOPE_ARTIFACT_OS/BANDSCOPE_ARTIFACT_ARCH) similar to expected_binary_path()
— implement a helper (e.g., resolved_artifact_target()) that parses
BANDSCOPE_TARGET_TRIPLE into a normalized platform ("windows"/"macos"/"linux")
and arch ("arm64"/"amd64"/etc.), have artifact_identity() call that helper to
build suffix/archive_name/manifest_name, and if neither the triple nor both
artifact env vars are present, raise an error immediately to fail fast during
cross-builds.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 4aeac504-aa62-493e-887c-86d1d4376646

📥 Commits

Reviewing files that changed from the base of the PR and between 7d404d2 and 206955b.

📒 Files selected for processing (14)
  • ARCHITECTURE.md
  • package.json
  • scripts/checks/security_gates.py
  • scripts/checks/verify_docs.py
  • scripts/checks/verify_github_bootstrap_policy.py
  • scripts/checks/verify_security_notes.py
  • scripts/checks/verify_supply_chain.py
  • scripts/release/package_desktop_artifact.py
  • services/analysis-engine/src/bandscope_analysis/health.py
  • services/analysis-engine/tests/conftest.py
  • services/analysis-engine/tests/test_api.py
  • services/analysis-engine/tests/test_health.py
  • services/analysis-engine/tests/test_release_packaging.py
  • services/analysis-engine/tests/test_supply_chain_policy.py

@@ -1,3 +1,5 @@
"""Scan tracked source files for disallowed security patterns."""

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.

⚠️ Potential issue | 🟡 Minor

tracked라는 표현이 현재 동작과 맞지 않습니다.

이 스크립트는 Line 47의 Path(".").rglob("*")로 작업 트리 전체를 훑기 때문에, 현재 docstring처럼 추적된 파일만 검사하는 동작은 아닙니다. 로컬 quickcheck가 임시/미추적 파일에 의해 흔들릴 수 있으니, 설명을 실제 동작에 맞추거나 파일 수집 로직을 추적 파일 기준으로 맞춰 주세요.

예시 수정안
-"""Scan tracked source files for disallowed security patterns."""
+"""Scan repository files for disallowed security patterns."""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"""Scan tracked source files for disallowed security patterns."""
"""Scan repository files for disallowed security patterns."""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/checks/security_gates.py` at line 1, The module docstring claims it
scans "tracked" files but the implementation uses Path(".").rglob("*") (see
Path(".").rglob) which iterates the whole working tree; update the code to make
behavior and docs consistent: either change the top-level docstring to state it
scans the entire workspace, or change the file-collection logic to only include
tracked files (e.g., replace Path(".").rglob("*") usage with a git-tracked file
list via subprocess/gitpython or filter by tracked paths returned from `git
ls-files`) and ensure functions that rely on that list (the file iteration loop)
use the new tracked-only list.

Comment on lines 39 to +40
def main() -> int:
"""Return a failing exit code when plan files are missing security notes."""

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.

🧹 Nitpick | 🔵 Trivial

main() docstring이 실제 실패 조건을 덜 설명합니다.

이 함수는 Security Notes 섹션 자체가 없을 때만 아니라, Line 48-50처럼 필수 하위 섹션이 빠져도 실패를 반환합니다. 현재 문구면 체크 범위를 오해하기 쉬우니 설명을 넓혀 두는 편이 좋겠습니다.

예시 수정안
 def main() -> int:
-    """Return a failing exit code when plan files are missing security notes."""
+    """Return a failing exit code when plan files are missing Security Notes or required subsections."""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def main() -> int:
"""Return a failing exit code when plan files are missing security notes."""
def main() -> int:
"""Return a failing exit code when plan files are missing Security Notes or required subsections."""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/checks/verify_security_notes.py` around lines 39 - 40, Update the
main() docstring to accurately reflect that the function returns a failing exit
code not only when the "Security Notes" section itself is missing, but also when
required subsections inside that section are absent (i.e., the presence and
completeness of mandatory sub-sections checked later in the function such as
those validated in the block around lines checking for required sub-sections).
Mention the specific behavior: it fails for a missing Security Notes section or
for missing required subsections, so readers of the code understand the full
validation performed by main().

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Superseded by #43 to clear repeated stale CodeRabbit review state after fresh fixes and green verification.

@seonghobae seonghobae closed this Mar 11, 2026
auto-merge was automatically disabled March 11, 2026 23:44

Pull request was closed

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