Repository navigation
refactor(dashboard): extract page renderers - #1116
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 10:19 PM ET / August 11, 2026, 02:19 UTC. ClawSweeper reviewWhat this changesThe 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 readinessKeep 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 Review scores
Verification
How this fits togetherThe 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
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
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.
Summary
dashboard/worker.tstodashboard/dashboard-pages.tsdashboard/worker.ts/,/triage, and/pr-proof-triageWhat moved
issueTriagePageConfig,prProofTriagePageConfig,escapeHtml,externalHttpUrl,dashboardThemeInitScript,dashboardThemeCss,dashboardThemeControlHtml,dashboardThemeControlScript,serializedPageConfig,triageHtml, anddashboardHtml, 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.tsshrank from 11,316 to 7,207 lines (net 4,109 lines).Proof
The committed harness starts the real local Wrangler Worker at merge base
5a964dadc8131e6e6dc33e9be3536b8141d1d107and current head, fetches all three moved page surfaces, normalizes ISO timestamps and generated 40-character SHAs, and compares the results.PROOF_RC=0/: 162,536 bytes, SHA-256319af378a93ab82c5b20af7dbab40d04a0596606b1d1dab8b7db0ac34e2c52dfbefore and after/triage: 36,015 bytes, SHA-2563cb7bac49a71f1c5fe7be9420b31a087ff6c00d696b23f3b48cb99fb5dbb03b5before and after/pr-proof-triage: 35,833 bytes, SHA-256ded1952e9e89e99407cadfd754162e31b87caa4d4d8886d6c3673da290c69dc8before and aftersatisfies_contractThe same proof passed from a clean
--fresh-pr openclaw/clawsweeper#1116 --no-hydratecheckout at pushed head
a00e31c5ae40e33ab8718facac74d39d198dd994inside Docker-backed Crabboxprovider=local-container, imagenode:24-bookworm, leasecbx_36172f52e311(
golden-crayfish-3c9c). Corepack supplied pnpm 11.10.0, checksum-verified jq 1.8.1 printedjq-linux-amd64: OK,PROOF_RC=0,CONTAINER_PROOF_RC=0, and Crabbox stopped the leaseautomatically. 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:allpnpm run test:no-build— 3,315 tests; 3,306 passed, 9 skipped, 0 failedpnpm run lintpnpm run format:checkpnpm run check:dashboard-queue-boundarypnpm run check:active-surfacepnpm run check:limitsOpenClaw 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-demoalready renders throughdashboard/bay-page.tsand is outside the moved surface.