Spreadsheet Governance & Collaborative AI Workflows
MCP apply_changes Revision, Idempotency & Conflict Audit
Audit external connector apply_changes guardrails on cloud workbooks: Pro + editor/owner access, <= 100 cell cap, 16-80 char operation_id idempotency, base revision matching, and pendingReview concurrent peer-edit routing.
Prevent silent overwrites when an external MCP client writes to a live collaborative workbook!
When collaborators edit a shared cloud workbook in Arte Sheets while an external scoped OAuth client (such as the Arte Sheets ChatGPT 0.1.0 connector — currently In review / Not published; grants managed under Profile -> Connected apps) calls apply_changes under sheets:write, strict server-side invariants prevent silent data loss or duplicate network retries! Specifically, apply_changes requires: (1) a cloud collaboration workbook (local browser-only workbooks are unavailable to external connectors), (2) an active Pro subscription (or canceled-but-paid active billing period) PLUS workbook role editor/contributor or owner (suggester and viewer roles cannot mutate cells via apply_changes), (3) at most 100 cells per call, (4) a 16-to-80 character idempotent operation_id so network retries never apply the same patch twice, and (5) the exact base revision returned by read_range! Importantly, read_range (<= 200 cells) returns raw inputs/formulas and revision without recalculating formulas, ordinary MCP calls consume 0 Arte AI credits (subject to the 120 calls/min per-account limiter), and if a teammate concurrently modified any target cell since base_revision, the server routes the conflicting edit to pendingReview instead of clobbering the peer’s work!
Build a 7-parameter governance preflight table and verify every rule by hand! Set Pro_Active = 1 (B2), Role_Can_Edit = 1 for owner/editor (B3), Patch_Cell_Count = 42 cells (B4 <= 100), Operation_ID_Len = 36 chars (B5, e.g., a UUID in [16, 80]), Read_Base_Revision = 18 (B6), Current_Server_Revision = 21 (B7), and Target_Cell_Touched_Since_Base = 1 (B8): Preflight Payload Validity passes (1), Remaining Cell Headroom is 100 - 42 = 58 cells, Arte AI Credit Charge is 0 credits (vs metered in-app Pro Assistant requests), and Commit Outcome evaluates to "Route to pendingReview (Concurrent Peer Edit)" — whereas if Current_Server_Revision = 18 (or Target_Cell_Touched_Since_Base = 0), the write commits cleanly as "Clean Direct Commit"!
| apply_changes Governance Check | Verified Server Rule | Example Audit Output |
|---|---|---|
| Entitlement & Role Gate | Active Pro + owner/editor on Cloud Workbook | Pass (Suggester/Viewer Blocked) |
| Batch Size & Idempotency Gate | 1..100 cells & 16 <= LEN(operation_id) <= 80 | 58 cells headroom (36-char UUID) |
| Metered Arte AI Credit Cost | 0 Arte AI credits (120 calls/min burst cap) | 0 credits |
| Concurrent Revision Outcome (Rev 18 -> 21) | IF(AND(Rev > Base, Conflict=1), "pendingReview") | Route to pendingReview |
apply_changes Payload & Entitlement Preflight Gate Formula
Validate Pro status (1), editor/owner permission (1), 1 <= cells <= 100, and 16 <= operation_id_length <= 80 before dispatching an external mutation.
=LET(pr_ok, B2, ed_ok, B3, n_cl, B4, id_ln, B5, IF(OR(pr_ok <> 1, ed_ok <> 1), "Blocked: Require Active Pro & Editor/Owner", IF(OR(n_cl < 1, n_cl > 100), "Blocked: Exceeds 100-Cell Cap", IF(OR(id_ln < 16, id_ln > 80), "Blocked: Require 16-80 Char operation_id", "Preflight Valid"))))Base-Revision & Concurrent Peer-Edit Outcome Classifier Formula
After preflight passes, compare Current_Server_Revision against Read_Base_Revision: stale future base revisions (Current < Base) are invalid, clean non-conflicting revisions commit directly, and concurrent edits on target cells return pendingReview so teammates can inspect formulas and test changed inputs before accepting or rejecting!
=LET(pf_st, E2, rv_bs, B6, rv_cr, B7, cf_cl, B8, IF(pf_st <> "Preflight Valid", pf_st, IF(OR(rv_bs < 0, rv_cr < rv_bs, AND(rv_cr = rv_bs, cf_cl = 1)), "Invalid Revision State", IF(AND(rv_cr > rv_bs, cf_cl = 1), "Route to pendingReview", "Clean Direct Commit"))))Try the example
Use the original values or change them to test your understanding.