Skip to content

feat(devtools): file-size budgets per package and module - #439

Closed
Sinity wants to merge 1 commit into
feature/feat/topology-cohesion-executablefrom
feature/feat/file-size-budgets
Closed

Sinity wants to merge 1 commit into
feature/feat/topology-cohesion-executablefrom
feature/feat/file-size-budgets

Conversation

@Sinity

@Sinity Sinity commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

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

Problem

Polylogue has several modules and tests that grew past sustainable size: pipeline_probe.py (1,468 LOC), proof/runners.py (1,339 LOC), several test files at 2,000+ LOC. #419 splits the worst offenders, but nothing prevents the next file from accreting in the same shape.

Solution

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

  • docs/plans/file-size-budgets.yaml: defaults (source 1100, test 1500); per-package ceilings for devtools/, polylogue/proof/, polylogue/pipeline/services/, polylogue/operations/, polylogue/storage/, tests/infra/; nine exceptions naming sunset issues (refactor: rationalize source and test module structure #403, refactor(tests): split oversized contract suites #419).
  • devtools/verify_file_budgets.py (~150 LOC): 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.
  • tests/unit/devtools/test_verify_file_budgets.py: parser round-trip, resolution-order, and a "committed budgets are clean" smoke test.

Verification

$ devtools verify-file-budgets
file-size budgets: clean

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

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

Stacked on

Based on feature/feat/topology-cohesion-executable (#438). When #438 merges, base auto-updates to master.

Refs #401, #419, #429, #435.

🤖 Generated with Claude Code

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]>
@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: 462d42ae-2ff3-4061-ada7-91dedb233b86

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/file-size-budgets

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: c10eba4ebb

ℹ️ 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_file_budgets.py Resolved
@Sinity
Sinity deleted the branch feature/feat/topology-cohesion-executable April 26, 2026 05:49
@Sinity Sinity closed this Apr 26, 2026
Sinity added a commit that referenced this pull request Apr 26, 2026
## Summary

Closes #435. Reopens the work from #439 (auto-closed when its base
branch was deleted by #438's merge). Adds the second evidence-driven
structural lint after #429 (topology). Catches file accretion early.

## Problem

Polylogue has several modules and tests that grew past sustainable size:
`pipeline_probe.py` (1,468 LOC), `proof/runners.py` (1,339 LOC), several
test files at 2,000+ LOC. Issue #419 splits the worst offenders, but
nothing prevents the next file from accreting in the same shape.

## Solution

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

- **`docs/plans/file-size-budgets.yaml`**: defaults (source 1100, test
1500); per-package ceilings for `devtools/`, `polylogue/proof/`,
`polylogue/pipeline/services/`, `polylogue/operations/`,
`polylogue/storage/`, `tests/infra/`; nine exceptions naming sunset
issues (#403, #419).
- **`devtools/verify_file_budgets.py`** (~150 LOC): 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` after `verify-topology`.
- `tests/unit/devtools/test_verify_file_budgets.py`: parser round-trip,
resolution-order, and "committed budgets are clean" smoke test.

## Verification

```
$ devtools verify-file-budgets
file-size budgets: clean

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

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

## Context

Previously stacked on `feature/feat/topology-cohesion-executable`;
rebased to master after #438 merged.

Refs #401, #419, #429, #435.

🤖 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 `devtools verify-file-budgets` command to enforce per-file
line-of-code budgets defined in a configuration file
* Supports JSON output format and policy configuration with per-package
overrides and temporary exceptions

* **Documentation**
  * Added documentation for the new file budget verification command

* **Tests**
  * Added tests for file budget verification functionality

<!-- 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 #435. Reopens the work from #439 (auto-closed when its base
branch was deleted by #438's merge). Adds the second evidence-driven
structural lint after #429 (topology). Catches file accretion early.

## Problem

Polylogue has several modules and tests that grew past sustainable size:
`pipeline_probe.py` (1,468 LOC), `proof/runners.py` (1,339 LOC), several
test files at 2,000+ LOC. Issue #419 splits the worst offenders, but
nothing prevents the next file from accreting in the same shape.

## Solution

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

- **`docs/plans/file-size-budgets.yaml`**: defaults (source 1100, test
1500); per-package ceilings for `devtools/`, `polylogue/proof/`,
`polylogue/pipeline/services/`, `polylogue/operations/`,
`polylogue/storage/`, `tests/infra/`; nine exceptions naming sunset
issues (#403, #419).
- **`devtools/verify_file_budgets.py`** (~150 LOC): 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` after `verify-topology`.
- `tests/unit/devtools/test_verify_file_budgets.py`: parser round-trip,
resolution-order, and "committed budgets are clean" smoke test.

## Verification

```
$ devtools verify-file-budgets
file-size budgets: clean

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

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

## Context

Previously stacked on `feature/feat/topology-cohesion-executable`;
rebased to master after #438 merged.

Refs #401, #419, #429, #435.

🤖 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 `devtools verify-file-budgets` command to enforce per-file
line-of-code budgets defined in a configuration file
* Supports JSON output format and policy configuration with per-package
overrides and temporary exceptions

* **Documentation**
  * Added documentation for the new file budget verification command

* **Tests**
  * Added tests for file budget verification functionality

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

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

Sinity commented Oct 1, 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