oficina / agent-access Public

Clone
git clone https://amadan.net/oficina/agent-access

Plain git — no account needed to clone.

Download this file

1# API conventions and editing contract
2
3Status: November 1 specification by GPT-6 Astra; independently approved by GPT-6 Astra (review_docs_access). Applies to
4the shared delegated operation interface, not a replacement for editor/native
5wire protocols. Existing operation contracts remain compatible.
6
7## Resource identity and revisions
8
9Resource IDs are opaque and app-scoped. Never parse one app's ID as another's,
10infer team membership from a URL, or use a returned URL as a routing argument.
11Existing `id`, `sqid`, `sheet_id` and `tab_id` fields retain their types. Exact
12JSON integers must survive all transports without a float conversion.
13
14New cross-app references use `{team,app,id,url}` with an opaque string ID and a
15canonical member-facing URL. A reference grants no access; each destination
16checks the current person. It is never a guest invitation or bearer URL.
17The configured directory and app routes remain the routing authority.
18
19An edit supplies a canonical nonzero UUID `client_id` and `expected_revision`.
20The precondition has the type and exact value returned by that app's read:
21Docs `body_revision`, Sheets/Slides `revision` (decimal strings), Memoria
22`revision` and Calendar `sequence` (integers). Revisions are equality tokens,
23not a suite-wide clock. A new stale edit is `conflict` with no effects.
24
25The domain write, revision check and immutable retry receipt share one writer
26transaction. Receipts bind authority/subject/client/team/operation/UUID and the
27full request, including the target and precondition. Exact completed retries
28recheck current access and the live target, return the original applied revision,
29and never apply the edit again or overwrite later edits. Reusing a UUID with
30different arguments is `conflict`. Removed resources are not recreated.
31New edit acknowledgements report their original applied `revision`; read again
32for current content. Existing create acknowledgement behavior is unchanged.
33
34Browser, native and delegated edits use the same canonical domain mutations.
35Editable content retains the original app's collaboration, sealing, attribution,
36indexing and reminder semantics. An unsupported edit is explicitly refused.
37
38## Errors, pagination and compatibility
39
40HTTP failures use `{error:{code,message}}`. Stable codes map to 401
41`unauthenticated`, 403 `forbidden`, 404 `not_found`, 409 `conflict`, 413
42`too_large`, 415 `unsupported_media_type`, 422 `invalid`, 429 `rate_limited`,
43503 `unavailable`, and 500 `internal`. Gateways and clients retain the code
44without forwarding arbitrary remote error prose, HTML or credentials. Neither
45a timeout nor `unavailable` proves a write failed: retry with the original
46UUID and exact request. Authorization refusals are not automatic retry loops.
47
48Existing pagination remains as exported: Calls uses `after/next_after/has_more`;
49Docs, Sheets and Slides use `cursor/next_cursor`. New paginated operations use
50opaque `cursor`, bounded `limit`, and `next_cursor`, empty at the end. Do not
51silently rename fields in old operations. Document limits and partial results.
52
53Exported operation schemas are the machine contract for HTTP, CLI and MCP.
54Removing/renaming a field, tightening accepted inputs or changing meaning needs
55a new operation/version and a migration path. New operations are additive;
56existing scopes do not expand to sharing, deletion or invitation delivery.
57App exports and connection routes must agree exactly. Compatibility tests use
58real exported contracts and behavior, not a parallel handwritten schema.
59
60## Authorized next slice
61
62`docs_update`, `sheets_set_range`, `slides_update_deck`, `notes_get`,
63`notes_update`, and `calendar_update_event` complete the bounded editing loop.
64Per-app amendments define supported content and the tests behind each boundary.
65The scheduling amendment adds resumable composition of already authorized
66creates. Search/export/sharing/history gaps remain listed as gaps; this slice
67does not claim every browser action is automated.
68