Stage, review and persist changes
Choose the review workflow
Read the mode from server-status with detail: "Full":
| Mode | Inspect staged changes | Commit |
|---|---|---|
inspection-only |
Transaction tools unavailable | Unavailable |
transactional |
transaction-preview |
expectedSnapshot; Host confirmation per commit or session |
approval-required |
transaction-review |
expectedSnapshot and returned receiptId; Host receipt approval |
autonomous-trusted |
transaction-preview |
expectedSnapshot |
transaction-preview takes no expectedSnapshot; transaction-review requires it.
Complete one transaction
- Resolve the task through queries, then call
transaction-start. A Host permits one active transaction across all workspaces. - Resolve mutation targets in the transaction's current snapshot, then stage Code Actions, renames or formatting. Check
data.stagedand retain the returned snapshot before resolving the next target. Queries see staged source; ordinary file reads still see disk. Keep mutations and transaction operations sequential. - Inspect the complete changed-document summary. For a detailed diff, supply
documentandincludeDiff: trueto preview/review. This selects one diff, not a subset to commit. Review every changed path, including additions and deletions. - Commit the reviewed revision or discard it with
transaction-rollback. Inspectdata.committedanddata.transaction: a successful no-change commit can returncommitted: falseand leave the transaction active. Roll back an empty transaction when finished. - Run the repository's build/tests as needed after persistence. Workbench commit writes source files; it does not create a Git commit.
transaction-history moves one staged revision with direction: "Undo" or "Redo" and the current expectedSnapshot; it does not list history. Check canUndo/canRedo, retain its new snapshot and rediscover subsequent targets. Conflicted transactions must be rolled back before history can change.
Compiler validation
When enabled, transaction-validate compares compiler errors with the transaction-start baseline for changed loaded projects and their loaded transitive dependants. Existing errors may remain. Require both data.isComplete and data.succeeded; inspect limitations, incompleteReasons and data.continuation.
Review and commit enforce this optional gate automatically; commit validates again. It does not validate analysers, run tests or perform a full build. Fix introduced errors within the transaction. For incomplete validation, roll back, correct loading/input conditions, reload or reopen as status requires, then start again.
Receipt and persistence failures
Receipts are process-local, one-use and valid for at most 15 minutes while workspace epoch, snapshot and revision remain unchanged. Staging, history moves or expiry require another review. Declined/unavailable approval leaves the receipt and transaction active. Accepted approval consumes the receipt before final validation/persistence; a later failure requires a fresh review.
Keep affected source paths free of concurrent edits until commit returns. After uncertain persistence, inspect workspace-status and follow recovery guidance before retrying. Source creation, deletion and file renaming do not update project membership: handle explicit project includes separately and reload afterwards. Source-generated documents and obj source cannot be mutation targets; inspect warnings for checked-in generated-looking files.