CI / ci (push) Canceled after 0s
Profiles S4: passes run on their OWN one-shot engines — `hermes acp -p museion-passN` spawns per pass run and tears down at the verdict, so a model switch costs nothing (the next spawn reads fresh config). The verdict streams into a TRANSIENT unrostered transcript (#129's ruling: one Sessions surface over the chat engine; a rostered pass session would be unresumable by the chat engine). `beginPassSession` died with it — passes never mint sessions; the #28 roster pins flipped to the transient posture. The chat engine stays resident (adopted museion profile): a Chat model change in Settings fires onChatSurfaceWrite after a successful chat-surface write only, wired to requestRestart — re-spawn in place when idle (resuming the pre-restart active session), deferred to turn end while any turn streams (#129). Missing-key posture (#132): refreshPassReadiness reads both pass profiles' providers and their .env keys at pane entry; Run Pass disables naming the provider with an Open Settings link, .unknown never blocks, and the guard refuses before anything touches disk. Finish-audit (ponytail/security/general fanout) applied: the general reviewer's Medium — a session/new/load/fork completing mid-pass stole the active surface and lost the Cancel to the wrong engine — fixed with ONE claimActive gate across the post-await activation writers, pinned deterministically via the fake's loadReplayHold park + a mode-file flip (flip-verified: guard off fails on the steal observables and the misrouted-cancel hang). Also fixed: a spawn-window cancel loss in stopStreaming (keyed on the transient entry, not the late-arriving wire id), and a PRE-EXISTING rescan bug where a stale scan snapshot "vanished" a just-opened piece and killed its session, cancelling the edit debounce — the vanish-kill now re-checks disk and the watched home. Ponytail cut ~59 lines of test duplication; the app target's only force-unwrap is gone. Suite 477 (was 472): EngineLifecycleTests new (own-engine end-to-end, held-pass cancel, idle + deferred restart ordering, readiness, steal pin), +3 Settings hook pins, one duplicate pin deduplicated. swiftformat clean, swiftlint at HEAD baseline. Closes #137
201 lines
13 KiB
Markdown
201 lines
13 KiB
Markdown
# 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.xcodeproj` at repo root, filesystem-synchronized groups — disk is truth). SwiftUI on macOS 26.5+, latest Xcode/Swift only (ADR-0001). Swift language mode 6 with default MainActor isolation, tabs.
|
||
- **Forge**: Gitea @ git.babylondreams.de (`tea` CLI), CI via Gitea Actions (ADR-0003) — needs a self-hosted macOS runner.
|
||
- **License**: GPL-3.0-or-later (ADR-0002).
|
||
|
||
Commands:
|
||
|
||
```bash
|
||
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)
|
||
swiftformat . && swiftlint . # lint (run --fix first if dirty)
|
||
```
|
||
|
||
# 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
|
||
|
||
1. Read the root AGENTS.md
|
||
2. Identify every file or folder you expect to touch
|
||
3. Walk from the repository root to each target path
|
||
4. Read every AGENTS.md found along each route
|
||
5. If a parent AGENTS.md lists a child AGENTS.md whose scope contains the path, read that child and continue from there
|
||
6. Use the nearest AGENTS.md as the local contract and parent docs for repo-wide rules
|
||
7. 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
|
||
|
||
1. Re-check changed paths against the DOX chain
|
||
2. Update nearest owning docs and any affected parents or children
|
||
3. Refresh every affected Child DOX Index
|
||
4. Remove stale or contradictory text
|
||
5. Run existing verification when relevant
|
||
6. 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 by` list contains an OPEN issue, stop and ask — the `ready-for-agent` label 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 |
|
||
| `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 |
|
||
| `CONTEXT.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: `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
|
||
|
||
<!-- gitnexus:start -->
|
||
# GitNexus — Code Intelligence
|
||
|
||
This project is indexed by GitNexus as **museion** (5172 symbols, 19414 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).
|
||
|
||
## Always Do
|
||
|
||
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
|
||
- **MUST run `detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows. For regression review, compare against the default branch: `detect_changes({scope: "compare", base_ref: "main"})`.
|
||
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
|
||
- When exploring unfamiliar code, use `query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
|
||
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `context({name: "symbolName"})`.
|
||
|
||
## Never Do
|
||
|
||
- NEVER edit a function, class, or method without first running `impact` on it.
|
||
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
|
||
- NEVER rename symbols with find-and-replace — use `rename` which understands the call graph.
|
||
- NEVER commit changes without running `detect_changes()` to check affected scope.
|
||
|
||
## Resources
|
||
|
||
| Resource | Use for |
|
||
|----------|---------|
|
||
| `gitnexus://repo/museion/context` | Codebase overview, check index freshness |
|
||
| `gitnexus://repo/museion/clusters` | All functional areas |
|
||
| `gitnexus://repo/museion/processes` | All execution flows |
|
||
| `gitnexus://repo/museion/process/{name}` | Step-by-step execution trace |
|
||
|
||
## CLI
|
||
|
||
| Task | Read this skill file |
|
||
|------|---------------------|
|
||
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
|
||
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
|
||
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
|
||
| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
|
||
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
|
||
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
|
||
|
||
<!-- gitnexus:end -->
|
||
|
||
## Project Learnings
|
||
|
||
<!-- distill-learnings: project-learnings -->
|
||
|
||
### Testing
|
||
- 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)
|
||
- 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 <file>` check of the pure logic still verify honestly (#134)
|
||
|
||
## Session Logs
|
||
|
||
Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Full history: [`docs/devlog/INDEX.md`](docs/devlog/INDEX.md). The 10 most recent:
|
||
|
||
<!-- write-log: window-start -->
|
||
| Date | Log |
|
||
|------|-----|
|
||
| 2026-10-28 | issue | [20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md](20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md) | Pass engines on-demand per profile, transient transcripts, chat restart deferred mid-turn, missing-key Run Pass — 2 race fixes |
|
||
| 2026-10-27 | issue | [20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md](20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md) | Profiles S3: settings write path (config set + .env), Test Connection probe, three dogfood rounds, three-reviewer audit |
|
||
| 2026-10-27 | issue | [20261027-issue135-profiles-s2-settings-page-ui_log.md](20261027-issue135-profiles-s2-settings-page-ui_log.md) | #135 Profiles S2: variant C Settings sidebar+detail over the SettingsWriting seam; NSComboBox stale-stringValue dogfood fix; 432 tests |
|
||
| 2026-10-27 | issue | [20261027-issue134-profiles-s1-registry-provisioning-x3_log.md](20261027-issue134-profiles-s1-registry-provisioning-x3_log.md) | #134 Profiles S1: ×3 surface registry + provisioner, master-symlink skills with byte-match migration, three-profile backup; 412 tests |
|
||
| 2026-10-22 | issue | [20261022-issue31-first-draft-stats-capture-s5-1_log.md](20261022-issue31-first-draft-stats-capture-s5-1_log.md) | #31 S5.1: Swift-native first-draft stats stamped in place at pass invocation; two frontmatter-erasure bugs fixed; finish-audit fanout — 396 tests |
|
||
| 2026-10-22 | issue | [20261022-issue30-sessions-new-post-from-session-drill-offers_log.md](20261022-issue30-sessions-new-post-from-session-drill-offers_log.md) | #30 lands: session-born Posts stamp origin: ai, brainstorm flavor, shared composer, and the real-engine resume wire fix. |
|
||
| 2026-10-22 | issue | [20261022-issue29-research-library-light_log.md](20261022-issue29-research-library-light_log.md) | #29 research rail: submit_research_notes candidates in-session, ask-before keep into research/, resume replay pin, audit fixes — targeted suites green |
|
||
| 2026-10-22 | issue | [20261022-issue28-session-lifecycle-ui_log.md](20261022-issue28-session-lifecycle-ui_log.md) | #28 Session lifecycle: multi-session model + names-only roster, pane, pass auto-create, finish-audit with 7 fixes — 359 tests green |
|
||
| 2026-10-21 | issue | [20261021-issue27-dismiss-decay-learnings_log.md](20261021-issue27-dismiss-decay-learnings_log.md) | #27 dismiss & decay Learnings: per-type pass clock, frontmatter decay state, consult filtering, two review waves with 5 fixes |
|
||
| 2026-10-21 | issue | [20261021-issue26-promote-consult-learnings_log.md](20261021-issue26-promote-consult-learnings_log.md) | #26 promote/consult Learnings: teaching-shape files, on-disk-truth promote, symlink guard, Learnings pane — 329 tests green |
|
||
<!-- write-log: window-end -->
|