clawvault 1.11.1 → 2.0.0

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.
Files changed (55) hide show
  1. package/README.md +135 -1
  2. package/bin/clawvault.js +51 -1252
  3. package/bin/command-registration.test.js +148 -0
  4. package/bin/command-runtime.js +42 -0
  5. package/bin/command-runtime.test.js +102 -0
  6. package/bin/help-contract.test.js +23 -0
  7. package/bin/register-core-commands.js +139 -0
  8. package/bin/register-maintenance-commands.js +137 -0
  9. package/bin/register-query-commands.js +225 -0
  10. package/bin/register-resilience-commands.js +147 -0
  11. package/bin/register-session-lifecycle-commands.js +204 -0
  12. package/bin/register-template-commands.js +72 -0
  13. package/bin/register-vault-operations-commands.js +295 -0
  14. package/bin/test-helpers/cli-command-fixtures.js +94 -0
  15. package/dashboard/lib/graph-diff.js +3 -1
  16. package/dashboard/lib/graph-diff.test.js +19 -0
  17. package/dashboard/lib/vault-parser.js +330 -26
  18. package/dashboard/lib/vault-parser.test.js +191 -11
  19. package/dashboard/public/app.js +22 -9
  20. package/dist/{chunk-G3YZEFKU.js → chunk-GZOBCUVO.js} +1 -1
  21. package/dist/{chunk-FPEH4FVM.js → chunk-KOF3HYSL.js} +52 -3
  22. package/dist/chunk-MXSSG3QU.js +42 -0
  23. package/dist/chunk-O5V7SD5C.js +398 -0
  24. package/dist/chunk-PAYUH64O.js +284 -0
  25. package/dist/{chunk-3HFB7EMU.js → chunk-QFBKWDYR.js} +12 -0
  26. package/dist/{chunk-UBRYOIII.js → chunk-TBVI4N53.js} +210 -21
  27. package/dist/chunk-TXO34J3O.js +56 -0
  28. package/dist/commands/compat.d.ts +28 -0
  29. package/dist/commands/compat.js +10 -0
  30. package/dist/commands/context.d.ts +2 -33
  31. package/dist/commands/context.js +3 -2
  32. package/dist/commands/doctor.js +61 -3
  33. package/dist/commands/entities.d.ts +1 -0
  34. package/dist/commands/entities.js +4 -4
  35. package/dist/commands/graph.d.ts +21 -0
  36. package/dist/commands/graph.js +10 -0
  37. package/dist/commands/link.d.ts +1 -0
  38. package/dist/commands/link.js +14 -5
  39. package/dist/commands/observe.js +2 -2
  40. package/dist/commands/sleep.js +8 -7
  41. package/dist/commands/status.d.ts +6 -0
  42. package/dist/commands/status.js +63 -3
  43. package/dist/commands/wake.js +5 -4
  44. package/dist/context-COo8oq1k.d.ts +45 -0
  45. package/dist/index.d.ts +63 -2
  46. package/dist/index.js +53 -15
  47. package/dist/lib/config.d.ts +6 -1
  48. package/dist/lib/config.js +7 -3
  49. package/hooks/clawvault/HOOK.md +6 -1
  50. package/hooks/clawvault/handler.js +44 -3
  51. package/hooks/clawvault/handler.test.js +161 -0
  52. package/package.json +34 -2
  53. package/dashboard/public/graph.js +0 -376
  54. package/dashboard/public/style.css +0 -154
  55. package/dist/chunk-4KDZZW4X.js +0 -13
package/README.md CHANGED
@@ -103,7 +103,16 @@ clawvault wake
103
103
  Token-budget-aware context injection:
104
104
  ```bash
105
105
  clawvault context "what decisions were made" --budget 2000
106
- # → fits within token budget, 🔴 items first
106
+ # → blends semantic + graph-neighbor context within budget
107
+
108
+ clawvault context "what decisions were made" --format json
109
+ # → includes explain metadata (signals + rationale) per entry
110
+
111
+ clawvault context "plan database migration" --profile planning
112
+ # → profile-tuned ordering for planning, incident, handoff, or default
113
+
114
+ clawvault context "URGENT outage: rollback failed" --profile auto
115
+ # → auto infers incident/planning/handoff/default from prompt intent
107
116
  ```
108
117
 
109
118
  ## Search
