strom-research 1.22.0 → 1.22.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.cs.md +24 -0
- package/CHANGELOG.de.md +27 -0
- package/CHANGELOG.md +24 -0
- package/assets/lang/cs.json +14 -0
- package/assets/lang/de.json +14 -0
- package/dist/agents/files.js +12 -2
- package/dist/brief/history.js +6 -0
- package/dist/cli/main.js +9 -0
- package/dist/cli/menu.js +7 -1
- package/dist/cli/seal.js +45 -2
- package/dist/cli/ui.js +14 -0
- package/dist/commands/checks.js +19 -6
- package/dist/commands/history.js +8 -2
- package/dist/commands/setup.js +38 -3
- package/dist/core/changelog.js +1 -1
- package/dist/core/git.js +2 -2
- package/dist/core/integrity.js +104 -14
- package/dist/core/live.js +4 -0
- package/dist/core/oldsettings.js +101 -0
- package/dist/core/packaged.js +69 -0
- package/dist/core/paths.js +9 -5
- package/dist/core/placehistory.js +33 -0
- package/dist/core/seal.js +51 -3
- package/dist/core/tree.js +11 -5
- package/package.json +1 -1
package/dist/core/tree.js
CHANGED
|
@@ -21,7 +21,7 @@ import { settledRecord, validateRecord } from "./validate.js";
|
|
|
21
21
|
import { NeedsConsentError, StromError, UsageError } from "./errors.js";
|
|
22
22
|
import * as git from "./git.js";
|
|
23
23
|
import { opsLogs } from "./opslog.js";
|
|
24
|
-
import { commitSeal, createKey, fingerprint, loadKey, sha256, signOp } from "./seal.js";
|
|
24
|
+
import { commitSeal, createKey, fingerprint, loadKey, settleKey, sha256, signOp, verifyCommitSeal } from "./seal.js";
|
|
25
25
|
import { stringifyCanonical } from "./json.js";
|
|
26
26
|
import { lastBackup } from "./backup.js";
|
|
27
27
|
export const TREE_FILE = "strom.json";
|
|
@@ -29,7 +29,7 @@ export const TREE_FILE = "strom.json";
|
|
|
29
29
|
export const SEAL_FOREIGN = "seal.foreign";
|
|
30
30
|
// between releases the candidate being made (a bridge run from the sources says what it is: the Strom app goes by it);
|
|
31
31
|
// at a release the release's own (package.json)
|
|
32
|
-
export const VERSION = "1.22.
|
|
32
|
+
export const VERSION = "1.22.2";
|
|
33
33
|
const GITIGNORE = `# Strom Research — local state and large files are not versioned
|
|
34
34
|
.strom/
|
|
35
35
|
/media/
|
|
@@ -569,7 +569,7 @@ export class Tree {
|
|
|
569
569
|
/** The tree's seal key on this computer, or undefined (tree moved here). */
|
|
570
570
|
get key() {
|
|
571
571
|
if (this.keyCache === undefined)
|
|
572
|
-
this.keyCache =
|
|
572
|
+
this.keyCache = settleKey(this.env, this.config.id, (key) => this.headSealedWith(key)) ?? null;
|
|
573
573
|
return this.keyCache ?? undefined;
|
|
574
574
|
}
|
|
575
575
|
lastStamp = 0;
|
|
@@ -582,6 +582,11 @@ export class Tree {
|
|
|
582
582
|
opsFilesTouched() {
|
|
583
583
|
return [...this.touchedOps].map((f) => this.relative(f));
|
|
584
584
|
}
|
|
585
|
+
/** Whether the last commit carries the seal of this key. */
|
|
586
|
+
headSealedWith(key) {
|
|
587
|
+
const head = git.headInfo(this.root);
|
|
588
|
+
return !!head && verifyCommitSeal(key, head.tree, head.message);
|
|
589
|
+
}
|
|
585
590
|
/** Forget the cached key (after one was created on this computer). */
|
|
586
591
|
reloadKey() {
|
|
587
592
|
this.keyCache = undefined;
|
|
@@ -605,7 +610,8 @@ export class Tree {
|
|
|
605
610
|
], undefined, undefined, { code: SEAL_FOREIGN, params: { name: this.config.name, set: "strom seal adopt" } });
|
|
606
611
|
}
|
|
607
612
|
/** Sealed commit of everything under pathspec. */
|
|
608
|
-
commit(
|
|
613
|
+
/** `always`: a commit even when nothing changed (strom repair sealing again what was committed outside strom). */
|
|
614
|
+
commit(message, pathspec = ["."], always = false) {
|
|
609
615
|
const key = this.requireKey();
|
|
610
616
|
// its IDs on disk before it commits (written once here, not after every record: a sync of 2 200 people wrote the
|
|
611
617
|
// counters thousands of times)
|
|
@@ -613,7 +619,7 @@ export class Tree {
|
|
|
613
619
|
// another process may have committed since this one last looked — under the lock it read HEAD afresh already
|
|
614
620
|
if (this.lockDepth === 0)
|
|
615
621
|
git.resetCache(this.root);
|
|
616
|
-
const hash = git.commitAll(this.root, message, pathspec, (treeHash) => commitSeal(key, treeHash));
|
|
622
|
+
const hash = git.commitAll(this.root, message, pathspec, (treeHash) => commitSeal(key, treeHash), always);
|
|
617
623
|
// the logs this commit holds are closed: what comes next goes into new ones
|
|
618
624
|
this.opsNow.clear();
|
|
619
625
|
if (hash) {
|