integrate main: #193 PostsModel split (Watcher/Writes/Imports) into failed-flush departure guard
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
# Conflicts: # Museion/PostsModel.swift # docs/devlog/INDEX.md
This commit is contained in:
commit
ffb9457a63
47 files changed
+3272
-1811
No files matched your search
@@ -0,0 +1,73 @@
|
||||
# Port classis full-test.sh as the Museion verify rail + pre-push hook
|
||||
|
||||
> **Date:** 2026-11-17
|
||||
> **Type:** issue
|
||||
> **Reference:** https://git.babylondreams.de/AlexKucera/Museion/issues/190
|
||||
|
||||
## Goal
|
||||
|
||||
One command verifies a branch: port classis's `scripts/full-test.sh` (source commit 071966e) to Museion with the same CLI (`run` / `start` / `status` / `summary`), encoding the suite learnings (#33/#179 bundle race, #31/#178 xcresult authority, #31/#134 vacuous green, #30/#147 serialized rerun, #134 wedge family, #177 detached pattern), plus the hook pair (`install-hooks.sh` + pre-push lint gate, no-push-while-live, autofix-tree guard). The 2026-11-16 retro measured this loop at 29% of all session terminal calls.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- `scripts/full-test.sh` — classis port adapted to Museion: scheme Museion, `Museion.xcodeproj` at root, `-destination 'platform=macOS'`, default test selection `-only-testing:MuseionTests` (dropped the moment the caller forwards their own `-only-testing` — union semantics would make a finer filter a no-op), no default parallel flags (`--workers N` opts in, `--serialized` is the #30/#147 rerun hatch), header maps every encoded behavior to its Museion issue numbers.
|
||||
- `scripts/install-hooks.sh` — idempotent `git config core.hooksPath scripts/hooks`, with a trust note (versioned hooks = repo content executes at push).
|
||||
- `scripts/hooks/pre-push` — (1) blocks push while ANY full-test run is live (scans all run dirs, not just `current`); (2) lint gate scoped to the PUSH's Swift files; (3) autofix guard: a swiftformat pass that rewrites files after verification fails the push.
|
||||
- `scripts/test-full-test.sh` — in-tree pre-push acceptance rig: disposable bare+clone, real hook + real lint tools, 23 checks over every push shape, with an executed-count guard on the verdict.
|
||||
- DOX: root AGENTS.md commands + `scripts/` Child DOX Index row; MuseionTests/AGENTS.md Verification names the rail; `.gitignore` += `_build/`.
|
||||
- Finish-audit (4 rounds × 3 reviewers) — accepted fixes: merge-base delta gating for new-ref pushes, delete-ref skip, `--scheme` path guard, fail-closed on unscopable history, full `refs/remotes/origin/main` spelling (anti-tag-shadow), rig's vacuous first check + count guard.
|
||||
|
||||
## Verification (step-2 gates, 2026-11-17)
|
||||
|
||||
- `./scripts/full-test.sh run` — **692 executed / 692 passed / 0 failed / 0 skipped**, exit 0 (run twice through the rail itself).
|
||||
- `./scripts/test-full-test.sh` — **23/23**, exit 0; all four hook guards flip-verified in both directions this session.
|
||||
- `swiftformat .` — 0/141 files formatted, exit 0.
|
||||
- `swiftlint lint --quiet` — exit 2 from **pre-existing** error-severity findings (59 in `spike/`, 1 in `MuseionTests/PolishSeamTests.swift:34`); this diff touches zero Swift — outside the seam, named here per the finish-up exception.
|
||||
- `node .gitnexus/run.cjs detect-changes` — 3 files, 22 doc symbols, 0 affected processes, risk low (index-relative; the untracked scripts carry no indexed symbols).
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Pre-push lint gate scoped to the pushed diff's Swift files | Bare `swiftlint .` exits 2 on main (spike/ + one tests file) — a repo-wide gate would block every push forever. The gate guards the push's own files; no Swift in the push → nothing to gate. |
|
||||
| New-ref pushes lint the merge-base delta vs `refs/remotes/origin/main`; no resolvable base fails closed | Whole-tree lint on a new branch hits the same pre-existing violations (always-block); a silent skip is a vacuous pass — the #31/#134 class. Orphan-history/missing-ref pushes refuse loudly. |
|
||||
| Hardcoded `refs/remotes/origin/main`, not `$1`-derived | Ponytail + security converged: `$1` (remote name or URL) breaks bootstrap pushes to new remotes, URL-direct pushes, and master-default remotes — and buys nothing on a single-remote repo. Full-ref spelling also defeats `refs/tags/origin/main` shadowing (git resolves short refs through refs/tags/ first). |
|
||||
| Vacuity gate on `passed + failed == 0` (skipped ≠ executed) | A filter matching only skipped tests has zero executed tests; per AC3 that must fail, and "0 passed / 0 failed / N skipped" with exit 0 is a vacuous green. |
|
||||
| No `scripts/AGENTS.md` child doc | Contracts live in each script's header + root AGENTS.md index row; four files don't warrant a new doc layer. |
|
||||
| Classis port fidelity kept (CLI flags, FT_BASE_DIR, allocator walk vs mktemp, status-branch structure) | Upstream alignment: classis bug fixes keep flowing into this copy; deviations were only made where Museion's reality differs (single bundle, default unit-scope filter). |
|
||||
| Rig verdict = executed-count guard (`n_checks == 23`), never the banner | The repo's own #31 rule; a deleted/dead check fails loudly (flip-proven: disabling one check yields "22/23 executed"). |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| `swiftlint --quiet \| tail -3; echo $?` reported exit 0 while swiftlint exits 2 | Pipe reports the LAST command's exit — the pager's, not the gate's | Run gates bare or read `$?` from the un-piped command; caught the hook's repo-wide gate shipping unpassable this way |
|
||||
| Rig's first check never executed ("22/22" was 23 checks with one dead) | `check` called at line 30, defined at line 33 — bash defines functions incrementally; `set -uo` without `-e` swallows the 127 | Hoisted `fails=0`/`check()` above the first call + executed-count guard; all three round-4 reviewers reproduced it |
|
||||
| First push of any new branch was unconditionally blocked | Zero-sha remote ref took the whole-tree ls-tree path → spike/'s 59 error-severity violations | Merge-base delta vs `refs/remotes/origin/main` |
|
||||
| Delete pushes printed `fatal: bad object 000…` | `git diff $rsha $zero-sha` on ref deletions | `[[ "$lsha" == "$zero" ]] && continue` before the diff |
|
||||
| A reviewer staged a stale `pre-push` into the index | Read-only ban violated via `git add` while checking an exec bit | `git restore --staged` + explicit re-verification of `git status` after every fanout; later goals said "check modes with ls -l" |
|
||||
| Rig bootstrap broke after the fail-closed fix | The rig's bare repo starts empty — its own first push is a new-ref create with no default ref | Bootstrap seeded with `--no-verify` BEFORE hook activation (a fresh remote's first push is --no-verify by definition) |
|
||||
| Orphan fixture push sailed through | `git rm -qrf .` in the orphan branch deleted the hook itself | `git checkout main -- scripts …` to keep the hook in the orphan tree |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `scripts/full-test.sh` | new — detached, xcresult-authoritative verify rail (567-line classis port, Museion-adapted) |
|
||||
| `scripts/install-hooks.sh` | new — core.hooksPath installer with trust note |
|
||||
| `scripts/hooks/pre-push` | new — live-run scan + push-scoped lint gate + autofix guard |
|
||||
| `scripts/test-full-test.sh` | new — 23-check pre-push acceptance rig with executed-count guard |
|
||||
| `AGENTS.md` | commands section (rail/summary/install/rig), `scripts/` Child DOX Index row |
|
||||
| `MuseionTests/AGENTS.md` | Verification names the rail as the sanctioned verify path |
|
||||
| `.gitignore` | `_build/` (run dirs, logs, bundles) |
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [ ] `./scripts/install-hooks.sh` once per clone (core.hooksPath is local config)
|
||||
- [ ] Pre-existing lint debt: `spike/` (59 error-severity) + `MuseionTests/PolishSeamTests.swift:34` keep bare `swiftlint .` red on main — tuning `.swiftlint.yml` (classis-style disables or excludes) is a separate ticket
|
||||
- [ ] Deferred port: classis's 25KB `test-full-test.sh` stub harness for the RUNNER itself (this session pinned the hook only; the rail's ACs were verified via one-off scratch harnesses)
|
||||
- [ ] Rejected-with-rationale (audit record): versioned-hooks/formatter-config/forgeable-verdict/symlink/OSC/pidfile-DoS family (repo-write already = code-exec via Swift tests; same-uid ceiling), mktemp-vs-allocator (upstream fidelity), `base==lsha` harden (no-new-content push is a correct pass)
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
# Collapse the gate-running AGENTS.md learnings into the verify-rail pointer
|
||||
|
||||
> **Date:** 2026-11-17
|
||||
> **Type:** issue
|
||||
> **Reference:** https://git.babylondreams.de/AlexKucera/museion/issues/192
|
||||
|
||||
## Goal
|
||||
|
||||
Shrink root AGENTS.md's testing learnings to what `scripts/full-test.sh` cannot encode: the gate-running recitals (executed-count-not-banner #31/#178, newest-bundle race #33/#179, build/test split #177, vacuous filters #31/#134, the #30 flake ritual, the #182 stale-green corollary, the lint-gate scoping recital) collapse into one pointer line; test-authoring rules stay; MuseionTests/AGENTS.md Verification names the script instead of the raw xcodebuild line.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- Root `AGENTS.md` Testing section: deleted 7 gate-running bullets, added the one-line pointer — gate rules are encoded in `scripts/full-test.sh` (#190), run `start` + `status`, never hand-rolled xcodebuild/xcresult incantations
|
||||
- Root `AGENTS.md` Tooling & gates: deleted the lint-gate-scoping sentence from the lint bullet (survives verbatim in `scripts/hooks/pre-push` header + scoping loop; `#191` closed as superseded — tree went green, no baseline file ever landed)
|
||||
- `MuseionTests/AGENTS.md` Verification: deleted the raw xcodebuild line; the section now names only `./scripts/full-test.sh start` + `status`
|
||||
- Root Commands block: annotated the raw `xcodebuild … test` line as ad-hoc/outside-the-rail so it no longer contradicts the pointer (review follow-up)
|
||||
- Scoped the pointer's "everything below" to "the rest of this section" — it had swept in the heading-less format bullets and the Trust boundaries section (review follow-up)
|
||||
- Two-axis review (parallel subagents: Standards + Spec) — Spec verified all 8 deletion mappings against the script *body*, not just header claims (zero-executed VACUOUS fail at `full-test.sh:431-449`, pinned `-resultBundlePath` at `:190`, `--serialized` at `:192`)
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Deletion test = "can the script encode it?" | Issue AC2: authoring rules retained, nothing deleted the script does not encode. Each of the 8 deletions maps to verified script/hook behavior (table in the issue comment trail / commit body) |
|
||||
| Keep #197 stale-binary learning | `full-test.sh` does not verify `SwiftCompile` lines — the trap survives even scripted runs |
|
||||
| Keep #134 reboot remedy | Script *detects* the wedge family via per-test timeouts but cannot encode "reboot the machine"; the emergency workaround (standalone `swift <file>` check) is machine-level knowledge |
|
||||
| Delete #182 despite partial encoding | Encoded by obviation: the sanctioned rail builds+tests in one detached run, so no built-products-vs-sources gap exists; mid-run-edit residual is covered by the hook's no-push-while-live guard + kept #197 |
|
||||
| Keep lint green-contract sentence, delete only the gate-scoping sentence | The green contract is #197's documented state; the scoping recital duplicates the pre-push hook header (DOX: no duplication where the script header is the contract's home) |
|
||||
| Authoring halves of deleted bullets survive in the child | MuseionTests/AGENTS.md already carries suite-name-filter notes (L15, L28), spawnsTicker/`#30/#147` family (L27), keychain/makeHome guidance (L24) — untouched |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| Pointer line claimed "everything below is test authoring" | The section below also holds format-shape bullets and flows into Trust boundaries — sentence overshot its scope | Rescoped to "the rest of this section is authoring rules the script cannot encode" |
|
||||
| Commands block still listed bare `xcodebuild … test` beside the new "never hand-rolled incantations" pointer | Pre-existing tension, aggravated by the new prohibition | Annotated the line: ad-hoc run incl. UI smoke (outside the rail), full-suite verification → full-test.sh |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `AGENTS.md` | 8 gate-running learnings → one verify-rail pointer; lint recital sentence dropped; Commands annotation; GitNexus auto-managed counter refresh (7035→7044 nodes) |
|
||||
| `MuseionTests/AGENTS.md` | Verification names only `./scripts/full-test.sh` (raw xcodebuild line deleted) |
|
||||
|
||||
## Verification
|
||||
|
||||
- `swiftformat --lint .` → 0/141 require formatting; `swiftlint` → 0 findings (read-only checks, run before the suite so the green attaches to exact bytes)
|
||||
- `./scripts/full-test.sh start` + `status` → **693 executed / 693 passed / 0 failed / 0 skipped**, xcodebuild exit 0
|
||||
- `gitnexus detect-changes` → 2 files, 19 symbols (docs-shaped only), 0 affected processes, risk low
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- None — commit body carries the deletion→script-behavior mapping table (AC1); `Closes #192` auto-closes on push.
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
@@ -0,0 +1,68 @@
|
||||
# Split the fat files along the PostsModel pattern (#193)
|
||||
|
||||
> **Date:** 2026-11-17
|
||||
> **Type:** issue
|
||||
> **Reference:** https://git.babylondreams.de/AlexKucera/Museion/issues/193
|
||||
|
||||
## Goal
|
||||
|
||||
Split the 2026-11-16 retro's three most-re-read files — PostsModel.swift, WorkspaceView.swift, PostsPaneView.swift — into cohesive extension files the way PostsModelPasses / PostsModelCards already split PostsModel. Mechanical, module-internal moves: symbols keep names and module, zero call-site edits, zero behavior change, one commit per source file, Museion/AGENTS.md map gains the new entries.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- `PostsModel.swift` 775 → 325 lines; split into `PostsModelWatcher.swift` (151 — `PostsWatcher`, `bind`, `startWatching`, `rescan`), `PostsModelWrites.swift` (233 — `performWrite` rail, `flushOrAbort`, rename/trash, #108 project ops), `PostsModelImports.swift` (104 — external guest, import batch). Commit `902e860`.
|
||||
- `WorkspaceView.swift` 852 → 426; split into `ArchivePaneView.swift` (176), `WorkspaceViewSheets.swift` (189 — the four house ask sheets), `WorkspaceChrome.swift` (96 — `SelectedRowStrip`/`BorderedSecondaryButtonStyle`/`PaneHeader`). `RailButton` stayed in-core (its only caller is the rail; keeps `private`). Commit `70cd1c2`.
|
||||
- `PostsPaneView.swift` 776 → 186; split into `PostsLibraryColumn.swift` (521 — column + rename/move sheets + file-scope `librarySearch` + `LaunchFocusReset`) and `LibraryPostRow.swift` (94 — reused by the Archive pane). Commit `2a02b95` (amended with the audit fix).
|
||||
- Moves executed by a boundary-asserted Python range script: 68 exact line-content checks on PostsModel (plus equivalents on the views) before any write; every new file verified byte-identical to its extracted ranges; each boundary assert names the line it expected so a miss fails loudly.
|
||||
- 15 access widenings `private`→internal, each structurally required (Swift admits `private` members only to same-file extensions): 10 PostsModel members (6 carrying `/// #193: setter internal — <owner>` lines in the #146 convention), `ArchivePaneView`, and the 4 sheet structs (disclosed in their file headers).
|
||||
- Import hygiene: `import CoreServices` dropped from PostsModel core (FSEvents moved); `import AppKit` dropped from PostsPaneView after the audit (LaunchFocusReset was its last AppKit user).
|
||||
- DOX pass: Museion/AGENTS.md map — 8 new file bullets, the 3 parent bullets rewritten, moved-detail sentences relocated to the owning bullets, one stale `private(set)` doc claim corrected.
|
||||
- finish-audit (3 fresh-context reviewers): move-only confirmed by a third independent method (per-line counters / normalized line-multiset); security PASS with all trust-boundary guards verified byte-identical and the write-rail call graph intact; one LOW fixed (the AppKit import), one LOW deferred.
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Widen privates (option A) over keeping private-touching methods in-core (option B) | Option B left the core at ~520 lines with incohesive domains; option A lands 325 and matches the repo's #146 precedent exactly ("setter internal — the split-out domain extensions set it"). The widenings are module-internal only. |
|
||||
| One commit per source file, with each commit's slice of the AGENTS.md map | The AC's revert-independence. The map's first hunk interleaved two splits' adjacent bullet lines, so plain `git add -p` couldn't separate them — solved by staging asserted intermediate versions of AGENTS.md (HEAD+split1 edits, +split2 edits, final), verified equal to a from-HEAD reconstruction. |
|
||||
| PostsLibraryColumn keeps its sheets, search mount, and focus rider at 521 lines | They travel with the post rows by the file's own documented contract; cohesive and far under the 800 ceiling. Splitting them out would scatter one surface across files. |
|
||||
| RailButton stays in WorkspaceView.swift | Only the nav rail instantiates it; moving it would force a widening for zero cohesion gain. |
|
||||
| No new tests | Zero behavior change by construction; the existing 693-test suite is the pin (AC forbids behavior change). |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| GitNexus `impact`/`detect-changes` abort with "Multiple repositories indexed. Specify repo" but reject the very label format they print | CLI registry disambiguation quirk | `--repo /absolute/path/to/repo` works; used for all subsequent calls |
|
||||
| Root AGENTS.md showed an unrequested diff hunk (GitNexus counters 7044→7072) after `analyze` | The index run rewrites the auto-managed `gitnexus:` block | Reverted the hunk (auto-managed, re-bumps on the next index); reviewers confirmed no other scope creep |
|
||||
| An over-broad guard (`"FSEvent" not in core_text`) false-tripped on prose | Doc comments mention "the FSEvents window" — substring guards match prose | Tightened guards to the exact import line / API symbol (`import CoreServices`, `FSEventStream`) |
|
||||
| `import AppKit` left behind in PostsPaneView.swift | I deliberately didn't touch imports at split time ("code unchanged" posture); the compiler has no unused-import warning | Caught by the finish-audit general reviewer; dropped and amended into the split commit |
|
||||
| `detect-changes` reports "No changes detected" at wrap-up | The session's own mid-flight `analyze` already synced the index to the tree — clean by construction | Reported as index-relative; the real affected-scope check is the pre-analyze run (163 symbols / 73 flows, all relocations) plus the diff-scope reviews |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `Museion/PostsModel.swift` | 775→325; core keeps properties, draft lifecycle, select, Cold Turkey mirrors; 10 widenings |
|
||||
| `Museion/PostsModelWatcher.swift` | new — PostsWatcher + bind + startWatching + rescan |
|
||||
| `Museion/PostsModelWrites.swift` | new — #179 write rail + structural ops |
|
||||
| `Museion/PostsModelImports.swift` | new — external guest + import batch |
|
||||
| `Museion/WorkspaceView.swift` | 852→426; keeps WorkspaceView + RailButton |
|
||||
| `Museion/ArchivePaneView.swift` | new — #108 Archive pane (private→internal) |
|
||||
| `Museion/WorkspaceViewSheets.swift` | new — 4 house ask sheets (private→internal) |
|
||||
| `Museion/WorkspaceChrome.swift` | new — shared chrome (SelectedRowStrip, BorderedSecondaryButtonStyle, PaneHeader) |
|
||||
| `Museion/PostsPaneView.swift` | 776→186; keeps the pane layout only |
|
||||
| `Museion/PostsLibraryColumn.swift` | new — library column + sheets + search mount + LaunchFocusReset |
|
||||
| `Museion/LibraryPostRow.swift` | new — shared post row |
|
||||
| `Museion/AGENTS.md` | map: 8 new bullets, 3 parents rewritten, detail relocated to owners |
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [x] Close #193 (rides the docs commit: `Closes #193`)
|
||||
- [ ] Known limitation, documented in code + map: `watchedHome`'s single-writer invariant is doc-convention now, not compiler-enforced (security reviewer: Low, no reachable exploit, discipline verified holding) — revisit only if PostsModel ever gains a second Home writer
|
||||
|
||||
---
|
||||
|
||||
**Verification:** `xcodebuild build` SUCCEEDED (SwiftCompile lines confirmed for every split file — no stale-binary serve); `./scripts/full-test.sh` run `20261117T165454Z`: **693 executed / 693 passed / 0 failed / 0 skipped, exit 0**, on the exact final bytes (audit fix included; the subsequent amend changed no file bytes); `swiftlint .` 0 violations; `swiftformat .` 0/149. GitNexus re-indexed (7,072 nodes / 36,395 edges).
|
||||
|
||||
*Log written by write-log skill*
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
# Close out: repo-wide swiftlint green becomes the documented lint contract (#197)
|
||||
|
||||
> **Date:** 2026-11-17
|
||||
> **Type:** issue
|
||||
> **Reference:** https://git.babylondreams.de/AlexKucera/Museion/issues/197
|
||||
|
||||
## Goal
|
||||
|
||||
With #195 and #196 done, make the docs and code comments honest about repo-wide lint being green: refresh the pre-push hook's stale "pre-existing violations" rationale (gate semantics unchanged), prune/replace the stale #190 learning in AGENTS.md, confirm the root lint line is literally true — and land a green full unit suite.
|
||||
|
||||
Tree composition note: the working tree also carries the uncommitted #194/#195/#196 batches (lint policy, test renames + `.swiftformat` name-format pin, warning-fix sweep) from earlier sessions today; this session implemented #197 on top, then ran a three-reviewer finish-audit over the whole 27-file diff.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- `scripts/hooks/pre-push` — all three stale rationale blocks refreshed (header "pre-existing findings", gate block "a bare `swiftlint .` gate can never pass", NEW-ref note "pre-existing violations could never clear it") to the settled #190 design wording. Comment-only; gate logic byte-identical (reviewer grep-verified).
|
||||
- `AGENTS.md` — the Tooling & gates learning rewritten to the true contract: repo-wide lint green (#194 policy, #195/#196 cleared every finding, `spike/` excluded as unbuilt), bare `swiftlint .` = 0 violations + `swiftformat .` reformats nothing, gates stay push-scoped. Root lint line confirmed literally true by execution.
|
||||
- `MuseionTests/LibrarySearchTests.swift` — hardened `an unchanged rescan keeps the revision` against a pre-existing watcher-race flake: two FSEvent-burst rescans can snapshot the shared `PostScanCache` miss count before either stamps it, double-counting one first read → `contentRevision` double-bump (benign over-invalidation). The test now quiesces the burst (bounded 20 × 0.5 s stability loop, own deadline, post-loop `#expect`) before snapshotting. Suite scenario header names the fourth pin.
|
||||
- Finish-audit (3 parallel reviewers: ponytail / security / general over the full uncommitted diff):
|
||||
- Reviewer's "dead symlink clause" bug in `LearningsIndex.isPlainDirectory` **disproved by scratch probes** — `&&` out-binds `??` (`a ?? false && b` parses as `(a ?? false) && b`; second `??`/`&&` precedence claim probe-settled in this repo, see #26) and `URL.resourceValues` is lstat-style (symlink-to-dir → `isDirectory=false`). Kept parens + doc as readability hygiene; the expression had fooled a capable reviewer.
|
||||
- `Museion/LearningsPaneView.swift` — guard reordered so the cheap rejections (`isPlainDirectory`, dot-prefix) short-circuit before the directory listing.
|
||||
- `MuseionTests/LearningsPaneTests.swift` — new pin `a symlinked type dir never surfaces` (the documented "same skip posture as Post.scan" contract was unpinned). Flip-verified: the contract is **defended in depth** (lstat guard AND `contentsOfDirectory`'s own refusal of a symlinked entry URL) — the pin fails only when both go traversal-shaped (fileExists guard + resolved-URL listing failed the pin + a sibling pin; restored green).
|
||||
- `Museion/MentorSessionModel.swift` — pre-existing `sessions.json` world-readable sub-second window (atomic write → 0o600 chmod) parked with a `ponytail:` ceiling comment naming the upgrade path (createFile-0600 + rename).
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Fix the LibrarySearchTests race in the TEST, not the model | The model's revision over-bump only over-invalidates a search snapshot (conservative-safe); serializing rescans or making the miss counter race-free is real machinery for a signal that tolerates false positives. The test's timing assumption was the bug (#147 family). |
|
||||
| Keep parens in `isPlainDirectory` despite the finding being disproved | Behavior-identical, two characters, and the bare form demonstrably costs reviewer time — this audit burned a slot misreading it. |
|
||||
| Symlink pin added although no behavior changed | The documented contract was unpinned; the flip cycle showed it is held up by two accidental mechanisms, exactly the kind of seam a future "simplification" breaks silently. |
|
||||
| Chmod window parked, not fixed | Pre-existing, local-only, single-user workstation threat model; from-creation 0600 changes a pinned write path — ceiling comment names the trigger (hostile local account). |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| Full suite failed 1/692 on first run (`an unchanged rescan keeps the revision`, `contentRevision 2 ≠ 1`) | Two FSEvent-burst rescans double-count one shared `PostScanCache` miss; the test snapshotted mid-burst | Quiesce loop before snapshotting; verified in isolation (7/7), full (693/693) |
|
||||
| Flip cycle "passed" with the guard flipped — twice | **xcodebuild served stale binaries**: a source edit made seconds before invocation was not compiled (zero `SwiftCompile` lines, suite start 3 s after invocation) | `touch` the file and verify `SwiftCompile` lines in the run log before trusting any green; with that, guard-flip green → both-belts flip red → restored green |
|
||||
| Reviewer precedence claim contradicted the code's comment | `a ?? b && c` precedence is genuinely easy to misread (this repo's second such dispute) | Scratch probes settle it empirically — never rewrite comments on a reviewer's word |
|
||||
| `swiftlint` line_length (187 chars) after the guard reorder | swiftformat merges adjacent guards into one long condition list | Wrap the call arguments inside the condition (the shape the same function already uses for its root listing); format-stable on re-run |
|
||||
| Rail scoped reruns looked green during the flip | Stale-build hazard above | Always confirm compile lines in the run log for rapid edit→test cycles |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `scripts/hooks/pre-push` | Three stale rationale comment blocks refreshed; logic untouched |
|
||||
| `AGENTS.md` | Tooling & gates learning rewritten to the true lint contract |
|
||||
| `MuseionTests/LibrarySearchTests.swift` | Quiesce loop hardening + scenario header names the settled-state pin |
|
||||
| `Museion/LearningsPaneView.swift` | Guard reorder, parens + doc on `isPlainDirectory` |
|
||||
| `MuseionTests/LearningsPaneTests.swift` | New symlink-skip pin with flip-verified doc |
|
||||
| `Museion/MentorSessionModel.swift` | Ceiling comment on the roster chmod window |
|
||||
|
||||
(The commit also carries the #194/#195/#196 batches from earlier sessions: `.swiftlint.yml`, `.swiftformat`, `MuseionTests/AGENTS.md`, `PolishSeamTests.swift`, and the #196 warning-fix sweep across 11 app files + test files + `prototypes/GateUIPrototype.swift`.)
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [ ] User: commit + push (carries `Closes #197`; #194–#196 already closed on the tracker), verify auto-close
|
||||
- [ ] Candidate project learning: xcodebuild can skip recompiling a source edited seconds before invocation — flip/edit-test cycles must `touch` and verify `SwiftCompile` lines in the run log
|
||||
- [ ] Parked: roster 0600-from-creation if a hostile local account ever matters (`Museion/MentorSessionModel.swift` ceiling comment)
|
||||
|
||||
## Verification
|
||||
|
||||
- `swiftlint .` — 0 violations / 130 files, exit 0
|
||||
- `swiftformat .` — 0/141 formatted, tree unchanged
|
||||
- `./scripts/test-full-test.sh` — 23/23 hook acceptance checks
|
||||
- `./scripts/full-test.sh` — **693 executed / 693 passed / 0 failed** (run `20261117T151013Z-Museion`; no source file newer than the run — the green attaches to the committed bytes)
|
||||
- GitNexus: `detect-changes` risk **critical** (breadth: 100+ symbols across the four-ticket mechanical batch — affected-scope checked by the 3-reviewer fanout, probes, and the suite); `analyze` reindexed (7,035 nodes / 34,056 edges)
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
@@ -5,6 +5,10 @@ Complete history of session logs in this directory, newest first. One-line summa
|
||||
<!-- write-log: full-index -->
|
||||
| Date | Type | File | Summary |
|
||||
|------|------|------|---------|
|
||||
| 2026-11-17 | issue | [20261117-issue193-split-fat-files-along-postsmodel-pattern_log.md](20261117-issue193-split-fat-files-along-postsmodel-pattern_log.md) | Three most-re-read files split into 8 domain-extension files, move-only (three audits concur); 693/693 |
|
||||
| 2026-11-17 | issue | [20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md](20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md) | Root gate-running learnings collapse into the full-test.sh pointer; 8 deletions mapped to script/hook behavior; authoring rules retained; 693/693 |
|
||||
| 2026-11-17 | issue | [20261117-issue197-repo-wide-swiftlint-green-documented-lint-contract_log.md](20261117-issue197-repo-wide-swiftlint-green-documented-lint-contract_log.md) | Lint-green doc truth (#197) + finish-audit; watcher-race test quiesced, symlink pin flip-verified, stale-xcodebuild hazard found; 693/693 |
|
||||
| 2026-11-17 | feat | [20261117-issue190-full-test-verify-rail-pre-push-hook_log.md](20261117-issue190-full-test-verify-rail-pre-push-hook_log.md) | Classis full-test.sh ported as the verify rail + pre-push hook; 4-round finish-audit; suite 692/692 via the rail, hook rig 23/23 |
|
||||
| 2026-11-16 | fix | [20261116-failed-flush-discarded-on-document-switch_log.md](20261116-failed-flush-discarded-on-document-switch_log.md) | Unticketed fix (brief-25, argus cycle-4): document departure aborts on a failed flush — one sessionMayDepart gate (flushOrAbort's conflict+flush gates) behind dismissExternal/departOpenDocuments and select/openUnguarded; both navigation families pinned RED-first (6 pins); unit suite 699 green ×2 |
|
||||
| 2026-11-13 | opt | [20261113-fold-typing-budget-pin_log.md](20261113-fold-typing-budget-pin_log.md) | Unticketed pin (brief-24): typing-cost guard for the #142 re-key — per-call line-scan observer through the real keystroke pipeline; zero scans beside a fold at N/2N, exact-count control 206/406, mutation-checked |
|
||||
| 2026-11-13 | opt | [20261113-cold-turkey-full-tokenization_log.md](20261113-cold-turkey-full-tokenization_log.md) | Unticketed opt (argus digest): minutes feeds skip word counting entirely; DraftStats.words count-only — no token array per keystroke; +3 pins (RED-first rail-trip seam, corpus equivalence), suite 684 |
|
||||
|
||||
Reference in new issue
Block a user