[Feature] lib/services has 93 flat files and a parts/ directory mixing four libraries #632

Closed
opened 2026-07-22 16:21:57 +00:00 by brenno · 2 comments
Owner

Found in the pre-publication architecture review. Relates to #518, which established that the part split quieted the size gate; this is the second cost of that same split.

Evidence: ls lib/services/*.dart | wc -l93 files flat in one directory, alongside eight subdirectories that do follow the convention (git/ 31, privacy/ 35, cve/ 7, s3/, cvss/, net/, info_safety/, finding_templates/ 33). The inconsistency is demonstrable: lib/services/cve_search_service.dart and cve_transport*.dart (4 files) sit flat while lib/services/cve/ exists. Also flat: markdown_* (9), finding_* (6), image_* (5), the mastg/maswe/wstg/miauw catalogues (9), ai_* (4).

And lib/services/parts/ (23 files) is not a subject but a mechanism: it holds the internal parts of four unrelated libraries mixed together — file_service_* (9), marp_html_service_* (11), markdown_service_parse_* (3), slide_quality_analyzer_density.dart.

Why this matters now: an outsider navigates an unfamiliar repository with ls, not with SOURCE_MAP.md. lib/services/parts/ answers the question "what does this belong to" with "to a language construct". This can wait until after publication, but it gets more expensive once there are open pull requests from third parties, because a directory move conflicts with everything.

Proposal: one step — dissolve lib/services/parts/ by placing each part beside its library (lib/services/marp_html/, lib/services/file/, and so on). Pure movement plus updated part paths, and it makes the directory an answer to "which subject" again. Grouping the 93 flat files can follow later, or never.

Found in the pre-publication architecture review. Relates to #518, which established *that* the `part` split quieted the size gate; this is the second cost of that same split. **Evidence:** `ls lib/services/*.dart | wc -l` → **93** files flat in one directory, alongside eight subdirectories that do follow the convention (`git/` 31, `privacy/` 35, `cve/` 7, `s3/`, `cvss/`, `net/`, `info_safety/`, `finding_templates/` 33). The inconsistency is demonstrable: `lib/services/cve_search_service.dart` and `cve_transport*.dart` (4 files) sit flat while `lib/services/cve/` exists. Also flat: `markdown_*` (9), `finding_*` (6), `image_*` (5), the mastg/maswe/wstg/miauw catalogues (9), `ai_*` (4). And `lib/services/parts/` (23 files) is not a subject but a mechanism: it holds the internal `part`s of **four** unrelated libraries mixed together — `file_service_*` (9), `marp_html_service_*` (11), `markdown_service_parse_*` (3), `slide_quality_analyzer_density.dart`. **Why this matters now:** an outsider navigates an unfamiliar repository with `ls`, not with `SOURCE_MAP.md`. `lib/services/parts/` answers the question "what does this belong to" with "to a language construct". This can wait until after publication, but it gets more expensive once there are open pull requests from third parties, because a directory move conflicts with everything. **Proposal:** one step — dissolve `lib/services/parts/` by placing each `part` beside its library (`lib/services/marp_html/`, `lib/services/file/`, and so on). Pure movement plus updated `part` paths, and it makes the directory an answer to "which subject" again. Grouping the 93 flat files can follow later, or never.
Author
Owner

Opgepakt. Tak: refactor/services-parts-opsplitsen-632. Reikwijdte: lib/services/parts/ oplossen — elke part naar een onderwerpmap naast zijn library (file/, marp_html/, markdown_parse/, slide_quality/), de part- en part of-paden bijwerken, en SOURCE_MAP volgen. Pure verplaatsing, geen gedragswijziging; compiler en tests bewaken het. Ik land snel om het conflictvenster klein te houden.

Opgepakt. Tak: `refactor/services-parts-opsplitsen-632`. Reikwijdte: `lib/services/parts/` oplossen — elke `part` naar een onderwerpmap naast zijn library (`file/`, `marp_html/`, `markdown_parse/`, `slide_quality/`), de `part`- en `part of`-paden bijwerken, en SOURCE_MAP volgen. Pure verplaatsing, geen gedragswijziging; compiler en tests bewaken het. Ik land snel om het conflictvenster klein te houden.
Author
Owner

Gepauzeerd door een toolchain-uitval, niet door het werk. De refactor is klaar en lokaal gecommit (verplaatsing van alle parts/ naar file/, marp_html/, markdown_parse/, slide_quality/, met de hardgecodeerde paden in check_audience_boundary.dart, network_sink_guard_test.dart en de docs mee), maar niet gepusht: de Dart/Flutter-toolchain van de machine viel mid-sessie uit — de dart-SDK-cache verdween en flutter segfault bij zelfherstel, precies de instabiele toolchain uit #598. dart analyze lib/ en de SOURCE_MAP-poort waren groen tot dat moment.

Zonder werkende make check land ik dit niet. Zodra de toolchain hersteld is (de openstaande stap van #598), draait de gate en gaat het de deur uit. Blijft in-progress.

Gepauzeerd door een toolchain-uitval, niet door het werk. De refactor is klaar en lokaal gecommit (verplaatsing van alle `parts/` naar `file/`, `marp_html/`, `markdown_parse/`, `slide_quality/`, met de hardgecodeerde paden in `check_audience_boundary.dart`, `network_sink_guard_test.dart` en de docs mee), maar **niet gepusht**: de Dart/Flutter-toolchain van de machine viel mid-sessie uit — de dart-SDK-cache verdween en flutter segfault bij zelfherstel, precies de instabiele toolchain uit #598. `dart analyze lib/` en de SOURCE_MAP-poort waren groen tot dat moment. Zonder werkende `make check` land ik dit niet. Zodra de toolchain hersteld is (de openstaande stap van #598), draait de gate en gaat het de deur uit. Blijft `in-progress`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#632
No description provided.