Skip to content

test: enforce 100% coverage and docstring quality gates (v3) - #41

Closed
seonghobae wants to merge 11 commits into
mainfrom
chore/enforce-coverage-docstrings-v3
Closed

test: enforce 100% coverage and docstring quality gates (v3)#41
seonghobae wants to merge 11 commits into
mainfrom
chore/enforce-coverage-docstrings-v3

Conversation

@seonghobae

@seonghobae seonghobae commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • carry forward all quality-gate hardening and review follow-up commits from test: enforce 100% coverage and docstring quality gates (v2) #39 on a fresh merge path
  • enforce 100% line+branch coverage and 100% docstring coverage in CI/release/publish gates
  • include dependency-review noise mitigations (on-failure PR comments, fork-safe dependency-submission behavior) and SPDX project license metadata validation

Verification

  • uv run pytest -q
  • uv run python scripts/docstring_coverage.py --min-percent 100
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run mypy src tests scripts
  • uv run python -m build
  • uv run python scripts/smoke_installed_cli.py --dist-dir dist --venv-dir .venv-smoke-cli

Supersedes #39 as canonical merge path.

📝 Walkthrough

Walkthrough

이 변경은 100% 문서화 문자열 적용 강제, 의존성 검토 워크플로우 구성 업데이트, 라이선스 메타데이터 검증을 추가하고 CI/CD 및 지원 문서 전반에 걸쳐 이러한 정책을 문서화하는 포괄적인 품질 및 보안 개선 사항입니다.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/ci.yml, .github/workflows/dependency-review.yml, .github/workflows/dependency-submission.yml, .github/workflows/publish.yml, .github/workflows/release.yml
CI 파이프라인에 100% 문서화 문자열 적용 검사 추가; 의존성 검토 워크플로우를 스냅샷 경고에서 재시도 및 실패 시에만 PR 댓글 처리하도록 업데이트; 새로운 의존성 제출 워크플로우 추가하여 pip 및 uv.lock 의존성 스냅샷 제출.
Configuration & Metadata
pyproject.toml
라이선스 메타데이터를 문자열로 업데이트하고 license-files 추가; pytest 옵션 확장하여 100% 라인 및 분기 커버리지 강제 적용.
New Quality Enforcement Scripts
scripts/docstring_coverage.py, scripts/review_checks/dependency_review_warning_gate.py
문서화 문자열 적용을 AST 레벨에서 측정 및 리포팅하는 스크립트 추가; GitHub PR 댓글에서 의존성 검토 경고를 평가하고 라이선스 정책 위반을 감지하는 스크립트 추가.
Core Source Docstrings
src/vector_topic_modeling/_sanitize.py, src/vector_topic_modeling/clustering.py, src/vector_topic_modeling/ingestion.py, src/vector_topic_modeling/pipeline.py, src/vector_topic_modeling/providers/..., src/vector_topic_modeling/service.py, src/vector_topic_modeling/sessioning.py, src/vector_topic_modeling/text.py
모든 공개 함수, 클래스 및 내부 헬퍼에 문서화 문자열 추가; 로직 변경 없음.
Policy Documentation
ARCHITECTURE.md, docs/engineering/acceptance-criteria.md, docs/engineering/harness-engineering.md, docs/maintainers/releasing.md, docs/operations/deploy-runbook.md, docs/security/api-security-checklist.md, docs/workflow/one-day-delivery-plan.md, docs/workflow/pr-continuity.md
문서화 문자열 및 코드 커버리지 검사 요구 사항, 의존성 검토 정책(중간 이상 심각도), 라이선스 메타데이터 요구 사항 문서화.
Test Coverage
tests/test_clustering.py, tests/test_dependency_review_warning_gate.py, tests/test_docs_ci_policy_alignment.py, tests/test_docs_release_gate_alignment.py, tests/test_docstring_coverage.py, tests/test_ingestion.py, tests/test_pipeline.py, tests/test_pyproject_license_metadata.py, tests/test_sessioning.py
새로운 스크립트 및 정책 강제에 대한 단위 테스트 추가; 문서 정책 일관성 검증; 기존 모듈 동작에 대한 추가 통합 테스트 추가.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • PR #22: 의존성 검토 GitHub Actions 워크플로우 수정—제출 워크플로우 추가 및 런타임 동작 조정(스냅샷 경고 재시도 및 PR 댓글 정책).
  • PR #15: 동일한 섭취 서브시스템(TopicDocumentIngestionConfig, load_ingestion_config, load_jsonl_topic_documents) 수정 및 CLI 변경.
  • PR #31: redact_pii_and_secrets 문서화 및 퍼징 하니스 추가로 동일 코드 영역 수정.

