Repository navigation
docs(reference): split the session management deep dive by reader job - #143082
Conversation
The single page was 44,159 characters and 18 H2 sections mixing on-disk
reference, a disk-budget maintenance procedure, a downgrade runbook, four
key/default tables, compaction explanation, and a troubleshooting
checklist. It is now a short index over five child pages, one per reader
job, so a reader can finish one lookup on one page.
Children under docs/reference/session-management-compaction/:
- store.md - the two persistence layers and the per-agent on-disk paths
- maintenance.md - session.maintenance keys, the disk-budget cleanup
tiers, cron run retention, and downgrading after the SQLite flip
- schema.md - sessionKey patterns, sessionId lifecycle, SessionEntry
fields, and the transcript event stream
- compaction.md - what compaction is, when auto-compaction runs, its
settings, pluggable providers, and its user-visible surfaces
- housekeeping.md - the NO_REPLY silent-turn contract and the
pre-compaction memory flush
The index keeps the original lede, the Troubleshooting checklist, and
Related verbatim: the checklist is cross-cutting (its five bullets route
to four different children), so it belongs on the router.
Anchor strategy: per-anchor redirects are impossible (redirectSource()
throws on any source containing [?#]), so all 24 heading ids from the
previous single-page version stay alive on the index. 22 are authored
<a id="..." /> stubs linking to the child that now holds the content; the
remaining two (troubleshooting-checklist, related) are still published by
the index itself and are deliberately not stubbed, which would be a
duplicate authored/canonical id. Ids were computed with
parseDocsDocument, not a slug approximation. Four punctuated headings
each mint an encoded and a cleaned id (for example
compaction%3A-what-it-is and compaction-what-it-is); both members of every
pair are stubbed. Collisions are empty on the index and all five children,
and all 18 stub link targets resolve on their child.
Losslessness: the page has no intra-page ](#...) links, so no link
rewrites were needed and the split is byte-identical with no exceptions.
The shipped index lede + the five child bodies + the shipped
Troubleshooting and Related sections, concatenated in original order,
reproduce the previous body exactly:
sha256 1ee73287c171a5af95d4b50867bc035d54dd5e4b8039418780726fa113d33d14
(43,778 chars in, 43,778 out). 3 code fences in, 3 out, matching
one-for-one on info string and body sha256 (ee97c8dc34752b81,
2425950a4be6c02b, 30578e99ae85a0e4), so every command and config example
is character-identical. Table rows 22 -> 29 (+7 is the new routing
table). Body words 5,708 -> 5,999; the entire increase is index
scaffolding. The prose diff is empty: check-orphan-refs.py flags four
directional references, and all four are fine - three have same-page
antecedents ("the maintenance owner above", "the flush logic above") and
two are numeric comparisons ("above the cap", "below the compaction
threshold"), so none was rewritten.
docs.json gains a nested group following the reference/full-release-validation
precedent, which is the sibling split actually on main.
zh-Hans-navigation.json needs no change; it is a label overlay cloned
from the English nav. The zh-CN glossary needed five new sources for the
new child titles, inserted next to the existing "Session management deep
dive" entry rather than appended, so concurrent splits touch different
regions of the file.
Closes audit finding r3-0707; also addresses r3-2221.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 7:51 AM ET / 11:51 UTC. ClawSweeper reviewWhat this changesSplits the session-management reference into five task-focused pages, adds navigation and translated titles, and preserves existing section links on the index. Merge readiness✅ Ready for maintainer review Keep open: this useful documentation split is absent from current main, preserves the original content, and introduces no identified defect. The member-authored PR also carries the protected maintainer label. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s documentation site guides operators through session storage, retention, transcript structure, and compaction. Its navigation and section links direct readers to the relevant reference material. flowchart TD
A[Reader task] --> B[Documentation navigation]
C[Existing section link] --> D[Session reference index]
B --> D
D --> E[Storage and maintenance references]
D --> F[Session structure reference]
D --> G[Compaction and housekeeping references]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceDocs +102. Total +102 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the task-focused reference pages and stable legacy anchors while keeping future factual updates in their owning child pages. Do we have a high-confidence way to reproduce the issue? Not applicable: this reorganizes reference documentation rather than repairing a runtime defect; content preservation was independently checked. Is this the best way to solve the issue? Yes: contiguous section moves, a short routing index, and explicit legacy anchors provide a focused improvement without changing the documented contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f93881f90f42. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…openclaw#143082) The single page was 44,159 characters and 18 H2 sections mixing on-disk reference, a disk-budget maintenance procedure, a downgrade runbook, four key/default tables, compaction explanation, and a troubleshooting checklist. It is now a short index over five child pages, one per reader job, so a reader can finish one lookup on one page. Children under docs/reference/session-management-compaction/: - store.md - the two persistence layers and the per-agent on-disk paths - maintenance.md - session.maintenance keys, the disk-budget cleanup tiers, cron run retention, and downgrading after the SQLite flip - schema.md - sessionKey patterns, sessionId lifecycle, SessionEntry fields, and the transcript event stream - compaction.md - what compaction is, when auto-compaction runs, its settings, pluggable providers, and its user-visible surfaces - housekeeping.md - the NO_REPLY silent-turn contract and the pre-compaction memory flush The index keeps the original lede, the Troubleshooting checklist, and Related verbatim: the checklist is cross-cutting (its five bullets route to four different children), so it belongs on the router. Anchor strategy: per-anchor redirects are impossible (redirectSource() throws on any source containing [?#]), so all 24 heading ids from the previous single-page version stay alive on the index. 22 are authored <a id="..." /> stubs linking to the child that now holds the content; the remaining two (troubleshooting-checklist, related) are still published by the index itself and are deliberately not stubbed, which would be a duplicate authored/canonical id. Ids were computed with parseDocsDocument, not a slug approximation. Four punctuated headings each mint an encoded and a cleaned id (for example compaction%3A-what-it-is and compaction-what-it-is); both members of every pair are stubbed. Collisions are empty on the index and all five children, and all 18 stub link targets resolve on their child. Losslessness: the page has no intra-page ](#...) links, so no link rewrites were needed and the split is byte-identical with no exceptions. The shipped index lede + the five child bodies + the shipped Troubleshooting and Related sections, concatenated in original order, reproduce the previous body exactly: sha256 1ee73287c171a5af95d4b50867bc035d54dd5e4b8039418780726fa113d33d14 (43,778 chars in, 43,778 out). 3 code fences in, 3 out, matching one-for-one on info string and body sha256 (ee97c8dc34752b81, 2425950a4be6c02b, 30578e99ae85a0e4), so every command and config example is character-identical. Table rows 22 -> 29 (+7 is the new routing table). Body words 5,708 -> 5,999; the entire increase is index scaffolding. The prose diff is empty: check-orphan-refs.py flags four directional references, and all four are fine - three have same-page antecedents ("the maintenance owner above", "the flush logic above") and two are numeric comparisons ("above the cap", "below the compaction threshold"), so none was rewritten. docs.json gains a nested group following the reference/full-release-validation precedent, which is the sibling split actually on main. zh-Hans-navigation.json needs no change; it is a label overlay cloned from the English nav. The zh-CN glossary needed five new sources for the new child titles, inserted next to the existing "Session management deep dive" entry rather than appended, so concurrent splits touch different regions of the file. Closes audit finding r3-0707; also addresses r3-2221.
What
docs/reference/session-management-compaction.mdwas 44,159 characters across 18 H2 sections, mixing on-disk reference, a disk-budget maintenance procedure, a downgrade runbook, four key/default tables, compaction explanation, and a troubleshooting checklist.It is now a short index over five children, one per reader job:
store.mdmaintenance.mdschema.mdcompaction.mdhousekeeping.mdNO_REPLY); Pre-compaction memory flushIndex is 6,585 chars. Each child is a contiguous run of sections in original order, so nothing is reordered.
The index keeps the original lede, the Troubleshooting checklist, and Related verbatim. The checklist is cross-cutting — its five bullets route to four different children — so it belongs on the router rather than being arbitrarily assigned to one child.
Anchors — all 24 survive
Per-anchor redirects are impossible (
redirectSource()inscripts/lib/docs-redirects.mjsthrows on any source containing[?#]), so every pre-split id stays alive on the index. Ids were enumerated with the repo's ownparseDocsDocument, not a slug approximation.<a id="…" />stubs on the index, each linking to the child that now holds the content.troubleshooting-checklistandrelatedare still published by the index itself; stubbing them would be a duplicate authored/canonical id.compaction%3A-what-it-is+compaction-what-it-is; likewise for the twosessionKey/sessionIdheadings andsilent-housekeeping-(no_reply)). Both members of every pair are stubbed.Verified mechanically: 24/24 pre-split ids resolve on the index, 0 unresolved; collisions empty on the index and on all five children; 18/18 stub link targets resolve on their child.
This page has no
Accordion/Step/Tab/ParamFieldcomponents, so no verbatim-marker ids are involved and no id shifted between parent and child.Losslessness — byte-identical, no exceptions
The page has no intra-page
](#…)links, so no link rewrites were needed and the proof needs no carve-outs.The shipped index lede + the five shipped child bodies + the shipped Troubleshooting and Related sections, concatenated in original order, reproduce the previous body exactly:
Corroborating counts:
ee97c8dc34752b81,2425950a4be6c02b,30578e99ae85a0e4) — every command and config example is character-identical.Prose diff is empty
check-orphan-refs.pyflags four directional references. All four are fine and none was rewritten:compaction.md"leaves proactive scheduling to the maintenance owner above" — antecedent is item 2 of the same numbered list, same page.housekeeping.md"the flush logic above" — antecedent is the Pre-compaction memory flush section, same page.housekeeping.md"a soft threshold below the compaction threshold" — a numeric comparison, not a page reference.maintenance.md"keep the unarchived total above the cap" — a numeric comparison.stranded-stubs.py docs→ 0 suspect stubs (the source had no authored<a id>stubs to strand).Pins classified
docs-test-pins.pyreports 6; its "test(s)" label is loose, so each was read:qa/scenarios/**) list the page underdocsRefs:. These are doc pointers, not literal-string assertions — no contract test reads this file and asserts its content, so thesdk-subpaths.mdrefusal condition does not apply. They still resolve to the index; left unchanged.taxonomy.yaml(4 entries) — all plain paths with no#anchor(the file has only 2 anchored entries in total, both forcron-jobs.md). They resolve to the index, which remains.pnpm maturity:checkpasses, anddocs/maturity/taxonomy.mdis generated fromtaxonomy.yaml, which is unchanged.git greponorigin/mainwith no path filter found only prose links to/reference/session-management-compaction(all still resolve to the index), thedocs.jsonnav entry, and the zh nav overlay.RELEASE_METADATA_PATHSinscripts/changed-lanes.mtsdoes not contain this page, socheck-release-metadata-only.mtsis unaffected..github/labeler.yml: no file-exact glob names this page; the"docs"label uses a broaddocs/**glob that already matches the new directory. No gap is created and none pre-exists — no labeler change needed.CODEOWNERS: no rule matches this page or the new directory (simulated last-match-wins; control:
/docs/reference/RELEASING.mdcorrectly resolves to@openclaw/openclaw-release-managers, and there is no bare*catch-all). No maintainer team gates this PR.Validators
Run on the staged tree.
pnpm check:docs→ exit 0 (thecheck-docsjob's own aggregate:format:docs:check,lint:docs,lint:templates,docs:check-mdx,docs:check-i18n-glossary,docs:check-links,docs:check-config-examples).docs-link-audit.mjs --anchors→ 3 broken links, identical to the baseline I measured myself at the merge-basebc847251aabby stashing in place: the three known#windows-app-nodeones. Delta 0.pnpm maturity:check→ passes.vitest --config vitest.full-core-unit-src.config.ts src/docs/→ 8 files, 8 ran, 16 tests passed (file count checked against the 8 that exist).vitest --config vitest.tooling.config.ts src/scripts/docs-link-audit.test.ts→ 1 file, 1 pre-existing failure ('ass-guide'vs'as-s-guide', a slugifier assertion). Reproduced identically at the base sha, so it is not from this change.docs-list,docs-source-anchors,render-maturity-docs,docs-i18nscript tests → 4 files, 17 tests, all pass.Shared files
docs/docs.jsongains a nested group, following thereference/full-release-validationprecedent — the sibling split that is actually onmain(verified withtest -d).docs/reference/RELEASING.md's split is an open, unmerged PR and was not used as precedent.docs/.i18n/glossary.zh-CN.jsonneeded five new sources:check-docs-i18n-glossary.mtsrequires a glossary source for every new page title, so a split that adds child pages does need entries here. They are inserted next to the existing "Session management deep dive" entry, not appended, so concurrent splits touch different regions and merge cleanly. Result validated: 978 entries, 0 duplicate sources.docs/.i18n/zh-Hans-navigation.jsonneeds no change — it is a label overlay cloned from the English nav.Audit findings
Closes r3-0707 (blocking; its prescribed fix was exactly "split the page into store, maintenance, and compaction reference pages with a short index parent"). Also addresses r3-2221 (18 H2s, no index).
Deliberately not addressed here, to keep this content-preserving: r3-0708 (prose density), r3-2220 (lede), r3-2222 (Title Case H3 — kept verbatim so its anchor and text are unchanged), r3-2223 (back-link from
/concepts/context-engine), r3-2224 (unversioned Codex claims). Each needs a prose edit and belongs in a follow-up.