Teams Todo: direct-origin FIPS, SQLite and explicit review

One real FIPS identity per installation, one local entity/event database and one physically separate inbox/control database. No simulator runtime remains. See usage and implementation progress.

Ownership

Owner Responsibility
init.ts Open local.sqlite / network.sqlite, durability/lifecycle, peer-channel callbacks
app.ts Command routing, captured real-identity guard and post-action views
commands/boards/ Creation/list/show and incoming board navigation
commands/tasks/ Hierarchy, local event/projection transactions, Update/details modal and task UI
commands/changes/ Immutable event contracts, causal field classification and contextual summaries
commands/incoming/ Separate staging, individual/selected-context acceptance and resolution
commands/invitations/ Strict board-metadata validation and invitation/list status UI; no grant writes or entity acceptance
commands/priority/ Private root order, branch winners and champion/reconfirmation
commands/peers/network.ts Capability-backed identity, authorization reconciliation, publication, Sync and probes
commands/peers/{wire,network-db}.ts Versioned bounded framing/reassembly and external stream/receipt tables
commands/peers/delivery.ts Bounded/coalesced announcement and automatic direct-origin catch-up jobs, retry and shutdown
commands/peers/{sharing,web,identity}.ts Share/access entrypoints, compact header/status and verified roster labels

FIPS owns pairing, authenticated transport and owner grants. Core/web contain no Todo policy or imports. Task/review handlers remain independent of the transport provider.

Identity, grants and sharing

peer-network:v1 supplies the real compressed FIPS key, master binding and granted roster. The network store pins that local key. Actions include --identity as a stale context guard, never as an actor selector. Friendly labels come from the provider.

Protocol: teams-todo.events.v1. Topic: the exact lowercase board UUID. Only currently paired peers with an exact local grant for that protocol/topic participate. Incoming FIPS metadata must match the granted roster binding; each event author must equal its direct authenticated sender. Acceptance rechecks current board authorization.

Share requests the generic optional peer-network.select-members operation. It returns a command descriptor for a stored FIPS-owned selection intent bound to caller app/local key/protocol/topics. Only the explicit authenticated FIPS owner command shows the full paired roster and writes grants. Opening/polling an intent grants nothing. Saving rejects removed nodes/stale local keys and adds only missing exact scope. Reapproval after revocation always requires another explicit owner action.

The creating instance binds a strict board ID/title/creator/revision descriptor to the picker. Explicit Allow & send invitation queues per-node offers and local grants atomically in FIPS. A paired-only pre-grant carrier delivers metadata to the recipient's opt-in handler, which validates it without writing app entities/history. The recipient sees Invitations in the list and explicitly Accept & join reviews/approves the stored FIPS scope. Grant + decision commit in the FIPS DB; Close refreshes the app. Decline adds no access. Source status tracks durable delivery separately from acceptance.

FIPS owns durable offer/decision state, bounds, expiry and retry; see the carrier contract. Teams Todo's normal preflight excludes pending/declined invitation destinations, while authenticated incoming data authorization still checks actual current grants. Metadata receipt and joining never accept board creation/tasks; ordinary Send/Sync/review still applies. Approval or offer replay cannot restore revoked grants. Only the creating instance sends invitations.

Each receiving instance must pair/approve every original author whose history it needs. This is local owner-approved participant authorization, not globally versioned membership: board membership/owner mutations and roles remain unfinished. board_members records creation membership, not all local grants. Manual board-ID access setup remains a fallback.

Working → released → staged → accepted

  1. Local edits validate/preflight and atomically write immutable events plus projection.
  2. Explicit Send releases only local-author events in append order, assigning contiguous per-board positions in publications, then schedules release announcements to joined peers. The durable stream UUID lives in local settings. No automatic publication occurs.
  3. Recipients automatically pull bounded pages (at most 20 events / 512 KiB), without requiring an open view or a Sync click. Manual Sync remains a check/retry. It validates version, request correlation, origin, board, stream, contiguous positions, event schemas and immutable-ID equality before committing proposals plus cursor in network.sqlite. It never writes received history into the accepted database.
  4. A receipt is sent only after inbox commit. Missing receipts are harmless: the next Sync resumes from the durable cursor. A FIPS sent result is not a receipt. Receipt evidence records receipt position only, never approval or semantic agreement.
  5. Decline changes only external decision state. Accept inserts that original event and applies its entity change atomically, then finishes the external decision. Interrupted cross-database commits recover through identical-event retry, not source replacement.

Only own-origin history is served. Unsent data and accepted third-party events are never served as local releases. Board creation itself requires review. Dependencies/context wait for explicit acceptance; a resolution may atomically accept an exact individually selected staged context set. Incoming review pages contain 200 items independently of network page size. Staged boards remain discoverable after access changes.

Wire and failure bounds

