| 1 | # Resumable cross-app scheduling |
| 2 | |
| 3 | Status: November 1 draft by GPT-6 Astra, independently reviewed and approved by GPT-6 Astra (review_docs_access), November 1. The user |
| 4 | authorized implementing the everyday editing APIs, shared conventions and one |
| 5 | substantial workflow including interruption, retry and revoked access. |
| 6 | |
| 7 | ## Boundary |
| 8 | |
| 9 | `calls_schedule` is a synchronous composite operation in the connection gateway. |
| 10 | It creates an optional Docs agenda, a Calls meeting and a Calendar event holding |
| 11 | their member-facing URLs. It sends no invitations, grants no new access and |
| 12 | does not claim a reservation from advisory free/busy. It never deletes objects |
| 13 | automatically to undo a partial result. There is no cross-app transaction. |
| 14 | |
| 15 | The gateway stores no workflow inputs, results or credentials. Durable state |
| 16 | is the workflow fingerprint reservation in the selected team's Calls database |
| 17 | plus each app's existing atomic create receipts. Resumption means submitting the |
| 18 | same UUID and original arguments again, even after every process restarts. |
| 19 | This is not a background job, autonomous retry service or a status-only API. |
| 20 | The client must retain its original request. No cross-team composition exists. |
| 21 | |
| 22 | ## Input and reservation |
| 23 | |
| 24 | Input: `{team,client_id,title,calendar_id,start,end,tz,notes,agenda?}`. `start` |
| 25 | and `end` are RFC3339 instants with explicit offsets; `tz` is an IANA zone. |
| 26 | The offsets must match that zone at both instants, end must follow start, and |
| 27 | local date/time conversion must round-trip without ambiguity. Calendar's own |
| 28 | validator is authoritative. `agenda` contains a title and the bounded literal |
| 29 | blocks accepted by `docs_create`. Unknown fields are rejected. |
| 30 | |
| 31 | Before any content effect, validate all known downstream inputs against |
| 32 | the configured exported schemas, every required route for this exact team, and |
| 33 | all scopes: `calls:read`, `calls:write`, `calendar:read`, `calendar:write`, plus |
| 34 | `docs:read` and `docs:write` for an agenda. |
| 35 | Each step obtains a fresh audience-bound credential using the original current |
| 36 | principal. Current directory membership and destination checks remain in force. |
| 37 | |
| 38 | New app operation `calls_reserve_schedule` (`calls:write`) takes |
| 39 | `{team,client_id,fingerprint}` and returns `{reserved:true}`. The fingerprint |
| 40 | is the lower-case SHA-256 of the normalized complete typed workflow request, |
| 41 | including version `1`. Calls stores only keyed fingerprints: a domain-separated |
| 42 | coordinate binding identity/delegation issuers, subject, client, team, operation |
| 43 | and UUID, and a keyed fingerprint of the supplied digest. No title, event text, |
| 44 | agenda, credentials or remote resource coordinates are persisted there. The |
| 45 | reservation is atomic, stable across restart and bound by existing immutable |
| 46 | authority configuration. Same UUID/different fingerprint refuses before effects. |
| 47 | The operation can also be called directly; it only reserves a fingerprint, never |
| 48 | claims that another app committed a step and never grants authority. |
| 49 | |
| 50 | The gateway derives distinct deterministic nonzero UUIDs for agenda, meeting and |
| 51 | event from the root UUID and a versioned step namespace. Existing app receipts |
| 52 | also bind person/client/team/authority; two people using the same UUID cannot |
| 53 | collide. The full-input reservation prevents changed later fields from causing |
| 54 | partial changes under an already-used workflow UUID. There is no receipt expiry |
| 55 | that permits implicit recreation within this implementation. |
| 56 | |
| 57 | ## Execution and results |
| 58 | |
| 59 | Order: reserve, optional agenda, meeting, event. After each success record only |
| 60 | the response in transient memory. The Calendar event gets explicit local start, |
| 61 | end and zone, `kind:meeting`, confirmed status, supplied notes plus canonical agenda |
| 62 | and meeting member URLs. Exact enum values follow the exported app contract. |
| 63 | URLs are checked against the corresponding configured app origin and known |
| 64 | resource route; no external response URL is fetched. Invitations remain false. |
| 65 | |
| 66 | Replays execute the same sequence with the same step IDs. App receipts return |
| 67 | the prior resources and preserve later manual changes. If a prior resource was |
| 68 | deleted or access was removed, stop; do not recreate it or skip the failure. |
| 69 | An ambiguous/lost response is retried only with the same step UUID. Concurrent |
| 70 | requests rely on each app's atomic uniqueness and receipt transaction. |
| 71 | |
| 72 | Result: workflow UUID, team, `status:complete|partial`, confirmed step references, |
| 73 | `invitations_sent:false`, and, on partial completion, a failed step plus a fixed |
| 74 | failure code. Unattempted steps are distinguishable from confirmed steps. A |
| 75 | failed request may nevertheless have committed; failure is not a nonexistence |
| 76 | claim. When authorization is lost, return an authorization failure without |
| 77 | previously selected resource details. On other errors, revalidate selected |
| 78 | resources under current authority before releasing partial details. Completed |
| 79 | responses likewise revalidate selected resources. A later retry rediscovers |
| 80 | progress through receipts, not an unverified checkpoint supplied by a client. |
| 81 | |
| 82 | ## Evidence |
| 83 | |
| 84 | Use exported app contracts to validate every step and the composite contract. |
| 85 | Test whole success, missing scope/route before effects, changed-input reservation, |
| 86 | failure and lost response after each commit, full restart and replay, concurrent |
| 87 | retries, deletion/manual edit after partial completion, same UUID across users, |
| 88 | revocation between each step and before response, false/foreign URLs, DST gaps |
| 89 | and folds, result limits, HTTP/CLI/MCP parity, and real app store effects. |
| 90 | Remove reservation binding, step-ID stability and revalidation separately to |
| 91 | prove the behavioral gates fail. Source review precedes deployment; existing |
| 92 | team adoption and scoped infrastructure approval remain separate live gates. |
| 93 | |
| 94 | ## Review resolutions (November 1) |
| 95 | |
| 96 | Require read scopes as well as write scopes. Resource revalidation uses only |
| 97 | `docs_get`, `calls_get_meeting`, and `calendar_get_event`, never mutation replay. |
| 98 | Before every step and after all read checks, validate every required scope/team/ |
| 99 | destination through the credential provider against the original immutable |
| 100 | Subject/Client/Grant. Any unavailable/refused revalidation suppresses all |
| 101 | references. HTTP uses the existing guarded emission path before headers/chunks; |
| 102 | MCP revalidates before returning the bounded tool result to the SDK. There is no |
| 103 | claim of a cross-app atomic snapshot or byte-by-byte authorization inside the SDK. |
| 104 | |
| 105 | Preflight validates known fields only. Generated URLs are validated against |
| 106 | trusted routes and schemas before subsequent use; authoritative app validation |
| 107 | can still refuse a later step and leave an honest partial result. No pure |
| 108 | Calendar preflight endpoint is claimed. Calendar local minute precision requires |
| 109 | zero input seconds/nanoseconds; offsets and ambiguity are checked before effects. |
| 110 | |
| 111 | The fingerprint is SHA-256 of JSON for a version-1 typed request, with exact |
| 112 | int64 calendar ID and fields in declared order. UUID spelling is canonical; |
| 113 | title/notes/zone and canonical RFC3339 start/end spelling are preserved. Agenda |
| 114 | absence is nil; paragraph level omission normalizes to zero. Versioned step IDs |
| 115 | are RFC4122 v5 using namespace 8ba3600d-9e03-52df-8c34-9ff05a6e66cb and the exact |
| 116 | name `oficina.schedule.v1/<root UUID>/<agenda|meeting|event>`. Receipts additionally |
| 117 | bind actor, client and team. Responses are limited below 64 KiB. |
| 118 | |
| 119 | |
| 120 | ## Implementation evidence (2026-11-01) |
| 121 | |
| 122 | The opt-in `TestSuiteSchedulingInterop` passed against the real Docs, Calls and |
| 123 | Calendar delegated HTTP handlers, their exported contracts, sealed stores and |
| 124 | atomic create receipts. The CLI adapter observed a partial result after a |
| 125 | transport deliberately lost Calendar's committed reply. A fresh gateway's MCP |
| 126 | server completed the unchanged request, returned identical resources on replay, |
| 127 | and exposed the expected agenda body and both cross-app URLs in the event. |
| 128 | Changed arguments conflicted and revoked credentials refused resumption. |
| 129 | `python3 scripts/suite-interop.py` reproduces this with temporary private stores. |
| 130 | This does not establish deployed Home/team setup or hosted-client acceptance. |
| 131 | |
| 132 | The shared tests additionally drop responses after every step, reject revoked |
| 133 | read scopes before writes, withhold results after revocation, reject foreign |
| 134 | resource URLs, recheck deleted resources with pure reads, reject malformed |
| 135 | Unicode before reservation, reject DST folds/gaps, and recheck authority at the |
| 136 | MCP result-return seam after registry output validation. |
| 137 | |
| 138 | Independent GPT-6 Astra review selected six shared-runtime fault mutations: |
| 139 | accept malformed Unicode, omit the MCP final guard, omit final resource checks, |
| 140 | skip an earlier app's scope, accept a foreign URL, and randomize retry step IDs. |
| 141 | Each caused a behavioral test failure; no build failure counted as detection. |
| 142 | All original sources were restored. Resource references additionally validate |
| 143 | against the destination's read schema and member-route ID shape before use; |
| 144 | the response guard verifies the step, app, ID and canonical URL together. |
| 145 | |
| 146 | Final shared implementation review: GPT-6 Astra (`review_docs_access`) approved |
| 147 | on 2026-11-01 after inspecting source, all six effective mutation failures and |
| 148 | the three-app acceptance evidence. The restored source passed `make ci`, |
| 149 | including all-package race tests. Calls roster reconciliation and reservation |
| 150 | have their own app review and gate; live four-client acceptance remains pending. |
| 151 | |