Repository navigation
Enforce the file-length rule and delete its empty baseline - #949
Merged
Merged
Conversation
anth-volk
force-pushed
the
file-length-enforce
branch
6 times, most recently
from
October 27, 2026 17:11
57e26ff to
50351d5
Compare
Every tracked Python file is now within its limit, so sim.quality.python-file-length becomes enforced: the empty baseline, rules/baselines/python-file-length.txt, is deleted, and the rule's [rule.downgrade] section, which an enforced rule can't keep, is removed. Merging this closes its tracking issue. The rule's tier is corrected from mechanical to metric, because it measures a number, a file's line count, against a threshold, which is what the registry's tiers call a metric rule. Its proof uses the metric fields: below_fixture is the manifest of files at their limit, above_fixture the manifest of files one line over it, and threshold is the 800-line source limit; both fixtures also cover the 1,500-line limit for test code, and the proof test is unchanged. docs/engineering/skills/file-length.md says there is no baseline or exception, and the rendered rules are regenerated. Fixes #921 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
file-length-enforce
branch
from
October 27, 2026 17:23
50351d5 to
445408c
Compare
anth-volk
marked this pull request as ready for review
October 27, 2026 17:30
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #921
Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Summary
Last of nine stacked PRs; it builds on #946, which split the last two files over their limit. Every tracked Python file is now within the file-length limits, so this PR enforces
sim.quality.python-file-length.statusgoes fromratchetedtoenforced. The baseline is empty, sorules/baselines/python-file-length.txtand the rule's[rule.baseline]table are deleted. A file over its limit now fails thequality-guardsjob with no way to list it.[rule.downgrade]removed: an enforced rule can't keep one. The section named Enforce the file-length rule and delete its empty baseline #921, which this PR'sFixesline closes when it merges.mechanicaltometric, because the rule measures a number, a file's line count, against a threshold, which is whatdocs/engineering/skills/rules-registry.mdcalls a metric rule. The proof now uses the metric fields the registry's Proof table asks for:below_fixture:rules/fixtures/sim.quality.python-file-length/good_files.toml, the files at their limit (800 lines for source, 1,500 for test code), which pass;above_fixture:.../bad_files.toml, the files one line over their limit, which fail;threshold = 800, the source limit; both fixtures also cover the 1,500-line limit for test code, as a comment in the registry says;test: the same proof test,scripts/rules/tests/test_file_length.py::TestFileLengthProof::test_rule_proof_python_file_length, run by the same job. The fixtures keep their names: the validator only requires that they exist.docs/engineering/skills/file-length.mdreplaces its baseline section with one saying there is no baseline or exception;docs/generated/rules.mdis regenerated (the rule now counts as one enforced metric rule).Environment variables
None: no workflow or deployment file changes.
Testing
python scripts/run_quality_guards.py: every guard passed, includingfile-lengthwith no baseline.python -m scripts.rules guard --base-ref origin/file-length-split-entry-app: passed;python -m scripts.rules renderleaves no diff.python -m unittest discover -s scripts/rules/tests -t .: passed.Only the lowest PR in the stack runs full CI, so this PR's
CI completecheck fails by design until the PRs below it merge.🤖 Generated with Claude Code