Skip to content

feat(devtools): test-ownership manifest with import-resolution - #440

Closed
Sinity wants to merge 2 commits into
feature/feat/file-size-budgetsfrom
feature/feat/test-ownership-manifest
Closed

Sinity wants to merge 2 commits into
feature/feat/file-size-budgetsfrom
feature/feat/test-ownership-manifest

Conversation

@Sinity

@Sinity Sinity commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #437. Adds the fourth evidence-driven structural lint after #429 (topology) and #435 (file-size). Verifies each production module is imported by at least one unit test.

Problem

When a production module moves (per the topology refactors #424/#425/#426/#403), its test files often stay put — the test-tree mirror of the production tree drifts. Coverage analysis is wrong because test files updated their imports but never moved.

Solution

Same shape as #429 and #435: declarative YAML manifest plus a lint that walks the realized tree.

  • docs/plans/test-ownership.yaml: untested[] (modules that legitimately do not need unit tests, with justification) plus shared[] (cross-cutting test infrastructure that does not own one production module).
  • devtools/verify_test_ownership.py (~200 LOC): AST-based import resolution. For each production module under polylogue/ or devtools/, verifies at least one unit test imports it. Reports uncovered modules (blocking), stale untested entries (blocking), and orphan tests (warning).
  • Wired into devtools verify --quick after verify-file-budgets.
  • tests/unit/devtools/test_verify_test_ownership.py: parser round-trip, import-filter, and "committed manifest is clean" smoke test.

Verification

$ devtools verify-test-ownership
production modules: 674
covered: 698
untested (declared): 0
blocking=False

$ devtools verify --quick
verify: all checks passed (incl. verify-topology, verify-file-budgets, verify-test-ownership)

$ pytest tests/unit/devtools/test_verify_test_ownership.py
3 passed

Currently 0 uncovered production modules across 674 production files (polylogue + devtools). Four legitimate orphan tests are explicitly listed in shared: with reasons (structural test, terminal-snapshot, growth budget, entrypoints runtime).

Stacked on

Based on feature/feat/file-size-budgets (#439), which is based on feature/feat/topology-cohesion-executable (#438). Merge order: #438 → #439 → this.

Refs #401, #429, #435, #437.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 74e640bc-46fb-4a7f-b628-1faa5119f9d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/test-ownership-manifest

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

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9023679764

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_test_ownership.py Resolved
Sinity and others added 2 commits April 26, 2026 08:15
Closes #435.

Adds the third evidence-driven structural lint after #429 (topology) and
the topology cluster-cohesion check. Catches file accretion early — a new
module that grows past its declared ceiling fails the next commit.

- docs/plans/file-size-budgets.yaml: defaults (source 1100, test 1500)
  plus per-package ceilings for devtools/, polylogue/proof/,
  polylogue/pipeline/services/, polylogue/operations/, polylogue/storage/,
  tests/infra/. Nine exceptions name a sunset issue (#403, #419) and will
  fail the lint when their issue closes.
- devtools/verify_file_budgets.py: walks polylogue/, devtools/, tests/;
  resolves ceilings via exception → per-package → default; reports
  overages with file path, current LOC, and ceiling source.
- Wired into devtools verify --quick alongside verify-topology.

Pattern reuse from #429: declarative YAML + lint + tracked exceptions
with sunset issues. Same shape will land for #436 (mypy coverage),
#437 (test ownership), #434 (migration completeness).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes #437.

Adds the fourth evidence-driven structural lint after #429 (topology) and
#435 (file-size). Verifies each production module is imported by at least
one unit test.

- docs/plans/test-ownership.yaml: untested[] (modules legitimately not
  needing unit tests, with justification) plus shared[] (cross-cutting
  test infrastructure that does not own one production module).
- devtools/verify_test_ownership.py: AST-based import resolution. For
  each production module under polylogue/ or devtools/, verifies at
  least one unit test imports it. Reports uncovered modules (blocking),
  stale untested entries (blocking), and orphan tests (warning).
- Wired into devtools verify --quick alongside verify-topology and
  verify-file-budgets.

Currently 0 uncovered production modules across 674 production files
(polylogue + devtools). Four orphan tests are explicitly listed in
shared: with reasons (structural test, terminal-snapshot, growth budget,
entrypoints runtime).

Pattern reuse from #429: declarative YAML + lint + tracked exceptions.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@Sinity
Sinity force-pushed the feature/feat/test-ownership-manifest branch from 9023679 to d02238a Compare April 26, 2026 06:19
@Sinity

Sinity commented Apr 26, 2026

Copy link
Copy Markdown
Owner Author

Closing in favor of new PR — branches were rebased after #438 merged to drop already-upstream commits, leaving the diff in a state GitHub couldn't reconcile cleanly. Reopening with the same content under a new number.

@Sinity Sinity closed this Apr 26, 2026
Sinity added a commit that referenced this pull request Apr 26, 2026
## Summary

Closes #437. Replaces #440 (closed because branches were rebased after
#438 merged). Adds the third evidence-driven structural lint after #429
(topology) and #435 (file-size). Verifies each production module is
imported by at least one unit test.

## Problem

When a production module moves (per the topology refactors
#424/#425/#426/#403), test files often stay put — the test-tree mirror
of the production tree drifts. Coverage analysis is wrong because tests
update imports but never move.

## Solution

Same shape as #429 and #435: declarative YAML manifest plus an AST-based
lint.

- **`docs/plans/test-ownership.yaml`**: `untested[]` (modules
legitimately not needing unit tests, with justification) plus `shared[]`
(cross-cutting test infrastructure).
- **`devtools/verify_test_ownership.py`** (~200 LOC): for each
production module under `polylogue/` or `devtools/`, verifies at least
one unit test imports it. Reports uncovered (blocking), stale untested
(blocking), orphan tests (warning).
- Wired into `devtools verify --quick` after `verify-file-budgets`.
- `tests/unit/devtools/test_verify_test_ownership.py`: parser,
import-filter, "committed manifest is clean" smoke.

## Verification

```
$ devtools verify-test-ownership
production modules: 674
covered: 698
untested (declared): 0
blocking=False

$ devtools verify --quick
verify: all checks passed (incl. all 7 lints)

$ pytest tests/unit/devtools/test_verify_test_ownership.py
3 passed
```

Currently 0 uncovered production modules across 674 files. Four
legitimate orphan tests are listed in `shared:` with reasons.

## Stacked on

Based on `feature/feat/file-size-budgets` (#442). Merge order: #442 →
this.

Refs #401, #429, #437, #440 (closed predecessor).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added `verify-test-ownership` verification command that validates all
production modules are imported by at least one unit test, with support
for JSON output.

* **Documentation**
  * Updated devtools documentation with new verification command.
* Added test-ownership manifest file to manage module coverage
exceptions and cross-cutting test infrastructure.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@Sinity

Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

🤖 Post-hoc audit note: this PR received bot review feedback verified against current HEAD as part of #544. 1 finding(s) confirmed still present → tracked in #547.

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Closes #437. Replaces #440 (closed because branches were rebased after
#438 merged). Adds the third evidence-driven structural lint after #429
(topology) and #435 (file-size). Verifies each production module is
imported by at least one unit test.

## Problem

When a production module moves (per the topology refactors
#424/#425/#426/#403), test files often stay put — the test-tree mirror
of the production tree drifts. Coverage analysis is wrong because tests
update imports but never move.

## Solution

Same shape as #429 and #435: declarative YAML manifest plus an AST-based
lint.

- **`docs/plans/test-ownership.yaml`**: `untested[]` (modules
legitimately not needing unit tests, with justification) plus `shared[]`
(cross-cutting test infrastructure).
- **`devtools/verify_test_ownership.py`** (~200 LOC): for each
production module under `polylogue/` or `devtools/`, verifies at least
one unit test imports it. Reports uncovered (blocking), stale untested
(blocking), orphan tests (warning).
- Wired into `devtools verify --quick` after `verify-file-budgets`.
- `tests/unit/devtools/test_verify_test_ownership.py`: parser,
import-filter, "committed manifest is clean" smoke.

## Verification

```
$ devtools verify-test-ownership
production modules: 674
covered: 698
untested (declared): 0
blocking=False

$ devtools verify --quick
verify: all checks passed (incl. all 7 lints)

$ pytest tests/unit/devtools/test_verify_test_ownership.py
3 passed
```

Currently 0 uncovered production modules across 674 files. Four
legitimate orphan tests are listed in `shared:` with reasons.

## Stacked on

Based on `feature/feat/file-size-budgets` (#442). Merge order: #442 →
this.

Refs #401, #429, #437, #440 (closed predecessor).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added `verify-test-ownership` verification command that validates all
production modules are imported by at least one unit test, with support
for JSON output.

* **Documentation**
  * Updated devtools documentation with new verification command.
* Added test-ownership manifest file to manage module coverage
exceptions and cross-cutting test infrastructure.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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.

2 participants