refactor(workspace): finish-audit fixes — off-main scan, parser edges, dead code out

Reviewers' findings on 804b588: scan moved off MainActor (Task.detached),
PostLibrary struct folded into Post.scan, hidden dirs and symlinked dirs
now actually skipped (test de-vacuated), unterminated frontmatter no longer
leaks as the Title, quoted YAML values unquoted, leading blank line before
--- tolerated, #-only body reads untitled, persisted Home validated
isFileURL. Dead code deleted: radiusLarge, editorMinWidth, homeKey,
PaneHeader trailing slot, Settings ScrollView, PostRow fill dance.
Tests 56/56, lint 0.

[Generated by AI]
This commit is contained in:
AlexKucera committed 2026-10-01 13:43:25 +02:00
1 parent 804b5889f6
commit 765d32d4d4
10 files changed
+158 -101

No files matched your search

@@ -47,6 +47,28 @@ Ship #17 (S1.1): the workspace shell from the design contract — nav rail (Post
- Lint: `swiftlint Museion/ MuseionTests/` → 0 violations; SwiftFormat clean on changed files
- Live: app launched, gate sheet passed and dismissed via AX, workspace rendered (rail/Posts/editor/mentor verified by screenshot); window-resize collapse fix built but final visual pass blocked by a fullscreen break timer — needs one manual look
## Finish Audit (same day)
Three fresh-context reviewers (ponytail / security / general) over `804b588`. Accepted and fixed:
| Fix | Source |
|-----|--------|
| Scan off-main: `Task.detached { Post.scan(home:) }` in `.task(id:)` — MainActor-inherited synchronous scan froze the UI on big Homes | security MEDIUM-1 + review |
| `PostLibrary` struct → `Post.scan(home:) -> [Post]` (wrapper with one field, unused Equatable) | ponytail |
| Hidden-dir skip now real (dot-prefix guard) — the AGENTS.md claim was code-less and the test vacuous; test now writes a `post.md` into `.trash/` | review MEDIUM + security INFO-5 |
| Unterminated frontmatter returns `untitled` (was leaking `pass_state: …` as Title) | review MEDIUM |
| Quoted YAML values unquoted (`origin: "ai"` → `.ai`) | review MEDIUM |
| Leading blank line before `---` no longer defeats frontmatter detection (both parser funcs) | review LOW |
| `#`-only body → `untitled` (was empty string) | review LOW |
| Symlinked post dirs skipped (one resourceValues guard, single fetch) | security LOW-3 |
| Persisted home validated `isFileURL` (fails closed to default; hygiene) | security LOW-2 |
| Dead code out: `radiusLarge`, `editorMinWidth`, `homeKey`; `PaneHeader` trailing slot; Settings ScrollView; PostRow optional-fill dance; `availableWidth` default | ponytail |
Discarded as speculative: read-cap on file heads (detached hop fixes the hang; #18 owns growth), UserDefaults round-trip test (shared test host).
Tests 56/56 (4 new: quoted values, symlink, unterminated frontmatter, leading blank). Lint 0.
## Files Changed
| File | Change Summary |