Optional follow-up from #238, where the measurement showed that describe
needs no new infrastructure to leave app.py.
Measurement
On main at 655f38e, the describe flow is 7 methods / 179 lines and
touches 19 app attributes, of which the existing seams already cover 12:
| Covered by |
count |
ViewState |
4 |
UiSurface |
4 |
WriteGate |
4 |
| would need injecting |
7 |
The seven: _get_events, _get_manifest (data getters, the same shape
ForwardController already takes), _mark_agent_action,
_approval_dialog_active (agent coordination), and
_agent_panel_expanded, _provider_footer, query_one (layout).
For comparison: OperatorController takes 8 and ShellController 11.
Why this is optional, not owed
#187 closed on coupling criteria rather than a line count, and those
criteria are met. This slice removes ~179 lines and adds a seventh
controller; the case for it is that describe is self-contained and cheap,
not that app.py is still too big.
The case against is equally worth stating: every extraction so far cost
about one regression caught in review, and found zero pre-existing defects.
That is a real price for a cohesive 179-line area that is not currently
hard to work in.
If it is done
- Characterization tests first —
describe has an agent entry point
(agent_open_describe) as well as the d key, and both must keep
behaving identically.
- The
:ctx error path (_describe_ctx_error) and the precheck's
fail-open semantics are the parts most likely to be broken silently.
docs/dev/ui-controllers.md records the extraction order and would need
updating.
Optional follow-up from #238, where the measurement showed that
describeneeds no new infrastructure to leave
app.py.Measurement
On
mainat655f38e, thedescribeflow is 7 methods / 179 lines andtouches 19 app attributes, of which the existing seams already cover 12:
ViewStateUiSurfaceWriteGateThe seven:
_get_events,_get_manifest(data getters, the same shapeForwardControlleralready takes),_mark_agent_action,_approval_dialog_active(agent coordination), and_agent_panel_expanded,_provider_footer,query_one(layout).For comparison:
OperatorControllertakes 8 andShellController11.Why this is optional, not owed
#187 closed on coupling criteria rather than a line count, and those
criteria are met. This slice removes ~179 lines and adds a seventh
controller; the case for it is that
describeis self-contained and cheap,not that
app.pyis still too big.The case against is equally worth stating: every extraction so far cost
about one regression caught in review, and found zero pre-existing defects.
That is a real price for a cohesive 179-line area that is not currently
hard to work in.
If it is done
describehas an agent entry point(
agent_open_describe) as well as thedkey, and both must keepbehaving identically.
:ctxerror path (_describe_ctx_error) and the precheck'sfail-open semantics are the parts most likely to be broken silently.
docs/dev/ui-controllers.mdrecords the extraction order and would needupdating.