Store migration
Brings a store written by an older tkt up to this one's rules, rule-based (no AI): tkt reorg proposes interactively, tkt reorg --plan plan.yaml writes a plan file, tkt reorg apply plan.yaml applies it.
On this page
The store's data level is schemaVersion in .aitodo/config.yaml: tkt init writes the current one, tkt doctor names an older store (STORE_OUTDATED, → tkt reorg), and reorg raises it once no migration proposal is left (each applied or dismissed).
- All or nothing: the whole plan is validated, a backup goes to
.aitodo/backups/reorg-<timestamp>/(git-ignored), any failure restores every file.tkt reorg restoreundoes it, the level too. tkt reorg apply plan.yaml --dry-runruns it on a throwaway copy and prints the bundle impact on every ticket that reads an item it touches (of any type). A plan that makes a ticket lose a critical gotcha, a ref its body names or an own ref is refused:ERR_REORG_CONTEXT_LOSS, nothing written (--accept-context-lossoverrides).
Details7 items
Each proposal has a stable id (e.g. retired-status:SG-12), a reason, a confidence and options; choice is the option index (from 0), skip (later) or dismiss (never again). Kinds, the first seven on an older store only: dropped-affects (keep, or record as dropped, the affects a superseding or amending decision left out), text-supersession (a replacement named only in text: supersedes or amends), doc-header (a doc's status line names a superseded decision: mark it or name the successor), dangling-affects (an affects target that names nothing), bind-mention (an item named in text with no edge, grouped by the named item, bound by the declared edge; a doc's mention of a decision becomes the decision's affects), retired-status (a stored blocked: the status the work is in), decision-view (the old generated decision-log doc is deleted: a row ref points at its decision, a ref to the whole table goes, the text mentions of open items are listed for a hand edit), typed-frontmatter (a description for docs and gotchas without one).
- What a write and the bundle flag (
UNLINKED_ITEM,POSSIBLE_DUPLICATE,REPEATED_PARAGRAPH,LONE_GROUP_MEMBER,tkt suggest refs --group,LIFECYCLE) is no reorg proposal:--onlywith an old kind names its new place; a plan change reorg no longer makes (move_ticket,add_note…) names its command. - It never changes a closed item's content.
- Interactive:
aaccept,1-nan alternative,eedit in$EDITOR,sskip,ddismiss for good,qquit; then one confirmation (with loss,--yeswithout--accept-context-lossis refused). tkt reorg --impact: each proposal's own impact (plan file, JSON, interactive), not additive; apply never trusts it and measures again.tkt reorg dismiss <id>(--undo) hides a proposal (reviews/_store.yaml); the last migration proposal dismissed raises the level.tkt reorg backupslists the backups.tkt reorg restore(default: the latest) loses later edits, so it asks first.- A write outside tkt (an editor, a merge) is caught by
tkt index rebuild, not by reorg: it names the open reviews (tkt review).
Commands on this page#
tkt reorgMigrate an old store: propose what brings it up to this tkt's rules, and apply the accepted proposals (all-or-nothing, with a backup)→
tkt reorg applyApply a plan file all-or-nothing: every chosen option, or nothing at all→
tkt reorg backupsList reorg backups, oldest first→
tkt reorg dismissNever propose this again (stored in reviews/_store.yaml); the last migration proposal dismissed raises the store's data level→
tkt reorg restorePut the store back to a reorg backup (every later change to tickets, groups, docs is lost)→