strom-research 1.30.0 → 1.30.1

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.
@@ -0,0 +1,104 @@
1
+ <a id="R14"></a>
2
+ # R14 The seal and the integrity of a research
3
+
4
+ strom writes every change of a research as an operation into the logs of its history (`data/ops`) and seals it with
5
+ this computer's key, together with a commit in the research's history (git). `strom verify` compares every record and
6
+ commit with its seal and says what changed outside strom. The chapter describes which ways on strom offers, and in
7
+ detail accepting a research as it is (`strom seal accept`). It describes the research 1.30.1.
8
+
9
+ <!-- zdroj: research:39c56a89 strom help verify („seal check of every record and commit“), strom help repair, strom help seal adopt, strom help seal accept · src/core/accept.ts (záhlaví) · src/core/tree.ts commit (commitSeal klíčem tohoto počítače), requireKey · CHANGELOG.cs.md 1.30.1 · dirigent:spec/072-prijmout-stav/spec.md -->
10
+
11
+ <a id="R14.1"></a>
12
+ ## R14.1 What does not match its seal, and the ways on
13
+
14
+ What `strom verify` finds decides which way to go on. A person runs each of them in their own terminal.
15
+
16
+ | What happened | Way | What it does |
17
+ |---|---|---|
18
+ | a record edited or created outside strom, the history (git) can be read | `strom repair` | restores the last sealed state: edited records are restored, records created outside strom are removed; copies of everything replaced are kept in `.strom/quarantine/` |
19
+ | a research sealed on another computer | `strom seal adopt` | checks the chain of operations and every record's hash, and creates this computer's key for the research |
20
+ | a lost history: the oldest logs of `data/ops` are gone and the history (git) cannot be read or there is none; the records are as strom wrote them | `strom seal accept` | puts nothing back and takes nothing over: seals the research as it is now as a new base ([R14.2](#R14.2)) |
21
+
22
+ - **Enforced by the code:**
23
+ - with a history (git) that can be read, strom does not point to `strom seal accept`: `strom repair` puts the lost
24
+ logs back from it;
25
+ - with a damaged or missing history, `strom verify` and `strom check` report the finding `git-damaged` (“the history
26
+ (git) cannot be read — objects of it are missing”, or that the research has no history) and for every file not
27
+ matching its seal say: “the history (git) is damaged, strom repair cannot restore it — once the records are looked
28
+ over, in a terminal of one's own: strom seal accept”;
29
+ - a write into a research with a damaged history is refused with “the history (git) of the research is damaged:
30
+ nothing written” (code `tree.git-damaged`) and the same advice, instead of git's error. Before, every write and
31
+ `strom check` stopped on it.
32
+ - **Controls:** terminal: `strom verify`, `strom check`, `strom repair`, `strom seal adopt`, `strom seal accept`.
33
+ - **Since:** research 1.30.1
34
+
35
+ <!-- zdroj: research:39c56a89 src/core/accept.ts ACCEPT_HINT, acceptWay (jen bez .git nebo s git.damaged; čitelná historie → nic, strom repair vrátí logy), GIT_DAMAGED, guardOrDamaged · src/commands/checks.ts check a verify (acceptWay nad verifyFull) · src/core/integrity.ts assertIntact, gitDamagedError (tree.git-damaged) · src/cli/ui.ts ui.check.accept.hint, ui.error.tree.git-damaged(.hint) · strom help repair, strom help seal adopt · CHANGELOG.md 1.30.1 -->
36
+
37
+ <a id="R14.2"></a>
38
+ ## R14.2 Accepting a research as it is: `strom seal accept`
39
+
40
+ A cloud drive (iCloud Drive, for one) can take the oldest logs of the history (`data/ops`) and objects of its history
41
+ (git) away from a research. The records stay as strom wrote them, but `strom verify` reports them as created or edited
42
+ outside strom, and `strom repair` has nothing to put back, or would return an older state. `strom seal accept` takes
43
+ the research as it is now as a new sealed base. A person decides, having looked the records over first.
44
+
45
+ - **Counts first:** without a yes, the command changes nothing. It lists what accepting would do:
46
+ - records whose history is missing;
47
+ - records newer than what is left of their history;
48
+ - other files of the research (history, quality, `strom.json`) not sealed as they are;
49
+ - how many logs of the history are in the folder;
50
+ - the state of the history (git): **readable** (the change is added to it), **its last change not made by strom**
51
+ (sealed again), **damaged** (moved aside whole, nothing deleted, a new one begun), **none** (a new one begun);
52
+ - the iCloud copies of files that are moved aside, and those left where they are ([R14.2.1](#R14.2.1)).
53
+ - **The yes:** a person answers **Accept the research as it is now?** in their own terminal. The default answer is no.
54
+ - **The difference:** `strom repair` returns the last sealed state, `strom seal adopt` takes over a research sealed on
55
+ another computer; `strom seal accept` puts nothing back and takes nothing over ([R14.1](#R14.1)).
56
+ - **Controls:** terminal: `strom seal accept --preview` (counts only, an agent may run it too), `strom seal accept`.
57
+ It works in the Strom archive too.
58
+ - **Since:** research 1.30.1
59
+
60
+ <!-- zdroj: research:39c56a89 src/commands/checks.ts seal accept (planAccept → acceptSaid; preview nebo neinteraktivně jen počty, exit 4; confirm(ui.accept.ask, false)) · src/core/accept.ts AcceptPlan (unsealed, edited, other, logs, git ok|unsealed|damaged|missing, moveAside, copies) · src/cli/ui.ts ui.accept.title, unsealed, edited, other, logs, git.*, aside, copies, does, ask · src/cli/help.ts ARCHIVE_COMMANDS „seal accept“ · CHANGELOG.md 1.30.1 -->
61
+
62
+ <a id="R14.2.1"></a>
63
+ ### R14.2.1 What accepting does
64
+
65
+ After the yes, one sealed change names every file not matching its seal as it is now: no record changed, nothing
66
+ deleted.
67
+
68
+ - **Enforced by the code:**
69
+ - one signed operation (`seal.accept`) carries the hash of every such file, and strom keeps it in a sealed commit;
70
+ - a damaged history (git) is moved aside whole into the folder `.git-damaged-<when>` beside the research and a new
71
+ one is begun; the folder with the old history is not part of the new one. Without a history a new one is begun; a
72
+ history that can be read only gets the change added;
73
+ - iCloud's copies of files (“P0001 2.json”, say) in the folders `data/`, `history/` and `quality/`, and copies of
74
+ locks in `.strom/`, are moved into `.strom/accepted-<when>/`; they are never sealed as records. Copies elsewhere in
75
+ the research (beside `strom.json`, in `.strom/`, in `output/`) are only listed and left where they are;
76
+ - at the end the full check runs again: “strom verify: ok — every record matches its seal”, or how many problems are
77
+ left (“strom verify still finds problems: N”);
78
+ - a second run does nothing: “nothing to accept — every record matches its seal”.
79
+ - **Since:** research 1.30.1
80
+
81
+ <!-- zdroj: research:39c56a89 src/core/accept.ts applyAccept (appendOp seal.accept files[path, sha], targets []; tree.commit; .git-damaged-<stamp>, git.initRepo, .git/info/exclude /.git-damaged-*/; .strom/accepted-<stamp>), cloudCopies (SEALED_DIRS data, history, quality; kopie zámků v .strom; kořen, .strom, output jen vypsat), isCloudCopy, nothingToAccept · src/commands/checks.ts (po přijetí verifyFull) · src/cli/ui.ts ui.accept.does, done, gitmoved, copiesmoved, verified, still, nothing -->
82
+
83
+ <a id="R14.2.2"></a>
84
+ ### R14.2.2 What accepting guards and never settles
85
+
86
+ - **Enforced by the code:**
87
+ - only a person accepts a research, in their own interactive terminal, through the same gate as `strom seal adopt`;
88
+ `--yes` never accepts it (“--yes never accepts the research: a person decides at their own terminal”). Outside an
89
+ interactive terminal the command lists only the counts and the sentence “Accepting the research as it is is a
90
+ person's own decision, at their own terminal — strom seal accept”;
91
+ - an agent may run `--preview` only; strom refuses accepting itself to an agent, and the agent tells the person the
92
+ command;
93
+ - nothing is accepted while the bridge to the Strom app runs on the research (`strom live stop`, then again) or
94
+ somebody is at work on it (`strom session finish`, then again);
95
+ - after the yes, strom makes the plan again under the research's lock; when the research changed since it was looked
96
+ over, nothing is accepted (“the research changed since it was looked over: nothing accepted”);
97
+ - a research sealed on another computer is taken over first (`strom seal adopt`);
98
+ - accepting never settles the check's other findings: a log rewritten, an operation forged, another key, files only
99
+ in the cloud, a record deleted, or a file in `data/` that is not a record strom can read. With such a finding
100
+ nothing is accepted (“Not accepted: the check finds what accepting never settles”) and `strom verify` says the
101
+ way.
102
+ - **Since:** research 1.30.1
103
+
104
+ <!-- zdroj: research:39c56a89 src/commands/checks.ts seal accept (agentMay jen --preview; ctx.yes → accept.yes; requireHuman jako seal adopt; liveRunning → accept.bridge; liveWorkers/runsAtWork → accept.busy; tree.requireKey) · src/core/accept.ts SETTLED (unsealed, manual-edit, history-edited, quality-edited, config-edited, foreign-commit), planAccept refused (jiné kódy; recordReadable), applyAccept samePlan → accept.changed · src/cli/help.ts HUMAN_COMMANDS · src/cli/ui.ts ui.accept.person, refused, ui.error.accept.* · strom help seal accept -->
@@ -24,6 +24,7 @@ Parts R (the research), A (the app) and S (the app and the research together) ar
24
24
  - [R11 Material from the user](R11-material-from-the-user.md): files and texts from the user, a document and a lead, an imported family tree, a batch from the app
25
25
  - [R12 Where the agent works and what strom watches](R12-where-the-agent-works.md): the terminal, the Claude, ChatGPT (Codex) and OpenCode apps, Antigravity and Grok Build, a run alone: what strom watches where and what a person does
26
26
  - [R13 Report a problem: `strom error`](R13-reporting-a-problem.md): one ZIP file to send, what is in it and what not, which problem and which command, people's data only with consent, the agent and reporting a problem
27
+ - [R14 The seal and the integrity of a research](R14-seal-and-integrity.md): what does not match its seal and the ways on (`strom repair`, `strom seal adopt`, `strom seal accept`), accepting a research as it is when its history is lost
27
28
 
28
29
  ## A The Strom app
29
30
 
@@ -0,0 +1,106 @@
1
+ <a id="R14"></a>
2
+ # R14 Pieczęć i integralność badania
3
+
4
+ Każdą zmianę badania strom zapisuje jako operację w dziennikach jego historii (`data/ops`) i pieczętuje ją kluczem
5
+ tego komputera, razem z commitem w historii badania (git). `strom verify` porównuje każdy zapis i każdy commit z jego
6
+ pieczęcią i mówi, co zmieniono poza strom. Rozdział opisuje, jakie drogi dalej strom oferuje, a szczegółowo przyjęcie
7
+ badania takiego, jakie jest (`strom seal accept`). Opisuje badanie 1.30.1.
8
+
9
+ <!-- zdroj: research:39c56a89 strom help verify („seal check of every record and commit“), strom help repair, strom help seal adopt, strom help seal accept · src/core/accept.ts (záhlaví) · src/core/tree.ts commit (commitSeal klíčem tohoto počítače), requireKey · CHANGELOG.cs.md 1.30.1 · dirigent:spec/072-prijmout-stav/spec.md -->
10
+
11
+ <a id="R14.1"></a>
12
+ ## R14.1 Co nie zgadza się z pieczęcią i drogi dalej
13
+
14
+ To, co znajdzie `strom verify`, decyduje, którą drogą iść dalej. Każdą uruchamia człowiek we własnym terminalu.
15
+
16
+ | Co się stało | Droga | Co robi |
17
+ |---|---|---|
18
+ | zapis zmieniony lub utworzony poza strom, historia (git) jest czytelna | `strom repair` | przywraca ostatni zapieczętowany stan: zmienione zapisy przywraca, zapisy utworzone poza strom usuwa; kopie wszystkiego zastąpionego zostają w `.strom/quarantine/` |
19
+ | badanie zapieczętowane na innym komputerze | `strom seal adopt` | sprawdza łańcuch operacji i skrót każdego zapisu i tworzy dla badania klucz tego komputera |
20
+ | utracona historia: brak najstarszych dzienników `data/ops`, a historii (git) nie da się odczytać albo jej nie ma; zapisy są takie, jak zapisał je strom | `strom seal accept` | niczego nie przywraca ani nie przejmuje: pieczętuje badanie takie, jakie jest teraz, jako nową podstawę ([R14.2](#R14.2)) |
21
+
22
+ - **Pilnuje kod:**
23
+ - przy czytelnej historii (git) strom nie wskazuje `strom seal accept`: utracone dzienniki przywróci z niej
24
+ `strom repair`;
25
+ - przy uszkodzonej lub brakującej historii `strom verify` i `strom check` zgłaszają ustalenie `git-damaged` (historii
26
+ nie da się odczytać, brak jej obiektów, albo badanie nie ma historii) i przy każdym pliku niezgodnym z pieczęcią
27
+ radzą: „historia (git) jest uszkodzona, strom repair jej nie przywróci – po przejrzeniu zapisów we własnym
28
+ terminalu: strom seal accept”;
29
+ - zapis do badania z uszkodzoną historią strom odrzuca zdaniem „historia (git) badania jest uszkodzona: nic nie
30
+ zapisano” (kod `tree.git-damaged`) z tą samą radą, zamiast błędu gita. Wcześniej zatrzymywał się na niej każdy
31
+ zapis i `strom check`.
32
+ - **Obsługa:** terminal: `strom verify`, `strom check`, `strom repair`, `strom seal adopt`, `strom seal accept`.
33
+ - **Obowiązuje od:** badanie 1.30.1
34
+
35
+ <!-- zdroj: research:39c56a89 src/core/accept.ts ACCEPT_HINT, acceptWay (jen bez .git nebo s git.damaged; čitelná historie → nic, strom repair vrátí logy), GIT_DAMAGED, guardOrDamaged · src/commands/checks.ts check a verify (acceptWay nad verifyFull) · src/core/integrity.ts assertIntact, gitDamagedError (tree.git-damaged) · pl.json ui.check.accept.hint, ui.error.tree.git-damaged(.hint) · strom help repair, strom help seal adopt · CHANGELOG.pl.md 1.30.1 -->
36
+
37
+ <a id="R14.2"></a>
38
+ ## R14.2 Przyjąć badanie takie, jakie jest: `strom seal accept`
39
+
40
+ Dysk w chmurze (na przykład iCloud Drive) może zabrać badaniu najstarsze dzienniki historii (`data/ops`) i obiekty
41
+ jego historii (git). Zapisy zostają takie, jak zapisał je strom, ale `strom verify` zgłasza je jako utworzone lub
42
+ zmienione poza strom, a `strom repair` nie ma czego przywrócić albo przywróciłby starszy stan. `strom seal accept`
43
+ bierze badanie takie, jakie jest teraz, jako nową zapieczętowaną podstawę. Decyduje o tym człowiek, który wcześniej
44
+ przejrzał zapisy.
45
+
46
+ - **Najpierw liczby:** bez potwierdzenia polecenie niczego nie zmienia. Wypisuje, co zrobiłoby przyjęcie:
47
+ - zapisy bez historii;
48
+ - zapisy nowsze niż reszta ich historii;
49
+ - inne pliki badania (historia, jakość, `strom.json`) niezgodne z pieczęcią;
50
+ - ile dzienników historii jest w folderze;
51
+ - stan historii (git): **czytelna** (zmiana zostanie do niej dodana), **ostatniej zmiany nie zrobił strom**
52
+ (zostanie zapieczętowana na nowo), **uszkodzona** (odsunięta w całości, nic nie zostanie usunięte, zostanie
53
+ założona nowa), **brak** (zostanie założona nowa);
54
+ - kopie plików z iCloud, które zostaną odsunięte, i te, które zostaną na miejscu ([R14.2.1](#R14.2.1)).
55
+ - **Potwierdzenie:** człowiek we własnym terminalu odpowiada na **Przyjąć badanie takie, jakie jest teraz?**.
56
+ Domyślna odpowiedź to nie.
57
+ - **Różnica:** `strom repair` przywraca ostatni zapieczętowany stan, `strom seal adopt` przejmuje badanie
58
+ zapieczętowane na innym komputerze; `strom seal accept` niczego nie przywraca ani nie przejmuje ([R14.1](#R14.1)).
59
+ - **Obsługa:** terminal: `strom seal accept --preview` (tylko liczby, może też agent), `strom seal accept`. Działa
60
+ też w Archiwum Strom.
61
+ - **Obowiązuje od:** badanie 1.30.1
62
+
63
+ <!-- zdroj: research:39c56a89 src/commands/checks.ts seal accept (planAccept → acceptSaid; preview nebo neinteraktivně jen počty, exit 4; confirm(ui.accept.ask, false)) · src/core/accept.ts AcceptPlan (unsealed, edited, other, logs, git ok|unsealed|damaged|missing, moveAside, copies) · pl.json ui.accept.title, unsealed, edited, other, logs, git.*, aside, copies, does, ask · src/cli/help.ts ARCHIVE_COMMANDS „seal accept“ · CHANGELOG.pl.md 1.30.1 -->
64
+
65
+ <a id="R14.2.1"></a>
66
+ ### R14.2.1 Co robi przyjęcie
67
+
68
+ Po potwierdzeniu jedna zapieczętowana zmiana zapisuje każdy plik niezgodny z pieczęcią taki, jaki jest teraz: żaden
69
+ zapis się nie zmienia, nic nie zostaje usunięte.
70
+
71
+ - **Pilnuje kod:**
72
+ - jedna podpisana operacja (`seal.accept`) niesie skrót każdego takiego pliku, a strom zachowuje ją
73
+ w zapieczętowanym commicie;
74
+ - uszkodzoną historię (git) odsuwa w całości do folderu `.git-damaged-<kiedy>` obok badania i zakłada nową; folder
75
+ ze starą historią do nowej nie należy. Bez historii zakłada nową, czytelną historię tylko uzupełnia o zmianę;
76
+ - kopie plików z iCloud (na przykład „P0001 2.json”) w folderach `data/`, `history/` i `quality/` oraz kopie blokad
77
+ w `.strom/` przenosi do `.strom/accepted-<kiedy>/`; nigdy nie pieczętuje ich jako zapisów. Kopie w innych
78
+ miejscach badania (obok `strom.json`, w `.strom/`, w `output/`) tylko wypisuje i zostawia na miejscu;
79
+ - na koniec ponownie uruchamia pełną kontrolę: „strom verify: w porządku – każdy zapis zgadza się ze swoją
80
+ pieczęcią” albo ile problemów zostało („strom verify nadal zgłasza problemy: N”);
81
+ - drugie uruchomienie nic nie robi: „nie ma czego przyjmować – każdy zapis zgadza się ze swoją pieczęcią”.
82
+ - **Obowiązuje od:** badanie 1.30.1
83
+
84
+ <!-- zdroj: research:39c56a89 src/core/accept.ts applyAccept (appendOp seal.accept files[path, sha], targets []; tree.commit; .git-damaged-<stamp>, git.initRepo, .git/info/exclude /.git-damaged-*/; .strom/accepted-<stamp>), cloudCopies (SEALED_DIRS data, history, quality; kopie zámků v .strom; kořen, .strom, output jen vypsat), isCloudCopy, nothingToAccept · src/commands/checks.ts (po přijetí verifyFull) · pl.json ui.accept.does, done, gitmoved, copiesmoved, verified, still, nothing -->
85
+
86
+ <a id="R14.2.2"></a>
87
+ ### R14.2.2 Czego przyjęcie pilnuje i czego nigdy nie rozwiązuje
88
+
89
+ - **Pilnuje kod:**
90
+ - badanie przyjmuje tylko człowiek we własnym interaktywnym terminalu, tą samą bramą co `strom seal adopt`;
91
+ `--yes` nigdy go nie przyjmuje („--yes nigdy nie przyjmuje badania: decyduje człowiek we własnym terminalu”). Poza
92
+ interaktywnym terminalem polecenie wypisuje tylko liczby i zdanie „O przyjęciu badania decyduje tylko człowiek we
93
+ własnym terminalu – strom seal accept”;
94
+ - agent może tylko `--preview`; samo przyjęcie strom agentowi odrzuca, a agent podaje człowiekowi polecenie;
95
+ - nic nie zostaje przyjęte, dopóki nad badaniem działa most do aplikacji Strom (`strom live stop`, potem ponownie)
96
+ albo ktoś nad nim pracuje (`strom session finish`, potem ponownie);
97
+ - po potwierdzeniu strom układa plan ponownie pod blokadą badania; gdy badanie zmieniło się od przejrzenia, nic nie
98
+ zostaje przyjęte („badanie zmieniło się od przejrzenia: nic nie przyjęto”);
99
+ - badanie zapieczętowane na innym komputerze najpierw się przejmuje (`strom seal adopt`);
100
+ - innych ustaleń kontroli przyjęcie nigdy nie rozwiązuje: przepisanego dziennika, sfałszowanej operacji, innego
101
+ klucza, plików tylko w chmurze, usuniętego zapisu ani pliku w `data/`, który nie jest zapisem czytelnym dla strom.
102
+ Przy takim ustaleniu nic nie zostaje przyjęte („Nie przyjęto: kontrola znalazła to, czego przyjęcie nigdy nie
103
+ rozwiązuje”), a drogę wskaże `strom verify`.
104
+ - **Obowiązuje od:** badanie 1.30.1
105
+
106
+ <!-- zdroj: research:39c56a89 src/commands/checks.ts seal accept (agentMay jen --preview; ctx.yes → accept.yes; requireHuman jako seal adopt; liveRunning → accept.bridge; liveWorkers/runsAtWork → accept.busy; tree.requireKey) · src/core/accept.ts SETTLED (unsealed, manual-edit, history-edited, quality-edited, config-edited, foreign-commit), planAccept refused (jiné kódy; recordReadable), applyAccept samePlan → accept.changed · src/cli/help.ts HUMAN_COMMANDS · pl.json ui.accept.person, refused, ui.error.accept.* · strom help seal accept -->
@@ -24,6 +24,7 @@ Części R (badanie), A (aplikacja) i S (aplikacja i badanie razem) są zatwierd
24
24
  - [R11 Materiały od użytkownika](R11-material-from-the-user.md): pliki i teksty od użytkownika, dokument i wskazówka, przejęte drzewo genealogiczne, partia z aplikacji
25
25
  - [R12 Gdzie agent pracuje i czego strom pilnuje](R12-where-the-agent-works.md): terminal, aplikacje Claude, ChatGPT (Codex) i OpenCode, Antigravity i Grok Build, samodzielny bieg: czego strom gdzie pilnuje i co robi człowiek
26
26
  - [R13 Zgłosić problem: `strom error`](R13-reporting-a-problem.md): jeden plik ZIP do wysłania, co w nim jest, a czego nie, jaki problem i jakie polecenie, dane osób tylko za zgodą, agent i zgłaszanie problemu
27
+ - [R14 Pieczęć i integralność badania](R14-seal-and-integrity.md): co nie zgadza się z pieczęcią i drogi dalej (`strom repair`, `strom seal adopt`, `strom seal accept`), przyjęcie badania takiego, jakie jest, gdy zaginęła jego historia
27
28
 
28
29
  ## A Aplikacja Strom
29
30
 
package/dist/cli/help.js CHANGED
@@ -27,12 +27,12 @@ const WORK_WORDS = /\btasks?\b|\bqueue[ds]?\b|\bsessions?\b/i;
27
27
  const notInArchive = (text) => AI_WORDS.test(text) || WORK_WORDS.test(text);
28
28
  const ARCHIVE_COMMANDS = new Set([
29
29
  "help", "menu", "status", "tidy",
30
- "init", "trees", "trees use", "trees remove", "trees forget", "mode", "lang", "pack", "unpack", "seal adopt", "backup", "sync", "sync undo", "sync discard",
30
+ "init", "trees", "trees use", "trees remove", "trees forget", "mode", "lang", "pack", "unpack", "seal adopt", "seal accept", "backup", "sync", "sync undo", "sync discard",
31
31
  "intake", "input list", "input show", "conflict list", "conflict show", "conflict resolve",
32
32
  "person list", "person show", "person card", "family show", "source list", "source show", "media list", "media show",
33
33
  "find", "stats", "pedigree", "recent", "history", "history back", "doc",
34
34
  "export gedcom", "gedcom validate", "app", "app install", "live", "live start", "live stop",
35
- "check", "verify", "repair", "seal adopt", "fixes", "fixes show", "fixes run", "fixes decline", "fixes reopen", "fixes undo",
35
+ "check", "verify", "repair", "seal adopt", "seal accept", "fixes", "fixes show", "fixes run", "fixes decline", "fixes reopen", "fixes undo",
36
36
  "phone", "phone status", "phone on", "phone qr", "phone off", "phone list", "phone remove",
37
37
  "setup", "doctor", "error", "update", "config where", "config get", "config set", "config unset", "uninstall", "shortcut",
38
38
  "hook list", "hook on", "hook off", "hook test", "link on", "link off", "link status",
@@ -231,7 +231,7 @@ export const HUMAN_COMMANDS = [
231
231
  "intake", "sync", "sync undo", "sync discard", "conflict list", "conflict resolve", "conflict leave", "event revert", "person revert", "hypothesis decide", "task list", "task wake", "task order", "story approve", "story discard",
232
232
  "offline list", "offline show", "offline set", "offline answer",
233
233
  "stats", "recent", "plan", "history", "history back", "person card", "person list", "pedigree", "find", "doc",
234
- "app", "app install", "live", "live start", "live stop", "phone", "phone on", "phone qr", "phone off", "export gedcom", "pack", "unpack", "seal adopt", "backup", "tidy", "check",
234
+ "app", "app install", "live", "live start", "live stop", "phone", "phone on", "phone qr", "phone off", "export gedcom", "pack", "unpack", "seal adopt", "seal accept", "backup", "tidy", "check",
235
235
  "fixes", "fixes show", "fixes run", "fixes decline", "fixes reopen", "fixes undo", "fixes review", "media calibrate",
236
236
  "surname accept", "surname reject", "surname group", "surname ungroup", "surname unreject", "quality dismiss", "quality undo", "place answer", "place undo",
237
237
  "config get", "config set", "login", "connector add", "connector remove", "connector use", "link on", "link off", "hook on", "hook off",
package/dist/cli/main.js CHANGED
@@ -58,7 +58,7 @@ export { splitCommand } from "./execute.js";
58
58
  * Besides the writing ones, the commands that start work or write into a research or beside it: none runs while the
59
59
  * backup before another channel or an older version could not be made.
60
60
  */
61
- const STARTS_WORK = new Set(["menu", "run", "chat", "app", "live start", "init", "unpack", "trees remove", "compact", "repair", "seal adopt", "sync discard", "agents sync", "session finish", "link open"]);
61
+ const STARTS_WORK = new Set(["menu", "run", "chat", "app", "live start", "init", "unpack", "trees remove", "compact", "repair", "seal adopt", "seal accept", "sync discard", "agents sync", "session finish", "link open"]);
62
62
  /** Compact JSON: indentation costs an agent tokens and adds nothing for a parser. */
63
63
  function toJson(value) {
64
64
  return JSON.stringify(value) + "\n";
package/dist/cli/ui.js CHANGED
@@ -1155,6 +1155,7 @@ export const UI = {
1155
1155
  "ui.help.cmd.connector.remove": "Remove a downloader for an archive, its consent with it",
1156
1156
  "ui.help.cmd.trees.forget": "Forget a family tree gone from its folder (moved, deleted by hand)",
1157
1157
  "ui.help.cmd.seal.adopt": "Take over a family tree sealed on another computer",
1158
+ "ui.help.cmd.seal.accept": "Accept the research as it is now when the history of its records is lost (a new sealed base)",
1158
1159
  "ui.help.cmd.fixes.review": "Answer the facts made proven without the original record: keep them proven, or make them probable",
1159
1160
  "ui.help.cmd.connector.use": "How a downloader reaches its archive: directly or through the browser",
1160
1161
  "ui.help.cmd.link.on": "Let the Strom app open the research with a click",
@@ -3368,6 +3369,41 @@ export const UI = {
3368
3369
  "ui.seal.already": "\"{name}\" is sealed on this computer already",
3369
3370
  "ui.seal.unite.ask": "\"{name}\" was sealed with two keys of strom on this computer (strom of an app and of a terminal, each with settings of its own). Unite them? Every record was checked: nothing changed outside strom, nothing is lost.",
3370
3371
  "ui.seal.united": "\"{name}\" is sealed with one key on this computer now — writing works from the app and the terminal alike",
3372
+ "ui.accept.title": "\"{name}\" — what accepting it as it is now would do:",
3373
+ "ui.accept.unsealed": " records whose history is missing: {n}",
3374
+ "ui.accept.edited": " records newer than what is left of their history: {n}",
3375
+ "ui.accept.outside": " records created or changed outside strom though the history is whole (strom repair returns them; accepted, the change becomes the research's base): {n}",
3376
+ "ui.accept.other": " other files of the research not sealed as they are: {n}",
3377
+ "ui.accept.logs": " logs of the history in the folder: {n}",
3378
+ "ui.accept.git.ok": " history (git): readable — the change added to it",
3379
+ "ui.accept.git.unsealed": " history (git): its last change not made by strom — sealed again",
3380
+ "ui.accept.git.damaged": " history (git): damaged — moved aside whole (.git-damaged-…, nothing deleted), a new one begun",
3381
+ "ui.accept.git.missing": " history (git): none — a new one begun",
3382
+ "ui.accept.aside": " iCloud copies moved aside into .strom/accepted-…: {n} (the first: {first})",
3383
+ "ui.accept.copies": " iCloud copies left where they are: {n} ({list})",
3384
+ "ui.accept.does": "One sealed change then names every file above as it is now: no record changed, nothing deleted.",
3385
+ "ui.accept.ask": "Accept the research as it is now?",
3386
+ "ui.accept.person": "Accepting the research as it is is a person's own decision, at their own terminal — {command}",
3387
+ "ui.accept.nothing": "\"{name}\": nothing to accept — every record matches its seal",
3388
+ "ui.accept.refused": "Not accepted: the check finds what accepting never settles (above) — strom verify says the way",
3389
+ "ui.accept.done": "\"{name}\" accepted as it is (files sealed again: {n})",
3390
+ "ui.accept.gitmoved": "the damaged history kept in {dir}",
3391
+ "ui.accept.copiesmoved": "iCloud copies kept in {dir}",
3392
+ "ui.accept.verified": "strom verify: ok — every record matches its seal",
3393
+ "ui.accept.still": "strom verify still finds problems: {n} → strom verify",
3394
+ "ui.check.accept.hint": "the history (git) is damaged, strom repair cannot restore it — once the records are looked over, in a terminal of one's own: strom seal accept",
3395
+ "ui.error.accept.bridge": "the bridge to the Strom app runs on this research: nothing accepted",
3396
+ "ui.error.accept.bridge.hint": "strom live stop, then strom seal accept",
3397
+ "ui.error.accept.busy": "somebody is at work on this research: accepting only once the work is finished",
3398
+ "ui.error.accept.busy.hint": "strom session finish, then strom seal accept",
3399
+ "ui.error.accept.changed": "the research changed since it was looked over: nothing accepted",
3400
+ "ui.error.accept.changed.hint": "strom seal accept (looks it over again)",
3401
+ "ui.error.accept.refused": "the check finds what accepting never settles: nothing accepted",
3402
+ "ui.error.accept.refused.hint": "strom verify",
3403
+ "ui.error.accept.yes": "--yes never accepts the research: a person decides at their own terminal",
3404
+ "ui.error.accept.yes.hint": "strom seal accept",
3405
+ "ui.error.tree.git-damaged": "the history (git) of the research is damaged: nothing written",
3406
+ "ui.error.tree.git-damaged.hint": "strom verify (details)\nonce the records are looked over, in a terminal of one's own: strom seal accept",
3371
3407
  "ui.error.seal.other-key": "\"{name}\" was sealed with two keys of strom on this computer (strom of an app and of a terminal, each with settings of its own): nothing written",
3372
3408
  "ui.error.seal.other-key.hint": "united in a terminal of its own: {set} — never strom repair, which would undo that work",
3373
3409
  "ui.check.otherkey": "sealed with two keys of strom on this computer (strom of an app and of a terminal): the writes of both are strom's own",
@@ -1,4 +1,4 @@
1
- // check · verify · guard · repair · seal adopt · history
1
+ // check · verify · guard · repair · seal adopt · seal accept · history
2
2
  import { mb, tidyPlan, TIDY_SAID } from "../core/tidy.js";
3
3
  import { actsAsArchive } from "../core/state.js";
4
4
  import fs from "node:fs";
@@ -14,7 +14,8 @@ import { adoptSeal, keysToUnite } from "../cli/seal.js";
14
14
  import { NeedsConsentError, StromError, UsageError } from "../core/errors.js";
15
15
  import * as git from "../core/git.js";
16
16
  import { ui } from "../cli/ui.js";
17
- import { history } from "../core/live.js";
17
+ import { history, liveRunning } from "../core/live.js";
18
+ import { ACCEPT_HINT, acceptWay, guardOrDamaged, applyAccept, nothingToAccept, planAccept } from "../core/accept.js";
18
19
  import { humanWhen, verifyWaitsMore } from "../cli/human.js";
19
20
  import { verifyCounts } from "../core/verify.js";
20
21
  import { isAgent } from "../core/which.js";
@@ -51,6 +52,8 @@ function said(f, lang) {
51
52
  }
52
53
  /** Its next step said as its finding is (the research sealed on another computer: taken over by the person). */
53
54
  function hintSaid(f, lang) {
55
+ if (lang && f.hint === ACCEPT_HINT)
56
+ return ui(lang, "ui.check.accept.hint");
54
57
  if (lang && f.code === "foreign-seal")
55
58
  return ui(lang, "ui.check.foreignseal.hint");
56
59
  if (lang && f.code === OTHER_KEY)
@@ -106,7 +109,7 @@ register({
106
109
  const lang = agent ? "en" : tree.lang;
107
110
  // the shared folder's files of this research (its material, the images nobody fetches again): only here and in
108
111
  // strom verify, never before a command (each file asked whether it is there)
109
- const checked = report([...verifyFull(tree).findings, ...check(tree), ...guard(tree), ...unwritable(tree, agent), ...sharedMissing(tree)], ui(lang, "ui.check.ok"), lang, !agent);
112
+ const checked = report([...acceptWay(tree, verifyFull(tree).findings), ...check(tree), ...guardOrDamaged(tree, () => guard(tree)), ...unwritable(tree, agent), ...sharedMissing(tree)], ui(lang, "ui.check.ok"), lang, !agent);
110
113
  // much kept beside the research that can go (an older strom never tidied it): a sentence, in that language —
111
114
  // none where .strom cannot be listed (found on Windows: a folder denied to strom ended check with "no permission"
112
115
  // instead of its finding; unwritable says it)
@@ -142,7 +145,7 @@ register({
142
145
  options: [{ name: "fast", type: "boolean", description: "only what changed since the last commit (what runs before every write)" }],
143
146
  run(ctx, { opts }) {
144
147
  const tree = ctx.tree();
145
- return report(opts.fast ? verifyFast(tree).findings : [...verifyFull(tree).findings, ...sharedMissing(tree)], "ok — every record matches its seal");
148
+ return report(opts.fast ? verifyFast(tree).findings : [...acceptWay(tree, verifyFull(tree).findings), ...sharedMissing(tree)], "ok — every record matches its seal", isAgent(ctx.env) ? undefined : tree.lang, !isAgent(ctx.env));
146
149
  },
147
150
  }, {
148
151
  path: ["guard"],
@@ -302,6 +305,62 @@ register({
302
305
  }
303
306
  return { text: ui(lang, r.why === "already" ? "ui.seal.already" : "ui.cancelled", { name }), data: { adopted: false } };
304
307
  },
308
+ }, {
309
+ path: ["seal", "accept"],
310
+ summary: "Accept the research as it is now when the history of its records is lost (the user runs this in a terminal)",
311
+ group: "history",
312
+ tree: true,
313
+ description: "For a research whose records are as strom wrote them but whose history is lost: the oldest logs of data/ops taken\n" +
314
+ "away (a cloud drive), its git history damaged, so strom verify says records were created or edited outside strom and\n" +
315
+ "strom repair has nothing to put back. Says first what it would do (how many records lack their history, the state of\n" +
316
+ "git); on the user's yes, one sealed change names every such file as it is now — no record changed, nothing deleted.\n" +
317
+ "A damaged git history is moved aside whole (.git-damaged-<when>) and a new one begun; iCloud copies (\"P0001 2.json\")\n" +
318
+ "inside data/ are moved into .strom/accepted-<when>/. Never settles a log rewritten, an operation forged, another key\n" +
319
+ "or files only in the cloud. --preview says what it would do (read only, anyone may). Accepting itself is the user's\n" +
320
+ "own decision at their terminal — an agent tells the user the command, never runs it; never while the bridge runs or\n" +
321
+ "somebody works on the research.",
322
+ options: [{ name: "preview", type: "boolean", description: "only say what accepting would do; nothing written" }],
323
+ examples: ["strom seal accept --preview", "strom seal accept"],
324
+ person: "Accepting the research as it is (a new sealed base) is the user's own decision, in their terminal",
325
+ agentMay: { when: "--preview", check: (_ctx, { opts }) => opts.preview === true },
326
+ run: async (ctx, { opts }) => {
327
+ const tree = ctx.tree();
328
+ const agent = isAgent(ctx.env);
329
+ const lang = agent ? "en" : tree.lang;
330
+ const name = tree.config.name;
331
+ const set = "strom seal accept";
332
+ // sealed on another computer: no key of this one to seal with — taken over first
333
+ tree.requireKey();
334
+ const plan = planAccept(tree);
335
+ const data = acceptData(plan);
336
+ if (plan.refused.length) {
337
+ const found = report(plan.refused, "", lang, !agent);
338
+ return { ...found, text: lines(found.text, ui(lang, "ui.accept.refused")), data: { ...found.data, ...data, accepted: false } };
339
+ }
340
+ if (nothingToAccept(plan))
341
+ return { text: ui(lang, "ui.accept.nothing", { name }), data: { ...data, accepted: false, nothing: true } };
342
+ const said = acceptSaid(plan, lang, name);
343
+ if (opts.preview || !ctx.interactive)
344
+ return { text: lines(said, "", ui(lang, "ui.accept.person", { command: set })), data: { ...data, accepted: false, run: set }, exitCode: opts.preview ? 0 : 4 };
345
+ // the bridge reads the history this replaces; a writer at work would write on top of what is looked over now
346
+ if (liveRunning(tree.root))
347
+ throw new UsageError("the bridge to the Strom app runs on this research: nothing accepted", { hint: `strom live stop, then ${set}`, code: "accept.bridge" });
348
+ if (liveWorkers(tree.root).length > 0 || runsAtWork(tree.root).length > 0)
349
+ throw new UsageError("somebody is at work on this research: accepting only once they finished", { hint: `strom session finish, then ${set}`, code: "accept.busy" });
350
+ if (ctx.yes)
351
+ throw new UsageError("--yes never accepts the research: a person decides at their terminal", { hint: set, code: "accept.yes" });
352
+ ctx.requireHuman("Accept the research as it is now (a new sealed base)?", set, "seal", ui(lang, "ui.accept.person", { command: set }), { window: false });
353
+ ctx.io.stdout(said + "\n");
354
+ if (!(await ctx.confirm(ui(lang, "ui.accept.ask"), false)))
355
+ return { text: ui(lang, "ui.cancelled"), data: { ...data, accepted: false } };
356
+ const r = applyAccept(tree, plan);
357
+ const after = verifyFull(tree).findings.filter((f) => f.level === "error");
358
+ return {
359
+ text: lines(ui(lang, "ui.accept.done", { name, n: r.sealed }), r.gitMoved ? ui(lang, "ui.accept.gitmoved", { dir: r.gitMoved }) : undefined, r.copiesMoved ? ui(lang, "ui.accept.copiesmoved", { dir: r.copiesMoved }) : undefined, after.length ? ui(lang, "ui.accept.still", { n: after.length }) : ui(lang, "ui.accept.verified")),
360
+ data: { ...data, accepted: true, commit: r.commit, ...(r.gitMoved ? { gitMoved: r.gitMoved } : {}), ...(r.copiesMoved ? { copiesMoved: r.copiesMoved } : {}), verify: { ok: after.length === 0, errors: after.length } },
361
+ exitCode: after.length ? 1 : 0,
362
+ };
363
+ },
305
364
  }, {
306
365
  path: ["history"],
307
366
  summary: "What changed recently (one line per change)",
@@ -406,3 +465,23 @@ function backPreview(tree, plan, lang) {
406
465
  // trees the app sent that wait in the inbox (sync.review on): the return leaves them, decided after it they come on top
407
466
  ...(plan.same || !waiting ? [] : [ui(lang, "ui.back.inbox", { n: waiting })]));
408
467
  }
468
+ /** What accepting would do, as a person reads it: the counts, the state of git, the copies of iCloud. */
469
+ function acceptSaid(plan, lang, name) {
470
+ const list = plan.copies.slice(0, 5).join(", ") + (plan.copies.length > 5 ? ", …" : "");
471
+ return lines(ui(lang, "ui.accept.title", { name }), plan.unsealed.length ? ui(lang, "ui.accept.unsealed", { n: plan.unsealed.length }) : undefined, plan.edited.length ? ui(lang, "ui.accept.edited", { n: plan.edited.length }) : undefined, plan.outside.length ? ui(lang, "ui.accept.outside", { n: plan.outside.length }) : undefined, plan.other.length ? ui(lang, "ui.accept.other", { n: plan.other.length }) : undefined, ui(lang, "ui.accept.logs", { n: plan.logs }), ui(lang, `ui.accept.git.${plan.git}`), plan.moveAside.length ? ui(lang, "ui.accept.aside", { n: plan.moveAside.length, first: plan.moveAside[0] }) : undefined, plan.copies.length ? ui(lang, "ui.accept.copies", { n: plan.copies.length, list }) : undefined, "", ui(lang, "ui.accept.does"));
472
+ }
473
+ /** What accepting would do, for a program: the counts and the files. */
474
+ function acceptData(plan) {
475
+ return {
476
+ unsealed: plan.unsealed.length,
477
+ edited: plan.edited.length,
478
+ outside: plan.outside.length,
479
+ other: plan.other.length,
480
+ logs: plan.logs,
481
+ git: plan.git,
482
+ files: plan.files.map((f) => f.path),
483
+ moveAside: plan.moveAside,
484
+ copies: plan.copies,
485
+ refused: plan.refused.length,
486
+ };
487
+ }