Skip to content

refactor(dashboard): extract page renderers - #1116

Merged
steipete merged 4 commits into
mainfrom
steipete/extract-dashboard-pages
Aug 11, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/extract-dashboard-pages

Conversation

@steipete

@steipete steipete commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • move the server-side dashboard page renderers and renderer-only helpers from dashboard/worker.ts to dashboard/dashboard-pages.ts
  • keep Worker routing, response wrappers, JSON APIs, caching, queue/state logic, and StatusStore I/O in dashboard/worker.ts
  • add committed real-Worker before/after proof for /, /triage, and /pr-proof-triage

What moved

issueTriagePageConfig, prProofTriagePageConfig, escapeHtml, externalHttpUrl, dashboardThemeInitScript, dashboardThemeCss, dashboardThemeControlHtml, dashboardThemeControlScript, serializedPageConfig, triageHtml, and dashboardHtml, plus the renderer environment type and renderer-only CrabFleet default URL.

The 4,113-line contiguous function block is byte-identical to origin/main. Including the type and constant, 4,115 source lines moved. dashboard/worker.ts shrank from 11,316 to 7,207 lines (net 4,109 lines).

Proof

The committed harness starts the real local Wrangler Worker at merge base 5a964dadc8131e6e6dc33e9be3536b8141d1d107 and current head, fetches all three moved page surfaces, normalizes ISO timestamps and generated 40-character SHAs, and compares the results.

  • PROOF_RC=0
  • normalized rendered-page diff: empty
  • /: 162,536 bytes, SHA-256 319af378a93ab82c5b20af7dbab40d04a0596606b1d1dab8b7db0ac34e2c52df before and after
  • /triage: 36,015 bytes, SHA-256 3cb7bac49a71f1c5fe7be9420b31a087ff6c00d696b23f3b48cb99fb5dbb03b5 before and after
  • /pr-proof-triage: 35,833 bytes, SHA-256 ded1952e9e89e99407cadfd754162e31b87caa4d4d8886d6c3673da290c69dc8 before and after
  • source-blind behavior validation: satisfies_contract

The same proof passed from a clean --fresh-pr openclaw/clawsweeper#1116 --no-hydrate
checkout at pushed head a00e31c5ae40e33ab8718facac74d39d198dd994 inside Docker-backed Crabbox
provider=local-container, image node:24-bookworm, lease cbx_36172f52e311
(golden-crayfish-3c9c). Corepack supplied pnpm 11.10.0, checksum-verified jq 1.8.1 printed
jq-linux-amd64: OK, PROOF_RC=0, CONTAINER_PROOF_RC=0, and Crabbox stopped the lease
automatically. The exact proof ran in the container rather than the full suite, so the known
three-failure blob-hydration baseline was not applicable.

Artifacts and provenance are committed under docs/proof/extract-dashboard-pages/.

Validation

  • pnpm run build:all
  • pnpm run test:no-build — 3,315 tests; 3,306 passed, 9 skipped, 0 failed
  • pnpm run lint
  • pnpm run format:check
  • pnpm run check:dashboard-queue-boundary
  • pnpm run check:active-surface
  • pnpm run check:limits
  • clean structured Codex autoreview before every commit

OpenClaw Bay impact

None. Rendered output is byte-identical, and this ownership-only move changes no Bay data contract, lifecycle projection, observer-only boundary, or controls. /bay-demo already renders through dashboard/bay-page.ts and is outside the moved surface.

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

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. 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 10, 2026, 10:19 PM ET / August 11, 2026, 02:19 UTC.

ClawSweeper review

What this changes

The PR moves dashboard HTML renderers and renderer-only helpers into a dedicated module while leaving HTTP routing, APIs, caching, queues, and state access in the Worker.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal landing review: the renderer extraction preserves the existing Worker routes, is source-equivalent apart from module boundaries, and has sufficient real-Worker parity proof.

Priority: P3
Reviewed head: e86aa0bdc292c8d5909981e7f0e20a687522b06e

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, source-preserving refactor with strong real-Worker parity evidence and no actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.
Evidence reviewed 5 items Worker boundary preserved: The PR-head Worker imports only the renderer exports and retains the existing page-route dispatch for /, /triage, and /pr-proof-triage; API routing remains in the Worker.
Renderer implementation is a relocation: The new renderer module contains the moved page functions and exports only the four values consumed by the Worker; the comparison found no functional changes in the extracted function block.
Real Worker proof: Committed Docker-backed local Worker evidence records HTTP 200, stable bodies, and matching hashes for all three moved page routes, with an empty normalized diff.
Findings None None.
Security None None.

