preview_update
Preview COBie Excel updates as a dry run, returning a diff of changes to review before applying them with confirmation.
Instructions
Preview COBie updates (dry-run) and return diff. Explicit preview gate.
**Preview gate:** Use this before apply. To commit, call update_cobie with
dry_run=False only after user confirmation (e.g. confirm_token CONFIRM_APPLY).
No confirm_token on server; client enforces confirm_token.
Args:
excel_path: Path to COBie Excel file.
draft_json: Same shape as structured_update_json for update_cobie (instructions array).
actor_contact: Updater identity (required).
as_of_date: Optional date for CreatedOn/InstallationDate.
key_mode: Lookup mode for keys.
Returns:
UpdateResult with success, updated_count, diffs, summary, next_actions, dry_run=True.
Example:
result = preview_update("project.xlsx", {"instructions": [...]}, actor_contact)
# result.diffs = [{"sheet": "Component", "row_key": "C-1", "column": "SerialNumber", ...}]
# result.next_actions = ["To commit: call update_cobie with dry_run=False after confirm_token"]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key_mode | No | name | |
| as_of_date | No | ||
| draft_json | Yes | ||
| excel_path | Yes | ||
| actor_contact | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diffs | No | ||
| errors | No | ||
| dry_run | No | ||
| success | Yes | ||
| summary | No | ||
| provenance | No | ||
| updated_at | No | ||
| output_path | No | ||
| next_actions | No | ||
| updated_count | Yes | ||
| evidence_items | No |