@@ -126,6 +135,8 @@ clawvault vsearch "what did I decide" # Semantic (local embeddings)
126
135
  ```
127
136
  my-memory/
128
137
  ├── .clawvault.json # Config (includes qmd collection name)
138
+ ├── .clawvault/
139
+ │ └── graph-index.json # Typed memory graph index (incremental rebuilds)
129
140
  ├── decisions/ # Choices with reasoning
130
141
  ├── lessons/ # Things learned
131
142
  ├── people/ # One file per person
@@ -168,6 +179,7 @@ clawvault list # All documents
168
179
  clawvault list decisions # By category
169
180
  clawvault get decisions/title # Specific document
170
181
  clawvault stats # Vault overview
182
+ clawvault graph --refresh # Typed memory graph summary
171
183
  ```
172
184
 
173
185
  ### Session Continuity
@@ -189,6 +201,128 @@ clawvault recap --brief # Token-efficient recap
189
201
 
190
202
  # Health check
191
203
  clawvault doctor
204
+
205
+ # OpenClaw compatibility check
206
+ clawvault compat
207
+
208
+ # CI/automation-friendly compatibility gate
209
+ clawvault compat --strict # exits non-zero on warnings/errors
210
+ # validates openclaw CLI readiness, hook events/requirements, handler safety/profile delegation, and SKILL metadata
211
+ # flags missing, non-zero, or signal-terminated openclaw CLI checks as warnings
212
+ # warns on unsafe handler execution conventions (execSync usage, shell:true options, missing --profile auto delegation)
213
+
214
+ # Validate a specific project root (fixtures/CI)
215
+ clawvault compat --strict --base-dir ./tests/compat-fixtures/healthy
216
+
217
+ # Run strict compatibility fixture matrix (healthy + intentional drift cases)
218
+ npm run test:compat-fixtures
219
+ # fixture expectations are defined in tests/compat-fixtures/cases.json
220
+ # fixture manifest includes schemaVersion for explicit contract evolution (current schemaVersion=2)
221
+ # includes expectedCheckLabels to lock compat check-label contract
222
+ # supports expected status, detail snippets, and hint snippets per check
223
+ # supports openclawExitCode/openclawSignal/openclawMissing for declarative CLI failure simulation cases
224
+ # each case also owns its scenario description (README coverage is validated)
225
+ # expected check labels are validated against live compat output to catch stale contracts
226
+ # includes a fresh build before running fixtures
227
+
228
+ # Quick smoke check (healthy fixture only)
229
+ npm run test:compat-smoke
230
+ # runs fast contract validation + healthy fixture check (requires existing dist build)
231
+ # fails fast if build artifacts are stale
232
+
233
+ # Validate compatibility fixture contract only (no full matrix execution)
234
+ npm run test:compat-contract
235
+ # includes manifest/docs/runtime-label parity checks with a fresh build
236
+
237
+ # Fast contract-only validation (requires existing dist build)
238
+ npm run test:compat-contract:fast
239
+ # fails fast if compat source is newer than dist build artifacts
240
+
241
+ # Run full local CI gate (typecheck + tests + compat fixtures)
242
+ npm run ci
243
+ # runs build-backed contract validation, fixture matrix execution, and standalone summary artifact validation
244
+
245
+ # Optional: run only specific compatibility fixtures
246
+ COMPAT_CASES=healthy,missing-events npm run test:compat-fixtures
247
+ # duplicate COMPAT_CASES entries are rejected to prevent ambiguous selection
248
+ # empty/whitespace-only COMPAT_CASES values are rejected as invalid selection input
249
+ # runner logs resolved case selection before execution for easier verification
250
+
251
+ # Optional: run fast fixture checks without building
252
+ npm run test:compat-fixtures:fast
253
+
254
+ # Optional: write per-fixture JSON reports to a directory
255
+ COMPAT_REPORT_DIR=/tmp/clawvault-compat-reports npm run test:compat-fixtures
256
+ # includes per-case reports and summary.json (summarySchemaVersion + mode/schemaVersion/selectedCases/selectedTotal + expected/runtime labels + passed/failed case lists + preflight/overall timing + slowest cases)
257
+ # summary artifacts are validated for schema/field invariants before write (fail-fast on malformed report generation)
258
+ # validator now also enforces result-entry schema and passed/failed list coherence with selected case ordering
259
+ # slowestCases telemetry is also validated against case-result durations and sort order
260
+ # summary validation is enforced centrally in summary artifact writing, so all emitters share one contract path
261
+ # per-case report artifacts are also validated centrally before write
262
+
263
+ # Optional: validate an existing compatibility summary artifact set
264
+ node scripts/validate-compat-summary.mjs /tmp/clawvault-compat-reports/summary.json
265
+ # explicit option form (also supports custom case-report directory)
266
+ node scripts/validate-compat-summary.mjs --summary /tmp/clawvault-compat-reports/summary.json --report-dir /tmp/clawvault-compat-reports
267
+ # summary-only mode when per-case reports are unavailable
268
+ node scripts/validate-compat-summary.mjs --summary /tmp/summary.json --allow-missing-case-reports
269
+ # machine-readable success output for automation
270
+ node scripts/validate-compat-summary.mjs --summary /tmp/summary.json --json
271
+ # json output is schema-versioned and also used for machine-readable error payloads
272
+ # success payload includes summary/fixture schema versions for downstream compatibility checks
273
+ # write validator result payload (success/error) to a file
274
+ node scripts/validate-compat-summary.mjs --summary /tmp/summary.json --json --out /tmp/validator-result.json
275
+ # in CI, compat-summary artifacts now include summary.json + report-schema-validator-result.json + validator-result.json + schema-validator-result.json + validator-result-verifier-result.json + artifact-bundle-validator-result.json + artifact-bundle-manifest-validator-result.json
276
+ # validator payload schema/validation is centralized in scripts/lib/compat-summary-validator-output.mjs
277
+ # JSON schema artifacts for payload contracts live in /schemas (including json-schema-validator-output)
278
+ # generic schema checker CLI lives at scripts/validate-json-schema.mjs
279
+ # schema-validator result payload is written to schema-validator-result.json in compat report dirs
280
+ # summary/case-report artifacts can also be schema-validated via scripts/validate-compat-report-schemas.mjs
281
+ # see validator usage/help
282
+ node scripts/validate-compat-summary.mjs --help
283
+ # equivalent npm wrapper (supports arg passthrough, env fallback)
284
+ npm run test:compat-summary:verify -- /tmp/clawvault-compat-reports/summary.json
285
+ # validate previously emitted validator-result payload directly
286
+ npm run test:compat-validator-result:verify -- /tmp/clawvault-compat-reports/validator-result.json
287
+ # npm verifier wrapper enforces --require-ok by default
288
+ # validate validator-result payload against its JSON schema contract
289
+ npm run test:compat-validator-result:schema
290
+ # validate schema-validator-result payload against its own schema contract
291
+ npm run test:compat-schema-validator-result:verify
292
+ # validate summary.json and per-case report artifacts against schema documents
293
+ npm run test:compat-report-schemas:verify
294
+ # emit report-schema validator output payload + validate its schema contract
295
+ npm run test:compat-report-schemas:verify:report
296
+ npm run test:compat-report-schemas:verify:schema
297
+ # emit verifier output payload + validate verifier payload schema
298
+ npm run test:compat-validator-result:verify:report
299
+ npm run test:compat-validator-result:verify:schema
300
+ # verify full compat artifact bundle contract + emit schema-validated bundle result
301
+ npm run test:compat-artifact-bundle:verify
302
+ npm run test:compat-artifact-bundle:verify:report
303
+ npm run test:compat-artifact-bundle:verify:schema
304
+ npm run test:compat-artifact-bundle:manifest:schema
305
+ npm run test:compat-artifact-bundle:manifest:verify
306
+ npm run test:compat-artifact-bundle:manifest:verify:report
307
+ npm run test:compat-artifact-bundle:manifest:verify:schema
308
+ # bundle result now includes an artifactContracts manifest (artifact path + schema id + expected/actual schema version), now including artifact-bundle-manifest-validator-result.json
309
+ # bundle validator supports --manifest <path> to override the default contract manifest
310
+ # manifest verifier emits artifact-bundle-manifest-validator-result.json with schemaId/version-field contract checks
311
+ # explicit verifier CLI options:
312
+ node scripts/validate-compat-validator-result.mjs --validator-result /tmp/clawvault-compat-reports/validator-result.json --json --out /tmp/verifier-result.json
313
+ # enforce success-only validator-result status in strict automation paths
314
+ node scripts/validate-compat-validator-result.mjs --validator-result /tmp/clawvault-compat-reports/validator-result.json --require-ok
315
+ # use --help for verifier usage and path-resolution rules
316
+ # or run fixture generation + standalone summary validation together
317
+ npm run test:compat-summary:fast
318
+ # debug stack wrappers individually when isolating compat contract drift
319
+ npm run test:compat-report-stack:fast
320
+ npm run test:compat-validator-stack:fast
321
+ npm run test:compat-artifact-stack:fast
322
+ # script behavior is covered by dedicated unit tests (success + failure + env fallback)
323
+ # validator exits with a clear error when no summary path/source input is provided
324
+ # summary scripts respect COMPAT_REPORT_DIR (defaults to .compat-reports when unset)
325
+ # report parsing now validates per-check schema and warning/error count coherence before artifact evaluation
192
326
  ```
193
327
 
194
328