openclaw/docs/cli
Ayaan Zaidi b10035faa9
fix(backup): archive unmanaged SQLite files as opaque bytes (#146700)
## What Problem This Solves

An unrelated SQLite file with foreign-key violations could prevent every backup from completing.

## Why This Change Was Made

Whether an included file gets the live-database snapshot path is decided by exactly one mechanism at `src/commands/backup-resource-inventory.ts:336`, from the core set plus declared plugin resources. The online root snapshot supplies the registry used for discovery and traversal, so planning no longer needs a quiet write-ahead log.

## User Impact

Undeclared files survive backup unchanged with filename warnings. Foreign SQLite symbolic links that exceed the link-resolution limit (`ELOOP`), including loops, are skipped with a filename warning. Corrupt managed databases and unavailable plugin SQLite capabilities still stop publication.

## Evidence

- Pinned main `f0817f23e9`: the real CLI exits 1 on a structurally valid foreign database with a foreign-key violation and publishes no archive.
- Candidate `ce85d13530c4`: CLI create with verification, verify, and restore preserve seven foreign files and sidecars byte-for-byte, with one warning each. Corrupt core and unavailable plugin functions still refuse publication. Managed hardlinks include committed WAL data and restore identical images.
- Tested commit `37f9d97a9d65` (capture behavior unchanged): real CLI backup succeeds during 10 ms commits (309 rows during the 3.6-second run) and in the 100 ms control. Verify/restore retain identical valid root/alias images with writes committed during backup. The unrelated symlink loop is skipped with one warning and the archive restores successfully.
- The full architecture check passes with zero import cycles; five formatter/command tests pass. All 10 managed-refusal/older-schema command cases and changed-test checks pass. The separate macOS planning assertion noted below remains a baseline failure. Type checks and the test-partition check remain for CI.

## Compatibility

No schema, plugin fields, flags, or archive format change. Existing `backupResources` declarations define managed plugin data.

## Consumers

- `backup create`: preserves undeclared SQLite files and reports their filenames.
- `backup verify` and `backup restore`: treat files outside the captured core registry as opaque.
- `src/commands/migrate/apply.ts:26-41`: pre-migration backup now accepts unrelated foreign SQLite, returns only the archive path, and does not forward opaque warnings.
- Fleet backup: uses the shared archive metadata adapter to preserve independent hardlink entries without stalling.

- `formatBackupCreateSummary` moved unchanged to `src/commands/backup-summary.ts`; `src/commands/backup.ts` and `src/infra/backup-create.test.ts` import that owner.

census: generic formatBackupCreateSummary reviewed — 2 callers listed

## Invalidation

Ownership is frozen from the captured root registry for each backup; later registrations belong to the next capture. A plugin declaration changed after planning can be archived with payload classified by the earlier declaration.

## Contention

Registry discovery reads the online root snapshot before archive traversal. The 10 ms sustained-write test and 100 ms control both complete, verify, and restore successfully.

## Tests

- `backupCreateCommand`: all eight managed-refusal cases and both older-schema cases in `src/infra/backup-create.test.ts`; older-schema verification also uses `backupVerifyCommand`.
- `backupVerifyCommand`: all three opaque-file/sidecar cases in `src/commands/backup-verify.test.ts`.
- `backupCreateCommand` and `backupRestoreCommand`: opaque loop handling, declared/core loop refusal, and agent registration captured immediately before the root snapshot.

Those tables retain the complete case mapping, fixtures, and assertions. Source bytes are compared after capture or refusal and before the real outcome recorder runs; the recorder still runs unchanged. The unchanged macOS manifest-path assertion reproduces on base. The added source lines separate resource planning from captured ownership and preserve missing-root checks.

Thanks @clawputerlabs for the report.

Closes #144552.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-09-13 11:31:38 +05:30
..
doctor fix(doctor): avoid redundant cleanup after session imports (#146597) 2026-09-13 01:16:51 -04:00
gateway fix(gateway): classify opening timeouts and repair lifetime checks (#146508) 2026-09-12 17:13:42 -07:00
mcp docs: remove repeated MCP Apps introduction (#144408) 2026-09-10 18:31:04 -03:00
plugins fix(plugins): preserve update failures and prevent duplicate settlement (#146483) 2026-09-12 15:17:37 -07:00
policy fix: skip official setup approvals and default to Astra (#145646) 2026-09-12 00:34:25 -07:00
update fix(update): continue repair under the owning driver and reconcile dead drivers (#146514) 2026-09-12 18:46:35 -07:00
acp.md docs: fix checkable ux defects in docs/cli and docs/concepts (#143927) 2026-09-10 18:39:20 +08:00
agent.md fix: skip official setup approvals and default to Astra (#145646) 2026-09-12 00:34:25 -07:00
agents.md feat(custodian): recommend a chief of staff and specialist roles when creating an agent (#141453) 2026-09-12 01:02:39 -07:00
approvals.md docs: fix 16 secops-owned audit findings across gateway, cli, and security pages (#144030) 2026-09-10 20:28:21 +08:00
attach.md feat(talk): support native realtime for thin audio clients (#134003) 2026-09-03 21:51:49 -07:00
audit.md docs: correct verified accuracy defects in CLI, tools, and automation pages (#143179) 2026-09-09 23:57:06 +09:00
backup.md fix(backup): archive unmanaged SQLite files as opaque bytes (#146700) 2026-09-13 11:31:38 +05:30
browser.md fix(browser): warn when response bodies are truncated (#145210) 2026-09-11 13:31:55 -07:00
channels.md feat(channels): show labels and official docs in JSON listings (#93265) 2026-09-11 15:27:07 -06:00
clawbot.md docs: correct verified accuracy defects in CLI, tools, and automation pages (#143179) 2026-09-09 23:57:06 +09:00
claws.md feat(claws): activate plugin requirement batches without restarting (#145713) 2026-09-12 02:23:43 -07:00
completion.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
config.md fix(config): preserve root and recovery backups after failed saves (#146291) 2026-09-13 08:08:24 +05:30
configure.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
connect.md feat: share selected sessions read-only with a paired team Gateway (#136253) 2026-09-12 13:35:17 -07:00
cron.md fix(cron): recover automations after plugin reloads (#146582) 2026-09-12 18:29:17 -07:00
daemon.md docs(gateway): warn that installation starts the service (#139562) 2026-09-10 17:23:20 +05:30
dashboard.md fix: preserve dashboard HTTP errors when diagnostics fail (#145227) 2026-09-11 13:46:03 -07:00
devices.md fix(doctor): recover legacy node tokens with invalid scopes (#143599) 2026-09-10 07:19:45 +05:30
directory.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
dns.md docs: fix 20 link defects confirmed live in the verified backlog (#144133) 2026-09-11 03:48:10 +08:00
docs.md fix(docs): reject malformed search result collections (#145613) 2026-09-12 00:20:46 -07:00
doctor.md docs: close remaining one-way link findings in cli, plugins, tools, providers (#143855) 2026-09-10 16:15:08 +08:00
file-transfer.md docs: close the small audit categories (generated, governance, link, split) (#144029) 2026-09-10 21:52:03 +08:00
fleet.md feat(fleet): show log timestamps (#132554) 2026-09-10 17:54:19 -07:00
gateway.md docs(gateway): warn that installation starts the service (#139562) 2026-09-10 17:23:20 +05:30
health.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
hooks.md docs: STE pass on terminology consistency and run-on sentences (#143770) 2026-09-10 15:51:49 +09:00
index.md docs: fix 20 link defects confirmed live in the verified backlog (#144133) 2026-09-11 03:48:10 +08:00
infer.md fix(tts): avoid synthesis for unsupported remote output (#146222) 2026-09-12 10:53:20 -07:00
logs.md fix(cli): reject explicitly blank Gateway ports (#139613) 2026-09-06 06:47:43 -07:00
mcp.md docs: fix one-way and absolute links across cli, tools, gateway, and channels (#143157) 2026-09-10 07:40:16 +09:00
memory.md fix(memory): reuse completed embeddings after failed rebuilds (#144404) 2026-09-10 17:52:52 -07:00
message.md fix(cli): reject blank message channel selectors (#144802) 2026-09-11 16:21:56 +05:30
migrate.md fix(models): require explicit GitHub Copilot activation (#144749) 2026-09-11 13:51:44 +05:30
models.md fix(models): refresh expired provider inventory in background (#146317) 2026-09-13 05:21:29 +05:30
node.md feat: share selected sessions read-only with a paired team Gateway (#136253) 2026-09-12 13:35:17 -07:00
nodes.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
onboard.md docs: scope version-locked claims across plugins, platforms, providers, and gateway (#144032) 2026-09-10 21:33:28 +08:00
openclaw.md fix: skip official setup approvals and default to Astra (#145646) 2026-09-12 00:34:25 -07:00
pairing.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
path.md docs: fix checkable ux defects in docs/cli and docs/concepts (#143927) 2026-09-10 18:39:20 +08:00
plugins.md feat: manage and reload plugins without Gateway restarts (#145484) 2026-09-11 23:12:58 -07:00
policy.md docs: close remaining one-way link findings in cli, plugins, tools, providers (#143855) 2026-09-10 16:15:08 +08:00
promos.md docs: fix one-way and absolute links across cli, tools, gateway, and channels (#143157) 2026-09-10 07:40:16 +09:00
proxy.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
qr.md docs: fix one-way and absolute links across cli, tools, gateway, and channels (#143157) 2026-09-10 07:40:16 +09:00
reset.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
resume.md
sandbox.md docs: fix 16 secops-owned audit findings across gateway, cli, and security pages (#144030) 2026-09-10 20:28:21 +08:00
secrets.md docs: fix 16 secops-owned audit findings across gateway, cli, and security pages (#144030) 2026-09-10 20:28:21 +08:00
security.md fix: bound filesystem reads and keep sandbox reads responsive (#146654) 2026-09-12 19:41:19 -07:00
sessions.md fix: skip official setup approvals and default to Astra (#145646) 2026-09-12 00:34:25 -07:00
setup.md feat(agents): add role templates and a team preset for onboarding (#145712) 2026-09-12 00:07:12 -07:00
skills.md fix(skills): preserve full verification reports (#144559) 2026-09-10 19:21:05 -07:00
status.md perf(status): reuse scan snapshots and expose local stage timings (#146228) 2026-09-12 11:02:47 -07:00
system.md docs(cli): document system Gateway port and password options (#139071) 2026-09-10 16:01:11 +05:30
tasks.md docs: fix checkable ux defects in docs/cli and docs/concepts (#143927) 2026-09-10 18:39:20 +08:00
transcripts.md fix(meetings): make saved notes readable and searchable (#145367) 2026-09-11 16:25:07 -07:00
triage.md fix(update): require consent before interactive repair (#146693) 2026-09-12 22:24:18 -06:00
tui.md docs: close remaining one-way link findings in cli, plugins, tools, providers (#143855) 2026-09-10 16:15:08 +08:00
uninstall.md docs: fix one-way and absolute links across cli, tools, gateway, and channels (#143157) 2026-09-10 07:40:16 +09:00
update.md fix(update): recognize custom npm prefix installations (#146091) 2026-09-12 10:45:40 -07:00
voicecall.md docs(plugins): remove obsolete Gateway restart guidance (#146516) 2026-09-12 16:48:13 -07:00
webhooks.md docs: STE pass on terminology consistency and run-on sentences (#143770) 2026-09-10 15:51:49 +09:00
wiki.md fix(memory-wiki): bound exact page reads (#129897) 2026-09-04 22:05:24 -07:00
workboard.md docs: STE structural cleanup for gateway, cli and concepts (46 audit findings) (#143931) 2026-09-10 18:50:32 +08:00
worker.md docs: fix checkable ux defects in docs/cli and docs/concepts (#143927) 2026-09-10 18:39:20 +08:00