Skip to content

refactor(config): share documentation wildcard traversal - #149094

Merged
vincentkoc merged 3 commits into
mainfrom
refactor/config-doc-wildcards-20260915
Sep 24, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
refactor/config-doc-wildcards-20260915

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Configuration-document generation repeats the same wildcard traversal policy in map, single-item array, and tuple branches.

User Impact

No user-visible change. Generated configuration documentation, ordering, optionality, and metadata stay unchanged. There are no config/default, stored-data, schema, migration, or upgrade-contract changes and no required operator action.

Why This Change Was Made

One private visitor now owns that repeated recursion; the existing schema guards, caller order, shared visited set, and metadata merging stay in place. A broader exported walker would mix different schema responsibilities. Production code: +10/-15, net -5. Tests: +87/-1, net +86.

I confirm that this specific config-document wildcard cleanup is requested work in my active maintainer cleanup campaign, and I accept its standalone scope.

The signed main integration preserves the earlier PR head and this two-file proposal. It incorporates the already-landed dependency and Windows-test fixes needed by current CI composition. New-head validation below replaces reliance on the older head's CI.

Evidence

Candidate 8645eb134dbbe78c3770a36954bcc89145b82bb6, frozen comparison main 926bb1e1d75c6b102bcbf93114c690312c23cf18:

  • The expanded candidate unit fixture passed against the baseline production owner: 1/1. Restored candidate owner: complete unit 1/1 and integration 10/10, no failed or skipped cases.
  • Two separate fresh processes ran the unmocked public renderer in the same current dependency/schema context. All four complete UTF-8 outputs matched byte for byte: combined 3,640,182 bytes, core 810,138, channel 1,095,050, plugin 1,735,162. Entry counts also matched: core 2,463, channel 3,740, plugin 4,372. No generated repository files were written by this comparison. The integration test mocks the bundled channel collector; the separate full-renderer comparison does not.
  • Canonical two-path pnpm check:changed --base origin/main --timed passed, including formatting, lint, config-document baseline validation, core production types, the config-cli test graph, and the remaining selected guards.
  • All 49,475 tracked input bindings matched at the required phase boundaries; the baseline substitution was restored. Remote and local exits were zero, output reached EOF, and the one-shot Testbox was stopped.
  • Fresh whole-candidate source review, including current Zod 4.6.5 contracts, returned no actionable findings.

Timing: Linux x64, Node 24.19.0, pnpm 12.4.2, one worker. Baseline expanded-unit command: 16.657s wall. Candidate unit-plus-integration command: 17.746s wall, covering both files together. Setup/transforms are included; provisioning and dependency installation are excluded. These sequential samples do not establish a speedup, isolated candidate-unit cost, or incremental hosted-CI cost.

Remote proof: delegated Testbox run. Its backing Actions step may show cancellation during normal delegated lease cleanup; the actual proof command and lease closeout are the evidence above.

Pending: fresh exact-head hosted CI, required status projections, and ClawSweeper review. Local/remote focused proof and a pending publication receipt do not satisfy those landing gates. The wrapper retained an unavailable staging-discovery cursor; no broader staging-cleanup claim is made.

@vincentkoc vincentkoc self-assigned this Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review September 15, 2026 12:36
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 15, 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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 3:58 PM ET / 19:58 UTC (Revision 6).

ClawSweeper review

What this changes

The branch extracts a private wildcard visitor for configuration documentation and expands renderer coverage for map, array, and tuple metadata.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still has the repeated traversal, and the maintainer-sponsored PR remains a distinct, well-supported cleanup with no identified blocking defect.

