Skip to content

test: align coverage scope with platform source layout - #508

Closed
Pigbibi wants to merge 2 commits into
mainfrom
test/coverage-source-alignment
Closed

Pigbibi wants to merge 2 commits into
mainfrom
test/coverage-source-alignment

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

AI assistance

OpenAI Codex was used to prepare this change. The exact model used for the original implementation is not recorded in the available evidence.

The closeout report records a separate review of this coverage-source change: PASS, no findings.

What changed

  • pyproject.toml: source = ["."] with explicit omit categories (tests/*, */external/*, .venv/*, build/*, dist/*); move include_namespace_packages = true into [tool.coverage.report] so unexecuted package files without __init__.py still appear in the denominator at 0%.
  • tests/test_coverage_source_layout.py: stdlib-only contract tests that (1) assert the configuration uses the repository root with the explicit category exclusions and no fail_under; (2) derive the production paths from py-modules and packages.find and prove every declared production path exists and escapes all omit patterns; (3) run a hermetic synthetic-tree measurement proving unexecuted in-scope files remain in the denominator while excluded test/external/venv/build files cannot inflate it; (4) assert the CI job executes the suite under coverage instrumentation.
  • .github/workflows/ci.yml: an engineering-only measurement step after the existing test run: coverage run -m pytest -q, coverage report --show-missing, then a guard that fails the job if the measured-file inventory is empty.

No runtime code, dependency metadata, lockfile, threshold (fail_under), or required-check policy was changed. Dependency versions and pins remain untouched.

How verified

Offline validation ran in a network-denied environment with synthetic credentials.

Run Result
Uninstrumented full suite 1716 passed, 1 warning, 79 subtests passed
Instrumented full suite 1716 passed, 1 warning, 79 subtests passed (identical)
Coverage report 68 measured files, 74% TOTAL; no tests/, .venv/, external/, build/, or dist/ entry in the inventory; no "No data to report"

The four new contract tests pass under python -m unittest and Ruff is clean.

Hosted CI 41341590881 completed successfully for head 456837f600c705fc369234b043aff6ef50c3b744. The actual PR merge checkout was 92ca26f14cc581155268a5288f2197219cb95003, tree 59bd95e64458f07a60781bea83fbff0e8c661f51, matching the reviewed tree. The instrumented suite reported 1,716 passed, 1 warning and 79 subtests passed; the coverage report was 74% TOTAL and the measured-file inventory guard succeeded.

Why

[tool.coverage.run] currently declares source = ["src"], but the repository has no src directory: production code lives in the top-level modules declared by py-modules and in the application/, scripts/, and strategy_* packages. An instrumented run under the previous configuration collected no files at all, so any coverage report derived from it was structurally empty. This change points coverage at the repository root and excludes non-production categories explicitly, without introducing any threshold.

Risk

The path-based governance classification is high risk because .github/workflows/ci.yml is affected. The other changed paths are pyproject.toml and tests/test_coverage_source_layout.py. The changes affect engineering coverage measurement; owner approval remains required by risk-gate.

Out of scope

No coverage percentage target, no fail_under, no exclusions added to suppress real findings. This only makes the existing measurement measure the actual platform code.

Draft only: merging, labels, and approvals remain owner-reserved.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 286d6a42-b980-4bd7-a4ca-2694a2cd5c4c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 1, 2026
@Pigbibi
Pigbibi marked this pull request as ready for review November 1, 2026 19:45
@Pigbibi

Pigbibi commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #509 (merged). Branch kept.

@Pigbibi Pigbibi closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant