Status: proposed schema and command contract. No database migrations are implemented in this planning repository. Checked design date: 2026-11-26. The current-context additions below ship in increment 1C and do not expand the earlier 1A/1B schema gates.
The model separates things that are easy to conflate in a task UI:
- Status describes the work's lifecycle.
- Urgency is the person's explicit priority judgment.
- Deadline says when the work is due.
- Reminder says when to attract a particular person's attention.
- Review condition says when to reconsider an unresolved obligation or what evidence ends a wait; it is neither a deadline nor task completion (from 1C).
- Context item records a fact or decision without implying that the user has work to do (from 1C).
- Group organizes tasks and can narrow their user audience. Its optional organization is the default organization of the tasks in it: text typed into a task takes the group's organization unless the task has an explicit assignment. A group never relabels evidence collected from a source (see the origin rules below).
- Contact describes a person involved in the work; it is not a login identity.
- Provenance records where information came from and supports organization-key eligibility. User access control, resource-access identity and AI-key eligibility are distinct decisions.
The UI may present a task in one compact row. That does not justify one overloaded state, date, owner, or url field in storage. Every mutation passes through the application command layer.
All durable entities have a cryptographically random UUIDv4 created before their first command is submitted. IDs remain stable through retry, backup restore, local-to-server handoff and database-engine conversion. They are never regenerated to make imported data look new. UUID format follows RFC 9562; ID order is not a substitute for a change sequence or a deadline (source, checked 2026-11-25).
Use lowercase canonical UUID strings in public JSON. SQLite may store text UUIDs and PostgreSQL may use its UUID type; adapters must produce the same external value. Entity IDs are not secrets and are never authorization evidence.
Every workspace-owned table includes workspace_id. Cross-entity references use composite scope checks such as (workspace_id, contact_id), even when the referenced entity has a globally unique ID. This prevents an application mistake from linking a task to another workspace's private record. SQLite foreign keys must be enabled on every connection; SQLite documents that enforcement is connection-configured rather than something to assume (source, checked 2026-11-25).
An aggregate has a monotonic revision starting at 1. A successful logical change increments it once. A no-op returns the existing revision without producing a fake edit. Child link/contact-binding edits increment the task revision because they change the task returned to clients. Reminder delivery bookkeeping has its own revision; receiving an OS delivery receipt must not conflict with someone editing a title.
A task's effective organization (section 5) and its origin summary (section 8) are derived when the task is read and are not part of its revision. Neither is the overdue time of its deadline (section 4), which is stored but derived from the deadline and the rules of its zone. A group change that alters them, such as a new organization on the group or a subgroup moved to another parent, does not increment the revisions of the affected tasks. The same transaction emits a derived change record for each of those tasks, so clients refresh their copies without a fake edit and an expected revision does not conflict with a group change.
Server change sequences are separate, monotonic per workspace and assigned in the committing transaction. Timestamps are UTC instants; they describe history but do not decide concurrent-write winners. Client wall-clock time is advisory metadata only.
| Entity | Required meaning | Phase |
|---|---|---|
Principal |
Persistent person or service identity used for ownership/audit, with stable ID and kind | P1 local owner; P3 remote identities |
IdentityBinding |
Validated (issuer, subject) mapped to a principal; never email-based automatic merging |
P3 |
Workspace |
Hard tenancy boundary and home for tasks, groups and contacts | P1 |
Membership |
Principal's explicit workspace role and state | P1 owner seed; broader roles P3 |
Organization |
Workspace-scoped id, name, revision and personal_sources_allowed (false by default; whether personal channels may receive its content, see security and policy; it decides no key eligibility, section 8; only the owner changes it) that groups, explicit task assignments, source origins and organization keys refer to; the name is unique in the workspace (section 5). Not a general-purpose organization directory: it holds no members, accounts or contact data |
P1 (created in P1-02; P1-13 owns its references from source and credential records, deletion and merging) |
Group |
Root group or one subgroup; navigation, optional narrower user access scope and the default organization of its tasks; not a source organization identity | P1 structure; ACL behavior grows in P3 |
Task |
Work item and its lifecycle, urgency, deadline and readable summary | P1 |
TaskLink |
One ordered external/source/task reference attached to a task | P1 |
Contact / ContactMethod |
Workspace-scoped person description and optional email/phone/URL methods | P1 |
TaskContact |
Link between task and contact with a role | P1 |
CollectItem |
One entry of a Remind checklist: something the user still has to collect for a task. Gathered links and excerpts are capture proposals, not collect items | P1 (from 1B, P1-22) |
McpConnection / McpConnectionTool |
One configured connection to an external MCP server for API-model runs and acquisition (several connections may point to the same server), and each tool seen through it with Taskline's own read or write classification | P1 (from 1B, P1-23) |
Reminder |
Recipient-specific reminder plan and its current generation | P1 local recipient |
ReminderOccurrence |
One due instance of a reminder generation, with its snooze and acknowledgement state | P1 local recipient |
Channel / ChannelState |
A notification channel apart from its adapter: kind, direction, content level, urgency threshold, grace, quiet hours and organization policy at a revision; and what it learns while it runs, its pairing, update offset, consumer lease and health, without one (section 7) | P1 (from 1C, P1-31) |
SourceOrigin / ProvenanceEdge |
Source record/version, origin organization and derivation relationships for attribution and key routing. Content typed by the user or written by a CLI or MCP client gets a manual edge with actor and client and no SourceOrigin; SourceOrigin records come only from acquisition (connectors, CLI profiles and MCP connections) |
P1 (manual edges in P1-02; SourceOrigin records from 1B acquisition) |
CredentialEligibility / AccessGrant |
Organization/general AI scope and separately evaluated actor permissions; neither is a data-egress ban | P1 key scope; user/group ACLs P3 |
CommandReceipt / AuditRecord / ChangeRecord |
Retry identity, accountability and committed invalidations | P1 |
EffectOutbox |
Durable connector, model or delivery intent committed with state; distinct from a replica command queue | P1 (built with the task aggregate in P1-02; reminder delivery intents are its first effects) |
TaskIdentityLink / TaskDecision |
Cross-source obligation identity, merge/split history and durable semantic proposal decisions | P1 (from 1C, P1-24) |
ContextItem / ReconciliationConflict |
Versioned fact/decision evidence, temporal interpretation and unresolved competing changes | P1 (from 1C, P1-25) |
ReviewCondition |
Recipient-specific review time/event condition for an existing obligation | P1 (from 1C, P1-26) |
CurrentContext |
The group or task a principal last resumed in a workspace, or none (section 5); not the maintained context of 1C | P1 (P1-21) |
ContextSnapshot / ContextSeen |
Rebuildable current context and the principal's actually acknowledged change IDs | P1 (from 1C, P1-27) |
AttentionPreference |
Scoped, reversible treatment of relevant changes and noise; never implicit task authority | P1 (from 1C, P1-29) |
SourceConnection / Run policy and coverage |
Fixed source scope/schedule, scan progress and partial collection metadata in the single durable queue | P1 (from 1B, P1-07) |
RefreshPolicy / CoverageRecord extensions |
Adaptive policy, freshness objectives and independent interpretation/reconciliation coverage extending the 1B baseline | P1 (from 1C, P1-28 and P1-30) |
WorkspaceBinding / ReplicaCommand / ReplicaState |
Which authority owns a workspace, pending offline commands and what a device has acknowledged | P2 |
P1 startup creates a local principal, a private workspace and an owner membership in one transaction. Display names may change; IDs do not. The first-run UI is a task list, not an account-creation wizard. Owner records exist so P2/P3 can attach identity and access without relabeling every task.
Only one role is usable in P1: owner of the local workspace. Additional role names and grant rules are defined by security and policy, rather than prematurely embedded in a UI enum. A workspace must never lose its last active owner. Membership changes, ownership transfer and permission changes are their own administrative commands.
| Field | Contract |
|---|---|
id, workspace_id, revision |
Immutable IDs; optimistic concurrency revision |
title |
Required, 1–200 Unicode code points after trimming leading/trailing whitespace; at least one visible character, where whitespace, format characters such as U+200B, variation selectors such as U+FE0F and the other default-ignorable code points such as the Hangul filler U+3164 count as invisible; no control characters and no line or paragraph separators (U+2028, U+2029), because a title is one line |
excerpt |
Optional plain-language summary, at most 500 Unicode code points; intended to be 1–3 sentences explaining what must be done |
details |
Optional longer plain text, at most 10,000 Unicode code points; not required for quick capture |
status |
open, in_progress, waiting, completed, canceled |
urgency |
low, normal, high, urgent; default normal |
group_id |
Nullable group in the same workspace; null means uncategorized, in Inbox. A deleted group holds no task (section 5) |
organization_assignment / organization_id |
inherited (the default) or explicit. An inherited task has its current group's effective organization (section 5), or none when it is uncategorized. An explicit task has organization_id, where null means explicitly personal; the assignment is a FieldOverride with actor, client and time. Reset returns the task to inherited. The value labels user-typed content only; evidence collected from a source keeps its own origin (section 8) |
deadline |
Discriminated union: none, date, or datetime; see below |
resume_note / resume_updated_at |
Optional plain text, at most 1,000 code points, line breaks allowed: where work stopped and the next step. Park (context.park) sets the note at the task's revision and stamps resume_updated_at; parking an empty note clears both, and parking the same note again changes nothing. One is set exactly when the other is. tasks.update does not change the note yet, and source extraction never does; see interaction design |
pinned |
Boolean, default false; set only by an explicit command from the user or an authorized client ("Pin to Next"). Source extraction and AI proposals may suggest pinning but never set it |
sort_key |
Manual order of the task among the tasks of its group, or of Inbox; the key format of groups, chosen as section 5 describes; not a timestamp or priority |
created_at, updated_at |
Authoritative UTC instants |
created_by, updated_by |
Principal IDs; agent client/worker identity is recorded separately in audit |
completed_at, canceled_at |
Set only for the corresponding current terminal state; transition history remains in audit |
archived_at |
Set while the task is archived; archiving hides the task from working views without changing its status |
deleted_at |
Tombstone instant; deletion is not the same as completed/canceled or archived |
Validation counts Unicode code points consistently in Go, Swift and TypeScript; UTF-8 bytes or UTF-16 code units are not interchangeable. The text rules apply when text is written. The rules about white space, visible characters and case read the Unicode tables of the core's toolchain, and a newer Unicode version can classify or map a code point differently (Unicode 16 added capitals, such as U+1C89, that older tables leave as they are). So reading stored text checks only what no Unicode version changes: valid UTF-8, the length in code points and no control character. A title or name that one build stored stays readable after the toolchain is updated, and it is not normalized again. A code point that no Unicode version assigns yet is accepted, so a character typed on a system with newer tables, such as a new emoji, is kept. Do not normalize or rewrite quoted source evidence as a side effect of validation. The excerpt is editable task content, not an automatically trusted statement of source truth. A paraphrase may carry provenance but must not be stored as a verbatim quote.
The API returns links, contacts, origin_summary and optional reminder summaries with a task, but stores multi-valued relations separately. These fields are not a single URL/contact name embedded in a JSON blob. From 1C, review summaries and canonical identity relationships are likewise separate relations; Task remains the only canonical obligation aggregate.
Any active state can change to another active state or to a terminal state through explicit commands. complete sets completed_at; cancel sets canceled_at. reopen returns a terminal task to open unless an explicit active target is supplied, clearing current terminal timestamps while retaining the historical transition. A stale completion cannot overwrite a later reopen: it must satisfy the expected revision. The task also keeps an activation_seq that increases whenever it becomes alertable again (reopen, unarchive or restore); notification actions use it instead of the full revision, so ordinary edits do not block them and a reactivation always does.
archive hides a task from Next, Inbox and All without changing its status; it stays searchable and visible in an Archived filter. delete sets the deleted_at tombstone; the task is visible only in a Recently Deleted filter and restore brings it back during the configured retention window (default 30 days). A task is alertable when its status is active and it is neither archived nor deleted. Only an alertable task has pending or snoozed occurrences. An occurrence's effective time is its due instant, or snoozed_until while it is snoozed. Leaving the alertable state (complete, cancel, archive, delete) cancels every pending and snoozed occurrence and leaves the reminders active, so nothing is lost. Entering it (reopen, unarchive or restore that results in an active, visible task) increases activation_seq and every active reminder's generation. A snoozed occurrence canceled by the most recent exit is re-created as snoozed in the new generation with its snoozed_until, provided that time is still in the future and the reminder's schedule did not change in between; the user's explicit snooze survives the round trip. All other occurrences come only from the current schedule, for due instants after the moment of reactivation, so neither an alert whose time has passed nor one from an old deadline is created again. Schedule edits while the task is not alertable update the reminder but create no occurrence. Old occurrences are never replayed. After that window the task is purged and only the deleted-ID ledger described in the migration contract remains, so a connector replay or old sync event cannot recreate it. The window counts from the task's last deletion, and the core purges at start and then every hour.
Recurring tasks and recurring reminders are out of P1 scope and are not modeled. Test cases that mention recurrence apply once a later phase introduces it. The one-off, explicitly rearmed reviews in 1C and periodic source refresh do not introduce recurring tasks.
waiting does not require a deadline or a contact, although a contact and short explanation are useful. Do not make every captured task choose an assignee, due date or group.
From 1C, a ReviewCondition can return an undated or waiting task to attention at review_at, or resolve a wait when its recorded event predicate matches. A received reply may satisfy that condition while the task remains unfinished. Due reviews persist until resolved or rescheduled and appear in Next for active, non-archived, non-deleted tasks. Review time, deadline and snooze remain independent. See current context.
Inbox is a view of uncategorized tasks and pending capture proposals (proposals exist from increment 1B). It is not a sixth task status. Next is a view of active (open, in progress or waiting), non-archived, non-deleted tasks that are pinned, overdue, due today in their deadline zone, have a datetime deadline within the next 24 hours, have urgency urgent, or, from 1C, have an unresolved due ReviewCondition. Snoozing a reminder does not remove a task from Next or All; a separate Snoozed filter lists tasks with a snoozed occurrence. A capture proposal has its own acceptance state; until accepted it must not be indistinguishable from a task the person committed to doing. Reminder effects of complete, cancel, archive, delete, reopen, unarchive and restore follow the alertable rule above; nothing replays historical alerts.
Examples are wire-contract examples, not application implementation:
{"kind":"date","date":"2026-12-04","time_zone":"Europe/Prague"}{"kind":"datetime","at":"2026-12-04T14:30:00Z","time_zone":"Europe/Prague"}Date-only means due on that calendar day in the stored IANA time zone. It becomes overdue after that local day ends; it is not a zero-hour instant and must not trigger a midnight notification by accident. The end of the day, overdue_at, is derived and stored with the deadline, because the store cannot do the zone arithmetic in a query. A tz database update can move that local midnight, so the core derives it again for every date deadline each time it starts, before it serves requests: one pass over the tasks with a date deadline through an index of those tasks, 256 to a transaction, that writes only the tasks whose time moved. A moved time does not change the task's revision, its update time or its updater; its commit records a derived change, which tells clients to read the task again, and a system audit record with the reason tz_rules_changed that lists the tasks and the field and no values (API and MCP). A pass that moves nothing writes nothing. A deadline whose zone the tz database no longer holds keeps its stored time and is logged. A running core reads the rules of a zone once and keeps them, so the pass has nothing to find until the core starts again; a wake or a change of the machine's zone needs no pass, since a deadline carries its own zone. Datetime stores an unambiguous UTC instant plus the zone used to present/edit it. Traveling changes display context, not a persisted deadline's meaning. A user can explicitly change a task's zone.
For ambiguous local times during daylight-saving transitions, the editor must resolve the chosen occurrence before committing the UTC instant. Nonexistent local times produce a validation error or an explicit proposed adjustment. Agents supply an exact instant/zone or receive an ambiguity error; the backend does not guess from the machine's default zone.
Urgency does not change automatically when a deadline passes. Overdue is a derived view state. Suggested ordering for the Next view is overdue/due attention followed by explicit urgency and a stable tiebreaker; the product document defines the final display order independently of persistence.
Group has id, workspace_id, optional parent_id, name, sort_key, revision, archive/deletion state, optional user ACL bindings, an optional resume note with the same rules as the task field, a default capture assistance mode (off, remind or gather; off for a new group) and an optional organization_id. A group's effective organization is its own, else its parent's, else none (personal). It is the default organization of the tasks in the group: a task whose organization_assignment is inherited takes it on every capture path (native capture, CLI and MCP), and follows it when the task moves or the group's organization changes. No task row stores the effective organization: a read computes it from the task's assignment, its group and that group's parent, so it is the explicit organization, else the effective organization of the task's group, else personal. A commit that changes a group's effective organization (its own organization, its root group's, or its parent) records a derived change for each inherited task of that group, archived and deleted ones included (section 2). An explicit organization, personal included, survives every move of the task and every change of its group. Changing a group's organization asks for no confirmation and leaves explicit assignments alone. Each principal has one current context per workspace: one group or task reference, or none. It is a record of its own (current_contexts, migration 0017) with its own revision and the change kind current_context, named by the principal's ID; resuming sets it and changes nothing in the task or the group. The first resume creates the record, and a cleared context keeps it at a new revision. Deleting the target clears it in the commit of the delete, and a purge clears any it finds left; completing, archiving or moving the target does not. Maximum hierarchy is two levels total: a root group and its child. A child cannot have children. Parent and child must share the workspace; cycles and self-parenting are invalid.
Tasks may belong directly to a root group or a subgroup. A root view can aggregate both with a clear scope indicator. Group names need not become permanent identifiers. Rename/reorder does not change task IDs or source references.
Organization and group names follow the task title rule: 1–200 Unicode code points after trimming, at least one visible character, and a single line. They are compared through a stored lowercase key: the name with each code point replaced by its Unicode simple lowercase mapping, without Unicode normalization (section 4). The core computes the key when a name is set and stores it with the name; later builds compare names by the stored keys and compute a key again only for a new name, even where their tables would map the old name differently. Two names collide when, at each position, their code points or the code points of their keys are equal (simple lowercase maps one code point to one, so the positions line up). Under one set of tables that is equality of the keys; next to a key from older tables, a name that differs only in case still collides wherever the tables agree. Acme and ACME therefore collide, while a composed and a decomposed Dvořák stay distinct. An organization name is unique in its workspace. A group name is unique among the non-deleted groups with the same parent, and root groups count as siblings of each other; the same name under different parents stays allowed, as in Work A / Project A and Work B / Project A (product).
An organization keeps its ID through every rename; the name is a label, and no command reuses an ID or merges two organizations without saying so (P1-13 owns deletion and merging). A group's own organization_id and every effective organization derived from it name the organization by that ID, so a rename changes no group and no task. A workspace holds at most 500 organizations and 500 non-deleted groups; a create beyond either is refused with reason too_many.
sort_key orders the groups that share a parent, the root groups among themselves. It is a fractional key of 1 to 128 characters from 0-9, A-Z and a-z that never ends in 0, and keys compare by their bytes: every digit sorts before every uppercase letter and every uppercase letter before every lowercase one, so Z sorts before a and 1 before 10 before 2. Every client compares them so, never with a locale-aware or case-insensitive collation; Swift compares the UTF-8 bytes, not String's <. Placing a group between two siblings gives it a key between theirs and changes no other group, until that key would pass 128 characters: then the siblings get evenly spread keys in the same transaction, and only those whose key changed get a new revision. Clients never send a sort key: a create or a move goes last, first, or right after a sibling it names.
Tasks use the same keys for their manual order. A group and Inbox each order their own tasks, subgroups apart from their root group, and the order is the same for archived and deleted tasks, which keep their keys. A task placed between two tasks gets a key between theirs, as a group does. A task placed at an open end of its list gets a key one step from its neighbor instead of a midpoint: the key is padded with 0 to four characters and gets one unit more in its last place for the end of the list, or one unit less for the start, with the carry and without trailing 0s. After V comes V001, after V00z comes V01, after Vzzz comes W, and before V comes Uzzz. A list that grows at one end therefore keeps keys of four characters for millions of tasks, where a midpoint would add a character about every six tasks. When the step runs out, the key gets longer instead of wrapping around: after zzzz comes zzzzV, and before a key with nothing below it in those places comes a midpoint below it. Every new key sorts strictly between its neighbors by bytes, and a key that would pass 128 characters makes the keys of that list spread evenly in the same transaction, as for groups. The only task of a list has the key V. Clients never send a task's sort key: a create or a move goes last, first, or right after a task of the target list that it names. Migration 0008 placed every existing task in Inbox, keyed in the creation order of its workspace.
Archiving a root group hides it and its subgroups from ordinary navigation; archiving a subgroup hides only that subgroup. No group is created under an archived root group or moved under one, while reordering the subgroups an archived root group already has, and unarchiving one of them, stay allowed. When the organization of a root group changes, each of its subgroups without an organization of its own gets a derived change record in the same commit (section 2): its effective organization changed, its revision did not.
The SQLite schema keeps the two levels itself: each group row stores its depth (1 for a root group, 2 for a subgroup) and its parent's depth, and a composite foreign key on (workspace_id, parent_id, parent_depth) references (workspace_id, id, depth). A row that would make a third level, name a parent in another workspace, or turn a root group with subgroups into a subgroup fails that key, even when written without the core.
Deleting a group is not an implicit task delete. The delete command requires a destination for the group's tasks, another active group or Inbox, and moves every task there, archived and deleted tasks included, before it marks the group deleted, so a later restore never lands in a deleted group. The tasks keep their order and go after the last task of the destination; each gets a new revision and a change record, an inherited task takes the destination's effective organization and an explicit one keeps its own. The owner picks the destination, which can be a group of another organization, so each moved task also gets a field override of its group, as a move by the owner does, and automatic filing does not move it back (section 8). Deleting a group is the owner's command, and it is never refused for the number of tasks it moves; all of them move in one commit. To keep the tasks where they are, archive the group instead of deleting it. Deleting a group that still has non-deleted subgroups is refused; they must be moved or deleted first. Ungrouping sends tasks to Inbox while retaining their provenance and user ACLs. Archiving hides a category from ordinary navigation without closing its tasks; archived work remains searchable when explicitly included.
move_task validates source read/move permission, target create/write permission and any P3 audience change. It preserves task ID, status, links, contacts, provenance, deadlines and an explicit organization assignment, then recalculates visibility, reminder recipient eligibility and an inherited organization. A move never asks for confirmation. User-sharing authorization is evaluated independently of AI credential routing.
Evidence collected from a source keeps its recorded organization after moves, recategorization, text edits and source-link removal. A move changes only the organization of user-typed content, and only when it is inherited. For example, moving a task that holds Organization A evidence into a personal group makes it mixed (Organization A evidence and personal typed text), so no organization key remains eligible. An Organization A key may process only content whose every origin is Organization A. A general user-controlled key may process all stored planning data accessible to its execution principal, including combined Organization A and Organization B information. No declassification step or machine-local data restriction is introduced. Corporate planning information may be returned from an acquisition worker to the central system.
Cross-workspace transfer is a separate planned operation, not UPDATE workspace_id and not a P1 convenience button. It requires user access and transfer permission for all transferred tasks, contacts and links. Its preview identifies missing/inaccessible contacts, origin organizations and linked tasks. A permitted transfer creates a destination aggregate with a new ID and a recorded transfer relationship; the source can then be archived/tombstoned after acknowledgement. This avoids breaking immutable tenancy references. A full workspace migration to a server is different: it preserves the workspace and all entity IDs as described in migrations and sync.
Contact is a small record, not an address-book replacement. Initial fields are display name (at most 200 code points), optional organization_name (at most 200; free text with no routing meaning, not a reference to an Organization, so it never affects origins or key eligibility), optional note (at most 1,000), revision and provenance; a contact has at most 10 methods of at most 320 bytes each. User visibility is workspace-scoped, with explicit narrower grants only when configured in P3. ContactMethod holds zero or more typed methods with their own IDs. No contact can log in simply because their email matches an identity provider account.
TaskContact has its own ID, task/contact IDs, role and order. Allowed roles are assignee, requester, collaborator, external. Multiple contacts, including multiple assignees, may be represented without conflating responsibility with access. The UI should distinguish a contact assignment from an actual member assignment introduced in P3. Linking a contact never sends a message, invite or notification to them.
A contact may have narrower user access than the task's group in P3. A reader lacking contact permission gets a redacted relation or no relation according to the query contract, never the hidden person's name, email or source excerpt. Search, autocomplete, exports and agent tools apply the same rule. Attaching a restricted contact cannot smuggle its details into a public task preview.
TaskLink contains id, task_id, workspace_id, kind, target, optional user-visible label, optional source_origin_id, sort_key and provenance. Initial kinds:
| Kind | Behavior |
|---|---|
external_url |
HTTP/HTTPS link, stored as supplied subject to URL validation; no automatic fetching |
source_reference |
Stable pointer to an allowed source object/version, with an optional user-facing URL |
task_reference |
Same-workspace target task ID; target is resolved under the current reader's permissions |
A task has at most 100 links and 50 contact relations; a link target is at most 2,048 bytes and a label at most 200 code points. A task read returns contact relations as summaries (contact ID, display name and role); the full contact is a separate read. These caps keep a full task read within one local protocol frame. A task's context card carries its first 3 links by sort order and every contact relation, so the cap of 50 relations needs no smaller cap there. Links are an array in the UI/API. Each has an ID so concurrent add/remove does not replace the whole list. Duplicate targets can be detected conservatively, but do not strip meaningful query parameters or rewrite signed URLs. URLs containing credentials/secrets are rejected or require deliberate sanitized storage; link metadata is included in organization-origin tracking and user authorization.
A task link across groups does not grant access to its target. The caller sees a permitted preview or an unavailable target, not cached restricted text. Cross-workspace tasks may be represented only as explicit opaque external references with no automatic title/excerpt expansion. file: links and connector-specific URI schemes require a later explicit allowlist and local-device semantics; they are not implicitly portable to a server/browser.
Migration 0012 stores contacts, their methods, and the contacts and links of a task, each row with its own ID and the author that wrote it. A workspace holds at most 500 contacts, so the contact list is one answer of the local protocol. A method is an email (a local part and a domain around its last @), a phone number (digits and + - ( ) . / and spaces), or a URL, of at most 320 bytes. An external URL and a URL method must be absolute HTTP or HTTPS with a host. A URL that has a user name or password, or a query or fragment parameter that carries a credential (access-token, access_token, api_key, apikey, auth_token, bearer, client_secret, code, id_token, jwt, key, oauth_token, passwd, password, private_token, refresh_token, secret, session, token, X-Amz-Security-Token), is refused, and so is a source reference whose target is such an HTTP or HTTPS URL or a scheme-relative //host/... one. The signature of a signed URL, such as sig or X-Amz-Signature, grants only the request it signs and stays. A fragment is read with the separators of route-style fragments as well, so #/access_token= and #!/callback?id_token= are found. A source reference of any other scheme written as scheme://authority, such as git+https:// or ssh://, is refused when its authority holds user information, where a token would sit, or its query or fragment such a parameter: a link target reaches a model as part of the task's content. Every other parameter is kept as given. A task refuses a second link of the same kind to the same target, and a second relation of the same contact in the same role. A task reference names another task of the same workspace, and a source reference names a source origin of it. Adding, changing or removing a contact relation or a link moves the task to its next revision, which every subscriber sees as a change of the task; the command takes an expected revision only when the caller wants one checked. A contact edit keeps the revision of the tasks that relate it, because a task read shows the contact's current display name; a method sent without an ID keeps the ID of the contact's method with the same kind and value, so an edit that sends the methods the contact has changes nothing. A contact can be deleted, with its methods, once no task relates it, a deleted task included until it is purged; the delete frees its place under the cap, cannot be undone and is the owner's alone. A task reference stores only the target's ID, and a read shows no more of the target than whether it is deleted: while the target is in Recently Deleted, and after the purge removed it, the reference reads as its ID marked as a deleted task (target_deleted on the wire). The mark is derived when the task is read, so deleting, restoring or purging the target moves no revision of the task that refers to it, and a client that holds the task sees the mark change on its next read. Contacts and links are written by the owner or by an MCP client acting for them, so a task that has any counts as having typed content when its origins are read (§8). The source origin of a source reference counts as evidence of the task.
Reminder is the plan: stable ID, task/workspace ID, recipient principal, schedule kind (absolute or relative to the deadline), target time or relative offset, time zone where relevant, state, generation, revision and creation provenance. Reminder states are active, disabled (with a reason, for example a removed deadline), done and canceled. An absolute reminder becomes done when its occurrence is acknowledged or its instant passes while the task is not alertable (the core closes those at start and then every hour), so a one-off reminder never fires twice; an explicit time change returns it to active. A task has at most 10 live (active or disabled) reminders for each recipient; done and canceled ones do not count. generation increases whenever the schedule changes (a deadline edit for a relative reminder or an explicit time change) and when the task becomes alertable again. One name is used everywhere for this value; the OS notification identifier and every action carry it. A task can have multiple reminders; a practical P1 UI can offer one primary reminder while keeping the model extensible.
ReminderOccurrence is one due instance of one reminder generation: stable ID, reminder ID, generation, the task's activation_seq when the occurrence was created, due instant, snoozed_until, acknowledged_at and state. Occurrence states are pending, snoozed, acknowledged, superseded (a newer generation replaced it) and canceled (the task left the alertable state).
DeliveryAttempt records are keyed by occurrence, channel and device. Their states are scheduled, queued, attempted, provider_accepted, failed and unknown (the provider may have accepted the request but the reply was lost). This is the only list of delivery states; other documents refer to it. User acknowledgement belongs to the occurrence, not to a delivery attempt. Dismissing a banner is not completing the task. Snooze changes the recipient's occurrence time, never the task's deadline, urgency, group or another person's alert.
The snooze command addresses an occurrence and requires an alertable task. A task-level snooze (menu action, tasks_snooze tool) moves every one of the caller's pending or snoozed occurrences for that task whose effective time is before the snooze target to snoozed until the target, so no alert for the task fires before the target. Occurrences after the target are untouched, so snoozing never moves an alert earlier or loses a planned time. The native adapter shows one alert per task for occurrences with the same instant. If no occurrence was moved, the command creates a one-off absolute reminder marked as created by snooze, with an occurrence in state snoozed whose snoozed_until is the snooze target. "Snooze until tomorrow" therefore works for any active task, and the task appears in the Snoozed filter.
End Snooze ends a snooze. A reminder that snooze created is canceled, because its only purpose was the snooze. Any other occurrence returns to pending at its original due instant; if that instant has passed, End Snooze records the occurrence as acknowledged, because the user is acting on the task right now. A due task stays in Next either way.
End Snooze also works on a task that is not alertable (archived, completed or canceled), and honors the user: it ends the snooze that the task's exit canceled and kept for a reopen. A reminder that snooze created is canceled; any other forgets the snooze's end, so the task's return brings back only the reminder's own instant, and the reminder is done when that instant has passed. The command answers applied with a derived change of the task, and unarchiving or reopening the task does not bring the snooze back.
An absolute reminder has its own instant. A relative reminder is derived from the task deadline; a deadline edit increments its generation and replaces its scheduled delivery. Date-only tasks use the person's explicit preferred notification time if requested, never an implicit instant conversion. If removal of a deadline makes a relative reminder undefined, set that reminder to disabled and explain the change in the command result. P1 stores absolute reminders only, so a deadline edit leaves them as they are.
A person plans reminders with three commands. Each acts on the caller's own reminders and none changes the task. reminders.create adds a reminder at an instant, with a pending occurrence, on an alertable task and within the cap. reminders.update gives a reminder another instant, which is an explicit time change: the generation increases, the open occurrence becomes superseded and a new one is pending at the new instant; a snooze of the reminder ends, a done reminder is active again, and a reminder that a snooze created becomes an ordinary one. On a task that is not alertable the reminder keeps the new instant and gets its occurrence when the task returns, and a snooze the task's exit had kept does not come back. reminders.delete makes the reminder canceled with its open occurrence, on a task in any state. An instant must be after the current time: an alert whose time has passed is never created. The client resolves a date, a preset such as tomorrow at 09:00 or a local time into the instant, as for a snooze. Update and delete take no expected revision: each names the whole new plan of one reminder, and a snooze or an acknowledgement in between is bookkeeping that it replaces.
Native notification action commands carry task ID, occurrence ID and generation plus idempotency_key; the occurrence names its reminder. An occurrence of another task is not found, and a generation that is not the occurrence's is refused, for Complete too, before any check of whether the action is stale. A replay with the same key returns the stored result, marked as replayed, and already_applied only when that result was pruned. Otherwise:
- Snooze and Acknowledge apply only while the occurrence is
pendingorsnoozedand is its reminder's latest. In any other state (superseded, canceled, already acknowledged) they returnstale_actionwith that state and change nothing, also when the reminder is done or canceled and no task shows it any more. An acknowledgement also needs the alert's time to have come, the due time or the end of the snooze. For an occurrence that alerts later, such as one the person snoozed in the app while its banner was still on screen, it returnsstale_actionwith the occurrence's state (pendingorsnoozed), so answering an out-of-date banner never ends a snooze. - Complete is a task command. It returns
stale_actionwith the current task status, ordeleted, if the task is deleted, already completed or canceled, or if itsactivation_seqis greater than the occurrence's (the task was reactivated after the alert was created, so an old banner cannot undo a later reopen). Otherwise it completes the task, even if a deadline edit replaced the alert's generation, because the user's intent concerns the same active task.
Each action is recorded without fabricating a fresh task revision for mere OS delivery bookkeeping.
Channel is the settings of a notification channel (notifications): stable ID, workspace, owner principal, revision and
| Field | Contract |
|---|---|
name |
1 to 64 lowercase ASCII letters, digits and hyphens, a letter or digit first and last, as for an MCP client: audit and provenance records name the channel as the client of what it did |
kind |
The adapter: telegram |
direction |
inbound, outbound or both (the default) |
paused |
The owner's manual stop: a paused channel neither sends nor takes updates, whatever its health |
content_level |
full, title (the default) or generic |
min_urgency |
The least task urgency whose reminders the channel carries; urgent by default |
grace_seconds |
0 to 86400, 300 by default: how long the channel waits after an alert before it sends |
quiet_hours |
None, or a start and an end as minutes of the day that differ, in time_zone; a start after the end runs over midnight |
time_zone |
Optional IANA zone of the quiet hours and of the snooze until tomorrow; required with quiet hours |
audience |
personal (the default), organizations with 1 to 50 organization IDs and a flag that includes personal tasks, or bound with exactly one organization |
The channel carries only its owner's reminders, and a task captured through it is its owner's. A change of a setting increments the revision once; a request that changes nothing does not.
ChannelState is what the channel learns while it runs, and has no revision, so that a delivery receipt or a new offset never conflicts with an edit of the settings:
- the pairing:
unpaired,pending(the SHA-256 hash of a pairing code and its expiry, 10 minutes after it was issued) orpaired(the peer, as the adapter names the conversation and the sender in it, and the pairing time), with a generation that grows with every change. The code has 10 of 32 unambiguous symbols; the core shows it once and stores only the hash. A wrong or late answer leaves the challenge open until it expires. Every update is checked against both the conversation and the sender; - the update offset: the provider's ID of the last update the channel took; an update at or below it is a duplicate;
- the consumer lease: the one consumer that takes the channel's updates, and until when, decided by the clock of the authority that owns the store;
- the health of receiving and of sending, each with the last success, the last fault, the failures since the last success and the earliest next attempt. Faults are
unauthorized(a revoked or replaced token),blocked,rate_limited,conflict(another consumer),rejected,unavailable,secret_missingandsecret_unavailable; the first, the second,rejectedandsecret_missingneed the owner, the others are retried.
An update a channel refuses changes nothing and is counted by reason: unpaired, spoofed, stale, duplicate, direction, forged, malformed or paused. The count is one record per channel and reason, with the first and the last time, so a flood of messages from strangers does not grow the store.
A workspace has at most 20 channels, and a channel's name is unique in it. The channel commands are channels.add, channels.update, channels.pause, channels.resume, channels.unpair and channels.remove, each with an idempotency key and, but for add, the expected revision of the settings; an MCP client needs the admin scope for each of them and for reading channels. channels.pair opens a pairing challenge and returns its code once; it stores no receipt, since its result is a secret, so a repeated call opens a new challenge. Pairing, unpairing and a new state leave the revision of the settings and appear in the change feed as a derived change of the channel. A removed channel appears in the feed once more, at the revision after its last. The channel's secrets are kept by the caller of these commands under references derived from the channel's ID (channel/<kind>/<id>/token and .../key): stored after channels.add and removed before channels.remove, so a channel can outlive its secrets, which its health shows, but a secret never outlives its channel.
The core keeps source organization separate from workspace membership and task grouping. Corporate source information can leave the host on which it is acquired. The records needed for attribution, access and routing are:
SourceOrigin: immutable source connection/resource identity, external object ID and version when available, captured time, optional URL, origin kind andorganization_id(null for a personal source). Only acquisition creates one; typed content has none.ProvenanceEdge: origin or prior artifact that contributed to a field/artifact, relation (copied,quoted,summarized,derived,manual), producing run/actor and input/output revisions. Amanualedge records typed content: it has noSourceOriginand names the actor and, for a CLI or MCP client, the client.FieldOverride: fields deliberately edited or confirmed by the user or set explicitly by a CLI or MCP client (for example an explicit organization assignment), base evidence, author/client/time and revision; later scans propose conflicting changes rather than overwriting these fields.CredentialEligibility:generalororganizationplus an organization ID for the latter, allowed models/endpoints and explicit execution-principal/workspace bindings.AccessGrant: permission to view/change a workspace/group/artifact; introduced for P3 collaboration and independent of model-key scope.AuditRecord: principal, client/profile, worker where applicable, command, source references, before/after revisions and result. Secrets and full source bodies are not default audit payloads.
An artifact's origins are derived from its provenance, and two kinds count. Evidence collected automatically from a source (a connector, a CLI profile or an MCP connection) has a SourceOrigin with that source's organization, or none for a personal source. It keeps that origin after the visible source link is removed and whatever later happens to the task. Content typed by the user or written by a CLI or MCP client through its commands has no SourceOrigin; its manual edge records the actor and client, and it carries the task's current organization (section 4), so a move with an inherited organization or an explicit recategorization changes it. Recategorizing replaces the organization: earlier assignments stay in provenance and audit but do not take part in routing. Derived material, such as a summary, an embedding or a model-written collect item, keeps the origins of whatever it was derived from, and its edge names them. Material derived only from the user's own text would follow the task's current organization, but no edge records that yet, so a summarized or derived edge without a SourceOrigin counts as content of unknown origin. An artifact whose origins span more than one organization, or an organization and personal content, is mixed.
An organization assignment is ordinary categorization. The user, the CLI and MCP clients (tasks_assign_organization) can set an explicit organization, set the task explicitly to personal or reset it to inherit from its group. Each change applies immediately, with no pending state, and is recorded in provenance and audit with the actor, the client name where there is one, and the time. A personal origin is never silently asserted to belong to an organization, and source content cannot assign one. The router gives an organization key only requests whose every origin belongs to its organization; mixed, personal and unknown origins go to general credentials. This prevents an organization key from receiving another organization's or personal data; it does not prevent a general key from processing any of it.
Key eligibility depends on two facts the core keeps exact: the note's current effective organization (section 4) and the origins of its content. Every path that changes a note's effective organization commits the change and its audit entry in one transaction. A creation and an explicit assignment also add a manual provenance edge with the actor and the client, a move and each move of a group delete record the new group as a field override, and a change of a group's organization records a derived change for each inherited task (section 5). Typed content is what a manual creation edge records and any explicit edit of a task's title, excerpt or details; a move, an assignment and an edit of the status, urgency, pin or deadline add no content. Content that provenance does not attribute, of a task with no creation edge or of a summarized or derived edge with no SourceOrigin, has an unknown origin. No row stores the effective organization, so routing always reads the current one. The contract, which property tests check rule by rule:
- A general key is eligible for every note: personal, of any organization, or mixed.
- A key of organization O is eligible only when the note's current effective organization is O and every origin of its content is O. The two conditions are checked separately, so a note captured from O's source and then moved to Inbox or assigned to another organization still has only O's origin, and O's key is refused.
- A note whose effective organization is personal is never eligible for an organization key, whatever any organization's
personal_sources_allowedsays. - A note with any origin of another organization P is never eligible for O's key. A capture from Acme assigned to Beta is refused by Beta's key because of the Acme origin, and by Acme's key because the note is Beta's. Personal and unknown content refuse O's key in the same way.
personal_sources_allowedon O decides only whether personal channels may receive O's content (security and policy). It changes no key eligibility: a note of O with personal evidence stays general-key-only.- An assignment by the user, the CLI or an MCP client needs no approval and routes the next request at once. A move of an inherited note to Inbox makes it personal in the same commit, and O's key loses it then.
Source origins and provenance edges are never changed. They are removed only by the purge of a deleted task (migration contract): the store refuses to remove an edge while its task is not deleted, and a source origin while an edge or a link names it, so the purge takes the task's edges, its field overrides, its contacts and links, and the origins that no other task's edge or link names; a field override is replaced by the next explicit edit of its field, and a reset of the organization to the group removes the organization override.
Migration 0009 added the provenance records empty. A task made before it had no creation edge and counted as typed content, routing by its current effective organization, and every organization started with personal_sources_allowed off.
Migration 0011 gives each task without a creation edge the manual edge of its creation, recorded by the system for the task's creator with no organization assignment: every task made before 0009 was typed through the CLI, the app or an MCP client, and the assignment it was created with is not known. Such a task keeps counting as typed content and routing by its current effective organization. The core writes a creation edge with every new task, so from then on a task without one comes from a store this build did not write: its content has an unknown origin, and a missing edge refuses every organization key rather than granting one. A revision conflict names each field the command sets that an explicit edit changed after the revision it expected: one whose override is newer, and the organization also when an edge of it is newer, so a reset to the group is named too.
Deleting an organization is a soft delete. Its row stays, so evidence keeps pointing at it and the key rules keep holding for every note that names it; the organization is hidden from lists and pickers and can be restored. There is no hard delete of an organization. A merge of two organizations, when it exists, keeps both rows and maps the old ID to the new one when origins are read, so no edge or source origin is rewritten.
Resource acquisition has a separate SourceAccessProfile bound to the source organization, resource, host and installed API/CLI identity. Access to Organization A resources uses an authorized Organization A profile; a failed organization profile is not replaced with an unrelated general key to access the same protected resource. Once selected planning information is saved, general credentials can aggregate it across origins. General scope still respects the execution principal's P3 user permissions.
Migration 0014 adds the source access and credential records. A SourceAccessProfile holds its engine, execution host, the source identity it is authorized as, whose it is (personal or one organization's) and the acquisition capabilities it may use: delta, conditional_read, search, full_scan and model_assisted. Each of them reads; none writes to a source. A SourceConnection holds the exact provider account, whose it is, its selected resources and its access profile. The store refuses a connection whose profile is missing or has another owner, so an organization's connection always names a profile of that organization and a personal connection a personal profile, and a profile that connections name cannot change hands. A CredentialEligibility holds its scope, its allowed models and endpoints, and the execution principal it is bound to, who must be a member of its workspace. The secret reference, budget and health of the credential come with credential management (P1-14). For now the core only inserts and reads these records; credential and source management add the commands that change them.
The key router (internal/keyrouting) is the only place that chooses an inference credential, and acquisition selection in the same package is the only place that chooses an access profile. Neither keeps a decision, so a change applies to the next call. The command layer routes a call over tasks (RouteTasks) from one read transaction: it reads each task's origins and the content the call may send, its title, excerpt, details, links and contacts, together with the workspace's credentials, so an assignment commits wholly before or wholly after the decision. A grant is bound to the notes it was decided for, their IDs and a digest of their origins and content, and serves one call: only the core's wiring redeems it, with the notes the dispatch sends, and a grant redeemed with other notes, or a second time, yields no credential. A redeemed grant yields the credential's ID and the call it was granted for, not a credential record, so it cannot be routed again as a candidate. The command layer selects an access profile (RouteAcquisition) from one read transaction as well: the origins of the tasks whose content the job sends, the connection, the profiles and the personal_sources_allowed settings. Revalidating work that was queued before such a change comes with the durable source queue (P1-07) and the flow runtime (P1-18).
Credential stores an opaque secret reference, display name, provider/endpoint, scope kind, optional organization ID, owner principal, enabled model capabilities, budget limits and routing order. Secrets belong in the platform/server secret store, not ordinary task rows or API responses. A CLI profile is a separate identity/configuration reference and need not expose an API secret.
Manual state is enabled, paused_until, disabled or deleted; a pause has an explicit end time. Automatic health is tracked separately as unknown, healthy, backoff, probe_in_flight or needs_attention. The latter records an invalid/revoked credential requiring explicit retry or replacement rather than an unattended invalid-auth retry loop. Effective availability combines manual state, eligible scope/model, budget and health. A healthy key can be disabled; an enabled key can be in automatic backoff. Deletion removes secret material and future selection while retaining non-secret attribution/history references.
Health/status fields include last_attempt_at, last_success_at, last_failure_at, last_failure_class, sanitized reason, consecutive_failures, next_retry_at, backoff_attempt, optional provider retry_after, health_revision, credential generation, probe lease and manual override actor/time. Manual state/secret changes advance the credential generation so a late probe cannot re-enable or overwrite the new state. Model-capability failures are tracked for the affected route, not used to disable an otherwise valid credential globally. Network outages may also have an endpoint circuit to prevent exhausting an entire pool with identical probes.
Failure classification and exponential backoff with jitter are deterministic routing rules. retry_now clears the automatic delay and requests one bounded probe; it preserves failure history and never erases an explicit manual disable without the corresponding enable action. pause_until, indefinite disable, enable, replace-secret and delete are audited commands with expected revisions. The UI shows the last observed status, the exact current exclusion reason and next attempt when one exists. A manual indefinite disable has no next automatic retry. See AI and flows for fallback/budget state transitions.
| Entity | Data-model boundary |
|---|---|
SourceConnection |
Exact source account/organization, selected resources, access profile, schedule/cursor, availability and last successful collection |
SourceAccessProfile |
Host, engine (api, agent_cli or mcp) configuration and source-access identity; distinct from post-ingestion inference credentials |
CollectItem |
id, task ID, workspace ID, text (at most 200 code points), state open, done or dismissed, sort_key, revision, how it was produced (template, or model with the run reference) and origin. At most 20 per task |
McpConnection |
One connection to an external MCP server: its own ID, display name, transport (stdio command or Streamable HTTP URL), organization or personal binding, credential reference, observed server version, health and last error. Several connections may point to the same server with different credentials and organizations; each is configured, authorized, bound and removed on its own, and each change takes effect immediately. McpConnectionTool records one tool as seen through one connection: exact name, Taskline's classification (read or write) and its source (catalog, annotation or user), enabled state, a hash of its last seen name, description, input schema and annotations, and when that hash last changed. The classification is set when the connection is added: from the built-in catalog when an entry matches the connection's endpoint and reported server name and lists the tool, otherwise read when the annotations mark the tool read-only and write when they do not. Afterwards it changes through the user, through a catalog update (except for a user setting) or by narrowing to write on a metadata change, which applies whatever the source; a catalog-sourced read holds only while the tool's input schema and annotations match the vetted ones. A tool first seen later starts as write unless the catalog lists it as read with a matching definition. A changed hash records a definition-change notice and never suspends the tool. Read tools run automatically; write tools run only from an accepted proposal |
CaptureProposal |
A candidate new task or field change or, from P1-22, a link or excerpt for an existing task; evidence; state pending, accepted, dismissed or superseded; stable source-derived deduplication key (for a gathered item, the source object and version plus the task ID). An accepted link becomes a TaskLink. An accepted excerpt is appended to details as a quote with its source link and adds its origin to the task's provenance. If the result would exceed the details limit, acceptance fails with validation_failed and the remaining space, and the user can shorten the excerpt or accept only its source link |
FlowDefinition / FlowVersion |
Typed deterministic operations, version/hash, owner, allowed resource/credential bindings, validation/activation state and rollback predecessor |
Run / RunStep |
Scheduled occurrence, flow/profile version, input revisions, state, leases, bounded attempts, result and safe diagnostics |
ProviderAccount / Credential |
Billing/account identity, secret reference, organization/general scope and independent manual/automatic health |
ExecutionGrant |
Short-lived capability for a concrete run, permitted input/source profile, outputs, worker and authority epoch; not unrestricted impersonation |
Deduplication stores source connection/object/version, extraction/flow version and proposal decision independently from the visible task link. A dismissed proposal is not recreated on every scan. Source deletions/inaccessibility do not delete user-accepted tasks. Cached source evidence has explicit retention separate from durable task/provenance records. From 1C, a stable TaskDecision links semantic proposals across source and extraction revisions: wording or model changes do not reset dismissal, while a material new request or changed obligation can produce an explained new decision.
All records below carry the workspace/actor/revision boundaries above. Their authoritative behavior is specified in current context; refresh state and coverage are specified in refresh and reconciliation. P1-07 introduces fixed source policies and basic scan/collection coverage in 1B. The identity/context records and adaptive coverage extensions arrive in their own 1C migrations; neither requires empty tables in 1A or postpones the 1B baseline until 1C.
| Entity | Required data and invariants |
|---|---|
TaskIdentityLink (1C) |
Durable candidate ID shared by source proposals, source/former-candidate/task identities, optional accepted canonical task ID, relation, evidence, deciding actor/rule and revision. Acceptance binds the candidate atomically and uniquely to a Task; a pending candidate is not another task aggregate. Merge retains an existing canonical ID and original histories; split records its evidence partition and preserves old IDs where applicable. A redirected new write reauthorizes and validates the canonical revision |
TaskDecision |
Stable semantic candidate/action key, material evidence revision, accepted/dismissed/separate decision, actor and rationale. Exact event receipts remain separate; cosmetic re-extraction is not new intent |
ContextItem |
Kind fact or decision; optional task links; context/group; versioned content/evidence; observation time; optional evidence-supported effective interval; interpretation state proposed, current, disputed, superseded or retracted; verification state current, due or unknown, verification time and reason. No task is required |
ReconciliationConflict |
Affected canonical entity/fields, competing values and evidence revisions, authority, impact and resolution. Repeated observations update one conflict. Manual fields remain protected; source-owned fields name the explicitly enabled narrow mapping allowed to update them |
ReviewCondition |
Task/recipient, revision/generation, review_at instant and display zone, optional bounded event predicate and source/relationship IDs, state waiting, due, satisfied or canceled, resolving evidence/actor. Optional linked reminder uses the existing scheduler and per-task reminder cap |
ContextSnapshot |
Context, contributing task/item/decision revisions, derived current state, change IDs, derivation version and evidence/coverage interval. Rebuildable; never a competing writer to task intent |
ContextSeen |
Principal/context and acknowledged change IDs, with a compact cursor only where it cannot skip gaps. Reads, generation and delivery never mark seen. Acknowledgement is bounded to the actual exposed manifest |
AttentionPreference |
Principal/context, source/topic/change-class scope, treatment, optional expiry, revision and explicit authority. Suppression neither deletes evidence nor cancels a commitment/reminder |
| Fixed source policy and collection coverage (1B) | SourceConnection/Run hold selected scope, fixed interval/cron schedule, source limits, continuation checkpoint, attempted/completed windows, partial pages, last successful collection and blocked reasons. P1-07 persists normalized evidence, its checkpoint and pending processing work atomically |
Adaptive RefreshPolicy / CoverageRecord extensions (1C) |
Add cadence bounds, freshness targets, interpretation budgets and eligibility; independent collected/interpreted/reconciled progress with dependency holes. Existing durable work gains dirty reason, input dependency revisions and coalescing cutoff while retaining its fenced attempt identity; no second queue authority |
Identity combinations retain the union of origins and do not broaden contributor permissions. Source-owned fields may update under a preconfigured narrow rule; manual confirmation creates a FieldOverride, and accepting a task does not silently make every imported field user-owned. Supersession needs evidence or an explicit decision. Expired verification, missing sources and an elapsed TTL only change verification/review state, never complete or delete obligations. A source's collection, interpretation and reconciliation progress are distinct; a model response cannot assert coverage.
Worker has stable ID, server/workspace ownership, display name, allowed host-local profiles/capabilities, administratively enabled state, registration timestamp, token version/hash, connection epoch, connection/heartbeat times and sanitized last failure. The server creates it before any connection and issues the token once through an authorized administrative command.
Registration state starts awaiting_connection; valid outbound bidirectional TLS gRPC changes it to connected. Loss of its heartbeat/stream makes it disconnected; disable and deletion are explicit administrative states. Human-friendly connection state does not replace token validity checks. Hash server-issued bearer tokens at rest; store the worker's copy in its protected local secret store. TLS server validation is required; mandatory client certificates are not part of this contract.
Token reset atomically replaces the token version, advances the connection epoch, closes existing streams and fences in-flight execution grants/results. The worker must be provisioned with the new token before reconnecting. Deletion additionally stops scheduling, revokes outstanding jobs, rejects reconnects and retains an audit tombstone. Results include worker ID, run/attempt, grant ID, token/connection/authority epochs and deduplication identity; stale results are rejected after reset, deletion or authority handoff even if their transport was already open. This cannot undo external effects already performed, so affected runs record cancellation/unknown outcome and reconciliation where needed.
These records ship with their capabilities; P1 does not need empty remote-worker tables. Content an agent acquires from a source must already record its SourceOrigin and run rather than being indistinguishable from a manual entry; text an MCP client writes through the ordinary tools is typed content with a manual edge that names the client. See connectors and agents and security and policy.
CommandReceipt is uniquely keyed by logical workspace authority lineage, actor (the principal and, for a command sent through an MCP client, that client) and idempotency_key (in P1 the authority lineage is the local store identity with epoch 1; P2 handoffs extend it), and stores a canonical request hash, result, affected revisions and commit sequence. Different payload under the same key is rejected. A compact accepted-key/hash ledger survives authority handoffs and is retained for the supported replay horizon; expired client epochs must rebootstrap and cannot replay unverified old commands. Pruning a bulky response retains its key/hash: an old accepted replay returns already_applied and a refetch instruction, not a second execution. See the migration contract for epoch fences and deletion ledgers.
ChangeRecord is an ordered change envelope used for invalidation/sync. A record names an entity and its revision; a derived record reports that only derived read-time fields changed (section 2) and carries the unchanged revision. A command's affected set, which its receipt and its audit record keep, lists every entity the command touched with the revisions before and after, an unchanged entity included; its change records list only the entities whose revision changed, plus the derived invalidations. A command with neither is unchanged and records no change. It is not the only copy of current state and does not make the application an event-sourced system. AuditRecord is a human/security record with its own retention and visibility. A sync cursor, an audit ID and a task revision are different values.
DatabaseMetadata contains schema version, minimum reader/writer format, schema/checksum history, data epoch, restore generation and store identity; builds declare minimum and maximum compatible schemas. A copy made by Taskline's backup has restore generation 0, and the store that opens such a copy, or a new store, draws a random nonzero generation of its own; the change-feed epoch is derived from the store identity and that generation. A copy of the database file made another way keeps its generation, unless it opens behind the store's high-water mark, kept outside the database file, which draws a new one (migration contract §2). WorkspaceBinding contains home authority ID/epoch, server ID, workspace ID, replica epoch/cursor, transfer receipts and local mode. It does not rename the workspace when its home changes.
| Invariant | Enforcement |
|---|---|
| References cannot cross workspace implicitly | Composite foreign keys plus command validation |
| Group depth is at most two | Transactional parent/depth validation; in SQLite a composite foreign key on the stored parent depth (section 5) |
| A task's effective organization is its explicit one, else its group's, else personal, through every move, group change and group delete | Computed when the task is read, never stored; a model-based property test over task moves, assignments, group organization changes, group moves, archives and deletes |
| No task stays in a deleted group | The group delete moves every task, archived and deleted ones included, in the commit that deletes the group |
| Terminal timestamps agree with status | Command transition and database check constraints |
| A resume note is set exactly when its time is, and a current context names a target exactly when it has a resume time | Domain validation, database check constraints and the restore check |
| No current context points at a missing or deleted task or group | The delete clears every context on its target in its own commit; the purge clears any left; the restore check and the scan after an upgrade refuse a context whose target is missing or deleted |
| Deadline precision is unambiguous | Union validation and nullable-column consistency checks |
| Same idempotency key cannot run different commands | Unique receipt key and canonical input hash |
| Collected evidence keeps its source's organization through moves, recategorization and source-link removal | Source origins in provenance, independent of group and link; typed content follows the task's current organization |
| An organization key never receives personal, another organization's or mixed content | Routing over every origin in the request; property test of the hard credential rules in security and policy; general keys remain eligible |
| Server metadata never widens a tool's automatic use | Taskline-owned tool classification; a definition change can only narrow it |
| Concurrent edits do not silently overwrite | Expected revision and conflict response |
| Task deletion cannot be undone by an old client replay | Tombstone, change cursor and replica-epoch rules |
| A contact assignment does not create membership | Separate contact/principal tables and commands |
| Loss of group access removes derived disclosure | Actor-authorized query/search/export/MCP/sync paths |
| Reset/deleted worker cannot submit through an old stream | Token version, connection/authority epoch and execution-grant fence |
| A manually disabled key is not probed automatically | Manual state checked independently from health and retry time |
| Last workspace owner cannot disappear | Administrative command transaction and lock |
| A 1C merge/split does not lose identity, decisions or manual state | Atomic identity mappings, evidence partition and revision-checked command receipts |
| Time passing is not completion or source deletion | Separate verification/review state and evidence-backed lifecycle commands |
| A reply can end a wait without fulfilling the task | Review condition state separate from task status |
| Generated/delivered context is not automatically seen | Explicit acknowledgement of exposed change IDs; gap-preserving seen state |
| Cosmetic reprocessing does not reset dismissal | Durable semantic decision identity separate from model and event versions |
| A derived cache cannot regain revoked access | Current authorization/origin checks before reuse or disclosure |
Indexes should serve actual product queries: active tasks by workspace/group, status and due ordering; contact lookup; task-link target; provenance origin; reminder due time; command key; and change sequence. Search indexes are derived and rebuildable. Neither an index nor a materialized view such as Next is a separate source of task truth.
See migrations and sync for schema upgrades, backups, conversion, offline conflicts and tombstone retention. Those rules are part of the data model, not deployment notes to invent after users have data.