Skip to content

Commit 352c178

Browse files
author
Threepwood-7
committed
RUST-POLICY: allow cohesive file cap bumps
1 parent 8f5cb27 commit 352c178

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ not change the semantics of supported stock interactions.
4343
Rust source should stay split by subsystem and responsibility. The guardrail in
4444
`policy/rust-client.toml` sets file-size budgets, names current legacy oversized
4545
files as refactor debt, and prevents new oversized modules from appearing
46-
without an explicit rationale.
46+
without an explicit rationale. Existing caps can be raised only when the touched
47+
behavior is one cohesive function or protocol decision surface and the policy
48+
rationale explains why splitting it would make the code harder to reason about.
4749

4850
Run the local policy guard before policy-sensitive protocol or architecture
4951
changes:

policy/rust-client.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ helper = "emulebb_ed2k::long_path::long_path"
7070
current_model_note = "incoming + category output boundaries documented; wired where the category path is consumed"
7171

7272
# New `.rs` files must stay within `max_rs_lines` (600) / `max_test_rs_lines` (900).
73-
# The legacy files below are grandfathered, but their caps are FROZEN at the
74-
# current line count: caps are ratchet-down-only. Do not raise a cap to fit new
75-
# code -- put new functionality in a new module within budget, and lower a cap
76-
# whenever a split shrinks its file. The remaining splits are deferred to
77-
# post-parity, done opportunistically "as touched".
73+
# The legacy files below are grandfathered and remain refactor debt, but their
74+
# caps are engineering guardrails rather than mechanical split triggers. Prefer
75+
# extracting independent responsibilities into new modules within budget, and
76+
# lower a cap whenever a split shrinks its file. A cap may be raised only when
77+
# the touched behavior is one cohesive function or protocol decision surface and
78+
# splitting it would harm readability, invariants, or parity evidence; the
79+
# allowlist rationale must say why the code belongs together. The remaining
80+
# splits are deferred to post-parity, done opportunistically "as touched".
7881
[structure]
7982
max_rs_lines = 600
8083
max_test_rs_lines = 900

0 commit comments

Comments
 (0)