Skip to content

refactor(dashboard): share durable storage types - #1418

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/dashboard-storage-types
Sep 4, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/dashboard-storage-types

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Seven dashboard storage modules independently declared the same structural Durable Object storage types, creating avoidable drift risk when that internal contract is maintained.

Why This Change Was Made

This change moves the exact existing SqlStorage and DurableStorage structural declarations into one type-only dashboard module and imports that type from the seven reviewed consumers. It changes no methods, SQL, classes, storage schemas, telemetry behavior, queues, Worker code, or runtime exports.

The matching declarations in active failure-telemetry and queue work are intentionally excluded to avoid colliding with those in-flight branches; this is bounded collision avoidance, not an incomplete runtime migration. Their type shape and behavior remain unchanged.

User Impact

There is no user-visible or runtime behavior change. Dashboard storage typing now has one shared definition across the reviewed modules, reducing maintenance drift.

OpenClaw Bay Impact

OpenClaw Bay is unaffected. This is a type-only refactor with no dashboard data-contract, status, telemetry, public API, storage schema, or runtime change.

Documentation Impact

No documentation or changelog update is needed. AGENTS.md, CONTRIBUTING.md, and VISION.md were reviewed; their runtime and operational contracts remain accurate because this is a pure internal type refactor.

Evidence

  • Current signed head: 7ca7921deddc2eac2454d10e6619860cfbfd3189
  • Diff: 8 files, 17 insertions, 63 deletions; git diff --check passes.
  • Focused dashboard tests on Node.js 26.7.0 and Bash 5.3.12: 199 passed, 0 failed across lifecycle/publication, publication batches, GitHub egress telemetry, record snapshots, and state-writer coordination.
  • Fresh Codex review before commit: clean, no actionable findings.
  • Fresh Codex review of the committed branch against origin/main: clean, no actionable findings.
  • Dashboard TypeScript build passes before and after the refactor.
  • Pinned Wrangler 4.107.0 dry-run bundle proof: structured multipart parsing produced byte-identical worker.js modules, 2,343,844 bytes each, SHA-256 ea5311a80bd2f4cba4a340bbe8da1b88717a9698c15ff9da9d6e15827f5bd9b4. Parsed metadata was also identical with SHA-256 e0d517989f901dcab9c22e5a7800a92374afb32ca1e2f182a35135a912f7c0e5. Raw transport hashes differed only because Undici generated different multipart boundary delimiters; application JavaScript was not normalized.
  • Crabbox AWS validation receipt: run run_4e8a06f5711f, lease cbx_ca0cd6d6f17a, Linux c7a.8xlarge, Node.js 24.18.1, pnpm 11.10.0. Formatting, active-surface checks, dashboard boundary/strict checks, documentation checks, limits, all builds, and all lint targets passed. The test suite reported 4,824 passed, 1 failed, and 18 skipped. The sole failure was environmental: Crabbox's raw sync directory omitted .git, while test/apply-drift-refresh.test.ts invokes git rev-parse HEAD. The exact failed surface was rerun at the committed Git head in a Git checkout and passed 1/1 in 11.3 seconds. The lease was released.

Real Behavior Proof

Claim

Consolidating the duplicate structural types does not change the generated dashboard Worker or the behavior exercised by the affected storage modules.

Exercised surface

Dashboard Worker build output plus lifecycle/publication, publication-batch, GitHub-egress, snapshot, and state-writer behavior.

Scenario or fixture

The unmodified base and committed candidate were built separately. Wrangler's multipart upload payload was parsed structurally with Response.formData(), then the raw module bytes and metadata were compared. Focused repository fixtures exercised the seven affected storage consumers.

Command and environment

  • Node.js 26.7.0, Bash 5.3.12: dashboard TypeScript build and focused node:test suites.
  • Wrangler 4.107.0: deploy --dry-run only for baseline and candidate.
  • Crabbox AWS run run_4e8a06f5711f: Linux, Node.js 24.18.1, pnpm 11.10.0, full pnpm run check.

Observable result

The candidate Worker module and metadata exactly match the baseline. All 199 focused assertions passed. The full remote gate passed every static, build, lint, and product test except one checkout-dependent test that could not read absent Git metadata; that exact test passed from the committed Git checkout.

Artifact or trace

  • Worker module: 2,343,844 bytes; SHA-256 ea5311a80bd2f4cba4a340bbe8da1b88717a9698c15ff9da9d6e15827f5bd9b4
  • Worker metadata SHA-256: e0d517989f901dcab9c22e5a7800a92374afb32ca1e2f182a35135a912f7c0e5
  • Crabbox run: run_4e8a06f5711f
  • Crabbox lease: cbx_ca0cd6d6f17a (released)

Limits

No live Cloudflare deployment was performed. The runtime proof is a pinned dry-run bundle identity comparison plus controlled repository tests. No live apply, close, queue, workflow, or GitHub mutation path was exercised. No Rank-up move applies to this bounded type-only refactor.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 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:

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

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 6:51 AM ET / 10:51 UTC.

