MindAttic.Tickets/BIBLE
MindAttic.Tickets — Project Bible
Single source of truth for what MindAttic.Tickets IS, is NOT, and the rules that keep it coherent. README says how to build/run; this says how to think about the system.
1. The one sentence
MindAttic.Tickets is the workspace's ticket engine and repo job runner: a .NET library plus a tickets CLI that keeps every repo's milestones and permanent ticket log — each ticket placed in a tree by level (epic → feature → story → task) and part-of links — in one database: a local SQL Server instance when configured (tickets db server migrate, M.TIX-T131), with data/Tickets.db kept a complete, git-committed copy; SQLite alone (data/Tickets.db is then the store) otherwise. It also runs workspace-wide jobs (status, prune, rollout) safely across every repo under D:\Projects\MindAttic.
2. The product promise
- Every change and fix gets a ticket with a stable
CODE-T<n>ID, kept forever in the repo it belongs to, so history travels with the code in git. - One query answers "every open ticket", "what got fixed this week", across all repos.
- Rules are enforced by a tool, not remembered by an agent: next ID, vocabulary, append-only rows, table last, unique project codes.
- Workspace jobs are repeatable and safe: a preview first, nothing destructive without
--applyand a typedyes, and nothing deleted that exists only on this machine unless explicitly overridden.
3. What it is NOT
- NOT a hosted tracker. The store of record is either
data/Tickets.db(SQLite, the default) or a local SQL Server database beside it (tickets db server migrate, M.TIX-T131); either waydata/Tickets.dbis committed to this repo with a readable dump (data/Tickets.sql), and on SQL Server it's kept a complete copy, brought up to date after every write, so there's never a copy that needs reconciling by hand. - NOT an agent and NOT an LLM client. No code path calls an LLM SDK or API.
- NOT the Launcher. MindAttic.Launcher launches agent tabs and orchestrates; it calls this library as one front door (HOUSE-LAW-6). This repo owns tickets and workspace jobs.
- NOT a git client for commits.
/commitcommits; it callstickets ticketto log the work. - NOT a free-form document editor. A ticket's place in the plan is its level (
ticket level <ID> epic|feature|story|task) and itspart-oflinks (ticket new --parent,ticket split); milestones group ticket trees toward a goal (milestone new/add). Edited only through the CLI, which keeps the database and each generated view in step.
4. Architecture canon
tickets CLI (src/MindAttic.Tickets.Cli, Spectre.Console.Cli) Launcher menu, /commit
| |
+-------------------- MindAttic.Tickets (library) -------+
| |
Data/ (TicketsDb: SQL Server Repos/ (git + GitHub)
or SQLite, M.TIX-T131) RepoStatus, GitHubRepoIndex,
Log/ Ticket, levels, milestones DependencyScan, PrunePlanner
| |
SQL Server database (store of record, when configured), git -C <repo>, api.github.com
data/Tickets.db (its copy, or the store itself), data/Tickets.sql,
<repo>/docs/USER_STORIES.md (generated view, `tickets db render`)
4.1 Projects
src/MindAttic.Tickets— the library (net10.0), packed toC:\LocalNuGet.src/MindAttic.Tickets.Cli— theticketsexe.src/MindAttic.Tickets.Desktop— Tickets Desktop, the WPF ticket app (net10.0-windows).tests/MindAttic.Tickets.Tests— NUnit 4.tests/MindAttic.Tickets.Desktop.Tests— NUnit 4: Tickets Desktop's view model and store.
4.2 Domain model (nouns)
- Repo — a git repo directly under the workspace root (
Workspace.cs). - TicketsDb — the database connection and schema: repos, tickets, their levels and labels, links, milestones and ticket history, on SQL Server or SQLite (
Data/TicketsDb.cs,Data/TicketsDb.Server.cs,Data/TicketsServer.cs). - Ticket — one row: ID, Date, Type, Status, Summary, Ref (
Log/Ticket.cs). - Ticket level — where a ticket sits in the planning tree, kept as its one
level:<x>label (epic→feature→story→task) pluspart-oflinks to its parent; an epic also carries the plainepiclabel (Data/TicketsDb.Level.cs, M.TIX-T362). - Milestone — a checkable point on the way to a goal across one or more repos: a goal, repos, an order, a state (
planned→active→accepting→reached, ordropped) and its ownMS-nID; tickets and epics join one with an ordinarypart-oflink (M.TIX-T335). - StoryDocument / StoryFile — parses a repo's generated
docs/USER_STORIES.mdback into ordered blocks sotickets db migratecan import a workspace not yet in the database; stories, epics and backlog items are the legacy planning rows it reads, being retired in favor of the ticket tree (Stories/StoryDocument.cs,Log/StoryFile.cs). - RepoStatus — what a repo holds only locally (
Repos/RepoStatus.cs). - GitHubRepoInfo — archived flag and topics for a repo (
Repos/GitHubRepoIndex.cs). - PruneCandidate / PruneBlocker — a repo that no longer belongs, and why it can't simply go (
Repos/PrunePlanner.cs).
4.3 Key services (verbs)
TicketsDb.Add/Close/CorrectType— append a ticket, move its status, or relabel a nonstandard type (one of the two sanctioned exceptions to append-only, recorded inticket_events).TicketsDb.RenameRepo/RepoRenames— rename a repo's folder-name key everywhere it's used (repos, blocks, epics, stories, backlog_items, tickets.repo), backing up the database first; the other sanctioned exception. The old name is kept forever inrepo_renames, and each moved ticket gets a 'repo'ticket_eventsrow, so the repo and every ticket trace back to their original name; a stale--repo <old name>keeps resolving through that history.TicketsDb.SetLevel/Orphans— set a ticket's onelevel:label, and list open tickets with no epic ancestor in their own repo (M.TIX-T362, M.TIX-T389).TicketsDb.Split— break a ticket intolevel:taskchildrenpart-ofit, approved like the parent, optionally chained byrequires(M.TIX-T363).TicketsDb.Milestones/AddToMilestone/MilestoneChecks/MilestonesOf— milestones, their member tickets and acceptance checks, and the scope-lock approval queue on an active one (M.TIX-T335, M.TIX-T347).TicketsDb.AddLink/RemoveLink/Requires— links between any two tickets or stories (requiresis a prerequisite; arequirescycle is refused).TicketsDb.Render/StaleViews/Export— rewrite a repo's generateddocs/USER_STORIES.mdview from the database, or report which views have fallen out of date.TicketsDb.Import/Check/Dump— migrate a repo's file in (only used once per repo, bydb migrate), validate the whole database, and write the readabledata/Tickets.sqldump.TicketRules.Validate/CheckAppendOnly— the same rules, still used by the markdown fallback and byCheckon the database.WorkspaceTickets.All/Check/DeriveCode— cross-repo listing, checks, project codes (reads the database once migrated, a repo's file otherwise).RepoStatus.Read— uncommitted, unpushed, stashes, local-only ignored files.GitHubRepoIndex.FetchAsync/WithRenamesAsync— one sweep of/user/repos, plus redirects for renamed repos whose localoriginpredates the rename.DependencyScan.Scan— repos reaching into a sibling folder by relative path.PrunePlanner.Plan/DeleteFolder— candidates, blockers, safe deletion.
5. The Laws
This project inherits the org-wide laws in MindAttic.HouseRules.md by reference. The directly load-bearing ones: HOUSE-LAW-1 (whole-number versions), HOUSE-LAW-3 (the GitHub token comes from Vault), HOUSE-LAW-6 (one engine; CLI, Launcher and /commit are front doors), HOUSE-LAW-8 (every ✅ story cites a test).
The ticket database is the only store.
Every repo's milestones, tickets (placed in a tree by level and part-of links) and the links between them live in the ticket database and nowhere else (amended 2026-10-15 by M.TIX-T20; markdown was the store before). The database is data/Tickets.db (SQLite) by default, or a local SQL Server database once migrated (tickets db server migrate; amended 2026-10-22 by M.TIX-T131), with data/Tickets.db then kept a complete copy, brought up to date after every write. A repo's docs/USER_STORIES.md is a generated, read-only view (tickets db render); db check flags a hand edit.
Ticket rows are append-only.
A row is never deleted or reworded. The database enforces it with triggers: a ticket can't be deleted, and only its status and ref can be updated; every change is recorded in ticket_events. Only Status (open → closed / wont-do) and Ref change, with three sanctioned, logged exceptions that lift the trigger for one update: CorrectType (a nonstandard type), RenameRepo (its repo key, when the repo's folder is renamed) and ID reassignment (ticket reassign, or repos recode for a whole repo's code; amended 2026-10-20 by M.TIX-T121). A reassigned ID keeps its history: the old ID is kept forever in the append-only id_history table and as an id entry in the ticket's own history, and every lookup by it (ticket show, links, the commit-msg hook) still finds the ticket. IDs are the highest existing number + 1 and are never reused, including former IDs. ticket verify fails if a committed row was deleted or reworded.
Nothing is lost.
Each repo's file was imported as ordered blocks as well as structured rows, and the migration only cut a repo over after its file rebuilt from the database byte-for-byte (line endings and BOM included).
Destructive jobs preview by default and never lose what only exists here.
prune and rollout change nothing without --apply; prune --apply also needs a typed yes. A folder with uncommitted, unpushed or stashed work or local-only ignored files is blocked unless named in --override. A repo with no GitHub copy, or one a kept repo depends on by path, can never be overridden.
Models only through Legion, only to plan.
No code path links an LLM SDK or calls a model provider directly. The plan-reasoning commands (reason, gaps, change) may ask a model through MindAttic.Legion for advice, and only as a reviewed proposal: nothing is filed until a dry run has been shown and applied. Every other path stays model-free (Visionary's answer to M.TIX-T709, 2026-12-01).
6. Verified state
dotnet build MindAttic.Tickets.slnx: 0 warnings, 0 errors.dotnet test: 147 passing NUnit tests (Tickets Desktop's tickets page and--ticketopening and handoff, database import/export/links/history, the ticket queue, repo rename, story/epic/backlog editing, the CLI commands through the realticketson a temp workspace, ticket parsing and writing on the markdown fallback, rules, workspace checks, code derivation, git status on real temp repos, GitHub index with a fake handler, dependency scan, prune planning).- First real run (2026-10-12):
ticket listread 35 tickets across the workspace,codes checkfound the duplicateGGcode, andrepos pruneblocked MindAttic.Telemetry because GridGameGaiden loads it from its folder, resolved MindAttic.Cryptography's pre-rename origin, then deleted 20 folders with the user's confirmation. - Database cutover (2026-10-15, M.TIX-T20): 46 repos migrated, 1046 stories, 561 tickets, 831 links, every file rebuilt byte-for-byte before the cutover.
7. Active frontier
See the Priority backlog in USER_STORIES.md.
8. Quality bar
A feature is done when it has a focused NUnit test, the solution builds with zero warnings, and any command that writes or deletes has a preview path. Anything touching other repos is tried on temp directories in tests before it runs on the real workspace.
9. Glossary
- Workspace root —
D:\Projects\MindAttic, the parent of every repo (--rootoverrides). - Ticket log — a repo's tickets in the database, shown as the
## Ticketstable at the end of its generateddocs/USER_STORIES.mdview. - Level — where a ticket sits in the planning tree:
epic,feature,storyortask, kept as its onelevel:label (ticket level). - Milestone — a checkable point on the way to a goal across one or more repos, with its own
MS-nID (never a ticket ID); tickets and epics join one with apart-oflink. - Project code — the
code:front-matter value that prefixes ticket IDs (M.LNCH-T4). - Local-only work — anything a folder delete would lose: uncommitted, unpushed or stashed work, or ignored files that no build regenerates.
- Candidate — a repo whose GitHub copy is archived or lacks the
work-in-progresstopic. - Blocker — a reason a candidate can't be deleted (local work, git error, no GitHub copy, a kept dependent).