trajectories 0.1.3 → 0.1.5
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 +1 -0
- package/dist/cli.js +19 -15
- package/docs/shared-history.md +5 -4
- package/legacy/src/shared.ts +15 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
- Observed `remote pull --machine` skips origin rows only when a local `shared://` copy already exists, so a lost SQLite can recover its own history.
|
|
13
14
|
- The sync worker-deadline regression isolates worker admission from database setup, retaining real abort/reap and resume checks without a CI scheduling-speed assumption.
|
|
14
15
|
|
|
15
16
|
## 0.1.2
|
package/dist/cli.js
CHANGED
|
@@ -9182,7 +9182,7 @@ var package_default;
|
|
|
9182
9182
|
var init_package = __esm(() => {
|
|
9183
9183
|
package_default = {
|
|
9184
9184
|
name: "trajectories",
|
|
9185
|
-
version: "0.1.
|
|
9185
|
+
version: "0.1.5",
|
|
9186
9186
|
description: "Portable coding-agent sessions: read, search, convert, and continue across harnesses.",
|
|
9187
9187
|
type: "module",
|
|
9188
9188
|
license: "Apache-2.0",
|
|
@@ -9239,7 +9239,7 @@ var init_package = __esm(() => {
|
|
|
9239
9239
|
publishConfig: {
|
|
9240
9240
|
access: "public"
|
|
9241
9241
|
},
|
|
9242
|
-
gitHead: "
|
|
9242
|
+
gitHead: "2e6e5983c65895f1a2e3d8364eaf06646fd1ea43"
|
|
9243
9243
|
};
|
|
9244
9244
|
});
|
|
9245
9245
|
|
|
@@ -31071,6 +31071,17 @@ function project2(state) {
|
|
|
31071
31071
|
records: state.records.map((record) => ({ ...record, id: `${id}:${record.id}`, session_id: id }))
|
|
31072
31072
|
};
|
|
31073
31073
|
}
|
|
31074
|
+
function localSharedSession(dbPath, observationId) {
|
|
31075
|
+
if (isMemoryStorePath(dbPath) || !existsSync15(dbPath))
|
|
31076
|
+
return null;
|
|
31077
|
+
const reader = new TrajectoryReader(dbPath);
|
|
31078
|
+
try {
|
|
31079
|
+
const local = reader.getSession(`shared:${observationId}`);
|
|
31080
|
+
return local?.source_path.startsWith("shared://") ? local : null;
|
|
31081
|
+
} finally {
|
|
31082
|
+
reader.close();
|
|
31083
|
+
}
|
|
31084
|
+
}
|
|
31074
31085
|
async function runSharedCli(argv) {
|
|
31075
31086
|
if (!argv.length || argv.some((value) => value === "--help" || value === "-h") || argv[0] === "help") {
|
|
31076
31087
|
console.log(help2);
|
|
@@ -31200,21 +31211,14 @@ async function runSharedCli(argv) {
|
|
|
31200
31211
|
}
|
|
31201
31212
|
const observed = [];
|
|
31202
31213
|
for (const item of await client.listObserved()) {
|
|
31203
|
-
|
|
31214
|
+
const local = localSharedSession(dbPath, item.id);
|
|
31215
|
+
if (item.machineId === machine && local) {
|
|
31204
31216
|
observed.push({ id: item.id, head: item.head, outcome: "skipped-origin" });
|
|
31205
31217
|
continue;
|
|
31206
31218
|
}
|
|
31207
|
-
if (
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
const local = reader.getSession(`shared:${item.id}`);
|
|
31211
|
-
if (local?.source_path.startsWith("shared://") && local.content_hash === item.head) {
|
|
31212
|
-
observed.push({ id: item.id, head: item.head, records: local.record_count, outcome: "unchanged" });
|
|
31213
|
-
continue;
|
|
31214
|
-
}
|
|
31215
|
-
} finally {
|
|
31216
|
-
reader.close();
|
|
31217
|
-
}
|
|
31219
|
+
if (local && local.content_hash === item.head) {
|
|
31220
|
+
observed.push({ id: item.id, head: item.head, records: local.record_count, outcome: "unchanged" });
|
|
31221
|
+
continue;
|
|
31218
31222
|
}
|
|
31219
31223
|
const state = await client.getObserved(item.id);
|
|
31220
31224
|
const lease = isMemoryStorePath(dbPath) ? null : acquireWriterLease(dbPath, { holder: "trajectories remote pull" });
|
|
@@ -31288,7 +31292,7 @@ Token path fallback: TRAJECTORIES_REMOTE_TOKEN_FILE. Tokens never belong in URLs
|
|
|
31288
31292
|
Push publishes observed canonical records; native files are not uploaded by this lane.
|
|
31289
31293
|
--store additionally synchronizes managed logs and their referenced objects.
|
|
31290
31294
|
Pull updates the existing SQLite lexical index; it never launches native harnesses.
|
|
31291
|
-
Pull --machine skips that originating machine's observed rows already stored
|
|
31295
|
+
Pull --machine skips that originating machine's observed rows when a local shared:// copy is already stored.
|
|
31292
31296
|
`;
|
|
31293
31297
|
var init_shared2 = __esm(() => {
|
|
31294
31298
|
init_canonical3();
|
package/docs/shared-history.md
CHANGED
|
@@ -75,10 +75,11 @@ that a refreshed remote head is an ancestor of its accepted local chain and repo
|
|
|
75
75
|
with other sessions, indexes available accepted histories and prints its summary
|
|
76
76
|
before exiting nonzero. It does not merge conflicting branches automatically.
|
|
77
77
|
|
|
78
|
-
When pulling
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
|
|
78
|
+
When pulling with the same stable `--machine` ID used by its pushes, that
|
|
79
|
+
origin's observed rows are reported as `skipped-origin` only when a local
|
|
80
|
+
`shared://` copy already exists. A machine that lost its SQLite (or never stored
|
|
81
|
+
those rows) still imports them. Other machines' histories are imported as usual.
|
|
82
|
+
Omit `--machine` when building a complete separate mirror.
|
|
82
83
|
|
|
83
84
|
Pull never launches a harness, takes native execution ownership or migrates a
|
|
84
85
|
workspace. A restored managed session retains its workspace reference; preparing
|
package/legacy/src/shared.ts
CHANGED
|
@@ -27,7 +27,7 @@ Token path fallback: TRAJECTORIES_REMOTE_TOKEN_FILE. Tokens never belong in URLs
|
|
|
27
27
|
Push publishes observed canonical records; native files are not uploaded by this lane.
|
|
28
28
|
--store additionally synchronizes managed logs and their referenced objects.
|
|
29
29
|
Pull updates the existing SQLite lexical index; it never launches native harnesses.
|
|
30
|
-
Pull --machine skips that originating machine's observed rows already stored
|
|
30
|
+
Pull --machine skips that originating machine's observed rows when a local shared:// copy is already stored.
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
function required(value: string | undefined, option: string): string {
|
|
@@ -63,6 +63,15 @@ function project(state: ObservedState) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
function localSharedSession(dbPath: string, observationId: string) {
|
|
67
|
+
if (isMemoryStorePath(dbPath) || !existsSync(dbPath)) return null;
|
|
68
|
+
const reader = new TrajectoryReader(dbPath);
|
|
69
|
+
try {
|
|
70
|
+
const local = reader.getSession(`shared:${observationId}`);
|
|
71
|
+
return local?.source_path.startsWith('shared://') ? local : null;
|
|
72
|
+
} finally { reader.close(); }
|
|
73
|
+
}
|
|
74
|
+
|
|
66
75
|
export async function runSharedCli(argv: string[]): Promise<void> {
|
|
67
76
|
// Help must not open SQLite, managed stores, credentials or sockets.
|
|
68
77
|
if (!argv.length || argv.some(value => value === '--help' || value === '-h') || argv[0] === 'help') { console.log(help); return; }
|
|
@@ -155,19 +164,14 @@ export async function runSharedCli(argv: string[]): Promise<void> {
|
|
|
155
164
|
}
|
|
156
165
|
const observed = [];
|
|
157
166
|
for (const item of await client.listObserved()) {
|
|
158
|
-
|
|
167
|
+
const local = localSharedSession(dbPath, item.id);
|
|
168
|
+
if (item.machineId === machine && local) {
|
|
159
169
|
observed.push({ id: item.id, head: item.head, outcome: 'skipped-origin' });
|
|
160
170
|
continue;
|
|
161
171
|
}
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const local = reader.getSession(`shared:${item.id}`);
|
|
166
|
-
if (local?.source_path.startsWith('shared://') && local.content_hash === item.head) {
|
|
167
|
-
observed.push({ id: item.id, head: item.head, records: local.record_count, outcome: 'unchanged' });
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
} finally { reader.close(); }
|
|
172
|
+
if (local && local.content_hash === item.head) {
|
|
173
|
+
observed.push({ id: item.id, head: item.head, records: local.record_count, outcome: 'unchanged' });
|
|
174
|
+
continue;
|
|
171
175
|
}
|
|
172
176
|
const state = await client.getObserved(item.id);
|
|
173
177
|
const lease = isMemoryStorePath(dbPath) ? null : acquireWriterLease(dbPath, { holder: 'trajectories remote pull' });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trajectories",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Portable coding-agent sessions: read, search, convert, and continue across harnesses.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "2e6e5983c65895f1a2e3d8364eaf06646fd1ea43"
|
|
61
61
|
}
|