Skip to content

docs: split database-schemas reference into seven child pages - #143152

Merged
vincentkoc merged 1 commit into
mainfrom
docs-audit/split-database-schemas
Sep 9, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
docs-audit/split-database-schemas

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What

docs/reference/database-schemas.md was 90,025 bytes / 907 lines in one page. This splits it into docs/reference/database-schemas/ (seven children) and keeps the parent as an index.

Shape matches the two split directories already on main: docs/reference/session-management-compaction/ and docs/reference/full-release-validation/. Children carry their original ## sections verbatim, at their original heading levels; the page title is new frontmatter. No prose was rewritten, reordered or "improved" — with the single exception declared below.

Page Sections (original lines) Size
layout — Database layout 14–257 19,368
versioning — Versioning contract 258–434 14,599
personal-data — Per-person and companion storage 435–533 9,688
storage-changes — Storage changes and release preflight 534–685 12,599
agent-schema-history — Agent schema history 686–733 11,146
state-schema-history — State schema history 734–803 11,645
integrity-and-recovery — Integrity, troubleshooting, and recovery 804–907 12,516

Index: 90,025 → 8,922 bytes.

Not a generated page

Checked first, since a schema reference often is generated. It is hand-written:

  • No script under scripts/ writes docs/reference/database-schemas.md; nothing in src/, test/, scripts/ or qa/ even reads it (the only two hits are comments in src/state/openclaw-state-schema-v{10,11}-retirement.test-support.ts).
  • No <!-- generated --> marker; every "generated" hit in the file is ordinary prose.
  • The nearby schema baseline generator (scripts/lib/sqlite-session-schema-baseline.ts) emits .artifacts/*.sql plus docs/.generated/sqlite-session-transcript-schema-baseline.sha256 — never this markdown.
  • CONFIG_DOC_BASELINE_PATHS in scripts/changed-lanes.mts names only the two config-baseline.* files; this page is not pinned there, and neither is a baseline of it.

Losslessness, proven

Reassembly rule: strip each child's frontmatter, rejoin the seven bodies with the single blank line that separated their sections, restore the terminating newline.

original body sha256 : f299afbe78d9cbc78cfab3f2c635cab8d2ac357167514a23ccd44262ec9e1d4c

The raw extraction (before the rewrite below) reproduced that sha256 exactly. The complete diff of the final tree against the original body is three lines — the one rewrite, and nothing else:

 identity in the terminal write transaction. The shared 30-minute constant also
-owns the older-updater schema-publication bound below.
+owns the older-updater schema-publication bound described under
+[Schema bumps and older updaters](/reference/database-schemas/versioning#schema-bumps-and-older-updaters).

Invariants: fenced blocks 2 → 2 with identical info strings; table rows 89 → 89; word count 10,472 → 10,478 (grew only).

The one prose diff

python3 .audit/check-orphan-refs.py surfaced three directional references. Two are fine and were verified, not assumed:

  • layout.md "the legacy explicit repair/supersession rules below" — target is at original lines 204–223, inside the same child.
  • storage-changes.md "the review checkpoint below" — target is ## Review checkpoint for material changes (original line 645), inside the same child.

One was genuinely orphaned by the split and is the entire prose diff above: "the older-updater schema-publication bound below" (original line 199) sat in Database layout, but its target is the deferred-publication discussion in Versioning contract (original lines 361, 408–411). "Below" no longer reaches it, so it is now an explicit link.

Anchors

All 46 pre-split ids are stubbed on the index under ## Where each section moved, each linking to the child that now holds it. Enumerated with the repo's own parseDocsDocument (scripts/lib/docs-markdown.mjs), not a slug approximation:

  • 46/46 resolve on /reference/database-schemas; 46/46 also exist on a child.
  • 0 collisions on the index and on every child.
  • The index publishes none of the 46 itself, so every one is a stub — no duplicate authored/canonical id.
  • ### Why you cannot go back after updating to 2026.7.2 mints two ids (…-2026.7.2 encoded and …-2026-7-2 cleaned). Both are stubbed, on one bullet, as the sibling precedent does.
  • The file has no MDX components, so no verbatim-marker ids are involved and every child id equals its pre-split id.

Stranded stubs. The page already carried eight authored <a id=…> anchors (original lines 888–896) — legacy anchors for the removed "Downgrades are unsupported" section. They sit above ## Downgrade recovery and below ### A database is quarantined…, exactly the shape a naive ## -boundary cut strands in the wrong child. The cut keeps them with the heading they belong to; both sections land in integrity-and-recovery. python3 .audit/stranded-stubs.py docs → 0 suspects.

Note: /reference/database-schemas#integrity-checks at original line 684 (now in storage-changes.md) is left unchanged — it resolves through the index stub. Retargeting it at the child would be a second prose diff for no correctness gain.

Pins classified

.audit/docs-test-pins.py reported 9; an independent unfiltered git grep -n "reference/database-schemas" origin/main returned 46 hits. Every one classified:

  • No test reads the markdown. The four test files (src/cli/update-cli.test.ts, src/infra/sqlite-user-version.test.ts, src/state/openclaw-agent-db.test.ts, src/state/openclaw-state-db.test.ts) assert the bare route https://docs.openclaw.ai/reference/database-schemas inside runtime error messages, with no fragment. The route is unchanged. Same for the constant in src/state/openclaw-state-db-contract.ts.
  • No whole-document set assertion and no section-scoped assertion exists, so this is a full split, not a partial one.
  • AGENTS.md, CONTRIBUTING.md, CHANGELOG.md, appcast.xml, .agents/skills/* and ~20 docs/** pages link the page or its anchors; all resolve (index kept, all anchors stubbed).
  • taxonomy.yaml has no entry for this page. RELEASE_METADATA_PATHS does not contain it.

CI

.github/labeler.yml has zero references to database-schemas — no file-exact glob names the page, so it was never labelled. That is a pre-existing gap, not one this split creates; reported, not fixed here. test/scripts/labeler-*.test.ts pass unchanged.

docs/docs.json: children added as a "Database schemas" group directly after the parent entry, matching the sibling pattern.

docs/.i18n/glossary.zh-CN.json: seven source entries added, one per new child title — check-docs-i18n-glossary.mts hard-fails without them. Appended beside the existing "SQLite maintenance and session migration" entry rather than at the end of the array, so concurrent split PRs touch different regions and merge cleanly. 1010 entries, 0 duplicate sources.

CODEOWNERS

Simulated last-match-wins against .github/CODEOWNERS. No rule matches docs/reference/database-schemas.md or docs/reference/database-schemas/**. The only /docs/reference/ entries are secretref-credential-surface.md, secretref-user-supplied-credentials-matrix.json (@openclaw/openclaw-secops) and RELEASING.md (@openclaw/openclaw-release-managers). No maintainer team gates this page.

Validators

Baseline measured on a clean tree at the merge-base 2c19155, in this worktree, before any edit — not by stashing, and not against a moving origin/main.

Check Baseline After
pnpm check:docs rc=0 rc=0
docs-link-audit.mjs 0 broken 0 broken (12,219 links)
docs-link-audit.mjs --anchors 3 errors (#windows-app-node) 3, identical
check-docs-mdx.mjs pass pass (1202 files)
markdownlint-cli2 --config config/markdownlint-cli2.jsonc 0 issues (1182) 0 issues (1189)
vitest tooling src/scripts/docs-link-audit.test.ts 1 failed / 32 passed identical
vitest full-core-unit-src src/docs/ 8 files, 16 tests 8 files, 16 tests, green
vitest tooling test/scripts/labeler-*.test.ts — 2 files, 15 tests, green
.audit/stranded-stubs.py docs — 0 suspects

The one docs-link-audit.test.ts failure (expected ['ass-guide','param-ass-guide'] to deeply equal ['as-s-guide','param-as-s-guide'], line 155) is pre-existing: reproduced at the base sha on a clean tree before any change here.

format-docs.mts --check initially flagged the index; running the formatter padded only the index table's columns. Children were already format-clean and were not touched.

docs/reference/database-schemas.md was 90,025 bytes in a single page. Split it
into docs/reference/database-schemas/ and keep the parent as an index, matching
the docs/reference/session-management-compaction/ and
docs/reference/full-release-validation/ precedents already on main.

Content-preserving: children carry their original H2 sections verbatim at their
original heading levels. The seven child bodies reassemble byte-identically to
the original body apart from one declared orphan-reference rewrite (a "below"
that now points across a page boundary).

All 46 pre-split anchor ids are stubbed on the index so existing deep links
such as /reference/database-schemas#schema-bumps-and-older-updaters continue to
resolve.
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 10:14 AM ET / 14:14 UTC.

ClawSweeper review

What this changes

Splits the database reference into seven topic pages, preserves existing links through an index, and updates navigation and Chinese glossary entries.

Merge readiness

✅ Ready for maintainer review

Keep open: the split remains useful because current main still contains the monolithic reference. Content preservation and navigation checks found no blocking defect; the maintainer-authored PR is also protected from automated closure.

Priority: P3
Reviewed head: 4bdc824b1b3768ad2a233db5fdacb59b551b4474

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused documentation split with independently verified preservation and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Patch quality 🐚 platinum hermit (4/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 7 items Pinned scope and clean checkout: The merge-base-to-head delta contains only documentation pages, navigation, and glossary changes. git diff --check passed, and git status remained clean.
Independent content-preservation check: A read-only Python comparison stripped child frontmatter and reassembled the seven bodies in original order. The sole difference was replacing the older-updater directional reference with an explicit cross-page link; all original headings and authored anchors were retained.
Navigation and compatibility anchors: The index contains 46 distinct authored anchor aliases, and every linked child page exists. Navigation and glossary JSON parse successfully, with all seven child routes present in navigation. Publishing-parser source was inspected; full docs validators were not rerun under the read-only review constraint.
Findings None None.
Security None None.

How this fits together

The database reference helps operators and contributors find storage, compatibility, migration, and recovery guidance. Documentation navigation and existing deep links now lead through an index to focused reference pages.

flowchart TD
  A[Documentation navigation] --> C[Database reference index]
  B[Existing section links] --> C
  C --> D[Layout and personal storage]
  C --> E[Versioning and storage changes]
  C --> F[Schema history]
  C --> G[Integrity and recovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Docs +156. Total +156 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 10 1050 894 +156
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 1050 894 +156

Review metrics

Metric Value Why it matters
Legacy section links 46 unique index aliases retained Existing section URLs remain discoverable after the reference is split.

Technical review

Best possible solution:

Keep one canonical copy of each reference section on its focused page, with the parent index preserving existing entry points.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this reorganizes documentation rather than repairing a runtime defect; source comparison confirms the original reference remains monolithic on main.

Is this the best way to solve the issue?

Yes: the split follows an established repository pattern and preserves the original content, headings, and entry-point links without creating competing reference copies.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 82050740b551.

Labels

Label changes:

  • add P3: This is a bounded documentation organization improvement with preserved reference content and no runtime changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • 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 bounded documentation organization improvement with preserved reference content and no runtime changes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • 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:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@vincentkoc
vincentkoc merged commit ccc84ac into main Sep 9, 2026
64 checks passed
@vincentkoc
vincentkoc deleted the docs-audit/split-database-schemas branch September 9, 2026 14:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…aw#143152)

docs/reference/database-schemas.md was 90,025 bytes in a single page. Split it
into docs/reference/database-schemas/ and keep the parent as an index, matching
the docs/reference/session-management-compaction/ and
docs/reference/full-release-validation/ precedents already on main.

Content-preserving: children carry their original H2 sections verbatim at their
original heading levels. The seven child bodies reassemble byte-identically to
the original body apart from one declared orphan-reference rewrite (a "below"
that now points across a page boundary).

All 46 pre-split anchor ids are stubbed on the index so existing deep links
such as /reference/database-schemas#schema-bumps-and-older-updaters continue to
resolve.
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: 🐚 platinum hermit Good normal PR readiness with ordinary 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