worktrust 0.10.30 → 0.10.31
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/README.md +15 -4
- package/engine-release.json +1 -1
- package/package-release.json +1 -1
- package/package.json +1 -1
- package/worktrust.mjs +52 -19
package/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# worktrust
|
|
2
2
|
|
|
3
|
+
## 0.10.31: a re-measure is offered only when measuring changed
|
|
4
|
+
|
|
5
|
+
`update` offers to re-measure this computer's sessions only when the new version MEASURES differently from the one it
|
|
6
|
+
replaces: a different timeline, seconds, tokens, steering, session kinds or readers. A release that changes something
|
|
7
|
+
else (consent, coupling, words) offers nothing. The offer lists what changed, one line each. The CLI carries the
|
|
8
|
+
version of its measuring rules beside its own version and records it in `~/.worktrust/installed-release.json` and
|
|
9
|
+
`~/.worktrust/history.json`; an install from before 0.10.31, which did not record it, counts as measuring by 0.10.29's
|
|
10
|
+
rules, so 0.10.29 or 0.10.30 updated to 0.10.31 is offered nothing. A history sent completely by a version with the
|
|
11
|
+
same rules counts as done, so the bare `npx worktrust` does not offer it again either.
|
|
12
|
+
|
|
3
13
|
## 0.10.30: an update asks only what is new
|
|
4
14
|
|
|
5
15
|
`update` remembers what you said yes to. Each AI app's WorkTrust door, the session hook, Codex's `notify` line and
|
|
@@ -363,10 +373,11 @@ sends them with one difference: WorkTrust **replaces** this computer's earlier l
|
|
|
363
373
|
token counts, model names, a layer keyword, counts; never text.
|
|
364
374
|
- **Only from this computer's own key.** A connector (an AI signed in on the web) cannot ask for a rebuild; WorkTrust
|
|
365
375
|
refuses it at the door.
|
|
366
|
-
- **Offered once by `update`.** When this computer's earlier lines were
|
|
367
|
-
`~/.worktrust` says which), `npx worktrust@latest update` says so in
|
|
368
|
-
(0.10.30); Enter and `--yes` are No, `--rebuild`
|
|
369
|
-
|
|
376
|
+
- **Offered once by `update`.** When this computer's earlier lines were measured by other rules (the copy in
|
|
377
|
+
`~/.worktrust` says which; 0.10.31: the measuring rules, not the version), `npx worktrust@latest update` says so in
|
|
378
|
+
plain words, lists what changed, shows the plan and asks once (0.10.30); Enter and `--yes` are No, `--rebuild`
|
|
379
|
+
agrees in advance, and a version that measures as the one before offers nothing. The command cannot read your
|
|
380
|
+
record, so it is an offer, not a finding.
|
|
370
381
|
|
|
371
382
|
## A web chat's data export
|
|
372
383
|
|
package/engine-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"0c29113179561af1c1e9ff8b7a786e7240edf48a2244993e12335e5ee362c812","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"0c29113179561af1c1e9ff8b7a786e7240edf48a2244993e12335e5ee362c812","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"7fdcd2996f0d401a7232467904d2900ee2cc084764ae25d4ffd5f9f4b57da1b3"},"format":"worktrust-package/1","kind":"engine","version":"0.10.31"},"signature":"BFiAtMFcbRPNlWst7-uNb2Flv378GZ195wtGF5nFxLkHaqNEhskqGe0KrzaDKM0T5AKCwf0VoAMOu9r4mf1TDw"}
|
package/package-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"c6f5280c5bf81a14db4bdc282218fb005706e92dd9a9170c0e727716ee91685a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"3096ed1693974a90e1f4f59bf01c9559d94a7941d933e36fb81d3995a97f25c1","README.md":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"c6f5280c5bf81a14db4bdc282218fb005706e92dd9a9170c0e727716ee91685a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"3096ed1693974a90e1f4f59bf01c9559d94a7941d933e36fb81d3995a97f25c1","README.md":"e0b621c26ba8bdfda128eb132d0c42db404bd2db285ad503d81a4bdcda2d1c9a","SECURITY.md":"a7f1187b4f384a71e1f69cb25327487597969c0b0422b377dd4c72086b1b9ad9","chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","engine-release.json":"02575409b07768da214adc4e11f14ce9118cda8dbf9163d6e330e472f9ee00a5","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","package.json":"ba40fbf9fb3ae3ec7bad023c1c327660294db61fc479961bdd5ebdc70e92103e","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"0c29113179561af1c1e9ff8b7a786e7240edf48a2244993e12335e5ee362c812","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"7fdcd2996f0d401a7232467904d2900ee2cc084764ae25d4ffd5f9f4b57da1b3"},"format":"worktrust-package/1","kind":"npm","version":"0.10.31"},"signature":"5zVtVZzppT1vbBpiUKj8OXIdN7C5HFGN3TXtBEY56jlctT7zYARKRAfRTbSDPnozaYiPeE5juo-5wseGwme4DA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrust",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.31",
|
|
4
4
|
"description": "Couple this computer to WorkTrust: approve a code in your browser, and every AI app here reports what you built. Metadata only, no dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/worktrust.mjs
CHANGED
|
@@ -76,7 +76,19 @@ const command = args.includes("--help") ? "help" : args.includes("--version") ?
|
|
|
76
76
|
const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
|
|
77
77
|
const has = (name) => args.includes(`--${name}`);
|
|
78
78
|
/** This CLI's version, said to the door so the app can tell which computer runs an old one (check-cli-package holds it equal to package.json). */
|
|
79
|
-
const CLI_VERSION = "0.10.
|
|
79
|
+
const CLI_VERSION = "0.10.31";
|
|
80
|
+
/**
|
|
81
|
+
* HOW THIS CLI MEASURES, AS A NUMBER OF ITS OWN (0.10.31; owner, 2026-10-28: 0.10.30 offered a re-measure it had no reason
|
|
82
|
+
* to offer). Raised ONLY when what is measured changes: the timeline, the seconds, the tokens, the steering, the session
|
|
83
|
+
* kinds, the readers. A release that changes consent, coupling or words keeps it. `update` offers the re-measure only when
|
|
84
|
+
* the earlier install measured by other rules, and names what changed from MEASURE_CHANGES; installed-release.json and
|
|
85
|
+
* history.json record it. 1 is the rules of 0.10.29, which 0.10.30 and 0.10.31 kept.
|
|
86
|
+
*/
|
|
87
|
+
const MEASURE_RULES = 1;
|
|
88
|
+
/** What each measure-rules version changed, in the words the re-measure offer says (one entry per raise, never rewritten). */
|
|
89
|
+
const MEASURE_CHANGES = {
|
|
90
|
+
1: ["each answer's tokens counted once", "nothing lost at midnight", "when each stretch began", "how you steered the agent", "what the seconds were", "more AI apps", "how each session was started"],
|
|
91
|
+
};
|
|
80
92
|
const ORIGIN = (flag("origin") ?? process.env.WORKTRUST_ORIGIN ?? "https://app.worktrust.io").replace(/\/$/, "");
|
|
81
93
|
const MCP = flag("url") ?? process.env.WORKTRUST_MCP_URL ?? `${ORIGIN}/api/mcp`;
|
|
82
94
|
const HOME_DIR = join(homedir(), ".worktrust");
|
|
@@ -297,7 +309,7 @@ async function prepareBundledRuntime() {
|
|
|
297
309
|
}
|
|
298
310
|
function saveStableEntry() {
|
|
299
311
|
const target = join(HOME_DIR, "installed-release.json"), temporary = `${target}.${randomBytes(8).toString("hex")}.tmp`;
|
|
300
|
-
try { writeFileSync(temporary, JSON.stringify({ version: CLI_VERSION }), { flag: "wx", mode: 0o600 }); renameSync(temporary, target); }
|
|
312
|
+
try { writeFileSync(temporary, JSON.stringify({ version: CLI_VERSION, measureRules: MEASURE_RULES }), { flag: "wx", mode: 0o600 }); renameSync(temporary, target); }
|
|
301
313
|
finally { try { rmSync(temporary); } catch { /* already renamed */ } }
|
|
302
314
|
}
|
|
303
315
|
|
|
@@ -645,7 +657,7 @@ async function update() {
|
|
|
645
657
|
else if (newOnes.length > 0) takeNew = await ask(`Couple the new ${newOnes.length === 1 ? "one" : "ones"} marked "new" (${newOnes.join(", ")})?`, false);
|
|
646
658
|
if (newOnes.length > 0 && !takeNew && !has("yes")) say(" The new ones stay as they are. npx worktrust update asks again.");
|
|
647
659
|
const skip = takeNew ? [] : fresh, hookOn = !hookFresh || takeNew;
|
|
648
|
-
const
|
|
660
|
+
const previous = stableInstall();
|
|
649
661
|
await prepareBundledRuntime();
|
|
650
662
|
ensureHome();
|
|
651
663
|
saveStableEntry();
|
|
@@ -663,7 +675,7 @@ async function update() {
|
|
|
663
675
|
await offerAntigravity();
|
|
664
676
|
const reported = await accepted(key.url, key.token, key.device);
|
|
665
677
|
say(reported === true ? ` ✓ WorkTrust received CLI version ${CLI_VERSION}.` : " ! Installed locally. WorkTrust could not confirm the version yet; it will be reported on the next connection.");
|
|
666
|
-
await offerRebuild(
|
|
678
|
+
await offerRebuild(previous, paths, key);
|
|
667
679
|
say();
|
|
668
680
|
say(" Done. Quit your AI apps completely and open them again to use the updated CLI.");
|
|
669
681
|
}
|
|
@@ -809,19 +821,39 @@ async function offerHistory(paths, token, devicePem, url = MCP, rebuild = false,
|
|
|
809
821
|
const stableVersion = () => { try { const installed = JSON.parse(readFileSync(join(HOME_DIR, "installed-release.json"), "utf8")); if (/^\d+\.\d+\.\d+$/.test(installed.version)) return installed.version; } catch { /* older registration */ } try { return /const CLI_VERSION = "([^"]+)";/.exec(readFileSync(STABLE_FILE, "utf8"))?.[1] ?? null; } catch { return null; } };
|
|
810
822
|
|
|
811
823
|
/**
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
|
|
824
|
+
* THE RULES AN EARLIER CLI MEASURED BY (0.10.31). Recorded since 0.10.31 (installed-release.json, history.json, or the
|
|
825
|
+
* stable copy's own MEASURE_RULES); before that, read from its version: 0.10.29 and 0.10.30 measured by rules 1, anything
|
|
826
|
+
* older by earlier rules (0). Null when the version is unknown too.
|
|
827
|
+
*/
|
|
828
|
+
const rulesOf = (record) => (Number.isInteger(record?.measureRules) && record.measureRules >= 0 ? record.measureRules
|
|
829
|
+
: typeof record?.version === "string" && /^\d+\.\d+\.\d+$/.test(record.version) ? (record.version.split(".").map(Number).reduce((order, part, at) => order || Math.sign(part - [0, 10, 29][at]), 0) < 0 ? 0 : 1) : null);
|
|
830
|
+
/** The stable copy's version and measure rules, what this computer ran before an update; both null without one. */
|
|
831
|
+
function stableInstall() {
|
|
832
|
+
const version = stableVersion();
|
|
833
|
+
if (!version) return { version: null, rules: null };
|
|
834
|
+
try { const installed = JSON.parse(readFileSync(join(HOME_DIR, "installed-release.json"), "utf8")); if (installed.version === version && rulesOf(installed) !== null) return { version, rules: rulesOf(installed) }; } catch { /* older registration */ }
|
|
835
|
+
try { const own = /const MEASURE_RULES = (\d+);/.exec(readFileSync(STABLE_FILE, "utf8"))?.[1]; if (own) return { version, rules: Number(own) }; } catch { /* no stable copy */ }
|
|
836
|
+
return { version, rules: rulesOf({ version }) };
|
|
837
|
+
}
|
|
838
|
+
/** What changed between two measure-rules versions, in MEASURE_CHANGES' words, oldest first. */
|
|
839
|
+
const measureChanges = (from, to) => Object.keys(MEASURE_CHANGES).map(Number).filter((rules) => rules > Math.min(from, to) && rules <= Math.max(from, to)).sort((x, y) => x - y).flatMap((rules) => MEASURE_CHANGES[rules]);
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* OFFERED ONCE, BY `update`, IN PLAIN WORDS (owner, 2026-10-07): when the computer's earlier lines were measured by OTHER
|
|
843
|
+
* RULES than this CLI's (0.10.31: the measure-rules version, not the CLI version; 0.10.30 offered on every version and
|
|
844
|
+
* invited a re-send of history measured exactly as before). The CLI cannot read the record, so it is an offer, not a
|
|
845
|
+
* finding: the plan is shown and the question asked by the same path as `history --rebuild`; Enter is No. The offer
|
|
846
|
+
* names what changed. The same rules updated again offer nothing.
|
|
816
847
|
*/
|
|
817
|
-
async function offerRebuild(
|
|
818
|
-
if (!
|
|
848
|
+
async function offerRebuild(previous, paths, key) {
|
|
849
|
+
if (!previous?.version || previous.rules === null || previous.rules === MEASURE_RULES) return;
|
|
850
|
+
const changes = measureChanges(previous.rules, MEASURE_RULES);
|
|
819
851
|
say();
|
|
820
|
-
say(` This computer's earlier lines in WorkTrust were measured by worktrust ${
|
|
821
|
-
say(
|
|
822
|
-
|
|
823
|
-
say(" sessions still on this computer and have WorkTrust replace this computer's earlier lines,
|
|
824
|
-
say(" a day twice. Later: npx worktrust");
|
|
852
|
+
say(` This computer's earlier lines in WorkTrust were measured by worktrust ${previous.version}. Version ${CLI_VERSION} measures`);
|
|
853
|
+
say(changes.length > 0 ? " differently:" : " differently.");
|
|
854
|
+
for (const change of changes) say(` · ${change}`);
|
|
855
|
+
say(" You can re-measure the sessions still on this computer and have WorkTrust replace this computer's earlier lines,");
|
|
856
|
+
say(" day by day, never counting a day twice. Later: npx worktrust");
|
|
825
857
|
// ONE QUESTION, AFTER THE PLAN (0.10.30): counting the plan reads this computer only and sends nothing, so it is shown
|
|
826
858
|
// first and the send is asked once, Enter is No; `--rebuild` agrees in advance, --yes alone never does.
|
|
827
859
|
await offerHistory(paths, key.token, key.device ?? null, key.url, true, has("rebuild"));
|
|
@@ -833,11 +865,12 @@ async function offerRebuild(previousVersion, paths, key) {
|
|
|
833
865
|
*/
|
|
834
866
|
const HISTORY_STATE = join(HOME_DIR, "history.json");
|
|
835
867
|
function historyDone(complete) {
|
|
836
|
-
try { ensureHome(); writeFileSync(HISTORY_STATE, JSON.stringify({ version: CLI_VERSION, at: new Date().toISOString(), complete }), { mode: 0o600 }); } catch { /* the next run asks again */ }
|
|
868
|
+
try { ensureHome(); writeFileSync(HISTORY_STATE, JSON.stringify({ version: CLI_VERSION, measureRules: MEASURE_RULES, at: new Date().toISOString(), complete }), { mode: 0o600 }); } catch { /* the next run asks again */ }
|
|
837
869
|
}
|
|
838
|
-
/** Complete AND measured by this
|
|
839
|
-
* measured by
|
|
840
|
-
|
|
870
|
+
/** Complete AND measured by this CLI's rules (0.10.9; the rules, not the version, since 0.10.31): a run stopped after the
|
|
871
|
+
* update, before the history, leaves the history measured by older rules, and the next run must offer it again rather
|
|
872
|
+
* than read "complete" as done. A version that measures as the one before finds its history done. */
|
|
873
|
+
const historyComplete = () => { try { const state = JSON.parse(readFileSync(HISTORY_STATE, "utf8")); return state.complete === true && rulesOf(state) === MEASURE_RULES; } catch { return false; } };
|
|
841
874
|
|
|
842
875
|
/**
|
|
843
876
|
* THE SAME COMMAND AGAIN DOES WHAT IS LEFT (0.10.5). On a computer already coupled, `npx worktrust@latest` brings it onto
|