Skip to content

docs: correct database-first current-state claims - #122085

Merged
steipete merged 1 commit into
mainfrom
steipete/database-first-corrections
Aug 11, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/database-first-corrections

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.

Old claim Verified current reality
Global schema v1 and agent schema v2 Global schema is v6; agent schema is v17.
QMD remains a runtime export/index/SDK surface QMD is removed; Doctor migrates retired paths to builtin memory and removes derived workspaces.
TypeScript and Swift device auth remain file-backed Both use SQLite device_auth_tokens; Android remains app-local in SecurePrefs.
Cache, payload, raw-stream, timeline, and macOS diagnostics are SQLite-only and path overrides were removed These opt-in diagnostics remain JSONL artifacts with supported path controls; Gateway stability bundles remain SQLite-backed.
SQLite VFS, tool-artifact, and run-artifact worker storage is implemented Those prototype paths were reverted and the canonical agent schema has no such tables; subagent attachments currently materialize in child workspaces.
Deleted prototype source paths are current owners The page now names the current Doctor, state-migration, session-accessor, and sandbox-registry owners.

State schema v5 is traced to 7a7d6bb / #110952 and v6 to 509a5f0 / #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 install
  • pnpm docs:list
  • pnpm exec oxfmt --check --threads=1 docs/refactor/database-first.md docs/reference/database-schemas.md
  • pnpm docs:check-mdx
  • pnpm docs:check-links (6,430 internal links, 0 broken)
  • pnpm docs:check-i18n-glossary
  • git diff --check origin/main...HEAD
  • Autoreview: clean, no accepted/actionable findings

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).
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Aug 11, 2026
@steipete steipete self-assigned this Aug 11, 2026
@steipete
steipete merged commit 48253cd into main Aug 11, 2026
54 checks passed
@steipete
steipete deleted the steipete/database-first-corrections branch August 11, 2026 15:03
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 11:02 AM ET / 15:02 UTC.

ClawSweeper review

What this changes

The PR corrects database-first documentation to distinguish current SQLite state from opt-in JSONL diagnostics, retired QMD/prototype paths, and schema-history provenance.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No 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
Reviewed head: ec4df5609bcbadf62f2c9693059285153f65e868

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, source-backed documentation correction with no actionable correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Evidence reviewed 5 items Current schema contracts: Current main declares global schema version 6 and agent schema version 17, with comments identifying v5 and v6 ownership.
Diagnostic artifact behavior: Cache traces, Anthropic payload logs, raw streams, and diagnostic timelines retain file paths and JSONL output controls on current main.
Current migration and platform owners: Doctor migrates retired QMD paths into builtin-memory extra paths; TypeScript and Swift read device tokens from SQLite while Android uses SecurePrefs.
Findings None None.
Security None None.

How this fits together

OpenClaw 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
Loading

Before merge

  • Complete next step (P2) - No repair work is needed; the protected maintainer PR remains in normal review flow.
Agent review details

Security

None.

PR surface

Docs -6. Total -6 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 2 130 136 -6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 130 136 -6

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a documentation-only accuracy correction with no runtime or configuration change.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.

Label justifications:

  • P3: This is a documentation-only accuracy correction with no runtime or configuration change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.

Evidence

What I checked:

Likely related people:

  • steipete: Authored this docs correction and the v5 provenance commit; current contract lines also trace to Peter Steinberger’s recent storage refactor. (role: current storage-documentation and schema-history contributor; confidence: high; commits: ec4df5609bcb, 7a7d6bb51f42, e082acd07762; files: docs/refactor/database-first.md, src/state/openclaw-state-db-contract.ts)
  • vincentkoc: Authored the v6 schema-hardening commit cited by the updated schema history. (role: shared-state schema hardening contributor; confidence: high; commits: 509a5f037376; files: docs/reference/database-schemas.md, src/state/openclaw-state-db-contract.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant