The Operations API: one command catalogue, several transports, person-bound tokens
Status: proposed (2026-10-01) — provisional by the maintainer’s explicit marking.
An Operation is a named, typed, permissioned domain command a Person — or an assistant acting as that Person — can invoke programmatically: create a Meeting, author a Slide, publish an Assessment, roll a Rota, generate a progress table. An Operation validates against the same domain schemas the UI uses, requires the same permissions the Person has, and leaves an audit record naming the actor, human or assistant. Operations are the intention-level verbs; they are not the application’s read/write data path — that remains the sync rail.
The Operations API exposes one catalogue through several transports: MCP for workstation assistants (the maintainer’s Claude/Codex sessions connect to it), plain HTTP for scripts, and the same catalogue called in-process by a future emergent-native assistant, so one definition serves all three. Authentication is by person-bound, scope-limited, revocable tokens. This is a new door kind beside standards, bytes and auth in the REST-to-sync rule: an agent driving typed commands is not the app syncing rows, and it never rides the sync rail.
Creating and modifying content may require connectivity. The platform’s offline guarantee is for presenting and for in-class records (Checkpoints, Attendance, Observations), which ride the sync rail as every app write does; deck authoring, calendar edits, bridge operations and Deliverable generation are online operations, and no local-model story is promised. This is the maintainer’s explicit line (2026-10-01): “we aren’t realistically going to be providing local models for creating decks, so the online API can be required for creating/modifying”.
The scaffolding is acknowledged as a workstream of its own, sized like one, serving every feature after it: operation schemas, per-operation permission checks, the audit trail, token issuance and revocation UI (and the personal-access-token story for workstation assistants), the MCP server package, idempotency for retried commands, and agent-facing documentation. The first consumers are deck authoring (ADR-0066), then meetings and the calendar, the Platform Bridge (ADR-0067) and Deliverables (ADR-0068).
Considered options
Section titled “Considered options”- Per-feature REST endpoints. Rejected: every feature would repeat the auth, validation and audit story, and the platform’s own written rule is that non-standards REST does not sprawl. One catalogue, many transports, is what makes “the direction of travel for everything” (the maintainer’s phrase) affordable.
- Routing authoring through the sync rail (pgxsinkit). Rejected by the maintainer explicitly: commands are coarse verbs with validation and audit, not row sync; and in-class writes already ride the sync rail without needing Operations to join them.
- MCP only, or HTTP only. Rejected: workstation assistants speak MCP today; scripts, cron jobs and CI want plain HTTP; the native assistant wants in-process calls. The definition must be transport-neutral.
- OAuth client-credentials shaped tokens now. Deferred: person-bound PATs with scopes cover the workstation-assistant case; a fuller OAuth story can arrive with external teachers without changing the catalogue.
Consequences
Section titled “Consequences”- A new authorisation surface: every Operation re-checks the person’s permissions server-side, reusing the domain’s reach rules rather than RLS alone (operations may act outside a request-scoped Postgres session).
- An operations audit trail (actor, operation, target, timestamp, result) that is separate from the row-level LWW columns; agents’ edits are attributable.
- Agent-facing documentation becomes a maintained artefact (operation catalogue as llms.txt-style reference), because the primary consumer is a model.
- The sync rail’s mandate is amended, not weakened: the new door kind is written down here, and anything that is not a command remains sync.
- Token management UI (issue, scope, revoke) lands in the teacher portal and/or account settings; revocation is the platform’s answer to a leaked assistant token.