Poem

🐰 문서화 문자열이 가득하고,
커버리지 게이트가 견고하고,
의존성은 검토되고 추적되며,
품질 정책이 명확합니다—
우리의 코드는 이제 완벽해요!

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 54133c2f-eff0-4528-a75b-7c7593447b52

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0c4a1 and 0f70ee7.

📒 Files selected for processing (2)
  • scripts/review_checks/dependency_review_warning_gate.py
  • tests/test_dependency_review_warning_gate.py

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • 품질 보증

    • 도큐스트링 검사 도구 도입 및 CI/릴리스/퍼블리시 파이프라인에 100% 도큐스트링 통과 게이트 추가
    • 특정 컴포넌트에 대해 100% 라인·브랜치 커버리지 요구 강화
  • 보안

    • 의존성 검토 취약도 임계값을 보통(또는 그 이상)으로 상향
    • 의존성 스냅샷 제출 워크플로 추가, 스냅샷 경고 재시도 및 PR 코멘트 요약을 실패 시로 제한
  • 문서

    • 엔지니어링·릴리스·운영 문서와 체크리스트에 검증·정책 및 라이선스 메타데이터 요구사항 반영
  • 테스트

    • 도큐스트링·의존성 경고 정책·워크플로 정합성 검증용 테스트 대거 추가

Walkthrough

CI 워크플로우에 AST 기반 docstring 커버리지(100%) 검사와 의존성 스냅샷 제출/검토 단계, PR 코멘트 기반 의존성 경고 게이트 및 관련 문서·테스트·스크립트·일부 모듈의 docstring/표기 보강을 추가했습니다.

Changes

