diff --git a/AGENTS.md b/AGENTS.md index 559067e..88e8894 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ Commands: open Museion.xcodeproj # develop in Xcode ./scripts/build-and-run.sh # build + launch from CLI (⌘R equivalent) xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' build # build -xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' test # test (unit + UI) +xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' test # ad-hoc run incl. UI smoke (outside the rail); full-suite verification → full-test.sh below swiftformat . && swiftlint . # lint (run --fix first if dirty) ./scripts/full-test.sh start && ./scripts/full-test.sh status # verify rail (#190): detached full unit suite, xcresult-authoritative counts; status exits 3 while live ./scripts/full-test.sh summary # finished run's executed/passed/failed @@ -135,7 +135,7 @@ Single-context: `GLOSSARY.md` + `docs/adr/` at the repo root. See `docs/agents/d # GitNexus — Code Intelligence -This project is indexed by GitNexus as **museion** (7035 symbols, 34056 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. +This project is indexed by GitNexus as **museion** (7044 symbols, 34067 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. > Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939). @@ -181,23 +181,17 @@ This project is indexed by GitNexus as **museion** (7035 symbols, 34056 relation ### Tooling & gates -- Repo-wide lint is green (#194 disabled deliberate-style rules; #195/#196 cleared every finding — `spike/` stays excluded as unbuilt experiments): bare `swiftlint .` reports zero violations and `swiftformat .` reformats nothing. Lint GATEs still scope to the pushed/changed Swift files, never the whole tree (settled #190 design) +- Repo-wide lint is green (#194 disabled deliberate-style rules; #195/#196 cleared every finding — `spike/` stays excluded as unbuilt experiments): bare `swiftlint .` reports zero violations and `swiftformat .` reformats nothing. - xcodebuild can serve STALE binaries on a source edited seconds before invocation (zero `SwiftCompile` lines, suite starts 3 s in) — rapid edit→test cycles and flip runs must `touch` the file and verify `SwiftCompile` lines in the run log before trusting any green (#197) - SwiftFormat's default `swiftTestingTestCaseNames` rewrites camelCase `@Test` names back into backticked sentence style — renaming a test to a filter-safe plain identifier (#195, #31/#134) needs `--test-case-name-format preserve` in `.swiftformat`; `standard-identifiers` would dirty all ~496 backticked test names repo-wide - git resolves short refs through `refs/tags/` before `refs/remotes/` — hooks and scripts spell `refs/remotes//` in full or a fetched tag named `origin/main` shadows the ref (#190) - A bash function invoked before its definition no-ops (`command not found`) under `set -uo` without `-e` — hoist definitions above first use and guard rig verdicts by executed-check count, never the banner (#190) ### Testing +- Gate-running rules are encoded in `scripts/full-test.sh` (#190) — run `./scripts/full-test.sh start` + `status` polling (`summary` for the finished counts), never hand-rolled xcodebuild/xcresult incantations. The rest of this section is authoring rules the script cannot encode. - A model-owned real-clock ticker races a test's injected decisive ticks — a >1 s main-actor stall lets the live ticker complete a met goal first, flipping pins on elapsed-time text; give `start(...)` a `spawnsTicker: Bool = true` seam and opt machine tests out (#162) - Two FSEvent-burst rescans can double-count one shared `PostScanCache` miss (both snapshot the count before either stamps it) → `contentRevision` double-bumps, benign over-invalidation — tests pinning settled-state revision must quiesce the burst (stability loop ≥ the 0.5 s FSEvents latency) before snapshotting (#197) -- Real-Process fake-ACP tests flake under concurrent build/analyze load — verify a failure in isolation and run the definitive full suite on an idle machine (#30) -- Verify xcodebuild runs by the xcresult executed count, never the SUCCEEDED banner — single-name `-only-testing` filters can match zero free-function Swift Testing tests and "pass" vacuously (#31); suite-member names with spaces/backticks ALSO fail to match — run the whole suite and count (#134) -- `xcresulttool totalTestCount` counts a Swift Testing parameterized `@Test` as ONE test — its per-argument executions are `nodeType: "Arguments"` children; reconcile executed-count arithmetic from the children, not the function total (#178) - A scripted transport double fires onCrash/onMessage BEFORE resuming the continuation it answers — resume-first lets the awaiting task close its assertion window (confirmation count 0) before the callback lands (#178) -- Read the xcresult bundle only AFTER xcodebuild exits — `ls -td | head -1` inside the test command races bundle finalization and reports a phantom missing path while the run itself is green (#33); the race persists in a chained read one command later — read the bundle from a LATER terminal invocation and retry the identical read once before diagnosing (#179) -- A `grep -c` printing 0 exits nonzero and breaks a `&&` chain — the later suite never runs and its stale xcresult reads as the final result; run each verification gate as its own command (#177) -- Under the delegation harness's ~420 s foreground cap a cold full `xcodebuild test` dies mid-build — `build-for-testing` then `test-without-building` splits the cost and the warm suite stays under (#177) -- `test-without-building` tests the BUILT PRODUCTS, not the sources — a rename/edit landing after `build-for-testing` (e.g. while a long suite runs in background) leaves the green detached from the tree; rebuild + rerun for the definitive gate (#182) - Keychain-touching tests run in their OWN account slot (inject the account param) — a locked login keychain makes read() return nil, so a save/restore defer around the PRODUCTION slot deletes a real live credential (#33) - An app-launch side effect that must never fire under hosted tests splits into the guarded entry + an arm-only seam (`startLaunchCheck`/`wireAutoFire`) — the wiring is pinnable without firing real-root writes, and the model facts stay pinned where the model is directly constructible (#151) - When the hosted-test runner fails the IDE-session handshake on EVERY run ("Timed out while preparing IDE session" / "Lost connection to testmanagerd"), stop resetting — `killall testmanagerd` and orphan cleanup don't clear it; the machine needs a reboot. Meanwhile `build-for-testing` + a standalone `swift ` check of the pure logic still verify honestly (#134) @@ -220,6 +214,8 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | Date | Log | +| --- | --- | +| 2026-11-17 | [20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md](docs/devlog/20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md) | | 2026-11-17 | [20261117-issue197-repo-wide-swiftlint-green-documented-lint-contract_log.md](docs/devlog/20261117-issue197-repo-wide-swiftlint-green-documented-lint-contract_log.md) | | 2026-11-17 | [20261117-issue190-full-test-verify-rail-pre-push-hook_log.md](docs/devlog/20261117-issue190-full-test-verify-rail-pre-push-hook_log.md) | | 2026-11-13 | [20261113-fold-typing-budget-pin_log.md](docs/devlog/20261113-fold-typing-budget-pin_log.md) | @@ -229,6 +225,4 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | 2026-11-10 | [20261110-issue182-profilelayout-config-set-rail_log.md](docs/devlog/20261110-issue182-profilelayout-config-set-rail_log.md) | | 2026-11-10 | [20261110-issue181-provider-descriptor-pass-readiness_log.md](docs/devlog/20261110-issue181-provider-descriptor-pass-readiness_log.md) | | 2026-11-10 | [20261110-issue180-postfrontmatter-codec-one-readwrite-engine_log.md](docs/devlog/20261110-issue180-postfrontmatter-codec-one-readwrite-engine_log.md) | -| 2026-11-09 | [20261109-issue179-postsmodel-write-rail_log.md](docs/devlog/20261109-issue179-postsmodel-write-rail_log.md) | -| 2026-11-09 | [20261109-issue178-extract-engine-host-transport-seam_log.md](docs/devlog/20261109-issue178-extract-engine-host-transport-seam_log.md) | diff --git a/MuseionTests/AGENTS.md b/MuseionTests/AGENTS.md index c20eebb..6695739 100644 --- a/MuseionTests/AGENTS.md +++ b/MuseionTests/AGENTS.md @@ -52,7 +52,6 @@ Conventions every suite follows. Per-suite pin inventories are NOT kept here — ## Verification - `./scripts/full-test.sh start` + `status` polling is the sanctioned verify rail (#190): detached run, per-run pinned bundle, counts from `xcresulttool` only, zero-match filters FAIL (vacuous-green trap), `--serialized` rerun for parallel-load flakes, per-test timeouts naming wedged tests. -- Raw command: `xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' -only-testing:MuseionTests test` — verify by the xcresult EXECUTED count, never the SUCCEEDED banner. ## Child DOX Index diff --git a/docs/devlog/20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md b/docs/devlog/20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md new file mode 100644 index 0000000..3a9c6a4 --- /dev/null +++ b/docs/devlog/20261117-issue192-collapse-gate-running-learnings-into-verify-rail-pointer_log.md @@ -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 ` 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* diff --git a/docs/devlog/INDEX.md b/docs/devlog/INDEX.md index e621563..de9bd90 100644 --- a/docs/devlog/INDEX.md +++ b/docs/devlog/INDEX.md @@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa | Date | Type | File | Summary | |------|------|------|---------| +| 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-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 |