-
Notifications
You must be signed in to change notification settings - Fork 5
Make Subduction the default #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,15 +45,15 @@ pushwork url | |||||||||||||||||||
|
|
||||||||||||||||||||
| **`init [path]`** - Initialize sync in a directory | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - `--sync-server <url> <storage-id>` - Custom sync server URL and storage ID | ||||||||||||||||||||
| - `--sub` - Use the Subduction sync backend (opt-in, persisted in config) | ||||||||||||||||||||
| - `--sync-server <url> <storage-id...>` - Custom sync server URL and storage ID | ||||||||||||||||||||
| - `--legacy` - Use the legacy WebSocket sync backend (Subduction is default) | ||||||||||||||||||||
| - `--debug` - Export performance flame graphs | ||||||||||||||||||||
|
|
||||||||||||||||||||
| **`clone <url> <path>`** - Clone an existing synced directory | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - `--force` - Overwrite existing directory | ||||||||||||||||||||
| - `--sync-server <url> <storage-id>` - Custom sync server URL and storage ID | ||||||||||||||||||||
| - `--sub` - Use the Subduction sync backend (opt-in, persisted in config) | ||||||||||||||||||||
| - `--sync-server <url> <storage-id...>` - Custom sync server URL and storage ID | ||||||||||||||||||||
| - `--legacy` - Use the legacy WebSocket sync backend (Subduction is default) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| **`sync [path]`** - Run bidirectional synchronization | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
@@ -105,38 +105,63 @@ Configuration is stored in `.pushwork/config.json`: | |||||||||||||||||||
|
|
||||||||||||||||||||
| ```json | ||||||||||||||||||||
| { | ||||||||||||||||||||
| "config_version": 1, | ||||||||||||||||||||
| "protocol": "subduction", | ||||||||||||||||||||
| "sync_server": "wss://subduction.sync.inkandswitch.com", | ||||||||||||||||||||
| "sync_enabled": true, | ||||||||||||||||||||
| "exclude_patterns": [".git", "node_modules", "*.tmp", ".pushwork"], | ||||||||||||||||||||
| "artifact_directories": ["dist"], | ||||||||||||||||||||
| "sync": { | ||||||||||||||||||||
| "move_detection_threshold": 0.7 | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| A legacy-backend config looks like: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```json | ||||||||||||||||||||
| { | ||||||||||||||||||||
| "config_version": 1, | ||||||||||||||||||||
| "protocol": "legacy", | ||||||||||||||||||||
| "sync_server": "wss://sync3.automerge.org", | ||||||||||||||||||||
| "sync_server_storage_id": "3760df37-a4c6-4f66-9ecd-732039a9385d", | ||||||||||||||||||||
| "sync_enabled": true, | ||||||||||||||||||||
| "defaults": { | ||||||||||||||||||||
| "exclude_patterns": [".git", "node_modules", "*.tmp", ".pushwork"], | ||||||||||||||||||||
| "large_file_threshold": "100MB" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "diff": { | ||||||||||||||||||||
| "show_binary": false | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "exclude_patterns": [".git", "node_modules", "*.tmp", ".pushwork"], | ||||||||||||||||||||
| "artifact_directories": ["dist"], | ||||||||||||||||||||
| "sync": { | ||||||||||||||||||||
| "move_detection_threshold": 0.8, | ||||||||||||||||||||
| "prompt_threshold": 0.5, | ||||||||||||||||||||
| "auto_sync": false, | ||||||||||||||||||||
| "parallel_operations": 4 | ||||||||||||||||||||
| "move_detection_threshold": 0.7 | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ### Sync Backends | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Pushwork supports two sync backends: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - **WebSocket (default)** — talks to `wss://sync3.automerge.org` via the | ||||||||||||||||||||
| standard Automerge sync protocol. Uses `sync_server_storage_id` to | ||||||||||||||||||||
| verify delivery via `getSyncInfo`. | ||||||||||||||||||||
| - **Subduction (opt-in)** — pass `--sub` on `init` or `clone` to select | ||||||||||||||||||||
| the Subduction backend (default endpoint: | ||||||||||||||||||||
| `wss://subduction.sync.inkandswitch.com`). The Subduction choice is | ||||||||||||||||||||
| persisted in `.pushwork/config.json` as `"subduction": true`, so | ||||||||||||||||||||
| subsequent `sync` / `watch` commands pick it up automatically. | ||||||||||||||||||||
| `sync_server_storage_id` is not used in this mode. | ||||||||||||||||||||
| Pushwork supports two sync backends. Subduction is the default. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - **Subduction (default)** — `wss://subduction.sync.inkandswitch.com`. | ||||||||||||||||||||
| The backend is selected at `init` / `clone` time and persisted in | ||||||||||||||||||||
| `.pushwork/config.json` as `"protocol": "subduction"`. Subsequent | ||||||||||||||||||||
| `sync` / `watch` runs read the choice from config. | ||||||||||||||||||||
| - **Legacy WebSocket** — opt in via `--legacy` on `init` or `clone` to | ||||||||||||||||||||
| use `wss://sync3.automerge.org` with `sync_server_storage_id` for | ||||||||||||||||||||
| delivery verification. Persisted as `"protocol": "legacy"`. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ### Config schema version | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Configs written by current pushwork include `"config_version": 1`. | ||||||||||||||||||||
| Older configs (without this field) are automatically migrated on the | ||||||||||||||||||||
| next write-ish command (`sync`, `watch`, `commit`, `init`, `clone`, | ||||||||||||||||||||
| `track`). The original v0 file is saved as `config.json.bak` (or | ||||||||||||||||||||
| `config.json.bak.1`, `.bak.2`, ... if earlier backups exist) and a | ||||||||||||||||||||
| notice is printed. | ||||||||||||||||||||
|
Comment on lines
+152
to
+156
|
||||||||||||||||||||
| Older configs (without this field) are automatically migrated on the | |
| next write-ish command (`sync`, `watch`, `commit`, `init`, `clone`, | |
| `track`). The original v0 file is saved as `config.json.bak` (or | |
| `config.json.bak.1`, `.bak.2`, ... if earlier backups exist) and a | |
| notice is printed. | |
| Older configs (without this field) are automatically migrated when you | |
| run `sync`, `watch`, or `commit`. The original v0 file is saved as | |
| `config.json.bak` (or `config.json.bak.1`, `.bak.2`, ... if earlier | |
| backups exist) and a notice is printed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section states that
init,clone, andtrackcallmigrateConfigIfNeeded()at the top, but the current command implementations only invoke migration forsync,watch, andcommit. Please update the command list here (or adjust the code) to avoid documenting behavior that doesn’t happen (especially around.bakbackups).