How this fits together

The dashboard Cloudflare Worker receives page and API requests, renders the dashboard pages, and serves state-backed JSON endpoints. This refactor isolates HTML generation from routing and operational state handling.

flowchart LR
  Requests[Dashboard requests] --> Router[Worker routing]
  Router --> Renderers[Page renderers]
  Renderers --> Pages[HTML dashboard pages]
  Router --> APIs[Dashboard APIs]
  APIs --> State[Queue and status state]
  State --> APIs
Loading

Before merge

  • Complete next step (P2) - No repair is indicated; this PR is ready for ordinary maintainer landing review once current required checks settle.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Runtime extraction 4,126 added, 4,116 removed; net +10 runtime lines The production change is a near-neutral relocation rather than a functional expansion.
Parity surface 3 dashboard routes compared Real-Worker proof covers the root dashboard and both triage pages affected by the move.

Technical review

Best possible solution:

Land the focused module split while retaining the Worker as the sole owner of request routing, response wrappers, and stateful operations.

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

Not applicable: this is not a reported defect; the relevant verification is before/after execution of the three moved page routes, which the committed Worker proof provides.

Is this the best way to solve the issue?

Yes: extracting the page-only rendering layer while retaining routing and state handling in the Worker is the narrowest maintainable split, and the rendered outputs were checked for parity.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5a964dadc813.

Labels

Label changes:

  • add P3: This is a focused internal dashboard refactor with evidence of unchanged visible behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.

Label justifications:

  • P3: This is a focused internal dashboard refactor with evidence of unchanged visible behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.
  • proof: sufficient: Contributor real behavior proof is sufficient. Committed Docker-backed local Worker output shows successful before/after HTTP behavior and equal response hashes for all three moved dashboard routes; later commits do not change runtime code.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger has the largest sampled contribution history on the Worker and authored the refactor after recent dashboard maintenance on main. (role: recent dashboard contributor and extraction author; confidence: high; commits: 5a964dadc813, 765644804756, d0b82258154a; files: dashboard/worker.ts, dashboard/dashboard-pages.ts)
  • Martin Cleary: Martin Cleary recently changed dashboard routing and Bay-related behavior in the same Worker surface. (role: recent adjacent dashboard contributor; confidence: medium; commits: 51ac499c741b, f9a2f9493c2d, 91272a65e6ff; files: dashboard/worker.ts, dashboard/bay-page.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.

@steipete
steipete merged commit c145b45 into main Aug 11, 2026
19 checks passed
@steipete
steipete deleted the steipete/extract-dashboard-pages branch August 11, 2026 02:22
steipete added a commit that referenced this pull request Aug 12, 2026
Ports the durable command-intake pipeline for the "@clawsweeper re-review" command from the abandoned Aug-8 WIP (snapshot 4cad8de on codex/fix-command-review-publication) onto current main.

Commands are now durably recorded pre-acknowledgement (intake/watermark/receipt/revision tables, 16-item intake, 15s-15m bounded retries, 30-day receipts), verified against the live comment and head, fenced through verify/enqueue/effects stages, and superseded by full version identity - including equal-timestamp edits (review-caught P1). Acknowledgement and reaction effects are idempotent; router runs that throttle mid-command now recover instead of stranding the command (live instance: openclaw/openclaw#116562 was acked then lost when both router runs throttled).

Superseded snapshot pieces were dropped, not ported: retry jitter (#1076/#1077), quota headroom (#1086), retry budgets (#1089), parked reconciliation (#1111), branch guard (#962); dashboard-monolith diffs were reworked around the #1116/#1124/#1132 splits.

Proof: committed receipt at this exact head (docs/proof/durable-command-intake/), real Wrangler Worker + DO comparison with durable throttled recovery, GitHub confined to loopback API; full gate 7056 passed / 0 failed; strict check green. Verdict clean (Findings: None) on 9eb957e.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant