Repository navigation
Description
Summary
Split the remaining 12 Python files above 500 physical lines by responsibility, pairing implementation changes with their related tests. Measured counts and proposed boundaries are in docs/investigations/file-length-limit.md at develop commit 902c759.
Scope
-
nitrostack/widgets/route_templates.py(870): separate generic, pizza, and flight/order templates; keep a small route dispatcher. -
nitrostack/transports/http.py(797): separate middleware and HTTP assembly helpers. -
nitrostack/widgets/views.py(569): separate route/view dispatch from response and preview handling. -
nitrostack/auth/oauth.py(516): separate OAuth types and token/client/cache operations only along stable dependency boundaries. -
nitrostack/cli/pack.py(507): separate file selection/ignore rules from wheel/vendor assembly. -
tests/test_cli.py(1,568): split lifecycle/ports, generation, packaging/upgrades/validation, and registration. -
tests/test_oauth.py(1,011): split guard/PKCE, metadata/discovery, and introspection/JWKS/cache. -
tests/test_transports.py(732): split HTTP/session lifecycle, protocol/header behavior, and dual transport/progress. -
tests/test_widgets.py(629): split route rendering, resource registration, metadata/host integration, and output assertions. -
tests/test_tasks.py(574): split lifecycle/progress, authorization/cancellation, and store/eviction where boundaries are cohesive. -
tests/test_secret_value.py(515): split construction/serialization, redaction/errors, and integration/security cases. -
examples/flight_booking_server.py(582): separate example-local domain code, MCP definitions, and startup/configuration. -
Keep each resulting hand-maintained Python module at or below 500 physical lines. Move static HTML/JavaScript into non-Python assets where appropriate; document a specific exception if a cohesive module cannot meet the limit.
-
Preserve existing imports with facade re-exports where callers may rely on them. Preserve rendered widget output and example run instructions.
-
Avoid test-module cross-imports and line-count-only reshuffling.
Acceptance criteria
- Every listed over-limit Python file is split along cohesive responsibilities and its resulting Python modules are at or below 500 physical lines, with any exception documented and justified.
- Focused tests cover preserved imports, widget output, transport behavior, and example startup as applicable.
- No unrelated behavior changes or unnecessary import cycles are introduced.
Wait for PR #37 to merge before splitting transports/http.py. Refresh open PR changed-file lists and remeasure from develop before assigning work.
Out of scope: unrelated behavior changes and broad cleanup.
Activity
manish-wekan commentedon Nov 5, 2026
Omit these from splitting.
widgets together, cli+example together, auth separate, transport separate.
@Prateep07