Priority: P3
Reviewed head: 8645eb134dbbe78c3770a36954bcc89145b82bb6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused refactor and renderer coverage are sound, with unusually strong output-parity evidence for a small cleanup.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed owner is the configuration documentation renderer. The PR records an unmocked public-renderer comparison across fresh baseline and candidate processes, with four byte-identical outputs and matching entry counts. The generated artifact format is unchanged, so no stored-data migration is implicated.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed owner is the configuration documentation renderer. The PR records an unmocked public-renderer comparison across fresh baseline and candidate processes, with four byte-identical outputs and matching entry counts. The generated artifact format is unchanged, so no stored-data migration is implicated.
Evidence reviewed 9 items Introduced change: The pinned base-to-head diff replaces three inline wildcard descents with one private visitor while retaining branch order, optionality, and the shared visited set.
Renderer contract: The expanded fixture calls the public renderer and asserts optional wildcard paths and merged type and enum metadata.
Production entry point: The generator loads bundled schema metadata, traverses it, deduplicates entries, and renders baseline JSON.
Findings None None.
Security None None.

How this fits together

The configuration documentation generator reads assembled core, channel, and plugin schemas with UI hints. It turns their fields into sorted baseline artifacts used by documentation drift checks.

flowchart LR
  A[Core and bundled plugin schemas] --> C[Config schema metadata]
  B[UI hints] --> C
  C --> D[Documentation traversal]
  D --> E[Sorted baseline entries]
  E --> F[JSON and hash artifacts]
  F --> G[Docs drift check]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +86. Total +81 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 15 -5
Tests 1 87 1 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 97 16 +81

Review metrics

Metric Value Why it matters
Production and test LOC production -5 net; tests +86 net Production shrinks while the expanded fixture checks the renderer output for each refactored wildcard form.

Technical review

Best possible solution:

Keep schema-to-document output byte-stable, with one private owner for wildcard recursion and renderer-level coverage of optionality and merged metadata.

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

Not applicable: this PR addresses duplication rather than a reported bug; the renderer fixture and submitted output comparison check behavior preservation.

Is this the best way to solve the issue?

Yes. A private visitor within the JSON-schema documentation owner is narrower than reusing the separate Zod-schema walker.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 510d72b2efec.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a bounded internal cleanup with no intended user-visible or configuration behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the configuration documentation renderer. The PR records an unmocked public-renderer comparison across fresh baseline and candidate processes, with four byte-identical outputs and matching entry counts. The generated artifact format is unchanged, so no stored-data migration is implicated.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the configuration documentation renderer. The PR records an unmocked public-renderer comparison across fresh baseline and candidate processes, with four byte-identical outputs and matching entry counts. The generated artifact format is unchanged, so no stored-data migration is implicated.

Evidence

What I checked:

  • Introduced change: The pinned base-to-head diff replaces three inline wildcard descents with one private visitor while retaining branch order, optionality, and the shared visited set. (src/config/doc-baseline.ts:441, 8645eb134dbb)
  • Renderer contract: The expanded fixture calls the public renderer and asserts optional wildcard paths and merged type and enum metadata. (src/config/doc-baseline.test.ts:48, 8645eb134dbb)
  • Production entry point: The generator loads bundled schema metadata, traverses it, deduplicates entries, and renders baseline JSON. (src/config/doc-baseline.ts:364, 8645eb134dbb)
  • Still absent from main: Current main retains the three inline branches replaced by this PR. The relevant production file is identical between the latest release tag and current main. (src/config/doc-baseline.ts:441, 510d72b2efec)
  • Release comparison: The configuration documentation owner has no changes between v2026.9.6 and current main, so the private visitor is absent from both. (src/config/doc-baseline.ts:441, 510d72b2efec)
  • Separate schema walker: The existing shared walker traverses Zod schema objects; the documentation baseline visitor traverses generated JSON-schema objects, so it is not a duplicate implementation of that contract. (src/config/schema.walk.ts:1, 8645eb134dbb)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-15T12:54:22.180Z sha 371d775 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T03:13:55.206Z sha 371d775 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T06:27:57.846Z sha 029d2d2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T06:56:50.432Z sha 029d2d2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-24T03:35:55.014Z sha 029d2d2 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Integrate the frozen main baseline while preserving the documentation wildcard extraction and its public renderer coverage.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 21, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Resuming the maintainer landing at 029d2d2. The refresh preserved the reviewed two-file patch, the touched main files are unchanged, and exact-head CI is green. Focused owner and renderer evidence remains in the PR description. Please refresh the completed review against current main; no repair or additional test run is requested.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