ClawSweeper review

What this changes

The PR consolidates seven identical dashboard Durable Object storage type declarations into a shared type-only module and rewires those consumers to import it.

Merge readiness

✅ Ready for maintainer review

This is a coherent, type-only cleanup: the shared definition preserves the seven consumers’ identical storage contract, and the submitted build and focused behavior evidence is strong. Keep it open for normal member-authored PR review rather than auto-closing it.

Priority: P3
Reviewed head: 7ca7921deddc2eac2454d10e6619860cfbfd3189

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A well-bounded internal refactor with strong behavior-preservation evidence and no actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed production surface is the dashboard Worker’s storage-typed modules; the PR records a base-versus-candidate dry-run bundle identity comparison plus focused storage-consumer tests, with identical Worker module and metadata output after the refactor.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production surface is the dashboard Worker’s storage-typed modules; the PR records a base-versus-candidate dry-run bundle identity comparison plus focused storage-consumer tests, with identical Worker module and metadata output after the refactor.
Evidence reviewed 5 items Introduced type-only contract: The new module exports only the existing structural SQL and transaction interface, while each changed consumer uses a TypeScript type-only import.
Consumer contract is unchanged: The lifecycle store still accepts the same DurableStorage shape; the refactor changes only where that shape is declared.
Submitted real-behavior proof: The PR body records byte-identical dry-run Worker module and metadata output for base and candidate, 199 focused assertions passing, and a Crabbox validation receipt; this directly supports the no-runtime-change claim.
Findings None None.
Security None None.

How this fits together

The dashboard Worker uses Cloudflare Durable Object SQL storage for review lifecycle, publication, telemetry, snapshots, and writer coordination. This shared compile-time contract describes the storage interface passed into those components without changing their queries or runtime behavior.

flowchart TD
  A[Dashboard Worker] --> B[Durable Object storage]
  B --> C[Shared storage type contract]
  C --> D[Review lifecycle and publication]
  C --> E[Telemetry and snapshots]
  D --> F[Canonical records and GitHub publishing]
  E --> G[OpenClaw Bay status]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Refactor scope 1 shared module added; 7 consumers rewired The small, uniform change set supports review as a mechanical compile-time consolidation.
Production/test delta production -46 net lines, tests +0 The patch removes repeated declarations without growing runtime behavior or test surface.

Technical review

Best possible solution:

Land the shared type-only contract after normal maintainer review, retaining the deliberately narrow scope around the seven matching consumers.

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

Not applicable: this PR changes compile-time declarations only; its submitted proof compares Worker output and exercises the affected dashboard stores.

Is this the best way to solve the issue?

Yes: one shared type-only declaration removes repeated contracts while preserving each consumer’s existing storage interface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 70a0a787eaf8.

Labels

Label justifications:

  • P3: This is low-risk internal maintainability cleanup with no reported user-visible 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 production surface is the dashboard Worker’s storage-typed modules; the PR records a base-versus-candidate dry-run bundle identity comparison plus focused storage-consumer tests, with identical Worker module and metadata output after the refactor.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production surface is the dashboard Worker’s storage-typed modules; the PR records a base-versus-candidate dry-run bundle identity comparison plus focused storage-consumer tests, with identical Worker module and metadata output after the refactor.

Evidence

What I checked:

  • Introduced type-only contract: The new module exports only the existing structural SQL and transaction interface, while each changed consumer uses a TypeScript type-only import. (dashboard/durable-storage.ts:1, 7ca7921deddc)
  • Consumer contract is unchanged: The lifecycle store still accepts the same DurableStorage shape; the refactor changes only where that shape is declared. (dashboard/exact-review-lifecycle.ts:1, 7ca7921deddc)
  • Submitted real-behavior proof: The PR body records byte-identical dry-run Worker module and metadata output for base and candidate, 199 focused assertions passing, and a Crabbox validation receipt; this directly supports the no-runtime-change claim. (7ca7921deddc)
  • Current-main context: Fetched main is commit 70a0a78 and does not contain dashboard/durable-storage.ts, so this contribution is not already implemented on main. (dashboard/durable-storage.ts, 70a0a787eaf8)
  • Feature-history routing: Recent history identifies Peter Steinberger’s strict dashboard typing work, Martin Cleary’s lifecycle work, and Vincent Koc’s recent snapshot work as relevant ownership context. (dashboard/record-snapshots.ts:78, 0e0106a0faf3)

Likely related people:

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

@vincentkoc
vincentkoc marked this pull request as ready for review September 4, 2026 11:03
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(dashboard): share durable storage types This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc
vincentkoc merged commit 956e5d7 into main Sep 4, 2026
23 checks passed
@vincentkoc
vincentkoc deleted the refactor/dashboard-storage-types branch September 4, 2026 11:06
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: 🐚 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant