wendkeep 0.67.1 → 0.67.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 +11 -0
- package/README.en.md +5 -5
- package/README.md +5 -5
- package/docs/en/commands/costs-and-observability.md +8 -8
- package/docs/en/commands/maintenance-and-diagnostics.md +13 -13
- package/docs/pt-BR/commands/costs-and-observability.md +8 -8
- package/docs/pt-BR/commands/maintenance-and-diagnostics.md +13 -12
- package/hooks/harness-doctor.mjs +8 -2
- package/hooks/obsidian-common.mjs +8 -0
- package/hooks/vault-health.mjs +26 -20
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to **wendkeep** are documented here. Format based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project follows
|
|
5
5
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.67.2] — 2026-08-02
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **O doctor agora exibe comandos de reparo executáveis no projeto.** Os diagnósticos de memória
|
|
12
|
+
e observabilidade usam `npx --no-install wendkeep`, informam o Vault absoluto resolvido em
|
|
13
|
+
`--vault` e
|
|
14
|
+
mantêm a sequência segura de inspeção (dry-run) antes da variante explícita com `--apply`.
|
|
15
|
+
- **O doctor continua somente leitura.** A correção altera apenas as recomendações exibidas; o
|
|
16
|
+
reparo continua exigindo execução humana do comando `--apply`.
|
|
17
|
+
|
|
7
18
|
## [0.67.1] — 2026-08-02
|
|
8
19
|
|
|
9
20
|
### Fixed
|
package/README.en.md
CHANGED
|
@@ -346,20 +346,20 @@ Codex uses `session_id`/`turn_id` plus transcript order, with no artificial caus
|
|
|
346
346
|
`DIGEST.md` is no longer the operational handoff: it remains the `/brain-recall` bridge and legacy-vault fallback. A vault without SHARED receives CORE+DIGEST with a deprecation warning; migrate during the compatibility window:
|
|
347
347
|
|
|
348
348
|
```bash
|
|
349
|
-
wendkeep memory status --gate --vault .MyApp-vault
|
|
350
|
-
wendkeep memory migrate --vault .MyApp-vault # preview, zero writes
|
|
351
|
-
wendkeep memory migrate --apply --vault .MyApp-vault # backup + candidates + v2 bundle
|
|
349
|
+
npx --no-install wendkeep memory status --gate --vault .MyApp-vault
|
|
350
|
+
npx --no-install wendkeep memory migrate --vault .MyApp-vault # preview, zero writes
|
|
351
|
+
npx --no-install wendkeep memory migrate --apply --vault .MyApp-vault # backup + candidates + v2 bundle
|
|
352
352
|
```
|
|
353
353
|
|
|
354
354
|
### Health and recovery
|
|
355
355
|
|
|
356
|
-
Use `wendkeep memory status --gate --vault <vault>` in CI and before `verify`/`archive`. Revision 0
|
|
356
|
+
Use `npx --no-install wendkeep memory status --gate --vault <vault>` in CI and before `verify`/`archive`. Revision 0
|
|
357
357
|
immediately after valid migration is healthy. The gate correlates `last_memory_attempt`, outbox,
|
|
358
358
|
ledger, SHARED, and checkpoint: `degraded` with a durable outbox is a warning; an ambiguous attempt,
|
|
359
359
|
lost publication, or mismatched checkpoint blocks. See [migration](docs/en/commands/memory-migration.md)
|
|
360
360
|
and [diagnostics](docs/en/commands/maintenance-and-diagnostics.md).
|
|
361
361
|
|
|
362
|
-
If status blocks, preserve the evidence and run `wendkeep memory repair --vault <vault>` to back up
|
|
362
|
+
If status blocks, preserve the evidence and run `npx --no-install wendkeep memory repair --vault <vault>` to back up
|
|
363
363
|
the corrupt ledger, retain valid lines, and re-project. Repair remains structural: its only narrow
|
|
364
364
|
acknowledgement exception covers attempts entirely represented by the outbox consumed by that same
|
|
365
365
|
run; it does not scan or reclassify historical attempts. Valid pre-0.59 causal checkpoints and
|
package/README.md
CHANGED
|
@@ -346,20 +346,20 @@ Codex uses `session_id`/`turn_id` plus transcript order, with no artificial caus
|
|
|
346
346
|
`DIGEST.md` is no longer the operational handoff: it remains the `/brain-recall` bridge and legacy-vault fallback. A vault without SHARED receives CORE+DIGEST with a deprecation warning; migrate during the compatibility window:
|
|
347
347
|
|
|
348
348
|
```bash
|
|
349
|
-
wendkeep memory status --gate --vault .MyApp-vault
|
|
350
|
-
wendkeep memory migrate --vault .MyApp-vault # preview, zero writes
|
|
351
|
-
wendkeep memory migrate --apply --vault .MyApp-vault # backup + candidates + v2 bundle
|
|
349
|
+
npx --no-install wendkeep memory status --gate --vault .MyApp-vault
|
|
350
|
+
npx --no-install wendkeep memory migrate --vault .MyApp-vault # preview, zero writes
|
|
351
|
+
npx --no-install wendkeep memory migrate --apply --vault .MyApp-vault # backup + candidates + v2 bundle
|
|
352
352
|
```
|
|
353
353
|
|
|
354
354
|
### Health and recovery
|
|
355
355
|
|
|
356
|
-
Use `wendkeep memory status --gate --vault <vault>` in CI and before `verify`/`archive`. Revision 0
|
|
356
|
+
Use `npx --no-install wendkeep memory status --gate --vault <vault>` in CI and before `verify`/`archive`. Revision 0
|
|
357
357
|
immediately after valid migration is healthy. The gate correlates `last_memory_attempt`, outbox,
|
|
358
358
|
ledger, SHARED, and checkpoint: `degraded` with a durable outbox is a warning; an ambiguous attempt,
|
|
359
359
|
lost publication, or mismatched checkpoint blocks. See [migration](docs/en/commands/memory-migration.md)
|
|
360
360
|
and [diagnostics](docs/en/commands/maintenance-and-diagnostics.md).
|
|
361
361
|
|
|
362
|
-
If status blocks, preserve the evidence and run `wendkeep memory repair --vault <vault>` to back up
|
|
362
|
+
If status blocks, preserve the evidence and run `npx --no-install wendkeep memory repair --vault <vault>` to back up
|
|
363
363
|
the corrupt ledger, retain valid lines, and re-project. Repair remains structural: its only narrow
|
|
364
364
|
acknowledgement exception covers attempts entirely represented by the outbox consumed by that same
|
|
365
365
|
run; it does not scan or reclassify historical attempts. Valid pre-0.59 causal checkpoints and
|
|
@@ -24,9 +24,9 @@ A consistent registry, complete price table, and transcript access for rebuilt s
|
|
|
24
24
|
## Syntax
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx wendkeep stats [--vault <vault>] [--json]
|
|
28
|
-
npx wendkeep cost [--since <date>] [--top [N]] [--trend day|week|month] [--write] [--json]
|
|
29
|
-
npx wendkeep cost rebuild [--session <id|file>] [--limit N] [--max-graph-nodes N] [--max-fallback-days N] [--max-fallback-candidates N] [--apply] [--json]
|
|
27
|
+
npx --no-install wendkeep stats [--vault <vault>] [--json]
|
|
28
|
+
npx --no-install wendkeep cost [--since <date>] [--top [N]] [--trend day|week|month] [--write] [--json]
|
|
29
|
+
npx --no-install wendkeep cost rebuild [--session <id|file>] [--vault <vault>] [--limit N] [--max-graph-nodes N] [--max-fallback-days N] [--max-fallback-candidates N] [--apply] [--json]
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Options and exit codes
|
|
@@ -50,11 +50,11 @@ npx wendkeep cost rebuild [--session <id|file>] [--limit N] [--max-graph-nodes N
|
|
|
50
50
|
## Examples
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
npx wendkeep stats --vault .MyApp-vault
|
|
54
|
-
npx wendkeep cost --since 2026-07-01 --top 10 --trend week
|
|
55
|
-
npx wendkeep cost rebuild --session 019abc --json
|
|
56
|
-
npx wendkeep cost rebuild --session 019abc --max-graph-nodes 8192 --json
|
|
57
|
-
npx wendkeep cost rebuild --session 019abc --apply
|
|
53
|
+
npx --no-install wendkeep stats --vault .MyApp-vault
|
|
54
|
+
npx --no-install wendkeep cost --since 2026-07-01 --top 10 --trend week
|
|
55
|
+
npx --no-install wendkeep cost rebuild --session 019abc --json --vault .MyApp-vault
|
|
56
|
+
npx --no-install wendkeep cost rebuild --session 019abc --max-graph-nodes 8192 --json --vault .MyApp-vault
|
|
57
|
+
npx --no-install wendkeep cost rebuild --session 019abc --json --vault .MyApp-vault --apply
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Expected result
|
|
@@ -23,11 +23,11 @@ Run from the project root or provide `--project` and `--vault` explicitly.
|
|
|
23
23
|
## Syntax
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npx wendkeep doctor [--vault <vault>]
|
|
27
|
-
npx wendkeep sync-defs [--check|--reseed] --vault <vault> --project <root>
|
|
28
|
-
npx wendkeep theme sync --vault <vault>
|
|
29
|
-
npx wendkeep --version
|
|
30
|
-
npx wendkeep --help
|
|
26
|
+
npx --no-install wendkeep doctor [--vault <vault>]
|
|
27
|
+
npx --no-install wendkeep sync-defs [--check|--reseed] --vault <vault> --project <root>
|
|
28
|
+
npx --no-install wendkeep theme sync --vault <vault>
|
|
29
|
+
npx --no-install wendkeep --version
|
|
30
|
+
npx --no-install wendkeep --help
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Options and exit codes
|
|
@@ -53,12 +53,12 @@ npx wendkeep --help
|
|
|
53
53
|
Post-update checklist:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
npx wendkeep --version
|
|
57
|
-
npx wendkeep sync-defs --check --vault .MyApp-vault --project .
|
|
58
|
-
npx wendkeep doctor --vault .MyApp-vault
|
|
59
|
-
npx wendkeep memory status --gate --vault .MyApp-vault
|
|
60
|
-
npx wendkeep cost rebuild --session <id> --json
|
|
61
|
-
npx wendkeep cost rebuild --session <id> --apply
|
|
56
|
+
npx --no-install wendkeep --version
|
|
57
|
+
npx --no-install wendkeep sync-defs --check --vault .MyApp-vault --project .
|
|
58
|
+
npx --no-install wendkeep doctor --vault .MyApp-vault
|
|
59
|
+
npx --no-install wendkeep memory status --gate --vault .MyApp-vault
|
|
60
|
+
npx --no-install wendkeep cost rebuild --session <id> --json --vault .MyApp-vault
|
|
61
|
+
npx --no-install wendkeep cost rebuild --session <id> --json --vault .MyApp-vault --apply
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Expected result
|
|
@@ -80,8 +80,8 @@ dry-run path before any write.
|
|
|
80
80
|
outbox, and SHARED so `last_memory_attempt` can be correlated before repair.
|
|
81
81
|
- Corrupt bundle: preserve evidence and run `memory status --gate` before `memory repair`.
|
|
82
82
|
- `legacy`/`degraded`/`stale`/`manifest-unproven` observability: run
|
|
83
|
-
`wendkeep cost rebuild --session <id> --json
|
|
84
|
-
`--apply`.
|
|
83
|
+
`npx --no-install wendkeep cost rebuild --session <id> --json --vault <vault>`, review diagnostics,
|
|
84
|
+
and only then authorize the second variant with `--apply`.
|
|
85
85
|
|
|
86
86
|
## Next steps
|
|
87
87
|
|
|
@@ -24,9 +24,9 @@ Registry consistente, tabela de preços completa e acesso aos transcripts das se
|
|
|
24
24
|
## Sintaxe
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx wendkeep stats [--vault <cofre>] [--json]
|
|
28
|
-
npx wendkeep cost [--since <data>] [--top [N]] [--trend day|week|month] [--write] [--json]
|
|
29
|
-
npx wendkeep cost rebuild [--session <id|arquivo>] [--limit N] [--max-graph-nodes N] [--max-fallback-days N] [--max-fallback-candidates N] [--apply] [--json]
|
|
27
|
+
npx --no-install wendkeep stats [--vault <cofre>] [--json]
|
|
28
|
+
npx --no-install wendkeep cost [--since <data>] [--top [N]] [--trend day|week|month] [--write] [--json]
|
|
29
|
+
npx --no-install wendkeep cost rebuild [--session <id|arquivo>] [--vault <cofre>] [--limit N] [--max-graph-nodes N] [--max-fallback-days N] [--max-fallback-candidates N] [--apply] [--json]
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Opções e códigos de saída
|
|
@@ -50,11 +50,11 @@ npx wendkeep cost rebuild [--session <id|arquivo>] [--limit N] [--max-graph-node
|
|
|
50
50
|
## Exemplos
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
npx wendkeep stats --vault .MeuApp-vault
|
|
54
|
-
npx wendkeep cost --since 2026-07-01 --top 10 --trend week
|
|
55
|
-
npx wendkeep cost rebuild --session 019abc --json
|
|
56
|
-
npx wendkeep cost rebuild --session 019abc --max-graph-nodes 8192 --json
|
|
57
|
-
npx wendkeep cost rebuild --session 019abc --apply
|
|
53
|
+
npx --no-install wendkeep stats --vault .MeuApp-vault
|
|
54
|
+
npx --no-install wendkeep cost --since 2026-07-01 --top 10 --trend week
|
|
55
|
+
npx --no-install wendkeep cost rebuild --session 019abc --json --vault .MeuApp-vault
|
|
56
|
+
npx --no-install wendkeep cost rebuild --session 019abc --max-graph-nodes 8192 --json --vault .MeuApp-vault
|
|
57
|
+
npx --no-install wendkeep cost rebuild --session 019abc --json --vault .MeuApp-vault --apply
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Resultado esperado
|
|
@@ -23,11 +23,11 @@ Execute na raiz do projeto ou informe `--project`/`--vault` explicitamente.
|
|
|
23
23
|
## Sintaxe
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npx wendkeep doctor [--vault <cofre>]
|
|
27
|
-
npx wendkeep sync-defs [--check|--reseed] --vault <cofre> --project <raiz>
|
|
28
|
-
npx wendkeep theme sync --vault <cofre>
|
|
29
|
-
npx wendkeep --version
|
|
30
|
-
npx wendkeep --help
|
|
26
|
+
npx --no-install wendkeep doctor [--vault <cofre>]
|
|
27
|
+
npx --no-install wendkeep sync-defs [--check|--reseed] --vault <cofre> --project <raiz>
|
|
28
|
+
npx --no-install wendkeep theme sync --vault <cofre>
|
|
29
|
+
npx --no-install wendkeep --version
|
|
30
|
+
npx --no-install wendkeep --help
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Opções e códigos de saída
|
|
@@ -53,12 +53,12 @@ npx wendkeep --help
|
|
|
53
53
|
Checklist pós-atualização:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
npx wendkeep --version
|
|
57
|
-
npx wendkeep sync-defs --check --vault .MeuApp-vault --project .
|
|
58
|
-
npx wendkeep doctor --vault .MeuApp-vault
|
|
59
|
-
npx wendkeep memory status --gate --vault .MeuApp-vault
|
|
60
|
-
npx wendkeep cost rebuild --session <id> --json
|
|
61
|
-
npx wendkeep cost rebuild --session <id> --apply
|
|
56
|
+
npx --no-install wendkeep --version
|
|
57
|
+
npx --no-install wendkeep sync-defs --check --vault .MeuApp-vault --project .
|
|
58
|
+
npx --no-install wendkeep doctor --vault .MeuApp-vault
|
|
59
|
+
npx --no-install wendkeep memory status --gate --vault .MeuApp-vault
|
|
60
|
+
npx --no-install wendkeep cost rebuild --session <id> --json --vault .MeuApp-vault
|
|
61
|
+
npx --no-install wendkeep cost rebuild --session <id> --json --vault .MeuApp-vault --apply
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Resultado esperado
|
|
@@ -80,7 +80,8 @@ ou sem manifest comprovado e oferece um caminho dry-run antes de qualquer escrit
|
|
|
80
80
|
outbox e SHARED para correlacionar `last_memory_attempt` antes de reparar.
|
|
81
81
|
- Bundle corrompido: preserve a evidência e use `memory status --gate` antes de `memory repair`.
|
|
82
82
|
- Observabilidade `legacy`/`degraded`/`stale`/`manifest-unproven`: rode
|
|
83
|
-
`wendkeep cost rebuild --session <id> --json
|
|
83
|
+
`npx --no-install wendkeep cost rebuild --session <id> --json --vault <cofre>`, revise diagnostics
|
|
84
|
+
e só então autorize a segunda variante com `--apply`.
|
|
84
85
|
|
|
85
86
|
## Próximos passos
|
|
86
87
|
|
package/hooks/harness-doctor.mjs
CHANGED
|
@@ -8,7 +8,12 @@ import { buildEffectiveRequirementPackage, checkSpecsState, evaluateVerdict, tas
|
|
|
8
8
|
import { getLocale } from './locale.mjs';
|
|
9
9
|
import { priceForModel } from './token-usage.mjs';
|
|
10
10
|
import { countMissing, indexDerivedBySession, listSessionNotes, missingDerivedLinks } from './derived-sections.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
quoteCommandArgument,
|
|
13
|
+
readControl,
|
|
14
|
+
readSessionRegistry,
|
|
15
|
+
WENDKEEP_COMMAND,
|
|
16
|
+
} from './obsidian-common.mjs';
|
|
12
17
|
import { parseObservabilityCheckpoint } from './session-observability-state.mjs';
|
|
13
18
|
import { readObservabilityStore } from './session-observability-store.mjs';
|
|
14
19
|
import { assessObservabilityFreshness } from './session-observability-lifecycle.mjs';
|
|
@@ -20,6 +25,7 @@ export function checkSessionObservability(vaultBase, deps = {}) {
|
|
|
20
25
|
const statSource = deps.statSource || statSync;
|
|
21
26
|
const registry = readRegistry(vaultBase);
|
|
22
27
|
const result = { ok: true, scanned: 0, healthy: 0, issues: [] };
|
|
28
|
+
const commandPrefix = `${WENDKEEP_COMMAND} cost rebuild`;
|
|
23
29
|
const entries = Object.entries(registry?.sessions || {})
|
|
24
30
|
.map(([sessionId, entry]) => ({ sessionId, ...entry }))
|
|
25
31
|
.filter((entry) => entry.session_file)
|
|
@@ -32,7 +38,7 @@ export function checkSessionObservability(vaultBase, deps = {}) {
|
|
|
32
38
|
try { content = readNote(notePath, 'utf8'); } catch { continue; }
|
|
33
39
|
if (!entry.provider && /^provider:\s*["']?claude/m.test(content)) continue;
|
|
34
40
|
result.scanned += 1;
|
|
35
|
-
const command =
|
|
41
|
+
const command = `${commandPrefix} --session ${quoteCommandArgument(entry.sessionId)} --json --vault ${quoteCommandArgument(vaultBase)}`;
|
|
36
42
|
const checkpoint = parseObservabilityCheckpoint(content);
|
|
37
43
|
if (!checkpoint) {
|
|
38
44
|
result.issues.push({
|
|
@@ -67,6 +67,14 @@ export function getVaultBase(input = {}) {
|
|
|
67
67
|
return resolveVault(input).base;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// Diagnostic commands must use the project-local package even when `wendkeep` is not installed
|
|
71
|
+
// globally. Quotes preserve resolved Windows paths with spaces in copy/pasteable output.
|
|
72
|
+
export const WENDKEEP_COMMAND = 'npx --no-install wendkeep';
|
|
73
|
+
|
|
74
|
+
export function quoteCommandArgument(value) {
|
|
75
|
+
return `"${String(value ?? '').replaceAll('"', '\\"')}"`;
|
|
76
|
+
}
|
|
77
|
+
|
|
70
78
|
// Diagnostic logger. No-op unless WENDKEEP_DEBUG is set, so it never pollutes the
|
|
71
79
|
// stdout hook contract during normal runs but makes fail-open paths debuggable.
|
|
72
80
|
export function debugLog(...args) {
|
package/hooks/vault-health.mjs
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
controlPath,
|
|
7
7
|
getVaultBase,
|
|
8
8
|
listMarkdownFiles,
|
|
9
|
+
quoteCommandArgument,
|
|
9
10
|
readControl,
|
|
10
11
|
readSessionRegistry,
|
|
12
|
+
WENDKEEP_COMMAND,
|
|
11
13
|
wikilinkFromRel,
|
|
12
14
|
} from './obsidian-common.mjs';
|
|
13
15
|
import { getLocale } from './locale.mjs';
|
|
@@ -98,8 +100,12 @@ function linkedNotesFromSession(content) {
|
|
|
98
100
|
return notes;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
+
const memoryStatusCommand = (vaultBase) => (
|
|
104
|
+
`${WENDKEEP_COMMAND} memory status --gate --vault ${quoteCommandArgument(vaultBase)}`
|
|
105
|
+
);
|
|
106
|
+
const memoryRepairCommand = (vaultBase) => (
|
|
107
|
+
`${WENDKEEP_COMMAND} memory repair --vault ${quoteCommandArgument(vaultBase)}`
|
|
108
|
+
);
|
|
103
109
|
|
|
104
110
|
function readJsonLines(vaultBase, path, label) {
|
|
105
111
|
let checked;
|
|
@@ -279,13 +285,13 @@ function checkMemoryAttempts(registry, {
|
|
|
279
285
|
: [];
|
|
280
286
|
|
|
281
287
|
if (state === 'skipped' && disposition === 'ambiguous') {
|
|
282
|
-
failures.push(`Lifecycle de memória v2 ambíguo: Stop pulou a publicação sem identidade causal suficiente. Inspecione com: ${
|
|
288
|
+
failures.push(`Lifecycle de memória v2 ambíguo: Stop pulou a publicação sem identidade causal suficiente. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
283
289
|
continue;
|
|
284
290
|
}
|
|
285
291
|
|
|
286
292
|
if (state === 'skipped' && ['stale_turn', 'superseded'].includes(disposition)) {
|
|
287
293
|
if (eventIds.length) {
|
|
288
|
-
failures.push(`Stop stale/superseded emitiu event_ids apesar da rejeição causal. Inspecione com: ${
|
|
294
|
+
failures.push(`Stop stale/superseded emitiu event_ids apesar da rejeição causal. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
289
295
|
} else {
|
|
290
296
|
warnings.push('Stop stale/superseded foi descartado sem publicar memória.');
|
|
291
297
|
}
|
|
@@ -294,12 +300,12 @@ function checkMemoryAttempts(registry, {
|
|
|
294
300
|
|
|
295
301
|
if (disposition !== 'applied') {
|
|
296
302
|
if (state === 'skipped') warnings.push('Attempt de memória v2 foi descartado sem publicação.');
|
|
297
|
-
else failures.push(`Attempt de memória v2 possui disposition não reconhecida para o estado informado. Inspecione com: ${
|
|
303
|
+
else failures.push(`Attempt de memória v2 possui disposition não reconhecida para o estado informado. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
298
304
|
continue;
|
|
299
305
|
}
|
|
300
306
|
|
|
301
307
|
if (!eventIds.length) {
|
|
302
|
-
failures.push(`Attempt v2 aplicado não declarou event_ids; publicação perdida. Inspecione com: ${
|
|
308
|
+
failures.push(`Attempt v2 aplicado não declarou event_ids; publicação perdida. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
303
309
|
continue;
|
|
304
310
|
}
|
|
305
311
|
|
|
@@ -317,7 +323,7 @@ function checkMemoryAttempts(registry, {
|
|
|
317
323
|
if (typeof attempt.turn_id !== 'string' || !attempt.turn_id) invalidAttemptFields.push('turn_id');
|
|
318
324
|
if (!Number.isInteger(attempt.turn_sequence) || attempt.turn_sequence < 0) invalidAttemptFields.push('turn_sequence');
|
|
319
325
|
if (invalidAttemptFields.length) {
|
|
320
|
-
failures.push(`Attempt v2 da sessão ${sessionId} possui identidade causal inválida (${invalidAttemptFields.join(', ')}). Inspecione com: ${
|
|
326
|
+
failures.push(`Attempt v2 da sessão ${sessionId} possui identidade causal inválida (${invalidAttemptFields.join(', ')}). Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
321
327
|
continue;
|
|
322
328
|
}
|
|
323
329
|
const causalMismatches = [];
|
|
@@ -330,14 +336,14 @@ function checkMemoryAttempts(registry, {
|
|
|
330
336
|
if (fields.length) causalMismatches.push(`${eventId}: ${fields.join(', ')}`);
|
|
331
337
|
}
|
|
332
338
|
if (causalMismatches.length) {
|
|
333
|
-
failures.push(`Attempt v2 da sessão ${sessionId} referencia evento(s) com identidade causal divergente (${causalMismatches.join('; ')}). Inspecione com: ${
|
|
339
|
+
failures.push(`Attempt v2 da sessão ${sessionId} referencia evento(s) com identidade causal divergente (${causalMismatches.join('; ')}). Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
334
340
|
continue;
|
|
335
341
|
}
|
|
336
342
|
|
|
337
343
|
if (state === 'enqueued' || state === 'degraded') {
|
|
338
344
|
const missing = eventIds.filter((eventId) => !ledgerEventIds.has(eventId) && !outboxEventIds.has(eventId));
|
|
339
345
|
if (missing.length) {
|
|
340
|
-
failures.push(`Attempt v2 perdeu ${missing.length} evento(s): ausentes do ledger e da outbox. Inspecione com: ${
|
|
346
|
+
failures.push(`Attempt v2 perdeu ${missing.length} evento(s): ausentes do ledger e da outbox. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
341
347
|
} else if (
|
|
342
348
|
state === 'enqueued'
|
|
343
349
|
&& eventIds.every((eventId) => ledgerEventIds.has(eventId))
|
|
@@ -353,14 +359,14 @@ function checkMemoryAttempts(registry, {
|
|
|
353
359
|
if (state === 'projected') {
|
|
354
360
|
const outsideLedger = eventIds.filter((eventId) => !ledgerEventIds.has(eventId));
|
|
355
361
|
if (outsideLedger.length) {
|
|
356
|
-
failures.push(`Attempt projetado perdeu ${outsideLedger.length} evento(s) no ledger. Inspecione com: ${
|
|
362
|
+
failures.push(`Attempt projetado perdeu ${outsideLedger.length} evento(s) no ledger. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
357
363
|
} else if (!checkpointMatchesLedgerPrefix(attempt.checkpoint, eventIds, ledgerEvents, vaultBase)) {
|
|
358
|
-
failures.push(`Checkpoint do attempt projetado diverge do prefixo rederivado do ledger. Inspecione com: ${
|
|
364
|
+
failures.push(`Checkpoint do attempt projetado diverge do prefixo rederivado do ledger. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
359
365
|
}
|
|
360
366
|
continue;
|
|
361
367
|
}
|
|
362
368
|
|
|
363
|
-
failures.push(`Attempt de memória v2 possui state inválido. Inspecione com: ${
|
|
369
|
+
failures.push(`Attempt de memória v2 possui state inválido. Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
364
370
|
}
|
|
365
371
|
|
|
366
372
|
return { failures, warnings };
|
|
@@ -410,26 +416,26 @@ export function checkMemoryBundle(vaultBase, { registry } = {}) {
|
|
|
410
416
|
const ledgerCorrupt = (bundle.ledger?.errors || []).length > 0;
|
|
411
417
|
if (ledgerCorrupt) {
|
|
412
418
|
for (const error of bundle.ledger.errors) {
|
|
413
|
-
failures.push(`${error} Execute com segurança: ${
|
|
419
|
+
failures.push(`${error} Execute com segurança: ${memoryRepairCommand(vaultBase)}.`);
|
|
414
420
|
}
|
|
415
421
|
}
|
|
416
422
|
for (const error of bundle.errors || []) {
|
|
417
423
|
if (error.startsWith('ledger:')) continue;
|
|
418
|
-
failures.push(`${error} Inspecione com: ${
|
|
424
|
+
failures.push(`${error} Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
419
425
|
}
|
|
420
426
|
|
|
421
427
|
if (outbox.errors.length) {
|
|
422
|
-
failures.push(`Outbox corrompida (${outbox.errors.join('; ')}). Inspecione com: ${
|
|
428
|
+
failures.push(`Outbox corrompida (${outbox.errors.join('; ')}). Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
423
429
|
}
|
|
424
430
|
if (candidates.errors.length) {
|
|
425
|
-
failures.push(`${candidates.errors.join('; ')} Execute com segurança: ${
|
|
431
|
+
failures.push(`${candidates.errors.join('; ')} Execute com segurança: ${memoryRepairCommand(vaultBase)}.`);
|
|
426
432
|
}
|
|
427
433
|
|
|
428
434
|
let replay = null;
|
|
429
435
|
if (bundle.ledger?.ok) {
|
|
430
436
|
try { replay = deriveMemoryProjection(vaultBase, bundle.ledger.events); }
|
|
431
437
|
catch (error) {
|
|
432
|
-
failures.push(`Ledger não pode ser reduzido: ${error.message}. Execute com segurança: ${
|
|
438
|
+
failures.push(`Ledger não pode ser reduzido: ${error.message}. Execute com segurança: ${memoryRepairCommand(vaultBase)}.`);
|
|
433
439
|
}
|
|
434
440
|
}
|
|
435
441
|
if (replay && bundle.shared?.ok) {
|
|
@@ -438,7 +444,7 @@ export function checkMemoryBundle(vaultBase, { registry } = {}) {
|
|
|
438
444
|
if (metadata.event_cursor !== replay.ledgerCursor) divergences.push(`event_cursor ${metadata.event_cursor} != ${replay.ledgerCursor}`);
|
|
439
445
|
if (metadata.state_hash !== replay.stateHash) divergences.push(`state_hash ${metadata.state_hash} != ${replay.stateHash}`);
|
|
440
446
|
if (divergences.length) {
|
|
441
|
-
failures.push(`Projeção SHARED stale/lag (${divergences.join('; ')}). Inspecione com: ${
|
|
447
|
+
failures.push(`Projeção SHARED stale/lag (${divergences.join('; ')}). Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
|
|
@@ -460,7 +466,7 @@ export function checkMemoryBundle(vaultBase, { registry } = {}) {
|
|
|
460
466
|
const activeConflicts = unresolved.filter((item) => item?.reason === 'conflict');
|
|
461
467
|
const ordinaryCandidates = unresolved.filter((item) => item?.reason !== 'conflict');
|
|
462
468
|
if (activeConflicts.length) {
|
|
463
|
-
failures.push(`${activeConflicts.length} conflito ativo em chave operacional (${activeConflicts.map((item) => item.memory_key || item.candidate_id).join(', ')}). Inspecione com: ${
|
|
469
|
+
failures.push(`${activeConflicts.length} conflito ativo em chave operacional (${activeConflicts.map((item) => item.memory_key || item.candidate_id).join(', ')}). Inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
464
470
|
}
|
|
465
471
|
if (outbox.count) warnings.push(`${outbox.count} evento(s) pendente(s) na outbox; execute o projector quando seguro.`);
|
|
466
472
|
if (ordinaryCandidates.length) warnings.push(`${ordinaryCandidates.length} candidate(s) aguardando curadoria humana.`);
|
|
@@ -585,7 +591,7 @@ export function runVaultHealth({ vaultBase, session = '' }) {
|
|
|
585
591
|
failures.push(...memory.failures.map((item) => `Memória: ${item}`));
|
|
586
592
|
warnings.push(...memory.warnings.map((item) => `Memória: ${item}`));
|
|
587
593
|
} else {
|
|
588
|
-
warnings.push(`Bundle de memória v2 ausente (vault legado); inspecione com: ${
|
|
594
|
+
warnings.push(`Bundle de memória v2 ausente (vault legado); inspecione com: ${memoryStatusCommand(vaultBase)}.`);
|
|
589
595
|
}
|
|
590
596
|
|
|
591
597
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wendkeep",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.2",
|
|
4
4
|
"description": "Vault-first persistent memory for AI coding agents, with an optional profile-aware governance runtime: OFF, FLOW, GUIDE, GOVERN, or ASSURE. Local-first and agent-agnostic (Claude Code, Codex, Cursor…).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"acorn": "^8.18.0",
|
|
73
|
-
"wendkeep": "^0.67.
|
|
73
|
+
"wendkeep": "^0.67.1"
|
|
74
74
|
}
|
|
75
75
|
}
|