Repository navigation
docs: correct database-first current-state claims - #122085
Conversation
Schema versions are global v6 and agent v17 (src/state/openclaw-state-db-contract.ts:6; src/state/openclaw-agent-db-contract.ts:22). State v5/v6 provenance comes from 7a7d6bb and 509a5f0, matching the current contract comments at src/state/openclaw-state-db-contract.ts:4. QMD is retired and Doctor migrates its paths to builtin memory (src/commands/doctor/shared/legacy-config-migrations.runtime.retired-memory-qmd.ts:94). Device auth is SQLite-backed in TypeScript and Swift while Android remains SecurePrefs-backed (src/infra/device-auth-store.ts:115; apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceAuthStore.swift:26; apps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceAuthStore.kt:55). Opt-in cache, payload, raw-stream, timeline, and macOS diagnostics remain JSONL artifacts (src/agents/cache-trace.ts:93; src/agents/anthropic-payload-log.ts:46; src/agents/embedded-agent-subscribe.raw-stream.ts:16; src/infra/diagnostics-timeline.ts:96; apps/macos/Sources/OpenClaw/DiagnosticsFileLog.swift:3). The canonical agent schema currently has cache_entries but no VFS/tool/run artifact tables, and subagent attachments materialize in child workspaces (src/state/openclaw-agent-schema.sql:398; src/agents/subagents/spawn/subagent-attachments.ts:308). Current Doctor/session owners replace deleted prototype paths (src/infra/state-migrations.doctor.ts:66; src/config/sessions/session-accessor.sqlite-entry.ts:165; src/config/sessions/paths.ts:320).
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 11:02 AM ET / 15:02 UTC. ClawSweeper reviewWhat this changesThe PR corrects database-first documentation to distinguish current SQLite state from opt-in JSONL diagnostics, retired QMD/prototype paths, and schema-history provenance. Merge readinessNo blocking findings. The documentation corrections match current state and diagnostics owners; this maintainer-labeled PR should remain open for normal maintainer handling. Likely related people: steipete and vincentkoc. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw keeps durable shared and agent-scoped state in SQLite, while Doctor migrates legacy data and operator diagnostics may intentionally write named JSONL artifacts. The changed pages describe those ownership boundaries and schema versions for contributors maintaining storage code. flowchart LR
A[Runtime state] --> B[Shared and agent SQLite]
C[Legacy files] --> D[Doctor migrations]
E[Operator diagnostics] --> F[Named JSONL artifacts]
B --> G[Database-first documentation]
D --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceDocs -6. Total -6 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Land the source-backed documentation corrections after ordinary maintainer review and the pending documentation checks. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR corrects documentation claims, which were checked against current source contracts rather than a runtime failure. Is this the best way to solve the issue? Yes. Updating the existing database-first and schema-reference pages is the narrowest maintainable repair for stale current-state claims. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 543603e9f742. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Schema versions are global v6 and agent v17 (src/state/openclaw-state-db-contract.ts:6; src/state/openclaw-agent-db-contract.ts:22). State v5/v6 provenance comes from d775076 and 6d3233f, matching the current contract comments at src/state/openclaw-state-db-contract.ts:4. QMD is retired and Doctor migrates its paths to builtin memory (src/commands/doctor/shared/legacy-config-migrations.runtime.retired-memory-qmd.ts:94). Device auth is SQLite-backed in TypeScript and Swift while Android remains SecurePrefs-backed (src/infra/device-auth-store.ts:115; apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceAuthStore.swift:26; apps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceAuthStore.kt:55). Opt-in cache, payload, raw-stream, timeline, and macOS diagnostics remain JSONL artifacts (src/agents/cache-trace.ts:93; src/agents/anthropic-payload-log.ts:46; src/agents/embedded-agent-subscribe.raw-stream.ts:16; src/infra/diagnostics-timeline.ts:96; apps/macos/Sources/OpenClaw/DiagnosticsFileLog.swift:3). The canonical agent schema currently has cache_entries but no VFS/tool/run artifact tables, and subagent attachments materialize in child workspaces (src/state/openclaw-agent-schema.sql:398; src/agents/subagents/spawn/subagent-attachments.ts:308). Current Doctor/session owners replace deleted prototype paths (src/infra/state-migrations.doctor.ts:66; src/config/sessions/session-accessor.sqlite-entry.ts:165; src/config/sessions/paths.ts:320).
What Problem This Solves
Corrects database-first documentation that described obsolete prototype paths and no-longer-current storage behavior as the present implementation. It also fills the missing state schema v5 and v6 history.
Why This Change Was Made
The refactor narrative now separates current runtime behavior from preserved historical migration evidence and future VFS/artifact goals. Each correction was checked against current source; the v5/v6 rows come from
git log -S OPENCLAW_STATE_SCHEMA_VERSION.device_auth_tokens; Android remains app-local inSecurePrefs.State schema v5 is traced to
7a7d6bb/ #110952 and v6 to509a5f0/ #113473.Deferred: Canvas document ownership wording is intentionally unchanged for maintainer product judgment.
User Impact
No runtime behavior changes. Maintainers and contributors get an accurate current-state reference without losing genuine past-tense migration evidence.
Evidence
CI=true pnpm installpnpm docs:listpnpm exec oxfmt --check --threads=1 docs/refactor/database-first.md docs/reference/database-schemas.mdpnpm docs:check-mdxpnpm docs:check-links(6,430 internal links, 0 broken)pnpm docs:check-i18n-glossarygit diff --check origin/main...HEAD