swg_write
Writes a workspace text file, denying if the file changed since last read, preventing silent overwrites by stale agents on a single host.
Instructions
Write a workspace text file (acquire -> write -> commit). DENIED with reason=stale_view if the file changed since you read it — a peer commit OR an out-of-band edit (another tool/editor): recover with swg_reacquire, then write FROM its bytes. A mid-write preempt returns reason=commit_preempted (disk may hold un-versioned bytes; reacquire_and_reconcile). SINGLE-HOST only. Out of guarantee and NOT detected in v1: writers on different hosts or across a synced/network mount, divergent-history reconciliation, semantic correctness, server-enforced auto-merge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes |