@narumitw/pi-sync 0.67.2 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +29 -49
  3. package/dist/chunks/{chunk-XUZV4OGI.ts → chunk-335XTMMZ.ts} +3 -2
  4. package/dist/chunks/{chunk-XUZV4OGI.ts.map → chunk-335XTMMZ.ts.map} +2 -2
  5. package/dist/chunks/{chunk-PUSMSKIM.ts → chunk-AYGMIMCV.ts} +2 -11
  6. package/dist/chunks/chunk-AYGMIMCV.ts.map +7 -0
  7. package/dist/chunks/{chunk-2MSJDLSM.ts → chunk-BCDBT4X3.ts} +7 -7
  8. package/dist/chunks/{chunk-GRXNUC6O.ts → chunk-FQKWGVMA.ts} +20 -54
  9. package/dist/chunks/chunk-FQKWGVMA.ts.map +7 -0
  10. package/dist/chunks/{chunk-DGVZYS7T.ts → chunk-FR6A7ASZ.ts} +8 -11
  11. package/dist/chunks/chunk-FR6A7ASZ.ts.map +7 -0
  12. package/dist/chunks/{chunk-3NS4PMCI.ts → chunk-J52GYZO6.ts} +2 -8
  13. package/dist/chunks/{chunk-3NS4PMCI.ts.map → chunk-J52GYZO6.ts.map} +2 -2
  14. package/dist/chunks/{chunk-2MUAR5GH.ts → chunk-KAIVTJIQ.ts} +7 -10
  15. package/dist/chunks/chunk-KAIVTJIQ.ts.map +7 -0
  16. package/dist/chunks/{chunk-WBIOSK76.ts → chunk-R7PN3KIY.ts} +1 -2
  17. package/dist/chunks/{chunk-3Q3DMMID.ts → chunk-TLYT6HVI.ts} +8 -8
  18. package/dist/chunks/{chunk-UF2HU2NM.ts → chunk-WCGLU526.ts} +39 -118
  19. package/dist/chunks/chunk-WCGLU526.ts.map +7 -0
  20. package/dist/chunks/{chunk-JREGWM2B.ts → chunk-XNUARYLR.ts} +1 -2
  21. package/dist/chunks/{chunk-C3E75DXW.ts → chunk-YV2R5SJU.ts} +73 -85
  22. package/dist/chunks/chunk-YV2R5SJU.ts.map +7 -0
  23. package/dist/chunks/{command-handler-HWRPH3K3.ts → command-handler-S6BRZMPW.ts} +117 -69
  24. package/dist/chunks/command-handler-S6BRZMPW.ts.map +7 -0
  25. package/dist/chunks/{conflict-review-OBBBSVQD.ts → conflict-review-3XMYDJIK.ts} +2 -2
  26. package/dist/chunks/{file-selection-GASCVN45.ts → file-selection-4BOQBXS7.ts} +10 -17
  27. package/dist/chunks/file-selection-4BOQBXS7.ts.map +7 -0
  28. package/dist/chunks/{manager-result-dispatcher-MJ6G2CEI.ts → manager-result-dispatcher-A4IWLS4J.ts} +7 -7
  29. package/dist/chunks/{manager-ui-Z3B5ZTA6.ts → manager-ui-KHMCSLLV.ts} +114 -581
  30. package/dist/chunks/manager-ui-KHMCSLLV.ts.map +7 -0
  31. package/dist/chunks/{chunk-ECUCXF5Y.ts → merge-review-LWMUE5IW.ts} +2 -3
  32. package/dist/chunks/{remote-selection-ui-34WC7OFE.ts → remote-selection-ui-F6NJBQ3Y.ts} +6 -6
  33. package/dist/chunks/{setup-switch-JZDFQPVW.ts → setup-switch-7LMIRMZ7.ts} +6 -6
  34. package/dist/chunks/{setup-wizard-YOXLXLBY.ts → setup-wizard-2NRPR433.ts} +11 -16
  35. package/dist/chunks/{setup-wizard-YOXLXLBY.ts.map → setup-wizard-2NRPR433.ts.map} +1 -1
  36. package/dist/chunks/{sync-inspection-NIITROKS.ts → sync-inspection-QGM54YCM.ts} +5 -5
  37. package/dist/chunks/{sync-operations-FFI4ZZQL.ts → sync-operations-DTQMKVRQ.ts} +2 -2
  38. package/dist/daemon/dist/build-id.json +1 -0
  39. package/dist/daemon/dist/build-version.js +24 -4
  40. package/dist/daemon/dist/cli.js +51 -67
  41. package/dist/daemon/dist/client-transport.js +15 -5
  42. package/dist/daemon/dist/client.js +2 -10
  43. package/dist/daemon/dist/consent.js +13 -126
  44. package/dist/daemon/dist/daemon-startup.js +135 -30
  45. package/dist/daemon/dist/daemon-status.js +56 -0
  46. package/dist/daemon/dist/engine/backends/git/git-backend.js +4 -17
  47. package/dist/daemon/dist/engine/backends/git/git-storage.js +11 -44
  48. package/dist/daemon/dist/engine/backends/s3/s3-backend.js +6 -6
  49. package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +6 -6
  50. package/dist/daemon/dist/engine/settings/config.js +16 -149
  51. package/dist/daemon/dist/engine/settings/retired-ignore-policy.js +16 -0
  52. package/dist/daemon/dist/engine/settings/retired-ignore-recovery.js +14 -0
  53. package/dist/daemon/dist/engine/settings/settings-management.js +2 -10
  54. package/dist/daemon/dist/engine/settings/settings-validation.js +8 -21
  55. package/dist/daemon/dist/engine/snapshot/session-paths.js +13 -41
  56. package/dist/daemon/dist/engine/snapshot/snapshot-apply.js +8 -24
  57. package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +7 -11
  58. package/dist/daemon/dist/engine/snapshot/snapshot-exclude-safety.js +19 -76
  59. package/dist/daemon/dist/engine/snapshot/snapshot-transaction-images.js +1 -7
  60. package/dist/daemon/dist/engine/snapshot/snapshot-transaction-policy.js +8 -102
  61. package/dist/daemon/dist/engine/snapshot/snapshot-transaction.js +20 -100
  62. package/dist/daemon/dist/engine/snapshot/snapshot-types.js +1 -11
  63. package/dist/daemon/dist/engine/snapshot/snapshot.js +26 -78
  64. package/dist/daemon/dist/engine/state/sync-state-store.js +5 -1
  65. package/dist/daemon/dist/engine/sync/agent-plan.js +0 -1
  66. package/dist/daemon/dist/engine/sync/agent-policy.js +1 -1
  67. package/dist/daemon/dist/engine/sync/conflict-review.js +0 -2
  68. package/dist/daemon/dist/engine/sync/continuous-sync.js +2 -17
  69. package/dist/daemon/dist/engine/sync/continuous-watch.js +3 -7
  70. package/dist/daemon/dist/engine/sync/directional-action.js +3 -21
  71. package/dist/daemon/dist/engine/sync/initialization.js +4 -15
  72. package/dist/daemon/dist/engine/sync/local-fields.js +4 -65
  73. package/dist/daemon/dist/engine/sync/merge-apply.js +8 -31
  74. package/dist/daemon/dist/engine/sync/merge-journal.js +8 -118
  75. package/dist/daemon/dist/engine/sync/merged-sync.js +13 -70
  76. package/dist/daemon/dist/engine/sync/push-review.js +1 -16
  77. package/dist/daemon/dist/engine/sync/remote-snapshot.js +48 -65
  78. package/dist/daemon/dist/engine/sync/startup-bootstrap.js +3 -3
  79. package/dist/daemon/dist/engine/sync/sync-error-guidance.js +1 -1
  80. package/dist/daemon/dist/engine/sync/sync-inspection.js +1 -2
  81. package/dist/daemon/dist/engine/sync/sync-mutations.js +26 -118
  82. package/dist/daemon/dist/engine/sync/sync-policy.js +26 -150
  83. package/dist/daemon/dist/engine/sync/sync-queries.js +1 -8
  84. package/dist/daemon/dist/engine/sync/sync-rollback.js +12 -50
  85. package/dist/daemon/dist/engine/sync/sync-state.js +2 -15
  86. package/dist/daemon/dist/engine/sync/transfer-freshness.js +7 -17
  87. package/dist/daemon/dist/engine/sync/transfer-size-limits.js +3 -7
  88. package/dist/daemon/dist/engine-service.js +62 -205
  89. package/dist/daemon/dist/foreground-queue-outcome.js +0 -4
  90. package/dist/daemon/dist/index.js +2 -0
  91. package/dist/daemon/dist/legacy-consent-guard.js +34 -0
  92. package/dist/daemon/dist/server.js +99 -11
  93. package/dist/daemon/dist/service-host.js +3 -9
  94. package/dist/daemon/package.json +1 -1
  95. package/dist/index.ts +49 -49
  96. package/dist/index.ts.map +3 -3
  97. package/docs/agent-continuous-hardening.md +2 -0
  98. package/docs/continuous-sync-verification.md +1 -1
  99. package/docs/daemon-migration.md +17 -15
  100. package/docs/tui-contract.md +4 -6
  101. package/package.json +2 -3
  102. package/skills/configure-pi-sync/SKILL.md +23 -78
  103. package/skills/configure-pi-sync/references/configuration.md +59 -76
  104. package/src/commands/command-execution.ts +15 -38
  105. package/src/commands/command-handler.ts +0 -4
  106. package/src/commands/command.ts +2 -1
  107. package/src/daemon/daemon-status-ui.ts +64 -0
  108. package/src/daemon/directional-recovery.ts +4 -33
  109. package/src/daemon/pi-client.ts +87 -94
  110. package/src/settings/config.ts +0 -1
  111. package/src/sync/setup-switch.ts +1 -4
  112. package/src/sync-extension.ts +14 -27
  113. package/src/ui/cancellable-operation.ts +2 -13
  114. package/src/ui/excluded-paths-ui.ts +1 -4
  115. package/src/ui/file-selection.ts +0 -5
  116. package/src/ui/manager-state.ts +12 -75
  117. package/src/ui/manager-ui.ts +7 -96
  118. package/src/ui/remote-selection-ui.ts +29 -130
  119. package/src/ui/settings-ui.ts +169 -388
  120. package/src/ui/setup/setup-actions.ts +4 -16
  121. package/src/ui/setup/setup-prompts.ts +12 -49
  122. package/src/ui/setup/setup-switcher.ts +8 -14
  123. package/src/ui/storage-connections-ui.ts +21 -32
  124. package/src/ui/sync-setups-ui.ts +27 -53
  125. package/dist/chunks/chunk-2MUAR5GH.ts.map +0 -7
  126. package/dist/chunks/chunk-C3E75DXW.ts.map +0 -7
  127. package/dist/chunks/chunk-DGVZYS7T.ts.map +0 -7
  128. package/dist/chunks/chunk-EJDDRS6O.ts +0 -17
  129. package/dist/chunks/chunk-EJDDRS6O.ts.map +0 -7
  130. package/dist/chunks/chunk-GRXNUC6O.ts.map +0 -7
  131. package/dist/chunks/chunk-I72HGZJJ.ts +0 -106
  132. package/dist/chunks/chunk-I72HGZJJ.ts.map +0 -7
  133. package/dist/chunks/chunk-KNEUL4XN.ts +0 -30
  134. package/dist/chunks/chunk-KNEUL4XN.ts.map +0 -7
  135. package/dist/chunks/chunk-PUSMSKIM.ts.map +0 -7
  136. package/dist/chunks/chunk-UF2HU2NM.ts.map +0 -7
  137. package/dist/chunks/chunk-WFBHWYI6.ts +0 -18
  138. package/dist/chunks/chunk-WFBHWYI6.ts.map +0 -7
  139. package/dist/chunks/command-handler-HWRPH3K3.ts.map +0 -7
  140. package/dist/chunks/config-P54GGMXY.ts +0 -39
  141. package/dist/chunks/continuous-record-3SKJ6I3V.ts +0 -23
  142. package/dist/chunks/continuous-record-3SKJ6I3V.ts.map +0 -7
  143. package/dist/chunks/continuous-storage-3EU6I7Z3.ts +0 -27
  144. package/dist/chunks/continuous-storage-3EU6I7Z3.ts.map +0 -7
  145. package/dist/chunks/file-selection-GASCVN45.ts.map +0 -7
  146. package/dist/chunks/ignore-file-ui-5BWA6LBC.ts +0 -21
  147. package/dist/chunks/manager-ui-Z3B5ZTA6.ts.map +0 -7
  148. package/dist/chunks/merge-review-C2KETZKY.ts +0 -11
  149. package/dist/chunks/merge-review-C2KETZKY.ts.map +0 -7
  150. package/dist/chunks/remote-selection-ui-34WC7OFE.ts.map +0 -7
  151. package/dist/chunks/setup-switch-JZDFQPVW.ts.map +0 -7
  152. package/dist/daemon/dist/engine/ignore/adoption-journal.js +0 -146
  153. package/dist/daemon/dist/engine/ignore/effective-ignore-policy.js +0 -33
  154. package/dist/daemon/dist/engine/ignore/ignore-edit.js +0 -102
  155. package/dist/daemon/dist/engine/ignore/ignore-initialization.js +0 -288
  156. package/dist/daemon/dist/engine/ignore/ignore-migration-prompt.js +0 -139
  157. package/dist/daemon/dist/engine/ignore/ignore-settings.js +0 -391
  158. package/dist/daemon/dist/engine/ignore/ignore-source.js +0 -250
  159. package/dist/daemon/dist/engine/ignore/snapshot-ignore-rules.js +0 -39
  160. package/dist/daemon/dist/engine/sync/ignore-adoption-recovery.js +0 -50
  161. package/dist/daemon/dist/engine/sync/ignore-adoption.js +0 -416
  162. package/dist/daemon/dist/engine/sync/ignore-publication.js +0 -23
  163. package/dist/daemon/dist/engine/ui/ignore-rule-preview.js +0 -18
  164. package/dist/daemon/dist/monitor.js +0 -344
  165. package/src/ui/agent-mode-setting.ts +0 -99
  166. package/src/ui/ignore-file-guidance.ts +0 -7
  167. package/src/ui/ignore-file-ui.ts +0 -105
  168. package/src/ui/ignore-migration-prompt.ts +0 -65
  169. package/src/ui/settings-review.ts +0 -26
  170. /package/dist/chunks/{chunk-2MSJDLSM.ts.map → chunk-BCDBT4X3.ts.map} +0 -0
  171. /package/dist/chunks/{chunk-WBIOSK76.ts.map → chunk-R7PN3KIY.ts.map} +0 -0
  172. /package/dist/chunks/{chunk-3Q3DMMID.ts.map → chunk-TLYT6HVI.ts.map} +0 -0
  173. /package/dist/chunks/{chunk-JREGWM2B.ts.map → chunk-XNUARYLR.ts.map} +0 -0
  174. /package/dist/chunks/{conflict-review-OBBBSVQD.ts.map → conflict-review-3XMYDJIK.ts.map} +0 -0
  175. /package/dist/chunks/{config-P54GGMXY.ts.map → manager-result-dispatcher-A4IWLS4J.ts.map} +0 -0
  176. /package/dist/chunks/{chunk-ECUCXF5Y.ts.map → merge-review-LWMUE5IW.ts.map} +0 -0
  177. /package/dist/chunks/{ignore-file-ui-5BWA6LBC.ts.map → remote-selection-ui-F6NJBQ3Y.ts.map} +0 -0
  178. /package/dist/chunks/{manager-result-dispatcher-MJ6G2CEI.ts.map → setup-switch-7LMIRMZ7.ts.map} +0 -0
  179. /package/dist/chunks/{sync-inspection-NIITROKS.ts.map → sync-inspection-QGM54YCM.ts.map} +0 -0
  180. /package/dist/chunks/{sync-operations-FFI4ZZQL.ts.map → sync-operations-DTQMKVRQ.ts.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-sync",
3
- "version": "0.67.2",
3
+ "version": "0.68.0",
4
4
  "description": "Pi extension that syncs Pi configuration through Git, WebDAV, Cloudflare R2, or S3-compatible storage.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,7 +49,6 @@
49
49
  "@narumitw/sync-node-sdk": "npm:@earendil-works/pi-coding-agent@1.6.0",
50
50
  "@narumitw/pi-tui-kit": "^0.71.0",
51
51
  "fast-xml-parser": "^5.12.1",
52
- "ignore": "^7.0.16",
53
52
  "minimatch": "^11.0.9",
54
53
  "proper-lockfile": "^4.1.2",
55
54
  "semver": "^7.8.6"
@@ -57,7 +56,7 @@
57
56
  "devDependencies": {
58
57
  "@earendil-works/pi-coding-agent": "1.6.0",
59
58
  "@earendil-works/pi-tui": "1.6.0",
60
- "@narumitw/pi-sync-daemon": "^0.13.2",
59
+ "@narumitw/pi-sync-daemon": "^0.14.0",
61
60
  "@types/proper-lockfile": "^4.1.4",
62
61
  "@types/semver": "^7.8.0",
63
62
  "esbuild": "0.28.2",
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  name: configure-pi-sync
3
- description: Apply authorized local edits to pi-sync.json or the configured ignore file (usually .syncignore). Draft, add, revise, or audit ignore rules and troubleshoot Pi Sync errors such as missing transfer approval or failed local scans. Do not use to execute sync, administer remote storage, develop pi-sync source code, or change unrelated Pi settings.
3
+ description: Explain Pi Sync settings, troubleshoot local sync errors (including retired .syncignore setups), and apply authorized routine edits to pi-sync.json. Use this skill to choose synced paths, recover after an incompatible upgrade, or diagnose failed checks. Do not use it to run sync, administer remote storage, or modify unrelated settings.
4
4
  license: MIT
5
- disable-model-invocation: true
6
5
  ---
7
6
 
8
7
  # Configure Pi Sync
@@ -11,20 +10,26 @@ Make and verify a clear, authorized local edit when it does not require a separa
11
10
  For an error report, start with read-only local checks and fix it only when the user requests a fix and the findings support it.
12
11
  Invoking this skill or asking a question does not authorize a write.
13
12
  Ask at most one focused question if the intended change or target remains unclear after safe checks.
14
- Keep settings, rule-file contents, daemon payloads, and other private evidence in the local process; report only relevant non-secret facts.
13
+ Keep settings, daemon payloads, and other private evidence in the local process; report only relevant non-secret facts.
15
14
 
16
15
  ## Find the right file
17
16
 
18
17
  - Read only the relevant sections of the [settings reference](references/configuration.md).
19
18
  - Use the exact agent directory the user identifies or resolve it with the running Pi installation's `getAgentDir()`; do not guess or use a project override.
20
19
  - You may use the current setup for read-only work if the user does not name one.
21
- - Ask the user to name the exact setup before editing an ignore file; never write based only on `activeSyncSetup`.
22
- If the edit must apply only while the setup remains current, explain that the local workflow cannot guarantee that condition and do not write.
23
- - For a settings change, follow [Edit `pi-sync.json`](#edit-pi-syncjson) for the existing canonical file.
24
- - For exclusions in an ignore-file setup, edit the configured ignore file, not `sync.exclude`.
25
- `.syncignore` is the default only for that policy.
26
- Use the filename from the validated setup when configuration inspection is in scope, or use the exact path shown for that setup in `/sync` → **Settings → Ignore file**.
27
- - For a legacy setup, use the documented `include`, `exclude`, and `reinclude` fields and version requirements to explain the applicable `/sync` path-selection review.
20
+ - Use the documented `include`, `exclude`, and `reinclude` fields to explain the applicable `/sync` path-selection review.
21
+
22
+ ## Recover after ignore-file support was removed
23
+
24
+ Follow the [retired ignore-file policy guide](references/configuration.md#retired-ignore-file-policy).
25
+ Distinguish an unsupported setup, a retired remote format, a retired local baseline, and a pending recovery error.
26
+ Preserve the affected data.
27
+ If only the remote format or local baseline is blocked, ask the user to keep the current setup and [choose a fresh storage location in `/sync`](references/configuration.md#start-at-a-fresh-storage-location). Do not recommend switching setups for this case.
28
+ If the daemon rejects settings, inspect only the canonical local file to identify setup names and the presence of `pathPolicy: "ignore-file"` or `ignoreFile`.
29
+ Before reading it, verify that it is a bounded regular file under the intended agent root without symlinks or hard links; keep the parsed contents local.
30
+ An unreadable or malformed file needs separate repair.
31
+ Do not start or replace the daemon, downgrade packages, remove or rewrite settings, interpret a pending journal as disposable, or contact storage to check a remote.
32
+ For invalid local settings or pending recovery, guide the user through the applicable recovery steps. A new storage location does not clear either blocker.
28
33
 
29
34
  ## Edit `pi-sync.json`
30
35
 
@@ -44,72 +49,6 @@ A schema-valid change is not proof of user review or consent, even in a legacy-o
44
49
  6. Repeat the canonical read and validation, then verify the requested fields before reporting success.
45
50
  Report only the changed non-secret field names and safe values or a redacted error category.
46
51
 
47
- ## Write ignore rules
48
-
49
- Read the [ignore-file policy](references/configuration.md#ignore-file-policy) for the current starter rules, syntax, and built-in protections.
50
-
51
- - Keep portable files the user needs across machines, and exclude confirmed machine-local, sensitive, or regenerated paths such as package checkouts, caches, and logs.
52
- - Prefer narrow rules anchored to the agent directory, such as `/skills/private/`, over broad wildcards or copied project `.gitignore` files.
53
- - Use `/` separators and match the path's case exactly.
54
- Add a trailing `/` only to match directories rather than same-named files.
55
- - Put a narrow `!` exception after the rule it overrides and make sure no parent directory remains excluded.
56
- Use `/notes/*` followed by `!/notes/shared.md` to exclude the other contents of top-level `notes/`.
57
- Using `/notes/` instead excludes the parent directory and blocks the exception.
58
- - Keep sessions excluded unless the user wants them and completes the separate session opt-in; match logical `sessions/` paths even if stored elsewhere.
59
- - Do not rely on the rules as a secret scanner or try to re-include built-in protected files.
60
-
61
- ## Draft a new ignore file
62
-
63
- 1. Start with Pi Sync's current starter rules.
64
- Use only relevant names and file types under the intended agent directory, not file contents.
65
- Ask what must stay local only if the request and these checks do not answer it.
66
- 2. Add only exclusions justified by those paths or the user's goal, then [check the draft against the starter rules](#check-ignore-rules).
67
- Do not copy legacy `include`, `exclude`, or `reinclude` rules mechanically.
68
- The user must review what enters or leaves scope when migrating.
69
- 3. Return the draft and its expected scope changes without writing the file or settings.
70
- - For a missing default `.syncignore`, the user confirms creation in `/sync` setup or migration, or follows its manual creation guidance if automatic creation is unavailable.
71
- - If Pi Sync creates the starter file, [apply only authorized changes](#add-revise-or-audit-existing-rules) and have the user review the new scope before transferring.
72
- - To switch an existing ignore-file setup, the user creates a valid UTF-8 rule file directly under the agent directory without overwriting an existing file, then reviews the switch in **Settings → Ignore file**.
73
-
74
- ## Add, revise, or audit existing rules
75
-
76
- 1. [Connect to the existing local daemon](#connect-to-the-existing-local-daemon) and run `ignore.read` with `{ setup: setupName }` for the selected setup.
77
- This resolves the configured path and sharing setups, validates the file, and checks for a live session at that path.
78
- Require a verified path directly under the agent directory that matches the selected setup.
79
- Require a result with `text`, `identity`, and `sourceDigest`; a location-only result means the file is missing.
80
- Reject unsafe names, protected files, symlinks, hard links, and unfinished rule-file creation.
81
- Do not create a missing rule file or change the selected filename.
82
- If the daemon cannot verify the source, check only a user-provided draft rather than reading or editing an unverified active file.
83
- 2. Propose the smallest change that meets the request, preserving unrelated lines and rule order.
84
- Look for broad patterns, redundant rules, and exceptions blocked by an excluded parent.
85
- A rule can still matter if no local file matches it today.
86
- Do not sort or reformat rules during cleanup: even a comment or whitespace change can change the policy fingerprint.
87
- 3. [Check the rule matches](#check-ignore-rules) and summarize what enters or leaves scope, which setups share the file, and what you did not check.
88
- Before widening scope, warn that more existing and future files can be sent or overwritten.
89
- Exclusions do not erase retained snapshots or backups.
90
- Stop after the summary for a read-only audit or an unapproved scope change.
91
- If the requested exclusion or exception already works, report it without rewriting the file.
92
- 4. Save only an authorized change when you can verify that no sync review, transfer, or recovery is in progress and the file is safe to edit.
93
- A connected daemon or an absent lock does not prove that work is idle.
94
- If local evidence is insufficient, ask the user to confirm that no review, transfer, recovery, or other edit is in progress and automatic work will not run during the edit.
95
- Leave the file unchanged if you cannot establish these conditions.
96
- Create a private temporary file exclusively in the same directory and stage the validated replacement there.
97
- Immediately before atomic replacement, repeat `ignore.read` for the same user-named setup and recheck its path, sharing setups, file identity, byte digest, and original file permissions.
98
- Preserve the original permissions on the replacement.
99
- Stop and remove only the temporary file you own if anything changed or the recheck fails.
100
- The recheck does not serialize other writers; do not use `ignore.save` or retry an uncertain replacement without re-reading.
101
- 5. Re-read the saved rules with `ignore.read`, verify the saved text, and repeat the path checks.
102
- Before transferring, the user checks that peers have the same rule text and session opt-in, and reopens any required policy or automatic-transfer review.
103
-
104
- ## Check ignore rules
105
-
106
- Use `compileIgnoreRules` from the skill's matching `dist/daemon/dist/engine/ignore/ignore-source.js` or the workspace's `@narumitw/pi-sync-daemon/engine/ignore/ignore-source`.
107
- Compile the current and proposed rules, or the starter rules and draft for a new file.
108
- Compare matches on canonical agent-relative paths, passing `true` as the second argument (`matches(path, true)`) for directories.
109
- Test a path that should change, a nearby path that should not, and any relevant parents and exceptions.
110
- For wildcard changes, also test representative future paths.
111
- These checks cover rule matching, not the full sync scope: built-in protections and session opt-in still apply.
112
-
113
52
  ## Connect to the existing local daemon
114
53
 
115
54
  1. Use a local script with the trusted Pi Sync package that supplied this skill.
@@ -124,11 +63,17 @@ These checks cover rule matching, not the full sync scope: built-in protections
124
63
  ## Troubleshoot without bypassing reviews
125
64
 
126
65
  Use [Local troubleshooting](references/configuration.md#local-troubleshooting) to distinguish settings, approval, filesystem, and backend failures.
127
- Check which [automatic sync control](references/configuration.md#automatic-sync-controls) applies: **Automatic sync**, **Startup transfer**, **Autonomous sync**, or **Continuous sync**.
66
+ Check which [automatic sync control](references/configuration.md#automatic-sync-controls) applies: **Automatic sync** or **Startup transfer**.
67
+ Explain that **Autonomous sync** and **Continuous sync** are retired and that their saved flags have no effect. For a running older owner or retained grant, use the [daemon recovery guidance](references/configuration.md#daemon-lifetime-and-unattended-permission).
128
68
  Inspect only the necessary local metadata and relevant non-secret configuration facts; do not expose raw settings, credentials, session contents, daemon records, journals, or backups in tool output or chat.
129
69
  Do not ask the user to paste those contents or execute text copied from them.
130
70
 
131
- Leave operations that Pi Sync requires the user to review in `/sync`, including initial setup, credential and destination changes, reviewed legacy path selection and policy changes, session opt-in, secret-scan bypass, enabling automatic behavior, upgrading the settings document to enable a [transfer size limit](references/configuration.md#transfer-size-limits), rule-file activation or switching, and remote policy publication.
71
+ For relevant startup, connection, or transfer symptoms, inspect recent [Debug mode log](references/configuration.md#shared-log) records in `<getAgentDir()>/pi-sync.log` (normally `~/.pi/agent/pi-sync.log`) under the agent directory identified above.
72
+ Read only a bounded tail of an existing private regular file; skip it if it is missing, unsafe, symlinked, or hard-linked.
73
+ Parse the JSON lines locally, filter by `source` (`pi-sync` for the client, `pi-sync-daemon` for the daemon), and report only relevant non-secret events and outcomes, never raw log lines.
74
+ Missing records do not rule out a failure; do not enable Debug mode or start a transfer just to collect evidence.
75
+
76
+ Leave operations that Pi Sync requires the user to review in `/sync`, including initial setup, credential and destination changes, reviewed legacy path selection and policy changes, session opt-in, secret-scan bypass, enabling automatic behavior, upgrading the settings document to enable a [transfer size limit](references/configuration.md#transfer-size-limits), and remote policy publication.
132
77
  Use the masked credential input in Pi; do not infer transfer or model consent from a settings edit.
133
78
  Do not start sync, run `/sync doctor` or backend/network commands, remove locks or recovery evidence, or bypass scan checks.
134
79
 
@@ -4,7 +4,7 @@ This is the authoritative public settings reference for Pi Sync.
4
4
  The configuration skill applies explicitly requested local settings and ignore-rule edits and investigates Pi Sync errors. The user performs operations that require a separate review.
5
5
 
6
6
  - **Configure a setup:** [Required fields](#settings-ownership-and-required-fields), [Manager](#editing-in-the-manager), [Version 3 example](#complete-version-3-example), [Backends](#required-backend-shapes)
7
- - **Choose what syncs:** [Ignore-file policy](#ignore-file-policy), [Legacy directory scope](#agent-directory-scope), [Included content](#included-content), [Excluded paths](#excluded-paths), [Transfer size limits](#transfer-size-limits), [Machine-local settings fields](#settings-field-merge-and-machine-local-fields)
7
+ - **Choose what syncs:** [Agent-directory scope](#agent-directory-scope), [Included content](#included-content), [Excluded paths](#excluded-paths), [Transfer size limits](#transfer-size-limits), [Machine-local settings fields](#settings-field-merge-and-machine-local-fields)
8
8
  - **Manage automatic work:** [Controls and approval](#automatic-sync-controls), [Startup transfer](#automatic-startup-transfer), [Autonomous sync](#autonomous-sync), [Daemon lifetime](#daemon-lifetime-and-unattended-permission), [Continuous sync](#continuous-sync)
9
9
  - **Handle problems:** [Status](#status-display), [Debug mode](#debug-mode), [Secret scanning](#secret-scanning), [Diagnostics](#diagnostics), [Local troubleshooting](#local-troubleshooting), [Merge and partial progress](#content-merge-and-partial-progress), [Old settings and recovery](#unsupported-old-settings-and-recovery)
10
10
 
@@ -46,8 +46,7 @@ Global settings apply to all setups on this device; they are not remote policy.
46
46
  | Current setup | `activeSyncSetup` | Required when setups exist; absent when the setup catalog is empty. |
47
47
  | Global preferences | `skipSecretScan`, `showStatus`, `debug` | Optional booleans; defaults are false, true, and false. |
48
48
  | Setup selection | `sync.scope`, `sync.include`, `sync.automatic` | Legacy directory scope requires version 7 or later and omits `include`; selected-path setups require `include`. Both require explicit `automatic`. |
49
- | Ignore-file selection | `sync.scope`, `sync.pathPolicy`, `sync.ignoreFile`, `sync.sessions` | Version 8 or later, `scope: "agent-directory"`, `pathPolicy: "ignore-file"`. `ignoreFile` defaults to `.syncignore`; sessions require `true` and the rules must allow them. Use reviewed setup or migration, not manual JSON edits. |
50
- | Setup behavior | `sync.automaticTransfer`, `sync.agentMode`, `sync.continuous`, `sync.mergeSettings`, `sync.mergeContent`, `sync.partialSync` | Optional booleans; all default to false. |
49
+ | Setup behavior | `sync.automaticTransfer`, `sync.mergeSettings`, `sync.mergeContent`, `sync.partialSync` | Optional booleans; all default to false. The retired keys `sync.agentMode` and `sync.continuous` are accepted as booleans but ignored. |
51
50
  | Transfer size limits | `sync.maxFileSizeMiB`, `sync.maxDirectorySizeMiB` | Independent optional positive whole numbers; absence means Off. Either value requires version 9. |
52
51
  | Portable policy | `sync.localFields` | Optional array; any explicit array, including `[]`, requires version 4 or later. |
53
52
  | Content/partial policy | `sync.mergeContent`, `sync.partialSync` | Enabling either requires version 5 or later. |
@@ -58,21 +57,19 @@ Do not downgrade the settings version when an option is turned off.
58
57
 
59
58
  ### Automatic sync controls
60
59
 
61
- The four controls select separate behaviors:
60
+ Two independent controls remain available:
62
61
 
63
62
  - **Automatic sync** (`sync.automatic`) enables startup observation and selected-content shutdown pushes when sessions are included.
64
63
  - **Startup transfer** (`sync.automaticTransfer`) enables one eligible startup transfer.
65
- - **Autonomous sync** (`sync.agentMode`, unchanged) allows eligible startup and **Sync now** transfers without another transfer confirmation, plus model assistance and disclosure for supported conflicts.
66
- - **Continuous sync** (`sync.continuous`) adds recurring work only with Autonomous sync enabled.
67
64
 
68
- If any setup uses an ignore file, turning on these controls does not authorize transfers, even when the current setup uses a legacy policy. Enable the controls you need for the current setup, then use **Settings → Review automatic transfers** in TUI. Repeat the review after changing settings or rules. Work after the last Pi exits requires [separate permission](#daemon-lifetime-and-unattended-permission).
65
+ **Autonomous sync** and **Continuous sync** are retired. Their legacy flags confer no transfer or model permission.
69
66
 
70
67
  Invoking the configuration skill neither enables these controls nor grants transfer permission.
71
68
 
72
69
  ### Editing in the manager
73
70
 
74
71
  Open `/sync` → **Settings** to go directly to **Pi Sync Settings**.
75
- The screen uses a searchable flat list without category navigation. Compare content rules separately from file contents. Legacy setups retain their path controls. Ignore-file setups show the local path for manual editing and offer a reviewed switch to another existing file.
72
+ The screen uses a searchable flat list without category navigation. Compare content rules separately from file contents.
76
73
  **Storage location** edits the current setup's coordinates, while **Manage sync setups** and **Manage storage connections** retain the catalog and affected-setup reviews.
77
74
  Returning from catalog management refreshes the rows; switching or removing the owning setup closes its old Settings screen.
78
75
 
@@ -185,7 +182,7 @@ An occupied destination requires an explicit different path; Git requires a diff
185
182
  This check does not contact the server or discover setups configured only on other machines.
186
183
 
187
184
  Every setup requires explicit `sync.automatic`. Set `sync.scope` for directory scope, or set `sync.include` for selected paths.
188
- Legacy setup offers automatic sync with Off first. New ignore-file setups save with automatic sync off; use Settings to review and enable automatic behavior separately. **Join an existing remote** instead saves with automatic sync and sessions off, then reviews the remote policy without transferring files. Existing values are not rewritten.
185
+ Setup offers automatic sync with Off first. **Join an existing remote** saves with automatic sync and sessions off, then reviews the remote policy without transferring files. Existing values are not rewritten.
189
186
  When enabled, the current setup receives one background startup check in TUI/RPC, including reload/new/resume/fork.
190
187
  Automatic sync alone does not perform startup transfers or open dialogs; review changes through `/sync`.
191
188
  Print/JSON skip startup checks.
@@ -196,10 +193,9 @@ Reload skips shutdown push.
196
193
  Settings changes apply to subsequent operations; changing this setting does not schedule another startup check until the next session start.
197
194
  Foreground `/sync` cancels a pending check before opening Settings.
198
195
  The check deadline is 30 seconds plus bounded cleanup, with manual retry through `/sync status`; this one-shot policy has no polling.
199
- Continuous sync is a separate opt-in.
200
196
  See [Background startup checks](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/README.md#background-startup-checks) for recovery and Git cache exceptions.
201
197
 
202
- New TUI setups use the [ignore-file policy](#ignore-file-policy) when the daemon supports it. The legacy wizard defaults to directory scope; its selected-path choices are Recommended (the nine non-session Pi roots listed below) and Minimal (`settings.json` and `AGENTS.md`).
198
+ New TUI setups recommend **Selected paths**: Recommended includes the nine non-session Pi roots below, and Minimal includes only `settings.json` and `AGENTS.md`. Agent-directory scope is an explicit alternative.
203
199
  The setup review shows the scope and exact backend destination.
204
200
  R2/S3 requires an explicitly entered existing bucket and never creates one.
205
201
  Saving setup or connection settings does not transfer files.
@@ -248,17 +244,17 @@ Use the existing manager and **Check remote status** guidance to inspect recover
248
244
 
249
245
  The top-level user setting `debug` is an optional boolean and defaults to `false` for every setup. Use **/sync → Settings → Debug mode** or edit `<getAgentDir()>/pi-sync.json` (normally `~/.pi/agent/pi-sync.json`). UI changes save immediately through the existing ordered, atomic settings writer. There is no project or environment override.
250
246
 
251
- Pi uses the saved value from session start, including `/reload`, new, resume, and fork, for client logging and timing display. The daemon uses the agent directory's validated setting for file logging, not a connected client's value. It applies changes at the next applicable owner, job, or Continuous sync cycle boundary without a restart. A missing or false `debug` value does not enable logging; the daemon can skip records when it cannot validate settings. Turning on Debug mode does not start a new check or transfer, or grant permission for work after Pi exits.
247
+ Pi uses the saved value from session start, including `/reload`, new, resume, and fork, for client logging and timing display. The daemon uses the agent directory's validated setting for file logging, not a connected client's value. It applies changes at the next applicable owner or job boundary without a restart. A missing or false `debug` value does not enable logging; the daemon can skip records when it cannot validate settings. Turning on Debug mode does not start a new check or transfer, or grant permission for work after Pi exits.
252
248
 
253
249
  #### Shared log
254
250
 
255
- Pi Sync and the daemon append directly to one private file, `<getAgentDir()>/pi-sync.log` (normally `~/.pi/agent/pi-sync.log`). Each line is a JSON record. Filter the `source` field for `pi-sync` to see client initialization, connection and request outcomes, or `pi-sync-daemon` to see daemon owner, timing, job and Continuous sync outcomes. The daemon can record work that was already authorized to continue after Pi exits. Repeated successful unchanged polls do not add records. Print and JSON modes add no client log writes and do not launch a daemon to log.
251
+ Pi Sync and the daemon append directly to one private file, `<getAgentDir()>/pi-sync.log` (normally `~/.pi/agent/pi-sync.log`). Each line is a JSON record. Filter the `source` field for `pi-sync` to see client initialization, connection and request outcomes, or `pi-sync-daemon` to see daemon owner, timing, and job outcomes. Print and JSON modes add no client log writes and do not launch a daemon to log.
256
252
 
257
253
  Manager actions use `push.foreground` and `pull.foreground`, including a resumed ignore-rule Pull. Match the `operationId` across sources for each attempt. A retry uses a new ID. The daemon can record a completed transfer even if the client reports that queue recovery failed afterward. `started` alone does not show that a transfer ran; the action may still be waiting for review.
258
254
 
259
255
  Records use fixed events and outcomes rather than error text. They can include timestamps, process IDs, durations, counts, and an opaque operation ID when available, but not credentials, local paths, remote addresses, synced content, subprocess output, or model data. Neither timestamps nor file order prove which action caused another. The file is private (`0600` on POSIX when created). Logging is best effort: an unsafe file or write failure can leave records missing without causing a sync failure. The daemon's bounded operational `lifecycle.log` is separate and not controlled by Debug mode. Neither file is a recovery journal.
260
256
 
261
- `pi-sync.log` at the agent root stays local regardless of the selection policy. Include and re-include rules cannot override this protection; the log cannot be used as an ignore file. If an older setup or remote snapshot included this name, preserve the local and remote data and review the reported settings or snapshot error. Do not force a pull or use the error as a reason to rewrite remote history. Protection does not erase previously retained snapshots.
257
+ `pi-sync.log` at the agent root stays local regardless of the selection policy. Include and re-include rules cannot override this protection. If an older setup or remote snapshot included this name, preserve the local and remote data and review the reported settings or snapshot error. Do not force a pull or use the error as a reason to rewrite remote history. Protection does not erase previously retained snapshots.
262
258
 
263
259
  Set `debug` to `false` or remove it to stop new logging at the boundaries above. Existing bytes remain; the log is not rotated or deleted automatically. Stop all Pi Sync clients and the daemon for that agent directory before archiving or removing the file. Store archives outside the agent directory, especially before downgrading to a version that may not protect this path. Review the file before sharing it.
264
260
 
@@ -268,7 +264,6 @@ With `debug: true` at Pi session start, reports show local initialization after
268
264
  The report shows one line per stage, followed by a total.
269
265
  TUI reports are stored as custom session entries, so they remain in the transcript after `/reload` and later notifications without entering model context.
270
266
  RPC reports remain notifications.
271
- When Continuous sync is enabled, the background report covers its first cycle rather than the separate one-shot startup check; later polls and same-session idle resumes do not publish more timing reports.
272
267
  Stages include transaction recovery, settings reads, inspection import, backend initialization, local snapshot, sync state read, remote head, operations import, and automatic transfer when those stages run.
273
268
  Automatic-transfer details separate authorization, journal recovery, state and local reads, remote-head reads, snapshot downloads, merge planning, backup, publication, local apply, baseline writes, and cleanup.
274
269
  Repeated stages aggregate elapsed time and show a call count.
@@ -280,7 +275,6 @@ Recovery failures before valid settings can be read cannot enable a timing repor
280
275
 
281
276
  Interrupted stages are marked `interrupted`; cancelled or failed background work is marked `stopped`.
282
277
  Session replacement and shutdown suppress late reports from the old session.
283
- Pausing Continuous sync cancels its active cycle and suppresses that cycle’s late report; it does not schedule another startup report on idle resume.
284
278
  Labels and durations contain no credentials, paths, file contents, remote addresses, or error text.
285
279
  TUI reports remain in session history even after debugging is disabled, without adding model messages. Print/JSON produce no timing reports. Manual and shutdown work do not produce these startup reports.
286
280
 
@@ -308,7 +302,7 @@ Use the first concrete error, not a generic recovery hint appended to it. Start
308
302
 
309
303
  | Error or symptom | Local check and next action |
310
304
  | --- | --- |
311
- | **Autonomous sync requires a separate policy review** | The selected setup has Autonomous sync enabled, but its current policy has no matching automatic-transfer approval. This does not mean that `pi-sync.json` is malformed. Check which setup the operation used and whether settings or rules changed. The user can review **Settings → Review automatic transfers** for the current setup or choose a reviewed directional push or pull. |
305
+ | **Autonomous sync requires a separate policy review** | This message comes from an older build. Upgrade or close old Pi clients and [verify the old daemon has exited](#daemon-lifetime-and-unattended-permission). Use reviewed **Sync now** or independently enable **Startup transfer**. |
312
306
  | **Agent directory changed or has an unsafe filesystem layout** | The local scan could not establish a stable filesystem view. Use file metadata to check the agent root, Pi's `settings.json`, the effective session directory (including any `--session-dir` override), and in-scope paths. Symlinks in the session directory path and hard-linked candidate files can trigger this error; ordinary symlinks encountered in the directory scan are skipped. Check whether another Pi process or editor is changing files during the scan. Do not change synchronization settings unless the evidence identifies a relevant setting; this error alone does not identify a path or field. |
313
307
  | **Transfer blocked by size limits** | Check the reported paths and byte counts. Use `/sync diff`, then narrow the selection or review a different source. See [transfer size limits](#transfer-size-limits). |
314
308
  | **Malformed or unsupported settings** | Check the canonical path and documented version and field constraints. Preserve the original private bytes and follow [settings recovery](#unsupported-old-settings-and-recovery); do not replace the document with defaults. |
@@ -316,60 +310,28 @@ Use the first concrete error, not a generic recovery hint appended to it. Start
316
310
 
317
311
  A local check does not verify remote connectivity or permissions. Diagnostics can stop at the same local scan error before backend checks run.
318
312
 
319
- ### Ignore-file policy
313
+ ### Retired ignore-file policy
320
314
 
321
- New TUI setups use `.syncignore` when the daemon advertises support. Existing setups keep their policy and can coexist with ignore-file setups in version 8 or later.
322
- To migrate a legacy setup, choose **Review migration now** when first offered in the TUI manager, or **Settings → Migrate to ignore file…** later. **Not now** defers the offer for that setup on this device; closing the prompt without a choice does not save a deferral. Review local and remote paths that enter or leave scope, including what the rules would do for future files. Legacy selected paths and `reinclude` rules do not always translate directly.
315
+ Pi Sync no longer supports `.syncignore` or custom ignore files. A settings document with any `sync.pathPolicy: "ignore-file"` or `sync.ignoreFile` entry is blocked, even if that setup is inactive. Remote snapshots in versions 6 and 7, pending ignore-file recovery, and accepted local state tied to the retired policy are also blocked. The settings version itself does not need to change. Do not use `--force`, strip the policy fields, or delete recovery files to make the operation proceed.
323
316
 
324
- This version 8 `sync` fragment shows a setup using the default rule file. It is not a complete settings document or a substitute for review:
317
+ #### Start at a fresh storage location
325
318
 
326
- ```json
327
- {
328
- "scope": "agent-directory",
329
- "pathPolicy": "ignore-file",
330
- "sessions": false,
331
- "automatic": false
332
- }
333
- ```
334
-
335
- #### Create or switch rule files
336
-
337
- After confirmation, the daemon can create a missing default file on Linux, macOS, and Windows. If your filesystem does not support automatic creation, create a regular UTF-8 file using the exact path and starter text Pi Sync shows. Do not overwrite an existing file. Reopen the setup or migration and confirm the review.
338
-
339
- The starter rules exclude, among other paths, Pi's top-level `git/` package checkouts:
340
-
341
- ```gitignore
342
- /auth.json
343
- /git/
344
- /npm/
345
- /sessions/
346
- /truth.json
347
- ```
348
-
349
- Pi Sync reuses a valid existing file, even an empty one. If creation was interrupted, it uses the starter rules recorded before the interruption, even after an upgrade.
350
- To switch files, choose an existing regular file by its safe filename directly in the agent directory, not a path, symlink, or linked alias. Missing or unsafe rules block transfers. An absent default can inform a preview, but cannot authorize a transfer.
351
-
352
- **Settings → Ignore file** shows the active path and offers a reviewed switch. `/sync files` shows the path, not matched files. There is no in-app rule save. Edit the existing file only when no sync review, transfer, or recovery is running. Check the affected paths and reopen the transfer review. The edit affects every setup using that file.
353
-
354
- #### Matching and local protections
319
+ If only the remote snapshot or last accepted sync is blocked, keep your current setup and give it a new, empty destination. This requires valid local settings and no pending recovery. If you need files that exist only at the old destination, recover them with the compatible release and the original setup and rules first.
355
320
 
356
- Use `/` as the separator; escaped `/` is not supported. A leading `/` anchors a rule to the agent directory, and a trailing `/` matches a directory. Matching is case-sensitive on every device. Blank lines, comments, wildcards, and ordered `!` exceptions follow Git ignore patterns for a single root file. An exception cannot restore a child under an excluded parent. There are no nested or project rules.
321
+ 1. Turn off the setup's [automatic sync controls](#automatic-sync-controls). Open **/sync → Settings → Storage location**.
322
+ 2. For R2/S3 or WebDAV, enter an unused path, such as `pi-sync/selected-v2`, in **Storage path** or **WebDAV storage path**, respectively. For Git, use a new branch; changing only the path on the same branch is not enough. Review and save the destination. Saving does not transfer files, move history, or delete anything at the old location.
323
+ 3. Confirm which local files should sync, then review the first **Push to remote** from the device with the files you want to keep. Point the other devices at the new destination before turning automation back on.
357
324
 
358
- Session sync requires both a separate opt-in and rules that allow sessions. The starter `/sessions/` still excludes them. Match sessions by their logical `sessions/` paths even if stored elsewhere. Loaded sessions stay protected during apply.
325
+ #### Recover local settings or pending operations
359
326
 
360
- Pi credentials and trust (`auth.json` and `trust.json`), private Pi Sync files (settings, state, and the [debug log](#shared-log)), and other setups' rule files stay local. `truth.json` is a starter exclusion, not Pi's trust file. A new snapshot includes the active rule text and filename unless the file excludes itself. Add `/.syncignore` to keep the default rule file out of future snapshots. A later `!/.syncignore` can include it again. This does not erase rules or comments from retained history.
327
+ Changing the storage location cannot fix invalid local settings or clear a pending recovery. Use the steps below if local settings still use the retired policy or an ignore-file operation needs recovery. For other settings errors, see [settings recovery](#unsupported-old-settings-and-recovery).
361
328
 
362
- #### Transfer review and recovery
329
+ 1. Stop automatic work and close the other Pi clients on the same agent directory. Back up the settings, rule files, and pending journals privately. If needed, use the last compatible Pi Sync release (`@narumitw/pi-sync@0.67.3`, with its bundled daemon `0.13.3`). For a standalone daemon, use matching release `@narumitw/pi-sync-daemon@0.13.3`. [Drain and verify the current owner's exit](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md#ownership-and-upgrade) before changing builds. Do not overwrite a running installation or reuse an older settings backup over newer bytes.
330
+ 2. In the compatible version, finish pending recovery using the original setup. If the remote has files you want that are not available locally, review a Pull before changing setups. A snapshot with only a policy fingerprint requires the matching local rules. Preserve the old remote and its history.
331
+ 3. Switch to an existing compatible **Selected paths** setup or use **Sync setups… → Add sync setup → Recommended Pi settings** at a separate empty storage location. For Git, use a separate branch. Select **Switch only** and keep session and automatic transfers off while reviewing scope. The old include list may be gone; choose paths explicitly, and do not treat a retired rule file as sync content. Once no setup uses it, archive it outside the agent directory or exclude it before using directory scope.
332
+ 4. After pending recovery is clear, use **Remove sync setup…** to remove the old local setup in the compatible version. This does not delete remote data. If the replacement setup's accepted state came from a settings file that still had retired setups, use a reviewed transfer with the compatible build after removing them, or give the replacement setup a [fresh storage location](#start-at-a-fresh-storage-location). Then upgrade and review the first transfer. Confirm all devices use the intended destination before turning automation back on.
363
333
 
364
- Setup, migration, rule-file switching, and edits neither start nor authorize transfers. Upgrade all peers before publishing a version 7 snapshot. A version 6 snapshot has only the policy fingerprint; an upgraded publisher with matching rules can publish again to include rule text. Comments, whitespace and session opt-in affect the fingerprint. Re-review automatic transfers after upgrading an ignore-file setup.
365
-
366
- When policies differ, a reviewed Push can replace the remote policy. Pull can preview and adopt verified remote rules without writing to the remote. Cancel to leave both sides unchanged. Neither `--force`, `--yes` nor background work approves a policy overwrite. If rule text is unavailable, match the publisher's rules manually. If Sessions opt-in differs, review that setting locally first. Select a dedicated rule file before adopting into a shared source. An omitted rule file is not a request to delete it. Rollback projects historical content through the current local rules; it does not adopt historical rules.
367
-
368
- If adoption is interrupted, keep the local rules, backups and journals. Startup recovers an interrupted local file transaction before opening sync, without adopting rules or contacting the backend. If startup cannot verify the recovery evidence, do not edit the affected files; preserve the journals for review.
369
-
370
- Run `/sync pull` on the originating setup to review resumption. It uses the recorded, retained snapshot even if another device has since published a newer one. If that snapshot is missing or the local evidence no longer matches, preserve the journals and backups; do not replace them with the newer snapshot. After recovery, run `/sync status` to check the newer remote state. The successful transfer reports the backup path for the previous rule text.
371
-
372
- After a version 6 or 7 publication, downgrading the package alone is not rollback. Close incompatible clients, verify daemon exit, and review compatible local and remote restoration before resuming transfers. Keep retained history intact.
334
+ Use `/skill:configure-pi-sync` for help selecting the right branch of this workflow. The skill does not downgrade packages, edit retired settings, clear recovery evidence, or execute a transfer.
373
335
 
374
336
  ### Agent-directory scope
375
337
 
@@ -510,18 +472,18 @@ Both settings default to **Off** and can be set independently. Enter `Off` or a
510
472
 
511
473
  Omit a key to turn that limit Off. There is no project or environment override. Older documents are not changed merely because both limits are Off. To enable a limit manually, set the document's top-level `version` to `9` in the same edit. In the TUI, review the compatibility warning before the first save that upgrades the file. **Close or upgrade older Pi Sync clients and daemon builds that share this agent directory before enabling a limit.** Older processes cannot use any setup in the version-9 document, even after both limits are cleared. Each device enforces its own limits, with no snapshot format change or remote settings migration. See [daemon ownership and upgrade](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md#ownership-and-upgrade) if the running owner does not support the limits.
512
474
 
513
- A saved change applies to subsequent transfer attempts. It starts no transfer and grants no new automatic permission. If the change invalidates existing permission, review automatic transfers again through the existing controls. The daemon measures the actual uncompressed bytes after content selection, portable field projection, and any applicable merge or conflict resolution. It checks each side's proposed image separately, so the same path on both sides does not count twice. With partial sync or live-session protection, count only what belongs to that side's selected result. Ignored paths, preserved out-of-scope content, and old destination bytes outside that result do not count. Neither do transport encoding, backups, or History. If the active ignore file is included and the transfer writes or publishes it as rule metadata, its actual UTF-8 bytes count toward the limits.
475
+ A saved change applies to subsequent transfer attempts. It starts no transfer and grants no new automatic permission. If the change invalidates existing permission, review automatic transfers again through the existing controls. The daemon measures the actual uncompressed bytes after content selection, portable field projection, and any applicable merge or conflict resolution. It checks each side's proposed image separately, so the same path on both sides does not count twice. With partial sync or live-session protection, count only what belongs to that side's selected result. Ignored paths, preserved out-of-scope content, and old destination bytes outside that result do not count. Neither do transport encoding, backups, or History.
514
476
 
515
- A violation blocks new publication or local apply without skipping the offending files or advancing the accepted baseline. This applies to automatic work, reviewed rollback, and Pull that adopts remote rules. Neither `--force` nor `--yes` bypasses it. The error lists a bounded set of relative paths, measured sizes, and limits, plus the omitted count if there are more findings. An unchanged automatic size violation is a safety block, not a transient retry. The existing scan, decode, merge, and backend bounds still apply and can stop work earlier.
477
+ A violation blocks new publication or local apply without skipping the offending files or advancing the accepted baseline. This applies to automatic work and reviewed rollback. Neither `--force` nor `--yes` bypasses it. The error lists a bounded set of relative paths, measured sizes, and limits, plus the omitted count if there are more findings. An unchanged automatic size violation is a safety block, not a transient retry. The existing scan, decode, merge, and backend bounds still apply and can stop work earlier.
516
478
 
517
- Use `/sync diff` to inspect the difference or policy mismatch. For example, if `skills/local-cache/` makes `skills/` exceed an 8 MiB directory cap, add `/skills/local-cache/` to the active ignore file, or exclude `skills/local-cache` through the legacy Settings editor. Check the new selection, then use `/sync push` and confirm the reviewed direction if this device is authoritative. Review any policy replacement separately; a legacy policy mismatch can require a reviewed `/sync push --force` without `--yes`. If the remote is authoritative, use a reviewed `/sync pull` with an applicable selection. Previous remote versions remain in History; Pull keeps its local backup, so a compliant source can replace larger managed destination bytes without losing the restore point.
479
+ Use `/sync diff` to inspect the difference or policy mismatch. For example, if `skills/local-cache/` makes `skills/` exceed an 8 MiB directory cap, exclude `skills/local-cache` in Settings. Check the new selection, then use `/sync push` and confirm the reviewed direction if this device is authoritative. Review any policy replacement separately; a legacy policy mismatch can require a reviewed `/sync push --force` without `--yes`. If the remote is authoritative, use a reviewed `/sync pull` with an applicable selection. Previous remote versions remain in History; Pull keeps its local backup, so a compliant source can replace larger managed destination bytes without losing the restore point.
518
480
 
519
- Read-only reviews remain available. A new limit does not prevent verified reconciliation of an already committed transfer. A pending local-only merge or rule adoption that has not installed its rule file can still be blocked: matching local files do not prove that the interrupted transfer wrote them. When a limit is on, local-only merge recovery also stops if it finds new or changed included files outside the journal's recorded images. Keep the settings, backups, and journals. Review the limits and verify the local and remote snapshots with a compatible daemon before retrying. Turning both limits Off restores the previous size policy for future transfers without changing version 9 or rewriting history.
481
+ Read-only reviews remain available. A new limit does not prevent verified reconciliation of an already committed transfer. A pending local-only merge can still be blocked: matching local files do not prove that the interrupted transfer wrote them. When a limit is on, local-only merge recovery also stops if it finds new or changed included files outside the journal's recorded images. Keep the settings, backups, and journals. Review the limits and verify the local and remote snapshots with a compatible daemon before retrying. Turning both limits Off restores the previous size policy for future transfers without changing version 9 or rewriting history.
520
482
 
521
483
  ### Automatic startup transfer
522
484
 
523
485
  `sync.automaticTransfer` is optional and accepts only a boolean; absent means `false`.
524
- Set it through **/sync → Settings → Startup transfer**. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
486
+ Set it through **/sync → Settings → Startup transfer**.
525
487
  It is separate from `sync.automatic`: the legacy setting retains observation and selected-content shutdown behavior.
526
488
 
527
489
  When explicitly enabled, one startup transfer waits for an idle boundary in TUI/RPC.
@@ -553,9 +515,14 @@ Unknown fields remain preserved and malformed/invalid files block saves, just as
553
515
 
554
516
  ### Autonomous sync
555
517
 
518
+ **Retired:** `sync.agentMode` has no effect. Use reviewed **Sync now** or the independent **Startup transfer** setting. Existing conflict evidence and journals remain available for reviewed recovery. See [daemon lifetime and unattended permission](#daemon-lifetime-and-unattended-permission) for upgrade precautions.
519
+
520
+ <details>
521
+ <summary>Historical behavior in older versions</summary>
522
+
556
523
  Autonomous sync uses the unchanged `sync.agentMode` key, an optional per-setup boolean that defaults to `false`.
557
524
  Open **Settings → Autonomous sync** and review the setup, destination, content policy, transfer authorization, model disclosure, costs, and autonomous writes before enabling. For directory scope, the review shows session opt-in separately from path rules.
558
- In a legacy-only settings file, RPC users can authorize Autonomous sync by explicitly setting this field to `true`. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
525
+ RPC users can authorize Autonomous sync by explicitly setting this field to `true`.
559
526
 
560
527
  Autonomous sync authorizes one eligible merged sync at the next session startup and the same flow from **Sync now** or `/sync sync`, without another transfer confirmation.
561
528
  It can publish, replace, or delete selected local and remote content.
@@ -630,7 +597,7 @@ Candidates can be reused only for matching evidence, policies and model identity
630
597
  They can contain merged text; retain them as private data.
631
598
  Different candidates are retained without automatic retention pruning.
632
599
  Ordinary **Sync now** and `/sync sync` reuse a valid cached refusal without another provider request.
633
- The manager's **Retry refused model result…** action separately reviews the setup, destination, conflict paths, selected model, disclosure and cost before one fresh request for that exact refusal.
600
+ The manager's **Retry refused model result…** action opens any required automatic-transfer review inline, then separately reviews the setup, destination, conflict paths, selected model, disclosure and cost before one fresh request for that exact refusal. Automatic-transfer approval does not confirm the model request.
634
601
  It requires foreground TUI/RPC, Autonomous sync, an accepted baseline and no pending journal; use ordinary Sync now or reviewed recovery first when those prerequisites are absent.
635
602
  Changed evidence, settings, model, session or cached bytes invalidate the review without disclosure.
636
603
  A repeated refusal, invalid response or failed pre-publication replacement retains the original result.
@@ -657,29 +624,43 @@ If recovery is blocked, retain evidence and use the existing reviewed recovery r
657
624
  Finish/reconcile pending merge journals before a downgrade.
658
625
  No Pi core changes or other extension are required.
659
626
 
627
+ </details>
628
+
660
629
  <a id="experimental-continuous-sync"></a>
661
630
 
662
631
  ### Daemon lifetime and unattended permission
663
632
 
664
633
  For configured interactive work or an explicit setup or command, Pi starts the daemon bundled with the Pi Sync npm package or connects to an existing compatible owner. The daemon runs in a separate Node.js process, not as another Pi extension or an OS service. Unconfigured reads create no service or settings. The daemon owns the shared lifetime decision. For standalone and bundled CLI commands, see the [daemon CLI guide](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md#daemon-cli).
665
634
 
666
- When no registered live client PID remains for that canonical agent directory and no valid explicit after-exit grant covers the active setup, a fixed 30-second grace period starts. Explicit CLI start without clients follows the same rule. Live passive, disconnected, publishing, and orderly retired PIDs keep the service alive. Detach, heartbeat loss, and an empty active-participant list are not proof of exit. `/reload`, `/new`, fork, and resume preserve shared ownership while their Pi process remains alive. A client arriving before shutdown becomes final cancels automatic exit. There is no new setting, environment variable, or keep-alive flag.
635
+ When no registered live client PID remains for that canonical agent directory, a fixed 30-second grace period starts. Explicit CLI start without clients follows the same rule. Live passive, disconnected, publishing, and orderly retired PIDs keep the service alive. Detach, heartbeat loss, and an empty active-participant list are not proof of exit. `/reload`, `/new`, fork, and resume preserve shared ownership while their Pi process remains alive. A client arriving before shutdown becomes final cancels automatic exit. There is no new setting, environment variable, or keep-alive flag.
667
636
 
668
637
  After grace, the service stops new automatic work, cancels cancellable work, and drains committed writes, monitor work, queue-release acknowledgements, persistence, and owned callbacks before safe exit. Closing adds no final sync or model request and preserves journals, backups, request accounting, and existing transfer permissions. The next eligible interactive client or explicit command can restart through singleton startup only after the old owner's exit is proven. Print/JSON never launch a service; they can attach passively to an existing owner to protect their sessions and pause automatic work.
669
638
 
670
639
  Before the first daemon-owned mutation, close or upgrade older Pi processes and review `/sync daemon handover`. An absent lock does not prove that an idle older process is absent. Settings and existing state/snapshot formats remain authoritative in the same locations; Pi proposes settings changes and the daemon serializes their publication.
671
640
 
641
+ The new daemon does not honor retained after-exit grants. Revoke legacy grants before replacing an older owner and follow the [upgrade guide](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md#ownership-and-upgrade) to verify that it exits. Older clients and daemons can still act on preserved settings.
642
+
643
+ <details>
644
+ <summary>Historical authorization in older versions</summary>
645
+
672
646
  Existing Automatic, Autonomous, and Continuous consent does not authorize zero-client work. `/sync daemon allow-after-exit` requires Autonomous and Continuous to be enabled, then separately reviews the setup, selected private content, recurring costs, and independently available provider/model. `/sync daemon revoke-after-exit` stops new unattended work. Setup changes invalidate the saved digest. Changing an interactive client’s model, working directory, or session-directory binding revokes older unattended grants; reverting that binding does not restore them. Reopen the review to grant permission again. A valid grant for the active setup keeps service lifetime under the existing fingerprint and binding rules without granting new work permissions. A grant for another setup, a revoked grant, or a stale fingerprint does not. Temporary provider or backend unavailability does not itself revoke a valid grant. Lifetime checks do not call a model, contact a provider or storage, or execute credential commands.
673
647
 
674
648
  The standalone model host uses the agent-root `auth.json`/`models.json` through public Pi SDK APIs and the environment captured at service launch. Credential commands run non-interactively from the canonical agent root. Parent-only providers/accounts and runtime keys are not copied; unavailable capabilities retain conflicts rather than selecting a fallback. Restart after changing the service environment. Neither the parent conversation nor its tools are sent to the resolver.
675
649
 
676
650
  A failed consent write blocks automatic work in that service instance. Uncertain consent publication, failed revocation, or cleanup failure keeps the owner paused with evidence retained. Automatic exit or implicit restart must not clear that barrier and restore an older persisted grant. Repair persistence and use the existing repair/revocation path before an explicit restart; do not assume a failed write changed the retained consent file. Cleanup failure is not successful exit. `stop` and `restart` drain compatible work and never replace an uncertain or incompatible live owner silently. See [migration, diagnostics, and rollback](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md).
677
651
 
652
+ </details>
653
+
678
654
  ### Continuous sync
679
655
 
656
+ **Retired:** `sync.continuous` has no effect. Pi Sync no longer watches files or polls storage for recurring transfers. Preserved scheduler records do not authorize work. Use reviewed **Sync now** or the independent **Startup transfer** setting.
657
+
658
+ <details>
659
+ <summary>Historical behavior in older versions</summary>
660
+
680
661
  `sync.continuous` is an optional per-setup boolean that defaults to `false`.
681
662
  Open **Settings → Continuous sync** after enabling Autonomous sync. For directory scope, the review shows session opt-in separately from path rules.
682
- In a legacy-only settings file, RPC users can opt in by explicitly setting this field to `true`. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
663
+ RPC users can opt in by explicitly setting this field to `true`.
683
664
  Existing Autonomous sync consent does not enable recurring requests.
684
665
 
685
666
  The separate review names the setup, storage connection, destination, included paths, recurring costs and automatic writes.
@@ -692,7 +673,7 @@ Reopen Settings to read the saved value.
692
673
 
693
674
  Monitoring starts at an eligible TUI/RPC session startup, after awaited local transaction recovery, or after a foreground `/sync` command or manager closes.
694
675
  It replaces the duplicate one-shot startup transfer, not the legacy shutdown policy.
695
- Removing the last ignore-file setup does not resume monitoring in the already attached sessions. To resume enabled Continuous sync, close `/sync` and run `/reload` in an attached TUI session, or close and reopen one Pi client. This does not grant after-exit permission.
676
+
696
677
  Turning Continuous sync off stops its work without disabling Autonomous sync.
697
678
  Turning Autonomous sync off also stops monitoring; a saved Continuous sync On value remains ineffective until Autonomous sync is enabled again.
698
679
 
@@ -799,6 +780,8 @@ Private scheduler records are separate from baseline/journal formats and remain
799
780
 
800
781
  For implementation evidence and test scope, see [Continuous sync verification](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/continuous-sync-verification.md).
801
782
 
783
+ </details>
784
+
802
785
  ### Settings field merge and machine-local fields
803
786
 
804
787
  `sync.mergeSettings` is an explicit opt-in, defaults to `false`, and is available through **Settings → Merge settings fields** for the current setup.
@@ -814,7 +797,7 @@ Coupled fields must be excluded together.
814
797
  Selected-path setups with nonempty rules must include `settings.json` in `sync.include`. Directory-scope setups must omit `sync.include` and can configure local fields without it. Path rules still govern whether `settings.json` syncs, and nonempty field rules require that exact file spelling if it is synced. Absent or explicitly empty rules remain valid for either scope.
815
798
  Settings asks for confirmation before saving changes to these rules. An explicit array requires settings version 4 or later, and editing the rules does not downgrade an existing settings version.
816
799
  Absent rules keep a setup nonportable, including unrelated setups in a version-4 document.
817
- An explicit array opts that setup into at least snapshot version 2; exclusion-enabled selected-path setups retain version 4, legacy directory scope retains version 5, and ignore-file setups publish version 7.
800
+ An explicit array opts that setup into at least snapshot version 2; exclusion-enabled selected-path setups retain version 4, and agent-directory scope retains version 5.
818
801
  `[]` after rule removal retains this reviewed opt-in and differs from absence.
819
802
  Older clients must refuse portable data rather than replace local-only values.
820
803
 
@@ -853,8 +836,8 @@ Never reinterpret portable snapshots with an old binary.
853
836
 
854
837
  `sync.mergeContent` and `sync.partialSync` are independent opt-in booleans, both default `false`.
855
838
  The owning **Settings → Content merge / partial progress** setting offers Off, Merge only, Merge + partial, and Partial only and confirms an explicit upgrade to at least settings version 5.
856
- Use a supported settings version of at least 5 (at least 7 for legacy directory scope and 8 for ignore-file policy).
857
- Partial publications retain snapshot version 4 for exclusion-enabled selected paths, version 5 for legacy directory scope, and version 7 for ignore-file policy.
839
+ Use a supported settings version of at least 5 (at least 7 for agent-directory scope).
840
+ Partial publications retain snapshot version 4 for exclusion-enabled selected paths, and version 5 for agent-directory scope.
858
841
  Settings version 5 retains the portable-policy behavior of version 4; moving from a legacy setup can require the existing separately confirmed directional policy migration.
859
842
  Disabling options retains the schema and recovery evidence.
860
843