apply_table_patch
Preview or commit a keyed patch to existing Excel table rows, validating unique keys, read dependencies, and unchanged headers before applying all-or-nothing updates with rollback.
Instructions
Preview/commit a three-way keyed patch against a pinned retained base.
patch requires version=1, source={table_name, optional sheet_name}, nonempty
key_fields, explicit read_fields (use [] only for no extra dependencies), and
updates=[{key: {all key fields}, values: {literal field updates}}]. Write fields
must not be keys/read_fields. Checks complete unique keys and row-local read
dependencies; does not infer undeclared or cross-row dependencies. Existing
rows only, same exact headers with reordering allowed, no formula evaluation.
Conflicts/missing rows/changed premises block the entire batch. Commit requires
the identical patch/base and rebase_token/expected_workbook_sha256 from a fresh
preview. Reuses ChangeSet snapshots, exact-file checks and rollback. Limits:
1000 target cells, 50 contiguous column spans, 50000 table cells/64 columns per
source; sample_limit 1-10 bounds examples only. Tokens are not authentication.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | preview | |
| patch | Yes | ||
| filepath | Yes | Reuse supplied server path; NEVER prepend client cwd. Rooted: relative OK; unrooted stdio: absolute, ask if missing. | |
| rebase_token | No | ||
| sample_limit | No | ||
| base_filepath | Yes | Reuse supplied server path; NEVER prepend client cwd. Rooted: relative OK; unrooted stdio: absolute, ask if missing. | |
| expected_base_sha256 | Yes | ||
| expected_workbook_sha256 | No |