Teams Todo: command locality
Status: SQLite-only command-local runtime implemented. The former root model,
storage, network and view monoliths were removed. Public command grouping is still
a future decision; existing list, show, new and task commands remain in use.
References: landing ownership, Todo command architecture, current schemas and execution progress.
Current layout
teams-todo/
init.ts # database composition and lifecycle
app.ts # parsing/routing and captured peer context
definition.ts # aggregates owning definitions
db/
schema.ts # peer schema composition
settings.ts
commands/
boards/
schema.ts
db.ts
create/{definition,handler}.ts
list/{definition,web}.ts
show/{definition,handler,web}.ts
tasks/{definition,schema,db,handler,web,styles}.ts
changes/{schema,db,causality,summary}.ts
incoming/{definition,db,handler,review,web}.ts
invitations/{schema,web}.ts # app metadata validation and invitation UI
priority/{definition,db,model,handler,web}.ts
peers/
schema.ts
db.ts
definition.ts
identity.ts # labels from verified FIPS roster
network.ts # identity, exact grants, publication, Sync/probes
delivery.ts # bounded automatic delivery/retry/coalescing
network-db.ts # external stream cursors and receipts
wire.ts # bounded semantic framing/reassembly
sharing.ts # app entrypoint to FIPS owner member chooser
web.ts
common/{schema,definition,view}.ts
Ownership rules
- Keep schemas, handlers, queries, definitions, representations and UI beside their action/group. Create extra files only for real responsibilities, not symmetry.
- Handlers are independent of CLI parsing/rendering. UI and command routes call the same board/task/review actions; no second mock entity/event implementation exists.
- Reuse owning handlers/contracts from other commands where appropriate. Extract
shared helpers only for actual multiple consumers, as in
commands/common/. - An action's
db.tsowns queries/transactions, not a separate connection for each action. Connections belong to composition; source/projection writes stay atomic. - One local store is bound to the real FIPS identity. Captured identity guards reject stale actions; no actor/store selector remains. Inbox staging is physically separate.
- Root
app.tsdispatches; it does not implement raw-byte sync, draft application or the entity projector. The real FIPS adapter replaces fixtures without moving review or task semantics into core/FIPS.
Public grouping proposal
Still proposed, not registered:
/teams-todo boards --list
/teams-todo boards --create --title "Work board"
/teams-todo boards --show --board <id>
The current metadata has one subcommand level. Grouped action flags fit it;
positional boards list needs a deliberate help/catalog/parsing design. Confirm
spelling before changing all definitions, forms, navigation and refresh actions.
Do not register unfinished future invite/grant/merge operations merely to match folders.
Progress
Simulation/reset entries below record the completed former phase; those command owners and controls have since been removed. See the active FIPS transition in the implementation plan.
- Command-owned entity/event contracts and SQL.
- Local board/task business handlers and UI definitions.
- Separate incoming staging, review handlers and UI.
- Shared primitives only for actual consumers.
- Remove old root implementation and compatibility branches.
- Real list/show UI, per-peer stores, Send/Sync and individual incoming acceptance.
- Local-first display/post-write peer refresh and an explicit full simulation reset
owned by
commands/reset/, including interrupted-reset recovery. - Scoped Reset this peer and Reset all peers controls, confirmation and cursor cleanup.
- Task-owned ⋮ child/sibling/edit reveal panels, retro checkbox status menus and bottom root-add controls, composed by board-show with scoped styles and no timeline recording.
- Change-owned exhaustive summaries/causal field classification; incoming-owned explicit title/status resolution, compact ✓ / ✗ rows and selected context review.
- Simulation-owned passive publication counts and Sync-before-edit/send preflight, composed into board controls without adding plugin policy to core/web code.
- Targeted lint, generation and command/UI-schema checks.
- Owner visual/restart acceptance and UX iteration.
- Confirm future grouped public syntax.
- Replace fixture identity/transport with FIPS and remove simulation/reset UI.
- Pre-grant invitations through FIPS-owned transport/storage/owner approval; app metadata and list/status UI remain command-local.
- Post-Send announcements and automatic direct-origin staging/catch-up owned by peers/network + delivery queue; receipt stays separate from incoming acceptance.
- Implement full merge, global membership changes and board-local reset in their owning features.
No test suite, release hooks or publication is required for ordinary locality work.