You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Park, parkSingleNamedLane and switchLaneLocked exceed the 40-line function limit #3265
AGENTS.md sets a < 40-line limit per function. Three functions on the named-lane path exceed it:
Function
File
Lines
Park
cli/internal/worktree/done.go:103
92
parkSingleNamedLane
cli/internal/worktree/sweep.go:392
54
switchLaneLocked
cli/internal/lane/named.go:311
49
Defect
Raised as Finding 3 (Minor) by the independent adversarial review of HARNESS-186-named-lanes-sticky-personas (specs/HARNESS-186-named-lanes-sticky-personas/review.md),
and deliberately ticketed rather than fixed in that PR: the fix is pure extraction with no
behavioural test pinning the boundary, and the review run that found it took 24 minutes.
The concrete risk is not length for its own sake. Park mixes lease-metadata reading, state
transition, git checkout, and user-facing reporting in one body, which is why the --force gap in sweep.go went unnoticed (see the separate sweep ticket).
Fix direction
Extract along the existing seams, keeping behaviour identical:
Park: lease read / state write / git operation / report as four helpers.
parkSingleNamedLane: split the landing decision from the parking action.
switchLaneLocked: split lock acquisition and validation from the switch itself.
Do it with a characterisation test first, so the extraction is provably behaviour-preserving.
Acceptance
All three functions are under 40 lines.
No behavioural change; existing tests pass unchanged.
A characterisation test covers each function's outcome before the extraction.
Activity