Cohort / File(s) Summary
GitHub Actions 워크플로우
​.github/workflows/ci.yml, ​.github/workflows/publish.yml, ​.github/workflows/release.yml, ​.github/workflows/dependency-review.yml, ​.github/workflows/dependency-submission.yml
pytest 뒤에 uv run python scripts/docstring_coverage.py --min-percent 100 검증 단계 추가; dependency-review.ymlretry-on-snapshot-warnings: truecomment-summary-in-pr: on-failure로 변경; 신규 dependency-submission.yml 추가(uv.lock/Pip detectors, 비-포크 PR 조건).
구성·메타데이터
pyproject.toml
프로젝트 license 표기를 테이블형 → 문자열로 변경하고 license-files = ["LICENSE"] 추가; pytest addopts--cov=vector_topic_modeling --cov-branch --cov-report=term-missing --cov-fail-under=100를 넣어 100% 강제.
검증 스크립트
scripts/docstring_coverage.py, scripts/review_checks/dependency_review_warning_gate.py
새 AST 기반 docstring 커버리지 검사기(보고·CLI·exit코드) 추가 및 PR 코멘트 조회·파싱·정책평가 CLI(gh 사용, snapshot/unknown-license 검사, JSON 출력, 정책별 종료코드) 추가.
문서 업데이트
ARCHITECTURE.md, docs/engineering/*, docs/maintainers/releasing.md, docs/operations/deploy-runbook.md, docs/security/api-security-checklist.md, docs/workflow/*
문서 전반에 pytest·docstring 100% 요구, dependency-submission/의존성 리뷰 정책, 브랜치 보호 요구(dependency-review) 및 로컬 검증 명령 목록 반영.
라이브러리 문서화·타입 표기
src/vector_topic_modeling/...
src/vector_topic_modeling/_sanitize.py, src/vector_topic_modeling/clustering.py, src/vector_topic_modeling/ingestion.py, src/vector_topic_modeling/pipeline.py, src/vector_topic_modeling/providers/..., src/vector_topic_modeling/service.py, src/vector_topic_modeling/sessioning.py, src/vector_topic_modeling/text.py
다수 모듈에 docstring 추가 및 일부 내부 타입 표기(예: forward-ref 제거)·경미한 표현 정리(동작·시그니처 불변).
테스트 추가·수정
tests/...
tests/test_clustering.py, tests/test_dependency_review_warning_gate.py, tests/test_docs_ci_policy_alignment.py, tests/test_docs_release_gate_alignment.py, tests/test_docstring_coverage.py, tests/test_ingestion.py, tests/test_pipeline.py, tests/test_pyproject_license_metadata.py, tests/test_sessioning.py
새 스크립트·정책·문서·워크플로우 변경을 검증하는 단위·통합 테스트 추가 및 기존 테스트 확장(문서·워크플로우 일관성, docstring 커버리지, dependency-review 정책 파싱 등).
사소한 표현 변경
src/vector_topic_modeling/_sanitize.py, src/vector_topic_modeling/service.py
주로 docstring 추가 및 _norm_value 반환식 경미한 재작성(동작 동일).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GH as "GitHub Actions (workflow)"
    participant Runner as "Runner (checkout + deps)"
    participant Tests as "pytest (coverage enforced)"
    participant DocCheck as "DocstringCheck (scripts/docstring_coverage.py)"
    participant DepSubmit as "DependencySubmission Action"

    GH->>Runner: checkout & setup
    Runner->>Tests: run pytest (includes --cov-fail-under=100)
    Tests-->>GH: exit code / results
    Runner->>DocCheck: run python scripts/docstring_coverage.py --min-percent 100
    DocCheck-->>GH: report + exit code (may fail job)
    GH->>DepSubmit: conditional submit (push or PR non-fork)
    DepSubmit->>GH: submit dependency snapshot
    GH-->>GH: downstream build/publish gated on results
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇
토끼가 깡충와서 코드에 냄새 맡네,
줄마다 doc을 세우고 결함은 숨기네,
스냅샷 보냈다, 경고 살피며,
테스트 통과하면 당근으로 축배! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main changes: enforcing 100% coverage and docstring quality gates, which is the central focus of all file modifications in the changeset.
Description check ✅ Passed The PR description is directly related to the changeset, providing a summary of quality-gate hardening, coverage enforcement, and dependency-review improvements with verification steps.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/enforce-coverage-docstrings-v3

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


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

@seonghobae

Copy link
Copy Markdown
Owner Author

PR continuity: related/duplicate PRs detected and handled.

Duplicates (same repo):

@seonghobae

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ 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
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@seonghobae

Copy link
Copy Markdown
Owner Author

Added commit 4b0c4a1 to create a post-merge validation harness for issues #38 and #40. The new script scripts/review_checks/dependency_review_warning_gate.py parses dependency-review bot comments and enforces snapshot/unknown-license warning policy thresholds, with TDD coverage in tests/test_dependency_review_warning_gate.py and docs linkage in harness engineering docs. @coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
🧩 Analysis chain

Let me inspect the new files from the commit before reviewing.


🏁 Script executed:

#!/bin/bash
# Check the new files added in commit 4b0c4a1
echo "=== scripts/review_checks/dependency_review_warning_gate.py ==="
cat scripts/review_checks/dependency_review_warning_gate.py 2>/dev/null || echo "File not found"

echo ""
echo "=== tests/test_dependency_review_warning_gate.py ==="
cat tests/test_dependency_review_warning_gate.py 2>/dev/null || echo "File not found"

echo ""
echo "=== List all files in scripts/review_checks/ ==="
find scripts/review_checks -type f 2>/dev/null || echo "Directory not found"

echo ""
echo "=== List harness engineering docs ==="
find docs -type f -name "*.md" 2>/dev/null | head -20 || echo "docs directory not found"

Length of output: 10168


Good — files read. Let me also check the docs linkage and any existing coverage configuration.


🏁 Script executed:

#!/bin/bash
echo "=== docs/engineering/harness-engineering.md ==="
cat docs/engineering/harness-engineering.md 2>/dev/null || echo "File not found"

echo ""
echo "=== pyproject.toml (coverage config) ==="
cat pyproject.toml 2>/dev/null | grep -A 40 "\[tool.coverage" || echo "No coverage config found"

echo ""
echo "=== .coveragerc (if present) ==="
cat .coveragerc 2>/dev/null || echo "File not found"

echo ""
echo "=== scripts/__init__.py or scripts/review_checks/__init__.py ==="
cat scripts/__init__.py 2>/dev/null || echo "scripts/__init__.py not found"
cat scripts/review_checks/__init__.py 2>/dev/null || echo "scripts/review_checks/__init__.py not found"

echo ""
echo "=== Any conftest.py ==="
find . -name "conftest.py" | xargs cat 2>/dev/null || echo "No conftest.py found"

echo ""
echo "=== pytest config from pyproject.toml ==="
cat pyproject.toml 2>/dev/null | grep -A 30 "\[tool.pytest" || echo "No pytest config found"

Length of output: 2412


@seonghobae Thanks for the detailed walkthrough. I've read through the new script, tests, and docs linkage. Here's a focused review:


scripts/review_checks/dependency_review_warning_gate.py

1. body.replace("\\n", "\n") in parse_dependency_review_comment

normalized = body.replace("\\n", "\n")

This only replaces literal two-character sequences \ + n. Since _decode_comment_entry already performs the double-json.loads decode (which converts JSON escape sequences to real characters), the body string should already contain real \n by the time it reaches this function. This line is therefore a no-op in the happy path and could mask upstream encoding bugs if the body arrives still double-escaped. Consider either removing it or adding a comment explaining the specific edge case it guards against.

2. find_latest_dependency_review_comment_body — login comparison is case-sensitive after .lower()

if login != "github-actions[bot]":

After .lower(), the literal "github-actions[bot]" is already lowercase, so this is correct. ✅

3. evaluate_warning_policy — negative max_unknown_licenses guard is in main(), not in the function itself

max_unknown_licenses=max(int(args.max_unknown_licenses), 0),

The guard is applied in main() before passing to evaluate_warning_policy. If evaluate_warning_policy is ever called directly (e.g., from another script or future harness), a negative value would silently pass any count. Consider moving the max(…, 0) clamp into evaluate_warning_policy itself.


tests/test_dependency_review_warning_gate.py

4. Missing test cases for important branches

Untested path Risk
parse_dependency_review_comment with clean body (no warnings) has_snapshot_warning=False, unknown_license_count=0
evaluate_warning_policy pass case (ok=True) Only failure paths are tested
find_latest_dependency_review_comment_body returning None No test for the "no matching comment" branch
_decode_comment_entry directly The double-decode logic is tricky; isolated unit test would be valuable
main() exit codes 0, 1, 2 Entire CLI entrypoint untested
fetch_issue_comments / _run_gh Require subprocess mocking (unittest.mock.patch)

Since --cov=vector_topic_modeling is scoped to src/vector_topic_modeling only, these gaps won't trip the CI 100% gate — but they leave real functional risk uncovered, especially the missing-comment path (exit code 2) and the main() pass/fail paths.

5. MODULE = _load_module() at module scope

Loading and executing the module at import time (module scope) means any import-time side effect in the script would affect all test collection. This is fine given the current script, but it's fragile. A session-scoped pytest fixture would be more conventional and explicit.


Docs

6. harness-engineering.md linkage

The new entry correctly documents the required and optional args and is consistent with the actual parse_args() implementation.


Summary

The core parsing and policy logic is well-structured. The main actionable items are:

  • Add a test for the clean-pass path of evaluate_warning_policy
  • Add a test for find_latest_dependency_review_comment_body returning None
  • Add a test for parse_dependency_review_comment with a body that has no warnings
  • Add tests for _decode_command_entry (direct unit test) and main() (using unittest.mock.patch for subprocess.run)
  • Clarify or remove the body.replace("\\n", "\n") line with a comment
  • Consider moving the max(…, 0) clamp into evaluate_warning_policy
✅ 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
Owner Author

@coderabbitai pause

@seonghobae

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@seonghobae

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ 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

Choose a reason for hiding this comment

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

Actionable comments posted: 12

🤖 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/docstring_coverage.py`:
- Around line 110-111: The comparison uses an unnecessary float() cast; change
the check in the block using report.percent and args.min_percent to compare
directly (i.e., replace "if report.percent < float(args.min_percent):" with a
direct comparison using args.min_percent) so the code relies on argparse's
type=float and avoids the redundant conversion while preserving the existing
return behavior.
- Around line 27-38: _iter_symbol_docstrings currently calls ast.parse without
handling SyntaxError; wrap the ast.parse(...) call in a try/except that catches
SyntaxError (and optionally UnicodeDecodeError), and on exception log or warn
including the offending file_path and the exception text, then return an empty
list (i.e. skip that file) so a single bad file doesn't abort the whole run;
keep the rest of the function (building symbols, using ast.get_docstring)
unchanged so callers still get an empty result for skippable files.
- Around line 11-17: The DocstringCoverageReport dataclass currently uses a
mutable list for missing_symbols while being frozen; change the field type to an
immutable tuple (e.g., tuple[str, ...]) in the DocstringCoverageReport
definition and update any producer code (notably
build_docstring_coverage_report) to construct and return a tuple for
missing_symbols instead of a list (convert with tuple(missing_symbols) or build
as tuple) so the report is truly immutable and safe from in-place mutation.

In `@scripts/review_checks/dependency_review_warning_gate.py`:
- Around line 84-103: fetch_issue_comments calls _run_gh which uses check=True
and can raise subprocess.CalledProcessError; modify main() to wrap calls that
invoke fetch_issue_comments/_run_gh in a try/except that specifically catches
subprocess.CalledProcessError, import subprocess if missing, log or print a
concise, user-friendly error message including e.returncode and e.cmd (or
str(e)) and then exit with a non-zero status so the process fails cleanly
instead of propagating a full stack trace.
- Around line 65-75: The _decode_comment_entry function currently calls
json.loads(candidate) (and a second json.loads(item) when item is a string)
without handling json.JSONDecodeError; wrap each json.loads call in try/except
json.JSONDecodeError and on exception return None (or otherwise skip the invalid
line) so a malformed JSON line does not raise and stop the script; ensure you
reference the json.loads calls inside _decode_comment_entry and handle both the
initial parse and the secondary parse when isinstance(item, str).
- Around line 169-171: The call is doing redundant type conversions: remove the
unnecessary int(...) and bool(...) wrappers and pass args.max_unknown_licenses
and args.allow_snapshot_warning directly to the constructor/function (the
parameters named max_unknown_licenses and allow_snapshot_warning). Ensure
argparse is configured to provide an int for args.max_unknown_licenses and a
boolean (store_true) for args.allow_snapshot_warning so the direct values have
the correct types.
- Around line 78-81: The subprocess call in _run_gh triggers static-analysis
S603 because owner/repo/pull_number come from CLI; either explicitly mark this
call as an accepted risk with a trailing "# noqa: S603" comment on the _run_gh
function or add input validation earlier (e.g., in parse_args) to sanitize owner
and repo (validate with a safe regex like ^[\w.-]+$ and ensure pull_number is an
integer) before they are used to build the gh API path; update the repository to
use one of these approaches and ensure the change references _run_gh (and
parse_args if adding validation).

In `@tests/test_clustering.py`:
- Around line 225-228: RescueDisplayDominanceResult's field names don't match
the test keys (tests expect "display_top_share_before"/"display_top_share_after"
but the TypedDict in RescueDisplayDominanceResult defines
"top_cluster_share_before"/"top_cluster_share_after"); update the TypedDict in
src/vector_topic_modeling/clustering.py (RescueDisplayDominanceResult) to use
the display_* key names or change the code that constructs the result to emit
the display_top_share_before/after keys so that the produced dict keys match the
test's res["display_top_share_before"] and res["display_top_share_after"]
lookups.

In `@tests/test_dependency_review_warning_gate.py`:
- Around line 14-22: In _load_module(), split the combined assertion `assert
spec is not None and spec.loader is not None` into two separate checks so
failures indicate which is None; e.g., first `assert spec is not None` (or raise
with message referencing `spec`) and then `assert spec.loader is not None` (or
raise with message referencing `spec.loader`) before calling
`spec.loader.exec_module(module)`, so debugging of the _load_module function
clearly shows whether spec or spec.loader was the cause.

In `@tests/test_docstring_coverage.py`:
- Around line 15-23: The compound assertion in _load_docstring_coverage_module()
makes debugging harder; split "assert spec is not None and spec.loader is not
None" into two separate assertions that check spec and spec.loader individually
(e.g., assert spec is not None with a message, then assert spec.loader is not
None with a message) so failures identify whether spec creation or loader
resolution failed when executing spec.loader.exec_module(module).
- Around line 89-93: The lambda used in monkeypatch.setattr for
build_docstring_coverage_report declares repo_root and src_root but doesn’t use
them; to silence Ruff ARG005, rename those parameters to use an underscore
prefix (e.g., _repo_root and _src_root) in the lambda signature so the call
still matches build_docstring_coverage_report while marking the args as
intentionally unused; update the lambda passed to monkeypatch.setattr in the
test to accept the underscored names.

In `@tests/test_pipeline.py`:
- Around line 150-152: Add the missing type annotation to the pytest monkeypatch
fixture for the test function
test_fit_predict_allows_sessions_without_selected_representative: change the
parameter signature to annotate monkeypatch with pytest.MonkeyPatch so the
function reads monkeypatch: pytest.MonkeyPatch, and ensure pytest is imported if
not already referenced in the test module.
🪄 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: 3159aa7d-4a27-41e7-99c4-74c3d0e76a23

📥 Commits

Reviewing files that changed from the base of the PR and between 3e2b104 and 4b0c4a1.

📒 Files selected for processing (34)
  • .github/workflows/ci.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/dependency-submission.yml
  • .github/workflows/publish.yml
  • .github/workflows/release.yml
  • ARCHITECTURE.md
  • docs/engineering/acceptance-criteria.md
  • docs/engineering/harness-engineering.md
  • docs/maintainers/releasing.md
  • docs/operations/deploy-runbook.md
  • docs/security/api-security-checklist.md
  • docs/workflow/one-day-delivery-plan.md
  • docs/workflow/pr-continuity.md
  • pyproject.toml
  • scripts/docstring_coverage.py
  • scripts/review_checks/dependency_review_warning_gate.py
  • src/vector_topic_modeling/_sanitize.py
  • src/vector_topic_modeling/clustering.py
  • src/vector_topic_modeling/ingestion.py
  • src/vector_topic_modeling/pipeline.py
  • src/vector_topic_modeling/providers/base.py
  • src/vector_topic_modeling/providers/openai_compat.py
  • src/vector_topic_modeling/service.py
  • src/vector_topic_modeling/sessioning.py
  • src/vector_topic_modeling/text.py
  • tests/test_clustering.py
  • tests/test_dependency_review_warning_gate.py
  • tests/test_docs_ci_policy_alignment.py
  • tests/test_docs_release_gate_alignment.py
  • tests/test_docstring_coverage.py
  • tests/test_ingestion.py
  • tests/test_pipeline.py
  • tests/test_pyproject_license_metadata.py
  • tests/test_sessioning.py

Comment thread scripts/docstring_coverage.py
Comment thread scripts/docstring_coverage.py
Comment thread scripts/docstring_coverage.py
Comment thread scripts/review_checks/dependency_review_warning_gate.py
Comment thread scripts/review_checks/dependency_review_warning_gate.py
Comment thread tests/test_clustering.py
Comment thread tests/test_dependency_review_warning_gate.py
Comment thread tests/test_docstring_coverage.py
Comment thread tests/test_docstring_coverage.py
Comment thread tests/test_pipeline.py
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews paused.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews resumed.

@seonghobae

Copy link
Copy Markdown
Owner Author

Follow-up commit 0f70ee7 addresses the incremental review gaps in the warning-gate harness. Added tests for clean parse path, allow/pass policy path, negative threshold normalization, none-path for comment discovery, double-encoded comment decoding, and main() exit codes 0/1/2. Also normalized max_unknown_licenses inside evaluate_warning_policy and simplified comment normalization handling. @coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
🧩 Analysis chain

Let me read the updated files from the latest commit to verify the fixes.


🏁 Script executed:

#!/bin/bash
echo "=== scripts/review_checks/dependency_review_warning_gate.py ==="
cat scripts/review_checks/dependency_review_warning_gate.py

echo ""
echo "=== tests/test_dependency_review_warning_gate.py ==="
cat tests/test_dependency_review_warning_gate.py

Length of output: 13387


@seonghobae Verified commit 0f70ee7 — all six actionable items from the previous review are fully addressed:

Previous item Resolution
Test for evaluate_warning_policy pass path test_evaluate_warning_policy_passes_when_within_limits
Test for find_latest_dependency_review_comment_body returning None test_find_latest_dependency_review_comment_body_returns_none_without_marker
Test for parse_dependency_review_comment with no warnings test_parse_dependency_review_comment_without_warnings_is_clean
_decode_comment_entry direct unit test test_decode_comment_entry_handles_double_encoded_json_line
main() exit codes 0/1/2 Three test_main_returns_* tests with monkeypatch
body.replace("\\n", "\n") simplified Replaced with normalized = body
max(…, 0) clamp moved inside evaluate_warning_policy normalized_max_unknown_licenses = max(int(max_unknown_licenses), 0) in function body ✅

One trivial nit: main() still applies max(int(args.max_unknown_licenses), 0) before passing to evaluate_warning_policy, so the clamp is applied twice on the main() path. This is benign — the function-level guard is the important one and is now in place.

The harness is solid. No further concerns from the previous review thread.

✅ 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
Owner Author

@coderabbitai resume

@seonghobae

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ 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
Owner Author

@coderabbitai resolve

@seonghobae

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@seonghobae

Copy link
Copy Markdown
Owner Author

Duplicate of #42 (#42). Continuing work there.

@seonghobae seonghobae added the duplicate This issue or pull request already exists label Mar 27, 2026
@seonghobae

Copy link
Copy Markdown
Owner Author

Duplicate of #42 (#42). Continuing work there.

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

Pull request was closed

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== scripts/review_checks/dependency_review_warning_gate.py ==="
cat scripts/review_checks/dependency_review_warning_gate.py

echo ""
echo "=== tests/test_dependency_review_warning_gate.py ==="
cat tests/test_dependency_review_warning_gate.py

Length of output: 13387


@seonghobae Verified commit 0f70ee7 — all six actionable items from the previous review are fully addressed:

Previous item Resolution
Test for evaluate_warning_policy pass path test_evaluate_warning_policy_passes_when_within_limits
Test for find_latest_dependency_review_comment_body returning None test_find_latest_dependency_review_comment_body_returns_none_without_marker
Test for parse_dependency_review_comment with no warnings test_parse_dependency_review_comment_without_warnings_is_clean
_decode_comment_entry direct unit test test_decode_comment_entry_handles_double_encoded_json_line
main() exit codes 0/1/2 Three test_main_returns_* tests with monkeypatch
body.replace("\\n", "\n") simplified Replaced with normalized = body
max(…, 0) clamp moved inside evaluate_warning_policy normalized_max_unknown_licenses = max(int(max_unknown_licenses), 0) in function body ✅

One trivial nit: main() still applies max(int(args.max_unknown_licenses), 0) before passing to evaluate_warning_policy, so the clamp is applied twice on the main() path. This is benign — the function-level guard is the important one and is now in place.

The harness is solid. No further concerns from the previous review thread.

✅ 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 commented Mar 27, 2026

Copy link
Copy Markdown
✅ 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 commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews resumed.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Comments resolved and changes approved.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews resumed.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Comments resolved and changes approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant