testsAndMisc/docs/superpowers/contracts/focus-owner-dart-split-2026-08-16.json
Krzysztof kuhy Rudnicki d9982e53dd Split the focus_owner Dart files under the cap
main.dart 538 -> 130, policy.dart 272 -> 85, enforcement_status_card.dart
268 -> 145, plus both test files.

Every lib split uses part/part of rather than import. The first attempt
used import+export and the analyzer gave 30 errors like "The name
'_Card' isn't a class": Dart privates are visible to the whole LIBRARY,
and a separate file is a separate library unless it is a part.

The test splits separated groups from the testWidgets() calls that had
been initialising the binding implicitly, so four tests failed with
"Binding has not yet been initialized" - both halves now call
ensureInitialized() explicitly.

94 tests passing before and after; flutter analyze reports no issues.
focus_owner/analysis_options.yaml has an uncommitted change from an
earlier session and is deliberately left unstaged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 20:39:13 +02:00

19 lines
1.4 KiB
JSON

{
"title": "Split the focus_owner Dart files under the 250-line cap",
"objective": "Bring main.dart (538), policy.dart (272), enforcement_status_card.dart (268), widget_test.dart (351) and policy_test.dart (253) under the cap, using Dart's part/part of where private declarations cross the seam.",
"acceptance_criteria": [
"flutter test reports exactly 94 passing tests, the same as before the split.",
"flutter analyze reports no issues at all: no errors, no warnings, no infos.",
"Library-private declarations that cross a seam use part/part of rather than import. Dart privates are library-scoped, so a plain import cannot see them and the analyzer rejects it outright.",
"No test is deleted, skipped or weakened; whole groups move verbatim.",
"A split that separates a group from the testWidgets() calls that implicitly initialised the binding must add TestWidgetsFlutterBinding.ensureInitialized() explicitly to BOTH halves.",
"focus_owner/analysis_options.yaml carries a pre-existing uncommitted change made by someone else and must NOT be staged."
],
"out_of_scope": [
"The Kotlin sources under android/, which are a separate commit.",
"Changing what any test asserts.",
"Committing the unrelated analysis_options.yaml modification."
],
"verifier": "flutter test (expects 94 passed), flutter analyze (expects 'No issues found!'), and check_file_length.sh over focus_owner."
}