Repository navigation
docs(tools): split the code mode page by reader job - #142425
Conversation
The page was 79,412 characters with 43 headings in a flat run of 32 H2 sections, mixing a how-to quickstart, explanation, reference for exec, wait, the guest API, error codes, and telemetry, plus a contributor test plan. It is now an index with eight children, one per reader job. Children: - /tools/code-mode/quickstart - enable it, override one model, recover from tool errors, verify the surface, Swarm fan-out - /tools/code-mode/configuration - fields, automatic per-model activation, the preferred-model list, activation precedence - /tools/code-mode/tool-surface - model-visible tools, exec, wait, the hidden catalog, Tool Search interaction, name collisions - /tools/code-mode/guest-api - guest globals, catalog handles, MCP namespaces, virtual API declarations, paginated file data - /tools/code-mode/output - declared output contracts and the output API - /tools/code-mode/internals - runtime status, scope, terms, nested tool execution, snapshot lifecycle, QuickJS-WASI, TypeScript, security - /tools/code-mode/troubleshooting - error codes, telemetry, debugging - /tools/code-mode/maintainers - implementation layout, validation checklist, E2E test plan Anchor strategy: per-anchor routes are impossible because redirectSource() rejects any source containing [?#]. All 44 pre-split IDs computed with parseDocsDocument stay alive on the parent index instead: 4 remain natively published (what-it-does, why-use-it, technical-tour, related) and 40 became authored <a id="..." /> stubs in a "Where each section moved" list, each linking to the page that now holds the content. The one punctuated heading emits both an encoded and a cleaned ID; both are stubbed. No ID the index still publishes itself is stubbed, so there is no duplicate authored/canonical ID collision. A script enumerated the pre-split IDs and asserted each resolves end to end: 44/44 pass, and the 9 pages report 0 collisions. External deep links such as the CHANGELOG and appcast entries to #guest-runtime-api still land correctly. Losslessness: 43 of 43 section bodies are byte-identical at their destination, and all 23 code fences are character-identical on both info string and body. Words 10,630 -> 11,081, links 18 -> 65, table rows 40 -> 52, fences 23 -> 23; every delta is accounted for by the index's two child tables (12 rows, 8 links) and the 39-entry moved list. The empty "## Quickstart" heading became the quickstart page title, and its five H3 children were promoted to H2 with identical heading text, so their IDs are unchanged. Prose was not rewritten. Five orphaned cross-references were repaired: four same-page fragment links that now point at the child holding the target, and the "Technical tour" signpost, which said "The rest of this page covers" and now says "These pages cover". Six inbound deep links from other docs pages were retargeted at the children. Closes audit findings: r3-0783, r3-0784
|
🦞👀 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 8, 2026, 2:54 PM ET / 18:54 UTC (Revision 2). ClawSweeper reviewWhat this changesReorganizes the Code Mode guide into an overview and eight task-focused pages, updating navigation, incoming links, and translation glossary entries. Merge readiness✅ Ready for maintainer review The split remains useful and is not present on current main. No introduced correctness defects were found; the documentation preserves the existing guidance and provides compatibility links for moved sections. Priority: P3 Review scores
Verification
How this fits togetherThe Code Mode documentation helps operators configure tool orchestration and helps developers understand its execution contracts. The documentation index and existing deep links direct readers to setup, reference, troubleshooting, and implementation guidance. flowchart TD
A[Documentation navigation] --> C[Code Mode overview]
B[Existing section links] --> D[Preserved section anchors]
C --> E[Setup and configuration]
C --> F[Tool and guest API reference]
C --> G[Troubleshooting and internals]
D --> E
D --> F
D --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceDocs +169. Total +169 across 16 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the task-focused documentation structure and stable legacy anchors while maintaining each technical section in one canonical location. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a documentation reorganization, and its content-preservation claims can be checked directly against the pinned base. Is this the best way to solve the issue? Yes. Task-focused pages with preserved parent anchors improve navigation without duplicating implementation or changing the documented contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a9707e15bcda. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Glossary conflict only; union keyed on source, 678 entries, 0 duplicate sources. No page conflicted. Re-checked the invariant no validator covers: every surviving 'above'/'below' in the children still refers to same-page content. configuration.md:124 points at 'Shipped preferred models' at :74, :127 is semantic rather than directional, and internals.md:123 refers to the suspended-run cap five lines above at :118. docs-link-audit --anchors: 0 broken links.
The page was 79,412 characters with 43 headings in a flat run of 32 H2 sections, mixing a how-to quickstart, explanation, reference for exec, wait, the guest API, error codes, and telemetry, plus a contributor test plan. It is now an index with eight children, one per reader job. Children: - /tools/code-mode/quickstart - enable it, override one model, recover from tool errors, verify the surface, Swarm fan-out - /tools/code-mode/configuration - fields, automatic per-model activation, the preferred-model list, activation precedence - /tools/code-mode/tool-surface - model-visible tools, exec, wait, the hidden catalog, Tool Search interaction, name collisions - /tools/code-mode/guest-api - guest globals, catalog handles, MCP namespaces, virtual API declarations, paginated file data - /tools/code-mode/output - declared output contracts and the output API - /tools/code-mode/internals - runtime status, scope, terms, nested tool execution, snapshot lifecycle, QuickJS-WASI, TypeScript, security - /tools/code-mode/troubleshooting - error codes, telemetry, debugging - /tools/code-mode/maintainers - implementation layout, validation checklist, E2E test plan Anchor strategy: per-anchor routes are impossible because redirectSource() rejects any source containing [?#]. All 44 pre-split IDs computed with parseDocsDocument stay alive on the parent index instead: 4 remain natively published (what-it-does, why-use-it, technical-tour, related) and 40 became authored <a id="..." /> stubs in a "Where each section moved" list, each linking to the page that now holds the content. The one punctuated heading emits both an encoded and a cleaned ID; both are stubbed. No ID the index still publishes itself is stubbed, so there is no duplicate authored/canonical ID collision. A script enumerated the pre-split IDs and asserted each resolves end to end: 44/44 pass, and the 9 pages report 0 collisions. External deep links such as the CHANGELOG and appcast entries to #guest-runtime-api still land correctly. Losslessness: 43 of 43 section bodies are byte-identical at their destination, and all 23 code fences are character-identical on both info string and body. Words 10,630 -> 11,081, links 18 -> 65, table rows 40 -> 52, fences 23 -> 23; every delta is accounted for by the index's two child tables (12 rows, 8 links) and the 39-entry moved list. The empty "## Quickstart" heading became the quickstart page title, and its five H3 children were promoted to H2 with identical heading text, so their IDs are unchanged. Prose was not rewritten. Five orphaned cross-references were repaired: four same-page fragment links that now point at the child holding the target, and the "Technical tour" signpost, which said "The rest of this page covers" and now says "These pages cover". Six inbound deep links from other docs pages were retargeted at the children. Closes audit findings: r3-0783, r3-0784
What
docs/tools/code-mode.mdwas 79,412 characters with 43 headings in a flat run of 32 H2 sections. It mixed a how-to quickstart, explanation, reference forexec,wait, the guest API, error codes and telemetry, and a contributor test plan. This splits it into an index plus eight children, one per reader job./tools/code-mode(index)/tools/code-mode/quickstart/tools/code-mode/configuration/tools/code-mode/tool-surfaceexec,wait, hidden catalog, Tool Search, collisions./tools/code-mode/guest-api/tools/code-mode/output/tools/code-mode/internals/tools/code-mode/troubleshooting/tools/code-mode/maintainersAnchor preservation
Per-anchor redirect routes are not possible here:
redirectSource()inscripts/lib/docs-redirects.mjsthrows on any source containing[?#]. Every anchor is kept alive on the parent index instead.All 44 pre-split IDs were computed with
parseDocsDocument, not a slug approximation:what-it-does,why-use-it,technical-tour,related)<a id="..." />stubs in a Where each section moved list, each linking to the page that now holds the contentThe \compat.codeMode` catalog flag`) emits both an encoded and a cleaned ID; both are stubbedduplicate authored/canonical IDcollisionA passing
docs-link-auditis not evidence here, because the split rewrote the repo's own links. A separate script enumerated the pre-split IDs and asserted each resolves end to end against the post-split pages:External deep links keep working, including the
CHANGELOG.mdandappcast.xmlentries pointing atdocs.openclaw.ai/tools/code-mode#guest-runtime-api, and the Labs registrydocsUrlfor/tools/code-mode.Losslessness
Every delta is accounted for by index-only additions: the two child tables contribute 12 table rows and 8 links, and the moved-section list contributes 39 links.
Two structural notes:
## Quickstartheading became the quickstart page title; its ID is stubbed to/tools/code-mode/quickstartProse
Prose was not rewritten. Five orphaned cross-references were repaired, since the split is what orphaned them:
#automatic-per-model-activation,#override-one-modeltwice,#recover-from-tool-errors)Six inbound deep links from other docs pages were retargeted at the children.
docs/releases/2026.9.2.mdwas left alone as an archival release note; its link still resolves through the index stub.Remaining
above/belowphrasing in the children was checked by hand and each still refers to same-page content.Validation
No
.tsfiles are touched, sooxfmtdoes not apply..audit/docs-test-pins.pyreports 0 tests pinning the parent page and 0 pinning seven of the eight children. The single hit ontroubleshooting.mdis a false positive from the bare-filename heuristic:scripts/docs-i18n/*_test.gowrite their own temporarygateway/troubleshooting.mdfixture and assert nothing about this tree.src/config/schema.hints.test.ts(13 tests, passing) resolvesSECTION_DOCS_URLSagainst the docs tree but contains no Code Mode entry, and/tools/code-modestill resolves regardless.Audit findings
Closes:
r3-0783(blocking, page mixes four Diataxis modes),r3-0784(major, 43 headings in a flat H2 run).Deferred, since the rules for this PR forbid rewriting prose during a split:
r3-0785long paragraphs, now onoutput.md,guest-api.md, andtool-surface.mdr3-2337empty header row in the Runtime status table, now oninternals.mdr3-2338three Related targets do not link back to Code Moder3-2339the feature name rotates between three spellingsr3-2340version-locked wording has no version scoper3-2341the debug block and recovery rules are duplicated with drift, now split acrossquickstart.mdandtroubleshooting.md, which makes the duplication easier to reconcile in a follow-upOwnership
No
.github/CODEOWNERSrule matches any changed path. Every changed file was checked against every pattern in the file; there is no catch-all rule. Nothing was restructured to move around an ownership boundary, and the original page had no owner either.