diff --git a/docs/dev/COORDINATION.md b/docs/dev/COORDINATION.md index 30bb90879..c696b8dd0 100644 --- a/docs/dev/COORDINATION.md +++ b/docs/dev/COORDINATION.md @@ -4,7 +4,7 @@ Several sessions work on cli-core, tg-cli and max-cli at once. This page is what ## Store migrations -**The next free migration version is 76.** Version 75 is reserved for bots as their own entity (`sender_bot_identities`: an identity belongs to exactly one person or one sender bot, never both, and a bot's identities leave `identity_links`; `sender_bots` rows and their person's identities move to the bot, the person row they came from kept but hidden, so moving back restores it; triggers keep an older build from giving a bot's identity a person again; tables and triggers added only, forward-only, `minCompatible` stays 73 unless 1.0.0's writes cannot be made safe by triggers, which the migration's pull request says; contact-kinds plan step 3 in its full form, owner's ruling, 2026-11-25). Version 74 is reserved for sender bots (`sender_bots`: a program that writes to the owner, kept apart from people, with the person row it was sorted from, an optional organization, `rules` or `owner` as author; `sender_bot_moves`, every move of an identity between a person and a bot with who and why; triggers that drop their rows with a person, an identity or an organization, since neither table has a foreign key, and clear the person's stored kind; the index `emails_by_list_id` over the List-Id the people list reads; tables, an index and triggers added only, forward-only, `minCompatible` unchanged; contact-kinds plan steps 3 and 4, cli-core#3314, owner's ruling NEED-109 A; it merges after version 73, reserved in the same pull request as version 72 was, announced on issue #3157). Version 73 is taken by cli-core 1.0's store (every base table with an integer `id`, 101 of them, copied once to become `AUTOINCREMENT`, each counter started 1,000 above the largest id the store still knows; `CHECK`s for valid JSON in JSON columns, whole-or-empty pointer pairs and non-negative amounts; the index `taggings_by_taggable_type_taggable_id`; the runner turns foreign keys off before `BEGIN` for a migration that copies tables, puts back their triggers and indexes and checks their foreign keys before `COMMIT`; it raises `minCompatible` to 73 and refuses to run without a rollback copy unless `store migrate --no-backup`; owner's ruling NEED-2872 A, cli-core 1.0 plan phase 4, 2026-11-23). Version 72 is taken by document history (`document_revisions.title`, `front_matter` and `reason`, so a version keeps what the document was and why it was replaced: edited, deleted, unavailable or unsynced. `documents.removal`, why a removed document left the copy, its text kept when unavailable. `document_changes`, the change log of synced documents with no foreign key, and the trigger `document_changes_account_bd` that drops an account's rows with it. Columns, a table, an index and a trigger added only, forward-only, `minCompatible` stays 56. IDEA-2862 in cli-private's Notion roadmap, owner's answers NEED-2802, NEED-2803 A and NEED-2805, 2026-11-23. Reserved in the same pull request, as version 67 was, announced on issue #3157). Version 71 is reserved for the content category (`content_channels`, `content_authors`, `content_terms`, `content_posts` with the body as Markdown and its hash and its terms, authors and media as JSON (no `content_post_terms`: a post is found by a term through its JSON and its taggings), `content_post_revisions` (the title, body and status a sync or a write replaced, and a post the source deleted, kept before the change), `content_metrics` (snapshots in time, never overwritten) and the contentless word index `content_post_words` kept by triggers; a post becomes a taggable type `post`, with a trigger that drops its taggings when the post row goes; blog posts and pages of a site such as WordPress, later social posts; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; content category plan C5 in cli-private, owner's ruling NEED-2722 A, 2026-11-18). Version 70 is reserved for the tracker category (`tracker_items`: one row per team, user, workflow state, label, project, issue or comment of an issue tracker account such as Linear, with its source id, parent, title, text, source times, archive and deletion marks and the rest as JSON; `tracker_item_words`, a contentless word index over titles and text kept by triggers; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-2717 A, source-manifest plan L3 in cli-private, 2026-11-17). Version 69 is reserved for stored conversation readiness (`conversation_readiness`: per built chat and embedding model, the counts `search conversations` reports — messages new, edited or deleted since the build, chunks with current, stale and missing vectors — saved when first counted and dropped by triggers when the chat's messages, revisions, build or that model's vectors change, so a search reads them instead of recounting every chat; table and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-63 A, 2026-11-17). Version 68 is taken by CRM client files (`crm_files`: one row per downloaded file of a deal, lead, contact or company, with its owner record, source kind, name, size, type, local path and extracted text in its own word index, never a download link; CRM files plan in cli-private, 2026-11-16). Version 67 is taken by the facts removal log and phone-call fields on meetings (`fact_removals`: one row per removed fact with its id, the reference of what it was about, who removed it, when and why, never its text or value; `meetings.direction` and `client_phone`, set by a phone-line source; table, columns and indexes added only, forward-only, `minCompatible` stays 56; owner's rulings NEED-2614 B and the call-fields decision A, 2026-11-13; reserved in the same pull request under the one-PR rule for that round, announced on issue #849). Version 66 is reserved for the person-kind trigger on account names (`person_kind_identity_au` recreated to watch `identities.name` too, so a person with no name of their own has their kind and name order worked out again when an account's name changes; triggers only, forward-only, `minCompatible` stays 56; RISK-2268, 2026-11-11). Version 65 is taken by titles of found tasks (the migration sets a `store_settings` key only in a store holding a task still titled ` — `, and the next writable open gives each such task the first line of its source message, as `tasks list` already shows it, in batches, then deletes the key; tasks whose message is missing, deleted or empty keep their title; no schema change, forward-only, `minCompatible` stays 56; owner's ruling NEED-2517 B, 2026-11-10). Version 64 is taken by faster person-kind triggers on deal links (`person_kind_deal_link_ai`, `_ad` and `_au` recreated so their lookup of a deal's other links uses the `(from_type, from_id)` index, and `person_kind_deal_owner_moved_au` and `_owner_person_au` so they find the owner's links by person; version 63's read every person link per row, about 24 ms each on 118k links; triggers only, forward-only, `minCompatible` stays 56; removing CRM contacts outside the scope, owner's ruling 2026-11-10). Version 63 is reserved for people's ties from messages and CRM deals (triggers that clear a stored person kind when a deal or lead names the person or changes its owner, and when a chat whose message senders count as ties changes kind or crosses the small-group size; triggers only, forward-only, `minCompatible` stays 56; BUG-676 and the owner's ruling NEED-2500 A, 2026-11-10). Version 62 is reserved for stored person kinds (columns on `persons` for each person's kind, name order, message count, task count and newest contact, filled lazily and cleared by triggers when anything that decides them changes, so `people list` filters, sorts, pages and counts in SQL; columns, a partial index and triggers added only, forward-only, `minCompatible` stays 56; Desktop page speed plan item 1, 2026-11-10). Version 61 is reserved for people's ties to the owner (a phone-book marker written by `contacts sync`, indexes the tie checks need, and a stored ties table only if the benchmark in cli-testing `performance/people/ties` says reading them is too slow; columns and indexes added only, forward-only, `minCompatible` stays 56; people-clients-digests plan CC-2, 2026-11-09). Version 60 is reserved for WireCat base stages (`pipeline_stages.base_stage_id`, the stage of the owner's base set of its kind another pipeline's stage maps to, and `base_confirmed`, whether the owner confirmed that mapping or it is still a suggestion; columns added only, no table rebuild; forward-only, `minCompatible` stays 56; TASK-947, #2720, 2026-11-08). Version 59 is reserved for owner-edited message templates (`templates`: one row per key, such as `report/morning-digest`, channel, `telegram`, `email` or `text`, and language, the body the owner saved over the shipped default, when and by whom; `templates_history`, every body a save or a reset replaced, so an edit can be undone; forward-only, `minCompatible` stays 56; digest format plan §9 in max-cli, PR 5b, 2026-11-08). Version 58 is reserved for write-time enrichment (`enrichments`: per note, document or email, the standalone facts and reworded questions a hosted model wrote about it, with the hash of the text it read, the provider, the model and the tokens; triggers drop a record's row when the record is deleted; off by default, turned on by the owner with a consent; forward-only, `minCompatible` stays 56; feat/enrichment-setting, 2026-11-08). Version 57 is reserved for business entities (`catalog_items`, `order_lines`, `contracts`, `subscriptions` and `subscription_prices`, `financial_accounts`, `financial_transactions`, `transaction_splits`; `payments.refund_of` with net paid; contract, subscription, product and deal columns on invoices, payments, orders and their lines; `record_relations.as_role`, `records.created_entity`; forward-only, `minCompatible` as version 56 leaves it; business entities plan, `docs/dev/business-entities-plan.md`, #2649). Version 56 is reserved for business relationship links (`links.account_id`, the source account that reported a relationship; `links.starts_at` and `ends_at`, when it held, never guessed; `links.deleted_at`, the source stopped reporting it; `link_revisions`, one row per change of a relationship link written by triggers; a unique key on relationship links with the role and the account in it, after folding duplicates; CRM links stored so far become unconfirmed and name their account; forward-only; it raises `minCompatible` to 56, since an older build writing CRM links would bring back confirmed rows with no account (NEED-2406 A, pending); CRM relationships plan in cli-private `plans/2026-11-07-crm-relations/`, owner's ruling NEED-2372 A, 2026-11-07). Version 55 is taken by `decision_requests` (the one-time keys behind the buttons of a message that asks the owner to decide a batch from Telegram: only a token's digest is kept, using one cancels its siblings; forward-only, `minCompatible` stays 34; mail review from Telegram, plan §12 step 3 in max-cli, 2026-11-07). Version 54 is taken by CRM field definitions (`crm_fields`: a CRM account's own fields per kind, `deal`, `lead`, `person` or `organization`, with their code, label, type, whether they hold several values, whether a list can filter by them and a list field's options, written by the CRM sync and read by `fields list` and the desktop; values stay in each row's `metadata` keyed by code; forward-only, `minCompatible` stays 34; b24 plan §4.4, 2026-11-06). Version 53 is taken by CRM pipelines keyed by kind (the unique index on `pipelines` becomes `(account_id, kind, external_id)`, so a deal pipeline and a lead pipeline of one CRM account may share an id, and `pipelines.deleted_at` and `pipeline_stages.deleted_at` mark what the CRM deleted, kept because deals may still stand in it; forward-only, `minCompatible` stays 34; CRM write port, 2026-11-06). Version 52 is taken by deals and leads, amended in place on 2026-11-06 since no published CLI used 0.585.0, 0.586.0 or 0.587.0 (`pipelines` with a ref, a kind and an optional CRM account, `pipeline_stages` with an outcome, `deals`, `leads`, `pipeline_stage_changes` written by triggers, and a seeded `Leads` pipeline; agents write directly, no review; slice B2 of the business data plan). It keeps `minCompatible` at 34. Version 51 is taken by task links (`tasks.provider` and `tasks.external_id`, the task's id in an outside service such as an Avito conversation or listing, kept apart per service and given as `:`; `tasks.source_url` and `orders.source_url`, the http or https page the task or order is about, such as an Avito ad or an Amazon order; owner's ruling NEED-2245 A, 2026-11-05). It keeps `minCompatible` at 34. Version 50 is taken by orders (`orders`: what the owner or a client bought or sold, for whom (`customer_*`, a `person:` or `organization:`) and whether it is `personal`, `business`, `client` or `other`, the shop as the mail names it plus an optional `supplier_*` reference, the shop's order number, amount and currency in minor units, status `placed` | `shipped` | `delivered` | `cancelled` | `returned`, optional links to an invoice and a payment, and the audit and `review` columns invoices have; the mail-triage agent proposes them as `order` and `order_update` mail findings; BUG-531, owner's ruling NEED-2241 A, 2026-11-05). It keeps `minCompatible` at 34. Version 49 is taken by amounts on record relations (`record_relations.amount`, the share of a payment a `settles` relation of the records envelope names, as a decimal in the payment's currency, so an import allocates a payment split across invoices as its source says; WireCat records import, 2026-11-05). It keeps `minCompatible` at 34. Version 48 is taken by removing leaked test accounts (every account of provider `chat`, the fake messenger of `src/testing/shared-program.ts`, that tests wrote into the owner's real store before #2438; the migration sets a flag only in a store that holds one, and the next writable open purges each such account through `purgeAccount`; owner's choice NEED-250 A in the desktop journal, 2026-11-02). It keeps `minCompatible` at 34. Version 47 is taken by source records (`records`, `record_relations`: what each import said, unique per account, type and external id, with a fingerprint and the source's revision, mapped to at most one entity and never by name; relations to a record not yet imported wait for it; TASK-886 slice B1b, 2026-11-02). It keeps `minCompatible` at 34. Version 46 is taken by retiring payment facts (triggers `facts_no_payment_bi` and `facts_no_payment_bu` refuse a `payment` fact, and the next writable open moves stored payment facts into `payments` and `invoices` rows: a paid one a payment, an expected one an invoice, accepted ones confirmed and proposed ones proposed; owner's ruling NEED-2167 A, TASK-886 slice B0, 2026-11-02). It keeps `minCompatible` at 34. Version 45 is taken by finance tables (`invoices`, `invoice_lines`, `payments`, `payment_allocations`: money as integer minor units per ISO 4217 currency, invoice status derived from confirmed allocations, an agent's or an import's entry a proposal only the owner decides; triggers keep allocations within the payment, within the invoice and in one currency; TASK-886 slice B1a, 2026-11-02). It keeps `minCompatible` at 34. Version 44 is taken by proposals in one place (`relationships.purpose`, a chat's purpose in a project from the purposes memo's config lists, no fixed set in the store, null meaning `work`, beside the free-text `role`; unconfirmed links an agent or a rule proposed move from `links` into `proposed_actions` as `relationship` and `key_document` proposals with their bot, reason and time, while Drive editor links stay; TASK-834.d slice D2, 2026-11-02). It keeps `minCompatible` at 34. Version 43 is reserved for `memories.project_id` (a memory may name the project it belongs to, as a fact does, so the WireCat Desktop Memory page can group and filter memories by project; owner's choice NEED-198 A in the desktop journal, 2026-11-01). It keeps `minCompatible` at 34. Version 42 is reserved for narrowing the task revision (`tasks.revision` goes up only for a change a person could conflict with: title, description, status, priority, agent, due date, project and parent, and by triggers on `task_assignments` and task `taggings`; never for a claim, a follow-up time or a close suggestion; WireCat Desktop Tasks page, RISK-77, 2026-11-01). It keeps `minCompatible` at 34. Version 41 is taken by project task fields (`tasks.priority_score`, a decimal priority in [0, 1] that also orders a board column, kept in step with the old 0–4 `priority` by triggers; `tasks.agent`; `tasks.revision`, for a stale-write check; WireCat Desktop Tasks page, owner's choices NEED-176, NEED-178, NEED-180, 2026-11-01). It keeps `minCompatible` at 34. Version 40 is reserved for the trigram indexes of notes and documents (`note_trigrams`, `document_trigrams`: contentless FTS5 trigram tables over the normalized title and text, so notes, documents, knowledge annotations and contacts `--notes` are found by any part of a word in any letter case; owner's ruling A2, 2026-10-30). Version 39 is taken by `email_locations` (each stored email's place in an IMAP folder: folder, UIDVALIDITY and UID, so a quick mail sync proves deletions and refreshes flags for mail it does not read again; owner's choice NEED-1905 B in the private journal, 2026-10-30). Version 38 is reserved for folded copies of every remaining name a filter or lookup compares (project names and keys, tags, organizations, people and chat titles and the other text filters SQLite's ASCII-only `lower()` misses), with indexes on them, so every search ignores case in any script (owner's ruling, 2026-10-29). Version 37 is reserved for `identities.phone` (a person's phone as the messenger showed it, saved by `contacts sync` and by an online profile read, so `contacts show --offline` has it) and for the queue triggers that put a shared contact card's phone into `mentions` (tg-cli phones in the store, 2026-10-29). Version 36 is reserved for `attachments.contact` (a shared contact card's name, first and last name, whole phone and account id as JSON, so a card read from the store is the card the messenger sent; tg-cli contact cards, 2026-10-29). Version 35 is reserved for neutral calendar storage (`calendar_entries.series_external_id`, the provider's series id moved out of `metadata`, and RFC 5545-based words in the calendar columns; gcal plan lane C2, 2026-10-27). Version 34 is reserved for the vector index (`vector_indexes`, `vector_index_redo` and the triggers that keep one sqlite-vec `vec0` table per embedding model in step with `chunks` and `embeddings`; it raises `minCompatible` to 34, since a build without the extension can no longer write chunks; owner's choice 2026-10-25, stacked on #1979). Version 33 is reserved for calendar tables (`calendars`, `calendar_entries`, `calendar_entry_revisions`, `calendar_entry_participants`, `event_index_pending` and the events words index; `events.status`, `all_day`, `source_deleted_at`; `join_key` on `meetings` and `calendar_entries`; Wave 3 requirements 3.4). Version 32 is reserved for `files` (documents' source records, path plus parent), folder accounts' provider `folder` becoming `local` or `obsidian`, `entity_link_events`, the link review list and `identities.email`, with a backfill of one `files` row per `documents` row (Wave 3 requirements 3.3, 3.5, 3.6). Both ship in the same breaking release as versions 30 and 31 (owner's choice NEED-1780 A in the private journal, 2026-10-25). Version 31 is reserved for moving Drive documents from their stand-in notes-folder account (`folder`, `google-drive:`) to the `google-drive` account, so Drive is a provider of its own rather than a folder (owner's choice NEED-1727 A in the private journal, 2026-10-24). It ships only in the same release as version 30 (#1577) and raises `minCompatible` with it, so older CLIs refuse the store once, for both changes; it never ships on its own. Version 30 is reserved for reviewed tag redirects and text-free consolidation receipts, including a structural tag/automatic-claim compatibility boundary (Codex meetings/tag work, 2026-10-18; draft #1577, moved from 25 by the owner's choice NEED-1559, 2026-10-19, from 26 on 2026-10-21, from 27, 28 and 29 on 2026-10-22 because versions may not leave a gap and #1577 waits on a breaking release). Version 29 is taken by the voice-note transcript index (`transcript_words`, `transcript_words_vocab`, `transcript_stems` and its queue: a transcript found in any form of a word and widened to the spellings speech recognition garbles, as meetings are; owner's choice NEED-1635 B in the private journal, 2026-10-22). Version 28 is taken by chat state (`chats.muted`, `muted_until`, `archived`, `marked_unread` and `unread_counted_at`: a chat muted, archived or marked unread on the phone, and the point a messenger's unread count was taken, from which the store counts new messages for a messenger that opts in; wa, 2026-10-22). Version 27 is taken by `messages.delivery` (whether the owner's own message in a one-to-one chat was delivered or read, from the messenger's receipts; it only moves forward; wa, 2026-10-22). Version 26 is taken by `message_reactions` (each person's newest reaction to a message, from a messenger that sends reactions one person at a time; the store derives `messages.reactions` totals from them; wa, 2026-10-21). Its implementation and activation remain gated on a coordinated breaking release and consumer rollout; this reservation does not authorize raising `minCompatible` or publishing a new package major. Version 25 is taken by `chat_revisions` (one row per change to a chat's external id, title, membership, scope, search visibility or parent, written by a trigger in the same transaction; an offline read by a re-keyed chat's old id follows it; #1658, owner's choices NEED-1555 and NEED-1559, 2026-10-19). Version 24 is taken by `messages.starred` (the owner's star on a stored message, set by `messages star`/`unstar` and by the messenger's pushed star changes, read by `messages list starred:true` and `search messages is:starred`; wa S3 for S1, 2026-10-18). Version 23 is taken by `chat_events` and `chat_event_people` (who joined, left, was added, removed, promoted or demoted in a chat, and title changes, kept for a messenger whose history is pushed to the store; wa S3 for S2, 2026-10-18). Version 22 is taken by `account_identities.mail_demoted` (memo marks a sender whose fraud signals rank its mail lower in search; owner's choice NEED-1432, 2026-10-17). Version 21 is taken by resumable provider-neutral document annotation transfer receipts and reference mappings (Drive transfer, 2026-10-17). Version 20 is taken by `poll_votes` (each voter's newest vote in a poll the store holds, applied from the messenger's vote events and the owner's own votes; wa gaps, 2026-10-17). Version 19 is taken by the mail sender score (`account_identities.mail_score`, `mail_signals`, `mail_scored_at`: memo's spam score per sender and account, shown on email hits; owner's choice NEED-1403, 2026-10-17). Version 18 is taken by `places` (addresses found in text as records of their own, linked from `place` mentions; mentions plan phase 3, 2026-10-16). Version 17 is taken by the agent's close of a task (`tasks.close_certainty` and the close a task waits on the owner for — `close_suggested_as`, `_by`, `_certainty`, `_reason`, `_at`; tasks plan, follow-up-of and agent close, 2026-10-16). Version 16 is taken by mentions in documents, notes and mail (triggers that queue `documents.body`, `notes.body` and `emails` subject and text for mentions, as messages and attachments are; mentions plan phase 1e, 2026-10-15). Version 15 is taken by `task_pairs` (pairs of tasks that may be one job and every decision on them — review, unsure, merged, rejected, attach, new — with the levels the score came from; tasks plan step 5, 2026-10-15). Version 14 is taken by `task_words` / `task_stems` (full-text tables +**The next free migration version is 77.** Version 76 is reserved for mail types (`emails.mail_type`, `emails.reach` and `emails.type_signal`: each email's own type, such as order, newsletter or personal, how it reached the owner and the signal that decided it, worked out lazily from the stored headers, recipients, attachment types, the sender's bot and organization sector and the owner's own mail, and nulled by triggers on those inputs; a partial index over the emails still to work out and an index for filtering by type; columns, indexes and triggers added only, forward-only, `minCompatible` stays 73; contact-kinds plan, "Mail categories", owner's rulings 2026-11-25). Version 75 is reserved for bots as their own entity (`sender_bot_identities`: an identity belongs to exactly one person or one sender bot, never both, and a bot's identities leave `identity_links`; `sender_bots` rows and their person's identities move to the bot, the person row they came from kept but hidden, so moving back restores it; triggers keep an older build from giving a bot's identity a person again; tables and triggers added only, forward-only, `minCompatible` stays 73 unless 1.0.0's writes cannot be made safe by triggers, which the migration's pull request says; contact-kinds plan step 3 in its full form, owner's ruling, 2026-11-25). Version 74 is reserved for sender bots (`sender_bots`: a program that writes to the owner, kept apart from people, with the person row it was sorted from, an optional organization, `rules` or `owner` as author; `sender_bot_moves`, every move of an identity between a person and a bot with who and why; triggers that drop their rows with a person, an identity or an organization, since neither table has a foreign key, and clear the person's stored kind; the index `emails_by_list_id` over the List-Id the people list reads; tables, an index and triggers added only, forward-only, `minCompatible` unchanged; contact-kinds plan steps 3 and 4, cli-core#3314, owner's ruling NEED-109 A; it merges after version 73, reserved in the same pull request as version 72 was, announced on issue #3157). Version 73 is taken by cli-core 1.0's store (every base table with an integer `id`, 101 of them, copied once to become `AUTOINCREMENT`, each counter started 1,000 above the largest id the store still knows; `CHECK`s for valid JSON in JSON columns, whole-or-empty pointer pairs and non-negative amounts; the index `taggings_by_taggable_type_taggable_id`; the runner turns foreign keys off before `BEGIN` for a migration that copies tables, puts back their triggers and indexes and checks their foreign keys before `COMMIT`; it raises `minCompatible` to 73 and refuses to run without a rollback copy unless `store migrate --no-backup`; owner's ruling NEED-2872 A, cli-core 1.0 plan phase 4, 2026-11-23). Version 72 is taken by document history (`document_revisions.title`, `front_matter` and `reason`, so a version keeps what the document was and why it was replaced: edited, deleted, unavailable or unsynced. `documents.removal`, why a removed document left the copy, its text kept when unavailable. `document_changes`, the change log of synced documents with no foreign key, and the trigger `document_changes_account_bd` that drops an account's rows with it. Columns, a table, an index and a trigger added only, forward-only, `minCompatible` stays 56. IDEA-2862 in cli-private's Notion roadmap, owner's answers NEED-2802, NEED-2803 A and NEED-2805, 2026-11-23. Reserved in the same pull request, as version 67 was, announced on issue #3157). Version 71 is reserved for the content category (`content_channels`, `content_authors`, `content_terms`, `content_posts` with the body as Markdown and its hash and its terms, authors and media as JSON (no `content_post_terms`: a post is found by a term through its JSON and its taggings), `content_post_revisions` (the title, body and status a sync or a write replaced, and a post the source deleted, kept before the change), `content_metrics` (snapshots in time, never overwritten) and the contentless word index `content_post_words` kept by triggers; a post becomes a taggable type `post`, with a trigger that drops its taggings when the post row goes; blog posts and pages of a site such as WordPress, later social posts; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; content category plan C5 in cli-private, owner's ruling NEED-2722 A, 2026-11-18). Version 70 is reserved for the tracker category (`tracker_items`: one row per team, user, workflow state, label, project, issue or comment of an issue tracker account such as Linear, with its source id, parent, title, text, source times, archive and deletion marks and the rest as JSON; `tracker_item_words`, a contentless word index over titles and text kept by triggers; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-2717 A, source-manifest plan L3 in cli-private, 2026-11-17). Version 69 is reserved for stored conversation readiness (`conversation_readiness`: per built chat and embedding model, the counts `search conversations` reports — messages new, edited or deleted since the build, chunks with current, stale and missing vectors — saved when first counted and dropped by triggers when the chat's messages, revisions, build or that model's vectors change, so a search reads them instead of recounting every chat; table and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-63 A, 2026-11-17). Version 68 is taken by CRM client files (`crm_files`: one row per downloaded file of a deal, lead, contact or company, with its owner record, source kind, name, size, type, local path and extracted text in its own word index, never a download link; CRM files plan in cli-private, 2026-11-16). Version 67 is taken by the facts removal log and phone-call fields on meetings (`fact_removals`: one row per removed fact with its id, the reference of what it was about, who removed it, when and why, never its text or value; `meetings.direction` and `client_phone`, set by a phone-line source; table, columns and indexes added only, forward-only, `minCompatible` stays 56; owner's rulings NEED-2614 B and the call-fields decision A, 2026-11-13; reserved in the same pull request under the one-PR rule for that round, announced on issue #849). Version 66 is reserved for the person-kind trigger on account names (`person_kind_identity_au` recreated to watch `identities.name` too, so a person with no name of their own has their kind and name order worked out again when an account's name changes; triggers only, forward-only, `minCompatible` stays 56; RISK-2268, 2026-11-11). Version 65 is taken by titles of found tasks (the migration sets a `store_settings` key only in a store holding a task still titled ` — `, and the next writable open gives each such task the first line of its source message, as `tasks list` already shows it, in batches, then deletes the key; tasks whose message is missing, deleted or empty keep their title; no schema change, forward-only, `minCompatible` stays 56; owner's ruling NEED-2517 B, 2026-11-10). Version 64 is taken by faster person-kind triggers on deal links (`person_kind_deal_link_ai`, `_ad` and `_au` recreated so their lookup of a deal's other links uses the `(from_type, from_id)` index, and `person_kind_deal_owner_moved_au` and `_owner_person_au` so they find the owner's links by person; version 63's read every person link per row, about 24 ms each on 118k links; triggers only, forward-only, `minCompatible` stays 56; removing CRM contacts outside the scope, owner's ruling 2026-11-10). Version 63 is reserved for people's ties from messages and CRM deals (triggers that clear a stored person kind when a deal or lead names the person or changes its owner, and when a chat whose message senders count as ties changes kind or crosses the small-group size; triggers only, forward-only, `minCompatible` stays 56; BUG-676 and the owner's ruling NEED-2500 A, 2026-11-10). Version 62 is reserved for stored person kinds (columns on `persons` for each person's kind, name order, message count, task count and newest contact, filled lazily and cleared by triggers when anything that decides them changes, so `people list` filters, sorts, pages and counts in SQL; columns, a partial index and triggers added only, forward-only, `minCompatible` stays 56; Desktop page speed plan item 1, 2026-11-10). Version 61 is reserved for people's ties to the owner (a phone-book marker written by `contacts sync`, indexes the tie checks need, and a stored ties table only if the benchmark in cli-testing `performance/people/ties` says reading them is too slow; columns and indexes added only, forward-only, `minCompatible` stays 56; people-clients-digests plan CC-2, 2026-11-09). Version 60 is reserved for WireCat base stages (`pipeline_stages.base_stage_id`, the stage of the owner's base set of its kind another pipeline's stage maps to, and `base_confirmed`, whether the owner confirmed that mapping or it is still a suggestion; columns added only, no table rebuild; forward-only, `minCompatible` stays 56; TASK-947, #2720, 2026-11-08). Version 59 is reserved for owner-edited message templates (`templates`: one row per key, such as `report/morning-digest`, channel, `telegram`, `email` or `text`, and language, the body the owner saved over the shipped default, when and by whom; `templates_history`, every body a save or a reset replaced, so an edit can be undone; forward-only, `minCompatible` stays 56; digest format plan §9 in max-cli, PR 5b, 2026-11-08). Version 58 is reserved for write-time enrichment (`enrichments`: per note, document or email, the standalone facts and reworded questions a hosted model wrote about it, with the hash of the text it read, the provider, the model and the tokens; triggers drop a record's row when the record is deleted; off by default, turned on by the owner with a consent; forward-only, `minCompatible` stays 56; feat/enrichment-setting, 2026-11-08). Version 57 is reserved for business entities (`catalog_items`, `order_lines`, `contracts`, `subscriptions` and `subscription_prices`, `financial_accounts`, `financial_transactions`, `transaction_splits`; `payments.refund_of` with net paid; contract, subscription, product and deal columns on invoices, payments, orders and their lines; `record_relations.as_role`, `records.created_entity`; forward-only, `minCompatible` as version 56 leaves it; business entities plan, `docs/dev/business-entities-plan.md`, #2649). Version 56 is reserved for business relationship links (`links.account_id`, the source account that reported a relationship; `links.starts_at` and `ends_at`, when it held, never guessed; `links.deleted_at`, the source stopped reporting it; `link_revisions`, one row per change of a relationship link written by triggers; a unique key on relationship links with the role and the account in it, after folding duplicates; CRM links stored so far become unconfirmed and name their account; forward-only; it raises `minCompatible` to 56, since an older build writing CRM links would bring back confirmed rows with no account (NEED-2406 A, pending); CRM relationships plan in cli-private `plans/2026-11-07-crm-relations/`, owner's ruling NEED-2372 A, 2026-11-07). Version 55 is taken by `decision_requests` (the one-time keys behind the buttons of a message that asks the owner to decide a batch from Telegram: only a token's digest is kept, using one cancels its siblings; forward-only, `minCompatible` stays 34; mail review from Telegram, plan §12 step 3 in max-cli, 2026-11-07). Version 54 is taken by CRM field definitions (`crm_fields`: a CRM account's own fields per kind, `deal`, `lead`, `person` or `organization`, with their code, label, type, whether they hold several values, whether a list can filter by them and a list field's options, written by the CRM sync and read by `fields list` and the desktop; values stay in each row's `metadata` keyed by code; forward-only, `minCompatible` stays 34; b24 plan §4.4, 2026-11-06). Version 53 is taken by CRM pipelines keyed by kind (the unique index on `pipelines` becomes `(account_id, kind, external_id)`, so a deal pipeline and a lead pipeline of one CRM account may share an id, and `pipelines.deleted_at` and `pipeline_stages.deleted_at` mark what the CRM deleted, kept because deals may still stand in it; forward-only, `minCompatible` stays 34; CRM write port, 2026-11-06). Version 52 is taken by deals and leads, amended in place on 2026-11-06 since no published CLI used 0.585.0, 0.586.0 or 0.587.0 (`pipelines` with a ref, a kind and an optional CRM account, `pipeline_stages` with an outcome, `deals`, `leads`, `pipeline_stage_changes` written by triggers, and a seeded `Leads` pipeline; agents write directly, no review; slice B2 of the business data plan). It keeps `minCompatible` at 34. Version 51 is taken by task links (`tasks.provider` and `tasks.external_id`, the task's id in an outside service such as an Avito conversation or listing, kept apart per service and given as `:`; `tasks.source_url` and `orders.source_url`, the http or https page the task or order is about, such as an Avito ad or an Amazon order; owner's ruling NEED-2245 A, 2026-11-05). It keeps `minCompatible` at 34. Version 50 is taken by orders (`orders`: what the owner or a client bought or sold, for whom (`customer_*`, a `person:` or `organization:`) and whether it is `personal`, `business`, `client` or `other`, the shop as the mail names it plus an optional `supplier_*` reference, the shop's order number, amount and currency in minor units, status `placed` | `shipped` | `delivered` | `cancelled` | `returned`, optional links to an invoice and a payment, and the audit and `review` columns invoices have; the mail-triage agent proposes them as `order` and `order_update` mail findings; BUG-531, owner's ruling NEED-2241 A, 2026-11-05). It keeps `minCompatible` at 34. Version 49 is taken by amounts on record relations (`record_relations.amount`, the share of a payment a `settles` relation of the records envelope names, as a decimal in the payment's currency, so an import allocates a payment split across invoices as its source says; WireCat records import, 2026-11-05). It keeps `minCompatible` at 34. Version 48 is taken by removing leaked test accounts (every account of provider `chat`, the fake messenger of `src/testing/shared-program.ts`, that tests wrote into the owner's real store before #2438; the migration sets a flag only in a store that holds one, and the next writable open purges each such account through `purgeAccount`; owner's choice NEED-250 A in the desktop journal, 2026-11-02). It keeps `minCompatible` at 34. Version 47 is taken by source records (`records`, `record_relations`: what each import said, unique per account, type and external id, with a fingerprint and the source's revision, mapped to at most one entity and never by name; relations to a record not yet imported wait for it; TASK-886 slice B1b, 2026-11-02). It keeps `minCompatible` at 34. Version 46 is taken by retiring payment facts (triggers `facts_no_payment_bi` and `facts_no_payment_bu` refuse a `payment` fact, and the next writable open moves stored payment facts into `payments` and `invoices` rows: a paid one a payment, an expected one an invoice, accepted ones confirmed and proposed ones proposed; owner's ruling NEED-2167 A, TASK-886 slice B0, 2026-11-02). It keeps `minCompatible` at 34. Version 45 is taken by finance tables (`invoices`, `invoice_lines`, `payments`, `payment_allocations`: money as integer minor units per ISO 4217 currency, invoice status derived from confirmed allocations, an agent's or an import's entry a proposal only the owner decides; triggers keep allocations within the payment, within the invoice and in one currency; TASK-886 slice B1a, 2026-11-02). It keeps `minCompatible` at 34. Version 44 is taken by proposals in one place (`relationships.purpose`, a chat's purpose in a project from the purposes memo's config lists, no fixed set in the store, null meaning `work`, beside the free-text `role`; unconfirmed links an agent or a rule proposed move from `links` into `proposed_actions` as `relationship` and `key_document` proposals with their bot, reason and time, while Drive editor links stay; TASK-834.d slice D2, 2026-11-02). It keeps `minCompatible` at 34. Version 43 is reserved for `memories.project_id` (a memory may name the project it belongs to, as a fact does, so the WireCat Desktop Memory page can group and filter memories by project; owner's choice NEED-198 A in the desktop journal, 2026-11-01). It keeps `minCompatible` at 34. Version 42 is reserved for narrowing the task revision (`tasks.revision` goes up only for a change a person could conflict with: title, description, status, priority, agent, due date, project and parent, and by triggers on `task_assignments` and task `taggings`; never for a claim, a follow-up time or a close suggestion; WireCat Desktop Tasks page, RISK-77, 2026-11-01). It keeps `minCompatible` at 34. Version 41 is taken by project task fields (`tasks.priority_score`, a decimal priority in [0, 1] that also orders a board column, kept in step with the old 0–4 `priority` by triggers; `tasks.agent`; `tasks.revision`, for a stale-write check; WireCat Desktop Tasks page, owner's choices NEED-176, NEED-178, NEED-180, 2026-11-01). It keeps `minCompatible` at 34. Version 40 is reserved for the trigram indexes of notes and documents (`note_trigrams`, `document_trigrams`: contentless FTS5 trigram tables over the normalized title and text, so notes, documents, knowledge annotations and contacts `--notes` are found by any part of a word in any letter case; owner's ruling A2, 2026-10-30). Version 39 is taken by `email_locations` (each stored email's place in an IMAP folder: folder, UIDVALIDITY and UID, so a quick mail sync proves deletions and refreshes flags for mail it does not read again; owner's choice NEED-1905 B in the private journal, 2026-10-30). Version 38 is reserved for folded copies of every remaining name a filter or lookup compares (project names and keys, tags, organizations, people and chat titles and the other text filters SQLite's ASCII-only `lower()` misses), with indexes on them, so every search ignores case in any script (owner's ruling, 2026-10-29). Version 37 is reserved for `identities.phone` (a person's phone as the messenger showed it, saved by `contacts sync` and by an online profile read, so `contacts show --offline` has it) and for the queue triggers that put a shared contact card's phone into `mentions` (tg-cli phones in the store, 2026-10-29). Version 36 is reserved for `attachments.contact` (a shared contact card's name, first and last name, whole phone and account id as JSON, so a card read from the store is the card the messenger sent; tg-cli contact cards, 2026-10-29). Version 35 is reserved for neutral calendar storage (`calendar_entries.series_external_id`, the provider's series id moved out of `metadata`, and RFC 5545-based words in the calendar columns; gcal plan lane C2, 2026-10-27). Version 34 is reserved for the vector index (`vector_indexes`, `vector_index_redo` and the triggers that keep one sqlite-vec `vec0` table per embedding model in step with `chunks` and `embeddings`; it raises `minCompatible` to 34, since a build without the extension can no longer write chunks; owner's choice 2026-10-25, stacked on #1979). Version 33 is reserved for calendar tables (`calendars`, `calendar_entries`, `calendar_entry_revisions`, `calendar_entry_participants`, `event_index_pending` and the events words index; `events.status`, `all_day`, `source_deleted_at`; `join_key` on `meetings` and `calendar_entries`; Wave 3 requirements 3.4). Version 32 is reserved for `files` (documents' source records, path plus parent), folder accounts' provider `folder` becoming `local` or `obsidian`, `entity_link_events`, the link review list and `identities.email`, with a backfill of one `files` row per `documents` row (Wave 3 requirements 3.3, 3.5, 3.6). Both ship in the same breaking release as versions 30 and 31 (owner's choice NEED-1780 A in the private journal, 2026-10-25). Version 31 is reserved for moving Drive documents from their stand-in notes-folder account (`folder`, `google-drive:`) to the `google-drive` account, so Drive is a provider of its own rather than a folder (owner's choice NEED-1727 A in the private journal, 2026-10-24). It ships only in the same release as version 30 (#1577) and raises `minCompatible` with it, so older CLIs refuse the store once, for both changes; it never ships on its own. Version 30 is reserved for reviewed tag redirects and text-free consolidation receipts, including a structural tag/automatic-claim compatibility boundary (Codex meetings/tag work, 2026-10-18; draft #1577, moved from 25 by the owner's choice NEED-1559, 2026-10-19, from 26 on 2026-10-21, from 27, 28 and 29 on 2026-10-22 because versions may not leave a gap and #1577 waits on a breaking release). Version 29 is taken by the voice-note transcript index (`transcript_words`, `transcript_words_vocab`, `transcript_stems` and its queue: a transcript found in any form of a word and widened to the spellings speech recognition garbles, as meetings are; owner's choice NEED-1635 B in the private journal, 2026-10-22). Version 28 is taken by chat state (`chats.muted`, `muted_until`, `archived`, `marked_unread` and `unread_counted_at`: a chat muted, archived or marked unread on the phone, and the point a messenger's unread count was taken, from which the store counts new messages for a messenger that opts in; wa, 2026-10-22). Version 27 is taken by `messages.delivery` (whether the owner's own message in a one-to-one chat was delivered or read, from the messenger's receipts; it only moves forward; wa, 2026-10-22). Version 26 is taken by `message_reactions` (each person's newest reaction to a message, from a messenger that sends reactions one person at a time; the store derives `messages.reactions` totals from them; wa, 2026-10-21). Its implementation and activation remain gated on a coordinated breaking release and consumer rollout; this reservation does not authorize raising `minCompatible` or publishing a new package major. Version 25 is taken by `chat_revisions` (one row per change to a chat's external id, title, membership, scope, search visibility or parent, written by a trigger in the same transaction; an offline read by a re-keyed chat's old id follows it; #1658, owner's choices NEED-1555 and NEED-1559, 2026-10-19). Version 24 is taken by `messages.starred` (the owner's star on a stored message, set by `messages star`/`unstar` and by the messenger's pushed star changes, read by `messages list starred:true` and `search messages is:starred`; wa S3 for S1, 2026-10-18). Version 23 is taken by `chat_events` and `chat_event_people` (who joined, left, was added, removed, promoted or demoted in a chat, and title changes, kept for a messenger whose history is pushed to the store; wa S3 for S2, 2026-10-18). Version 22 is taken by `account_identities.mail_demoted` (memo marks a sender whose fraud signals rank its mail lower in search; owner's choice NEED-1432, 2026-10-17). Version 21 is taken by resumable provider-neutral document annotation transfer receipts and reference mappings (Drive transfer, 2026-10-17). Version 20 is taken by `poll_votes` (each voter's newest vote in a poll the store holds, applied from the messenger's vote events and the owner's own votes; wa gaps, 2026-10-17). Version 19 is taken by the mail sender score (`account_identities.mail_score`, `mail_signals`, `mail_scored_at`: memo's spam score per sender and account, shown on email hits; owner's choice NEED-1403, 2026-10-17). Version 18 is taken by `places` (addresses found in text as records of their own, linked from `place` mentions; mentions plan phase 3, 2026-10-16). Version 17 is taken by the agent's close of a task (`tasks.close_certainty` and the close a task waits on the owner for — `close_suggested_as`, `_by`, `_certainty`, `_reason`, `_at`; tasks plan, follow-up-of and agent close, 2026-10-16). Version 16 is taken by mentions in documents, notes and mail (triggers that queue `documents.body`, `notes.body` and `emails` subject and text for mentions, as messages and attachments are; mentions plan phase 1e, 2026-10-15). Version 15 is taken by `task_pairs` (pairs of tasks that may be one job and every decision on them — review, unsure, merged, rejected, attach, new — with the levels the score came from; tasks plan step 5, 2026-10-15). Version 14 is taken by `task_words` / `task_stems` (full-text tables for tasks, kept by task writes, for the duplicate check's candidate lookup; tasks plan step 3, 2026-10-15). Version 13 is taken by task fields (`category`, `claimed_by`, `claimed_until`, per-type keys for message tasks, tasks as a taggable type; tasks plan step 2, 2026-10-14). Version 12 is taken by `mail_rules` (mail rules move from memo's config into the store, with the rule that decided each email; universal mail rules plan in cli-memo, 2026-10-14).