Binary frames have a 24-byte header: TT, version 1, reserved byte, random 16-byte transfer ID, unsigned 16-bit fragment index/count. The flag byte is 0 for data and 1 for a header-only fragment acknowledgement. Maximum frame size is the smaller of provider limit and 512 bytes. Messages are strict versioned JSON unions: probe/head, pull/page, released-head announcement, durable receipt and bounded error. Maximum logical message: 512 KiB; maximum fragments: 2,048. This covers worst-case escaped 50,000-character details.

Reassembly is keyed by authenticated origin/board/transfer, permits out-of-order and identical duplicates, rejects contradictory fragments/counts and invalid UTF-8/JSON, and bounds incomplete transfers to 16 total / 2 per origin-board, 120 seconds each. Completed-transfer fragment hashes are cached for at most 32 transfers / 120 seconds so lost final acknowledgements can be retried without duplicate message processing. Each fragment waits for feedback, retries up to three times with a five-second ack deadline, and remains under the overall transfer deadline. Fragment feedback is not durable receipt; only the post-inbox-commit receipt message claims that. Four requests and four served replies are allowed concurrently. Each transfer/request has a 120-second deadline, with the current provider send itself bounded by FIPS. Shutdown rejects waiters, clears assemblies/timer and prevents post-stop DB operations.

Receipt cursors pin origin stream identity and nondecreasing heads. Stream changes, rollback, gaps, contradictory event IDs and truncated pages preserve prior receipt state and fail rather than silently resetting/accepting. A lost/truncated page times out; retry from the committed cursor. Source restart keeps its durable stream and releases. Shared reset negotiation and reconstruction after erased/corrupt history remain pending.

Freshness and local UI

Send announces a released stream/head; receipt of that hint schedules an authenticated pull from its origin. Hints contain no events and do not bypass schema/grant/stream checks. Older same-stream announcements cannot lower the known head. Background reconciliation rotates one authorized origin-board per 15-second tick and schedules automatic catch-up when its released head exceeds the durable cursor. Startup begins reconciliation after one second; connection-change hints schedule catch-up and reannounce existing releases.

The transient delivery queue holds at most 128 coalesced jobs and runs at most two automatic jobs concurrently. Catch-up yields after four pages (also checking a 60-second budget between pages), then continues fairly. Failure backoff is five seconds to five minutes; grants/readiness are rechecked before work and before inbox commit. Per-origin/ board locks coordinate background and manual pulls, preventing cursor races. Queue state need not be durable: persisted publications/cursors plus reconciliation recover missed hints and restart. Shutdown cancels queue/startup/periodic timers and existing waiters.

Five-second UI polling updates list incoming-review counts and board Incoming while visible/idle; the generic renderer preserves drafts by pausing while a field is focused. Receipt never invokes accept/resolve/decline. Status exposes last successful check and errors; unavailable origins never establish a clean freshness claim. Shared edits and Send perform Sync preflight and block on unavailable origins, pending review or remaining pages, preserving local work. Unshared boards have no remote gate. Simultaneous edits remain possible and use causal resolution. Personal priorities do not require semantic preflight. Explicit resolution Syncs first; remaining proposals may still be reviewed before Send.

Headers contain title and ⋮ (Boards, Sync now recovery, Share, Refresh), counted Send, receiving status while catching up and explicit review counts. No routine Sync click is required. Share sends invitations through the FIPS chooser; accepted invitations expose named boards. Incoming appears above local tasks. Update/📝 retain drafts/stale revision validation. Shared details and title save as separate changed-field events in one transaction; no-op saves create none. Web routing parses context.jsonPayload with the shared structured command parser, instead of reparsing the lossy display CLI string. This preserves spaces/newlines/ quotes and literal option-like content. Web editor Save requires both visible fields; incomplete submission cannot silently clear existing details. Persistent forms are not reset on submission; backend-returned editor roots own success/error values.

Causality and personal order

Entity/event UUIDs are distinct, creator identity is immutable and event authors remain unchanged. Timestamps/arrival order do not choose winners. based_on captures causal edit context; requires records semantic prerequisites. Independent fields and equal concurrent values combine; title/details/status conflicts require an explicit immutable resolution. Covered history never rolls back a descendant. Delete/hierarchy merges, full deterministic rebuild and unanimous agreement remain future work.

Root order and winner fingerprints/representative versions live only in the external preferences database. Active roots move as whole subtrees, without reparenting. Winners display first, preserving other relative order. The first root's confirmed path leads to the champion; the whole path is accent-colored and its leaf has 🏆. Accepted candidate history or sibling changes request bottom-up Keep/Pick. Keeping an unchanged representative does not cascade; changed representatives invalidate their immediate parent. Current review paths expand additively once, preserving later manual collapse during polling.

Transition and evidence

The owner approved fresh real-identity stores. Old A/B/C/inbox files remain unopened; no fixture author is rewritten or published. Simulator code, commands and reset UI are removed. See archived simulation architecture for historical implementation evidence. Current local checks are listed in the README; real network and authenticated UI/recovery acceptance remain owner-assisted.