* commit '926bb1e1d75c6b102bcbf93114c690312c23cf18': (2027 commits)
  refactor(matrix): reuse startup verification account key (#157310)
  perf(config): avoid repeated environment scans during publication (#156457)
  chore(i18n): refresh native locales (#157495)
  fix(update): show quiet step progress and date recorded outcomes (#153407)
  feat(gateway): preserve browser sign-in requirements before connecting (#157454)
  test(scripts): await CLI admission fixture lifetimes (#157424)
  fix(ci): preserve consumer selection across core type stripes (#157373)
  fix(wizard): preserve typed plugin enum values (#127577) (#138090)
  fix(qa): title mock Code Mode fixture calls
  refactor: simplify SQLite worker lifecycle and test fixtures (#157458)
  test: prebuild run-node signal fixture (#157478)
  refactor(exec): reuse approval policy rule keys (#157198)
  fix(ci): reuse prepared runtime for changed-target E2E shards (#157365)
  fix(config): apply Gateway writes without waiting for file events (#157372)
  fix: count recorded nested tool operations once (#157438)
  fix(telegram): stop leaking raw file:// markdown links in messages (#137810)
  refactor(claws): share resource capability changes (#154680)
  improve(channels): reduce redundant preparation for button messages (#157050)
  fix(build): package preparation fails on unrelated test types (#157318)
  refactor(claws): share bounded document reading (#157436)
  ...
@vincentkoc
vincentkoc merged commit 3f54103 into main Sep 24, 2026
114 of 115 checks passed
@vincentkoc
vincentkoc deleted the refactor/config-doc-wildcards-20260915 branch September 24, 2026 20:08
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* refactor(config): share config doc wildcard traversal

* refactor(config): refresh wildcard traversal on frozen main

Integrate the frozen main baseline while preserving the documentation wildcard extraction and its public renderer coverage.

* chore: merge main for config doc validation

* commit 'e0f58a77476acbe382bff5e55cd520e9d228d478': (2027 commits)
  refactor(matrix): reuse startup verification account key (openclaw#157310)
  perf(config): avoid repeated environment scans during publication (openclaw#156457)
  chore(i18n): refresh native locales (openclaw#157495)
  fix(update): show quiet step progress and date recorded outcomes (openclaw#153407)
  feat(gateway): preserve browser sign-in requirements before connecting (openclaw#157454)
  test(scripts): await CLI admission fixture lifetimes (openclaw#157424)
  fix(ci): preserve consumer selection across core type stripes (openclaw#157373)
  fix(wizard): preserve typed plugin enum values (openclaw#127577) (openclaw#138090)
  fix(qa): title mock Code Mode fixture calls
  refactor: simplify SQLite worker lifecycle and test fixtures (openclaw#157458)
  test: prebuild run-node signal fixture (openclaw#157478)
  refactor(exec): reuse approval policy rule keys (openclaw#157198)
  fix(ci): reuse prepared runtime for changed-target E2E shards (openclaw#157365)
  fix(config): apply Gateway writes without waiting for file events (openclaw#157372)
  fix: count recorded nested tool operations once (openclaw#157438)
  fix(telegram): stop leaking raw file:// markdown links in messages (openclaw#137810)
  refactor(claws): share resource capability changes (openclaw#154680)
  improve(channels): reduce redundant preparation for button messages (openclaw#157050)
  fix(build): package preparation fails on unrelated test types (openclaw#157318)
  refactor(claws): share bounded document reading (openclaw#157436)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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