Context
Discovered while verifying PR #254 (fix(core): break the synaptic-plasticity
import cycle, #233) had landed cleanly on main (commit 6c6ef61). Both
files are touched by that PR's own diff, so this is a boy-scout-gate finding
(coding-standards.md §14) against material the PR modified — filed rather
than folded in per §14.3, because fixing either properly (Extract Function /
Extract Module) is its own root-cause change, independent of a rebase-and-
verify task, and no PR is currently open to attach it to (§15.1: never mix
an enabling refactor with an unrelated change).
Violation 1 — _stochastic_single, 56 lines
mcp_server/core/synaptic_plasticity_stochastic.py::_stochastic_single is
56 lines — over CLAUDE.md's repo-local 40-line/method convention AND over
coding-standards.md's hard §4.2 50-line cap. Pre-existing (confirmed present
at 56 lines in adcc00f, PR #254's merge-parent, before that PR's own diff
— which only retargeted two import statements, "zero executable lines
changed" per the PR's own description).
Repro:
$ git show adcc00f:mcp_server/core/synaptic_plasticity_stochastic.py | python3 -c "
import ast,sys
src = sys.stdin.read()
for node in ast.walk(ast.parse(src)):
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
ln = (node.end_lineno or node.lineno) - node.lineno + 1
if ln > 40:
print(node.name, ln)
"
_stochastic_single 56
Violation 2 — test_stochastic_transmission.py, 490 lines
tests_py/core/test_stochastic_transmission.py was already over this repo's
300-line file convention before PR #254 (331 lines at adcc00f) and PR #254
itself added 161 more lines (mutation-killing exact-value tests), landing at
490 — under the hard 500-line cap but well over the repo's own stated 300.
This growth is inside PR #254's own diff, not merely a file it walked past.
Repro:
$ git show adcc00f:tests_py/core/test_stochastic_transmission.py | wc -l
331
$ git show 6c6ef61:tests_py/core/test_stochastic_transmission.py | wc -l
490
Acceptance criteria
_stochastic_single split (Extract Function, Fowler 2018 Ch. 6) so every
function in synaptic_plasticity_stochastic.py is <= 40 lines, with the
existing test suite passing byte-for-byte unchanged as the behavior-
preservation proof (no test added/modified for the split itself).
test_stochastic_transmission.py split along a concern boundary (e.g. one
file per Test* class family, mirroring the synaptic_plasticity_*
module split) so each resulting file is <= 300 lines, with all existing
tests passing unchanged post-split.
- Both changes ship as their own PR(s), separate from any behavior change,
so the split's correctness argument is "unchanged test outcomes" alone.
Not blocking PR #254 itself (already merged, all its own CI green per job) —
tracked here per coding-standards.md §14.3 so it does not become a silent,
un-issued "pre-existing" dismissal.
Context
Discovered while verifying PR #254 (fix(core): break the synaptic-plasticity
import cycle, #233) had landed cleanly on
main(commit6c6ef61). Bothfiles are touched by that PR's own diff, so this is a boy-scout-gate finding
(coding-standards.md §14) against material the PR modified — filed rather
than folded in per §14.3, because fixing either properly (Extract Function /
Extract Module) is its own root-cause change, independent of a rebase-and-
verify task, and no PR is currently open to attach it to (§15.1: never mix
an enabling refactor with an unrelated change).
Violation 1 —
_stochastic_single, 56 linesmcp_server/core/synaptic_plasticity_stochastic.py::_stochastic_singleis56 lines — over CLAUDE.md's repo-local 40-line/method convention AND over
coding-standards.md's hard §4.2 50-line cap. Pre-existing (confirmed present
at 56 lines in
adcc00f, PR #254's merge-parent, before that PR's own diff— which only retargeted two import statements, "zero executable lines
changed" per the PR's own description).
Repro:
Violation 2 —
test_stochastic_transmission.py, 490 linestests_py/core/test_stochastic_transmission.pywas already over this repo's300-line file convention before PR #254 (331 lines at
adcc00f) and PR #254itself added 161 more lines (mutation-killing exact-value tests), landing at
490 — under the hard 500-line cap but well over the repo's own stated 300.
This growth is inside PR #254's own diff, not merely a file it walked past.
Repro:
Acceptance criteria
_stochastic_singlesplit (Extract Function, Fowler 2018 Ch. 6) so everyfunction in
synaptic_plasticity_stochastic.pyis <= 40 lines, with theexisting test suite passing byte-for-byte unchanged as the behavior-
preservation proof (no test added/modified for the split itself).
test_stochastic_transmission.pysplit along a concern boundary (e.g. onefile per
Test*class family, mirroring thesynaptic_plasticity_*module split) so each resulting file is <= 300 lines, with all existing
tests passing unchanged post-split.
so the split's correctness argument is "unchanged test outcomes" alone.
Not blocking PR #254 itself (already merged, all its own CI green per job) —
tracked here per coding-standards.md §14.3 so it does not become a silent,
un-issued "pre-existing" dismissal.