@narumitw/pi-sync 0.70.1 → 0.70.2
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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/daemon/dist/build-id.json +1 -1
- package/dist/daemon/dist/client-transport.js +1 -0
- package/dist/daemon/dist/daemon-status.js +2 -1
- package/dist/daemon/dist/lifecycle-log.js +2 -1
- package/dist/daemon/dist/server.js +1 -0
- package/dist/daemon/package.json +1 -1
- package/docs/daemon-migration.md +1 -1
- package/package.json +2 -2
- package/skills/configure-pi-sync/references/configuration.md +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -191,7 +191,7 @@ Turn on **/sync → Settings → Debug mode**, or set the top-level `"debug": tr
|
|
|
191
191
|
|
|
192
192
|
Both processes append startup timings and selected check and transfer outcomes to the private, local-only `<getAgentDir()>/pi-sync.log` (normally `~/.pi/agent/pi-sync.log`). It uses one JSON record per line; filter by `source` (`pi-sync` or `pi-sync-daemon`). Records omit raw errors, credentials, file contents, and model data. Turning Debug mode Off does not remove the file, and nothing rotates it automatically.
|
|
193
193
|
|
|
194
|
-
Timing reports still appear in the TUI transcript or as RPC notifications without entering model context. The Pi client does not write debug records in print or JSON mode. The daemon's separate operational `lifecycle.log` is
|
|
194
|
+
Timing reports still appear in the TUI transcript or as RPC notifications without entering model context. The Pi client does not write debug records in print or JSON mode. The daemon's separate operational `pi-sync-lifecycle.log` is independent of Debug mode. See the [Debug mode reference](./skills/configure-pi-sync/references/configuration.md#debug-mode) for safe cleanup, older snapshots, and timing details.
|
|
195
195
|
|
|
196
196
|
### Background startup checks
|
|
197
197
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"cf35ee3ca45466ed3897beb74eea890f5825e053eb84e0dbaebecf19fda11b7c"
|
|
@@ -69,6 +69,7 @@ export async function hello(paths, identity, signal) {
|
|
|
69
69
|
buildVersion,
|
|
70
70
|
buildId,
|
|
71
71
|
upgradeStop: value.upgradeStop === 1,
|
|
72
|
+
prefixedLifecycleLog: value.prefixedLifecycleLog === true,
|
|
72
73
|
ignoreFilesRetired: value.ignoreFilesRetired === true,
|
|
73
74
|
autonomousSyncRetired: value.autonomousSyncRetired === true,
|
|
74
75
|
needsUpgrade: buildVersion === undefined || lt(buildVersion, DAEMON_BUILD_VERSION),
|
|
@@ -3,6 +3,7 @@ import { gt } from "semver";
|
|
|
3
3
|
import { DAEMON_BUILD_ID, DAEMON_BUILD_VERSION } from "./build-version.js";
|
|
4
4
|
import { hello } from "./client-transport.js";
|
|
5
5
|
import { processExited, readIdentity, readUpgradeOwner, runtimePaths } from "./identity.js";
|
|
6
|
+
import { LIFECYCLE_LOG_FILENAME } from "./lifecycle-log.js";
|
|
6
7
|
import { PROTOCOL_VERSION } from "./protocol.js";
|
|
7
8
|
export async function inspectDaemonStatus(root, signal) {
|
|
8
9
|
signal?.throwIfAborted();
|
|
@@ -35,7 +36,7 @@ export async function inspectDaemonStatus(root, signal) {
|
|
|
35
36
|
...(build.buildId && { buildId: build.buildId }),
|
|
36
37
|
buildComparison: compareBuild(build),
|
|
37
38
|
...(build.upgradeStop && { guardedUpgrade: true }),
|
|
38
|
-
lifecycleLog: path.join(paths.directory, "lifecycle.log"),
|
|
39
|
+
lifecycleLog: path.join(paths.directory, build.prefixedLifecycleLog ? LIFECYCLE_LOG_FILENAME : "lifecycle.log"),
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
catch {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { closeSync, constants, fstatSync, ftruncateSync, lstatSync, openSync, writeSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
export const LIFECYCLE_LOG_FILENAME = "pi-sync-lifecycle.log";
|
|
3
4
|
const MAX_BYTES = 8192;
|
|
4
5
|
/** Bounded lifecycle facts only: never log payloads, credentials, provider output, or exception text. */
|
|
5
6
|
export function openLifecycleLog(directory) {
|
|
@@ -7,7 +8,7 @@ export function openLifecycleLog(directory) {
|
|
|
7
8
|
const privateOwner = (value) => (!process.getuid || value.uid === process.getuid()) && (process.platform === "win32" || (value.mode & 0o077) === 0);
|
|
8
9
|
if (!parent.isDirectory() || parent.isSymbolicLink() || !privateOwner(parent))
|
|
9
10
|
throw new Error("Unsafe lifecycle log directory.");
|
|
10
|
-
const target = path.join(directory,
|
|
11
|
+
const target = path.join(directory, LIFECYCLE_LOG_FILENAME);
|
|
11
12
|
const handle = openSync(target, constants.O_CREAT | constants.O_APPEND | constants.O_RDWR | (constants.O_NOFOLLOW ?? 0), 0o600);
|
|
12
13
|
let closed = false;
|
|
13
14
|
const validate = () => {
|
|
@@ -747,6 +747,7 @@ export async function startServer(root, execute, hooks = {}) {
|
|
|
747
747
|
buildVersion: DAEMON_BUILD_VERSION,
|
|
748
748
|
...(DAEMON_BUILD_ID && { buildId: DAEMON_BUILD_ID }),
|
|
749
749
|
upgradeStop: 1,
|
|
750
|
+
prefixedLifecycleLog: true,
|
|
750
751
|
root: identity.root,
|
|
751
752
|
instance: identity.instance,
|
|
752
753
|
pid: identity.pid,
|
package/dist/daemon/package.json
CHANGED
package/docs/daemon-migration.md
CHANGED
|
@@ -140,7 +140,7 @@ If saving consent fails, that service instance blocks automatic work. Uncertain
|
|
|
140
140
|
|
|
141
141
|
Use the [daemon CLI](#daemon-cli) `status` command without starting a missing service. `stop` drains compatible work. `restart` must not replace an incompatible, unavailable live, or uncertain owner silently. The Pi client must report failure rather than fall back to in-process transfers. If the initial consent check blocked the update before a pending record was created, follow step 1 of [manual recovery](#ownership-and-upgrade); `repair-upgrade` cannot help in that case.
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
After a successful handshake, `status` reports the `lifecycleLog` path in the daemon's private runtime directory. New owners write `pi-sync-lifecycle.log`; for older owners, `status` still reports `lifecycle.log`. Existing legacy logs are left untouched. Only timestamps and lifecycle phases are retained; no request content, credentials, model output, or exception text is logged. The original cleanup error can distinguish a Pi file-queue acknowledgement from a Pi settings-lock release failure; the generic recovery error means that later work is blocked, not that another release failed. This log is not transaction recovery evidence. It is separate from the [Debug mode log](../skills/configure-pi-sync/references/configuration.md#shared-log) and remains available independently of that preference.
|
|
144
144
|
|
|
145
145
|
Before rollback:
|
|
146
146
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-sync",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.2",
|
|
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",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@earendil-works/pi-ai": "1.6.0",
|
|
58
58
|
"@earendil-works/pi-coding-agent": "1.6.0",
|
|
59
59
|
"@earendil-works/pi-tui": "1.6.0",
|
|
60
|
-
"@narumitw/pi-sync-daemon": "^0.16.
|
|
60
|
+
"@narumitw/pi-sync-daemon": "^0.16.1",
|
|
61
61
|
"@types/proper-lockfile": "^4.1.4",
|
|
62
62
|
"@types/semver": "^7.8.0",
|
|
63
63
|
"esbuild": "0.28.2",
|
|
@@ -258,7 +258,7 @@ Pi Sync and the daemon append directly to one private file, `<getAgentDir()>/pi-
|
|
|
258
258
|
|
|
259
259
|
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.
|
|
260
260
|
|
|
261
|
-
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.
|
|
261
|
+
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 `pi-sync-lifecycle.log` is separate and not controlled by Debug mode. The daemon CLI `status` command reports its path when it verifies the running owner. Neither file is a recovery journal.
|
|
262
262
|
|
|
263
263
|
`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.
|
|
264
264
|
|