chore: lower ADR-015 source-file cap to 500 lines - #749
Merged
Conversation
Lower the non-test source-file cap in ADR-015 section 2 from 600 to 500 lines to match SonarCloud's S104 threshold, removing the 500-599 band where files were repo-compliant but failed the Sonar quality gate at the dev -> main integration PR (#545). Re-baseline _ADR015_INITIAL_OVERSIZED_FILES and tools/policy/oversized_allowlist.yaml to the files over 500 lines as of this change; the allowlist shrink-only rule continues from the new baseline. Record the change as an ADR-015 amendment and update its acceptance pin. Closes #561
|
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.



Summary
Lowers the non-test source-file cap in ADR-015 §2 from 600 to 500 lines so
the repo's documented file-size policy matches SonarCloud's S104 threshold
(500). Previously the two disagreed, letting files land in the 500–599 band that
were repo-compliant but failed the SonarCloud quality gate at the
dev → mainintegration PR (see #545).
What changed
## Amendmentsrow (Lower ADR-015 source-file cap from 600 to 500 lines (align with SonarCloud S104) #561). Its acceptance pin indocs/decisions/adrs/adr-index.yamlis recomputed and anamendmentsrefadded (ADR-059 immutability gate).
tools/policy/adr_policy.yaml—oversized_source_files.line_cap600 → 500.tools/policy/repo_policy.py—_ADR015_INITIAL_OVERSIZED_FILESre-baselined to the 25 files currently over 500 lines; header/docstring/failure
message updated. No control-flow change.
tools/policy/oversized_allowlist.yaml— set to those same 25 files (thenew debt baseline). The allowlist stays a subset of the code constant, so the
shrink-only drain rule continues unchanged from the new baseline.
implementations/python/tests/test_repo_policy_tools.py— stale600/14-count comments refreshed to 500.
Why re-baseline instead of splitting
18 files sit in the 500–599 band today; splitting them all is far beyond one PR
and out of scope for this cap change. The issue explicitly sanctions the
allowlist path ("consistent with the ADR's allowlist-may-only-shrink rule"), and
ADR-015's own design makes a lowered cap a code-constant diff that PR review
scrutinises. Three band files (
inspection.py,orchestration.py,stubs.py)were in the original locked set but drained below 600 — at cap 500 they would
trip the config-wide debt-consistency check even if untouched, so the
comprehensive re-baseline is required for the lowered cap to be enforceable.
Verification
tools/check_repo_policy.py(full + config-wide changed set): PASStools/check_adr_immutability.py --staged: PASS (pin + amendment ref consistent)test_repo_policy_tools.py: 119 passednox -s lint(ruff project + tooling): PASSCloses #561