The Fix Cards Jump log: the four grilling answers, the caret-rail reuse decision, both review rounds, and the flip-verified pins. INDEX and the AGENTS window carry the row; the rolling window drops issue192's entry. The release 0.1.2 log's rows belong to another session and stay in the working tree.
16 KiB
AGENTS.md
Project instructions for AI agents.
Museion — the Agentic Writing Environment (AWE): a native SwiftUI macOS app where scholars, texts, and AI minds work under a single roof. Named for the Mouseion of Alexandria.
- Stack: native Xcode project (
Museion.xcodeprojat repo root, filesystem-synchronized groups — disk is truth). SwiftUI on macOS 27+ (MACOSX_DEPLOYMENT_TARGET = 27.0, Apple Silicon only), latest Xcode/Swift only (ADR-0001). Swift language mode 6 with default MainActor isolation, tabs. - Forge: Gitea @ git.babylondreams.de (
teaCLI), CI via Gitea Actions (ADR-0003) — needs a self-hosted macOS runner. - License: GPL-3.0-or-later (ADR-0002).
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 # 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
./scripts/install-hooks.sh # once per clone: pre-push lint gate + no-push-while-testing
./scripts/test-full-test.sh # pre-push hook acceptance rig (disposable git repo, all ref shapes)
./scripts/release.sh # release packaging: Developer ID export → notarized DMG in dist/ (refuses without the cert)
DOX framework
- DOX is highly performant AGENTS.md hierarchy installed here
- Agent must follow DOX instructions across any edits
Core Contract
- AGENTS.md files are binding work contracts for their subtrees
- Work products, source materials, instructions, records, assets, and durable docs must stay understandable from the nearest applicable AGENTS.md plus every parent AGENTS.md above it
Read Before Editing
- Read the root AGENTS.md
- Identify every file or folder you expect to touch
- Walk from the repository root to each target path
- Read every AGENTS.md found along each route
- If a parent AGENTS.md lists a child AGENTS.md whose scope contains the path, read that child and continue from there
- Use the nearest AGENTS.md as the local contract and parent docs for repo-wide rules
- If docs conflict, the closer doc controls local work details, but no child doc may weaken DOX
Do not rely on memory. Re-read the applicable DOX chain in the current session before editing.
Update After Editing
Every meaningful change requires a DOX pass before the task is done.
Update the closest owning AGENTS.md when a change affects:
- purpose, scope, ownership, or responsibilities
- durable structure, contracts, workflows, or operating rules
- required inputs, outputs, permissions, constraints, side effects, or artifacts
- user preferences about behavior, communication, process, organization, or quality
- AGENTS.md creation, deletion, move, rename, or index contents
Update parent docs when parent-level structure, ownership, workflow, or child index changes. Update child docs when parent changes alter local rules. Remove stale or contradictory text immediately. Small edits that do not change behavior or contracts may leave docs unchanged, but the DOX pass still must happen.
Hierarchy
- Root AGENTS.md is the DOX rail: project-wide instructions, global preferences, durable workflow rules, and the top-level Child DOX Index
- Child AGENTS.md files own domain-specific instructions and their own Child DOX Index
- Each parent explains what its direct children cover and what stays owned by the parent
- The closer a doc is to the work, the more specific and practical it must be
Child Doc Shape
- Create a child AGENTS.md when a folder becomes a durable boundary with its own purpose, rules, responsibilities, workflow, materials, or quality standards
- Work Guidance must reflect the current standards of the project or user instructions; if there are no specific standards or instructions yet, leave it empty
- Verification must reflect an existing check; if no verification framework exists yet, leave it empty and update it when one exists
Default section order:
- Purpose
- Ownership
- Local Contracts
- Work Guidance
- Verification
- Child DOX Index
Style
- Keep docs concise, current, and operational
- Document stable contracts, not diary entries
- Put broad rules in parent docs and concrete details in child docs
- Prefer direct bullets with explicit names
- Do not duplicate rules across many files unless each scope needs a local version
- Delete stale notes instead of explaining history
- Trim obvious statements, repeated rules, misplaced detail, and warnings for risks that no longer exist
Closeout
- Re-check changed paths against the DOX chain
- Update nearest owning docs and any affected parents or children
- Refresh every affected Child DOX Index
- Remove stale or contradictory text
- Run existing verification when relevant
- Report any docs intentionally left unchanged and why
User Preferences
When the user requests a durable behavior change, record it here or in the relevant child AGENTS.md
- Never commit, push, or comment on the forge autonomously — explicit authorization each time.
- Development targets what the maintainer runs (latest Xcode/Swift, macOS 26.5+); never pin toolchain versions in CI or scripts.
- Before implementing a ticket whose
## Blocked bylist contains an OPEN issue, stop and ask — theready-for-agentlabel does not override open dependency edges, and noticing the conflict only in the final report is not notification (2026-10-19, #24/#23).
Child DOX Index
| Path | Scope |
|---|---|
Museion/AGENTS.md |
App target — SwiftUI app shell, assets, entitlements |
MuseionTests/AGENTS.md |
Swift Testing unit suite (hosted in the app) |
MuseionUITests/ |
XCUITest smoke test — single file, no child doc yet |
scripts/ |
Verify rail + hooks + build/deploy/release-packaging scripts — contracts live in each script's header; full-test.sh is the sanctioned verify rail (#190), release.sh cuts the DMG from an already-bumped commit, no child doc |
.agents/skills/ |
Project-local agent skills (cross-tool convention, committed) — release/: the end-to-end release runbook (apex refresh → bump → notes → rail → tag → DMG → go-gated push + Gitea release → Micro.blog + Buy Me a Coffee announcements as drafts); no child doc |
docs/AGENTS.md |
Durable documentation — ADRs and their conventions |
ref/writing skills/AGENTS.md |
Bundled writing-skill set — the G3a payload seeded into the museion profile |
GLOSSARY.md |
Binding project glossary — shared vocabulary for app, mentor, and docs |
Agent skills
Issue tracker
Issues live in Gitea Issues on git.babylondreams.de (this repo), worked via the tea CLI. See docs/agents/issue-tracker.md.
Triage labels
Default five canonical roles, label string = role name. See docs/agents/triage-labels.md.
Domain docs
Single-context: GLOSSARY.md + docs/adr/ at the repo root. See docs/agents/domain.md.
Project Learnings
Tooling & gates
- Repo-wide lint is green (#194 disabled deliberate-style rules; #195/#196 cleared every finding —
spike/stays excluded as unbuilt experiments): bareswiftlint .reports zero violations andswiftformat .reformats nothing. - xcodebuild can serve STALE binaries on a source edited seconds before invocation (zero
SwiftCompilelines, suite starts 3 s in) — rapid edit→test cycles and flip runs musttouchthe file and verifySwiftCompilelines in the run log before trusting any green (#197) - SwiftFormat's default
swiftTestingTestCaseNamesrewrites camelCase@Testnames back into backticked sentence style — renaming a test to a filter-safe plain identifier (#195, #31/#134) needs--test-case-name-format preservein.swiftformat;standard-identifierswould dirty all ~496 backticked test names repo-wide - git resolves short refs through
refs/tags/beforerefs/remotes/— hooks and scripts spellrefs/remotes/<remote>/<branch>in full or a fetched tag namedorigin/mainshadows the ref (#190) - A bash function invoked before its definition no-ops (
command not found) underset -uowithout-e— hoist definitions above first use and guard rig verdicts by executed-check count, never the banner (#190) - GitNexus
detect-changesin this machine's multi-repo registry needs--repo /absolute/path— it aborts on ambiguity but rejects thename (path)label form it prints (#193) - When splitting a file, re-derive each side's imports from symbol usage, never copy the old import block — Swift has no unused-import warning, so a stranded import (PostsPaneView's AppKit) survives lint and only a diff review catches it (#193)
Testing
-
Gate-running rules are encoded in
scripts/full-test.sh(#190) — run./scripts/full-test.sh start+statuspolling (summaryfor the finished counts), never hand-rolled xcodebuild/xcresult incantations. The rest of this section is authoring rules the script cannot encode. -
macOS 27.2 (verified on 27.2.1) routes a drag to the DEEPEST destination — a LIVE NSTextView registers itself for drag types (a bare
NSTextView(frame:)readsregisteredDraggedTypes == [], so a standalone probe lies; lldb on the running app shows the list), matches Finder drags viaNSFilenamesPboardType, and its stockperformDragOperationpastes the file path; the window-level SwiftUI.dropDestinationnever fires over it — the inverse of the 27.0.1 ruling #141 was verified on. Drag routing is an OS-version claim: own the drop at the view (override theNSDraggingDestinationmethods without super) and re-dogfood after every OS point release; instrumented real handlers + one human drag settle which destination fires (#141 follow-up, 2026-12-03) -
A pin that drives a seam introduced WITH the fix has no broken-build past to fail on — drive the framework entry point itself (
DragInfoStubforNSDraggingDestination, the scripted transport for the ACP wire), or the pin passes with the fix reverted (#141 follow-up,image-drop-27-2-drag-routing-pastes-path) -
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(...)aspawnsTicker: Bool = trueseam and opt machine tests out (#162) -
Two FSEvent-burst rescans can double-count one shared
PostScanCachemiss (both snapshot the count before either stamps it) →contentRevisiondouble-bumps, benign over-invalidation — tests pinning settled-state revision must quiesce the burst (stability loop ≥ the 0.5 s FSEvents latency) before snapshotting (#197) -
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)
-
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 testmanagerdand orphan cleanup don't clear it; the machine needs a reboot. Meanwhilebuild-for-testing+ a standaloneswift <file>check of the pure logic still verify honestly (#134) -
A wrapped condition list gets its brace pushed to its own line by swiftformat, which swiftlint's opening_brace then flags — and the nested-if escape ALSO fails (swiftformat collapses it into one long line; line_length flags that). Hoist a predicate helper; that's the only stable shape (#142, #179)
-
swiftformat's self-remove strips a load-bearing
self.when a local hoists a property for a detached capture (let x = self.xbecomes the self-referentiallet x = x) — rename the local so nothing shadows (#143) -
A
//note sitting between a///doc block and its declaration detaches the doc (swiftlint orphaned_doc_comment) — fold such notes into the///block (#143) -
Sequential bounded-poll loops each arm their OWN deadline — a shared one starves the later loop, which then fails on the earlier flush's stale observable (zeros, never nil) (#147)
-
A pure test-file split changes Swift Testing's parallel schedule — a green-by-luck timing test can fail ~50% idle; fix the test's timing assumptions, not the split (#147)
-
One walk absorbed from near-twin writers inherits the more-lossless twin's edge behavior (import's prefix-drop became preserve) — audit each absorbed writer's divergences and pin the deliberate ones (#180)
-
A rig hook that releases a HELD engine turn must poll for the PARK first — the caller-side flag (
runningPass) flips before the one-shot engine even spawns; firing the release into that window false-fails under parallel-suite load (#181)
Trust boundaries
- A guard defending against a downstream validation must mirror its EXACT emptiness/shape semantics — FixCardStore validates TRIMMED emptiness, so an
isEmptyguard passes whitespace-only phrases through and the whole-call failure silently kills the entire submit (#6) - A trust gate matches its SINK's grammar, not just its own format check —
trustworthyURL(built for line-bounded frontmatter) passed URLs whose)injects a live link once the sink became markdown; gate at the sink (angle-form destination), never trust the reused gate (#34) - The frontmatter read (
PostFrontmatter.parse) is LINE-BOUNDED — a newline can never ride one scanned value; multi-line injection threatens only WRITE paths that interpolate raw values into the block (PostFrontmatter.updating), so gate external data before it reaches a stamp, not at scan (#33)
Session Logs
Session logs live in docs/devlog/ (one per completed task/issue/milestone). Full history: docs/devlog/INDEX.md. The 10 most recent: