File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ not change the semantics of supported stock interactions.
4343Rust source should stay split by subsystem and responsibility. The guardrail in
4444` policy/rust-client.toml ` sets file-size budgets, names current legacy oversized
4545files 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
4850Run the local policy guard before policy-sensitive protocol or architecture
4951changes:
Original file line number Diff line number Diff line change @@ -70,11 +70,14 @@ helper = "emulebb_ed2k::long_path::long_path"
7070current_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 ]
7982max_rs_lines = 600
8083max_test_rs_lines = 900
You can’t perform that action at this time.
0 commit comments