fix(bay): derive metrics from durable review lifecycle - #1222
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 10:56 PM ET / August 22, 2026, 02:56 UTC. ClawSweeper reviewWhat this changesThe PR derives Bay’s public review timing and completed-tide metrics from durable exact-review lifecycle records, scopes caches to public repositories, and retains completed cards alongside newer active revisions. Merge readinessKeep open for maintainer review: current main does not contain this durable lifecycle implementation, and the current PR head has no discrete correctness or security finding. Its exact-head Worker/Durable Object proof is strong; the remaining choice is whether to accept the intentional one-hour warming period after rollout or public-scope changes. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherOpenClaw Bay is the public status dashboard. Exact-review admissions and terminal outcomes enter the Durable Object, which aggregates public-scope metrics for the status API and Bay page. flowchart LR
A[Review ingress] --> B[Lifecycle projection]
B --> C[Durable terminal telemetry]
C --> D[Public repository scope]
D --> E[Status API]
E --> F[Bay dashboard]
Decision needed
Why: This is a public dashboard behavior and privacy/correctness rollout tradeoff, not a mechanical code choice. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the durable lifecycle source only with explicit acceptance of scoped one-hour warming, preserving fail-closed public metrics and the existing v1 timing field with additive provenance. Do we have a high-confidence way to reproduce the issue? Not applicable as a current-main bug reproduction in this read-only review; the PR supplies exact-head after-fix proof through a real local Worker, Durable Object, and rendered Bay page. Is this the best way to solve the issue? Yes, subject to rollout approval: durable lifecycle facts plus scope-bound, fail-closed aggregation are more reliable than the prior short-lived journey and worker samples. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9a09faa3da3b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
1084da9 to
c78a2b6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c78a2b6 to
4f414fb
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
51d5d1b to
021feff
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Make OpenClaw Bay's review timing and completed-tide metrics derive from durable exact-review lifecycle facts, rather than incomplete worker or journey samples.
This update also fixes a user-visible gap found during the deeper review: a finished review card was hidden whenever the same PR had a newer active review. Finished revisions now remain in the completed tide alongside active work, have a separate UI identity, and preserve legacy public-reference deep links.
Problem
The earlier Bay model combined short-lived journey records with worker and closed-item samples. It therefore missed valid reviews triggered by PR creation, new commits, PR-body edits,
@clawsweeper review, and@clawsweeper re-review; terminal/tide state could also be incomplete after recovery or retries.The original production failure in the durable solution was separate: its raw SQLite
SAVEPOINTuse is accepted by the in-memory test harness but rejected in a Cloudflare Durable Object. That made terminal metric materialization recover/fail closed in production. This branch replaces that transaction path with Durable Object-safe storage transactions and durable outbox recovery.The lower Durable lifecycle Kanban is intentionally a separate bounded historical projection. This PR fixes the public Bay timing indicator, completed tide, and last-tide display; it does not redefine that Kanban's distinct
over_capsemantics.Implementation
last_tide_atsolely from that stream.CHECKINGcard or collide with the active card's identity.timings.sample_kind: completed_review_journeyscontract and add explicit durable-lifecycle provenance.Validation
node --experimental-strip-types --test test/dashboard-worker-bay-records-routes.test.ts— 94 passedpnpm run check:dashboard-queue-boundarypnpm run check:dashboard-strictpnpm run lint:dashboardpnpm run lint:scriptspnpm run build:allgit diff --checkWindows note: this checkout has Git
core.autocrlfenabled.oxfmtreports the CRLF worktree representation as non-canonical even for the same files onorigin/main; formatting it produces no Git-normalized content diff. No repository-wide line-ending-policy change is included in this PR.Real Behavior Proof
Claim: all five review ingress paths contribute terminal reviews to the durable public Bay metrics, and all public terminal completions drive the completed tide/last-tide display. A completed revision remains visible and opens the correct terminal drawer even while its PR has active work.
Head:
021feff4cb1f2cd3d6b2b781faeaf9342791ade5(rebased ontomain9a09faa3da3b94957e021a98fd00bb5061bff904)Surface: local Wrangler Worker, real Cloudflare Durable Object runtime, and rendered Bay page
Scenario: 21 public terminal reviews spanning
opened,synchronize,edited,review, andre_review; one private terminal review; a released 20-item tide and one completion in the next tideCommand/environment:
Provider/run: Docker-backed Crabbox
local-container; leasecbx_c9430b1f6fca(blue-barnacle); runrun_2329cbf4baf9; imagemcr.microsoft.com/playwright:v1.60.0-noble; no hydrationObserved: 56/56 assertions passed on this exact head:
{"ok":true,"assertions":56,"status":{"metrics_state":"warming","timing_samples":21,"tide_generation":1,"terminal_count":1,"last_tide_at":"2026-08-22T02:33:26.083Z"}}. The rendered page showed1 / 20, a visibleCOMPLETED 1terminal card, and its terminal drawer opened successfully. The private completion was excluded.Trace/artifact: exact-head Crabbox run
run_2329cbf4baf9; the earlier matching rendered-page capturerun_33da8d5336a2-artifacts.tgzcontainsproof-summary.jsonandbay-lifecycle-metrics.png(1,638,171 bytes). The rebase introduced only upstream reviewer-policy commits, not Bay product changes.Limits: deterministic signed local lifecycle traffic only; no GitHub or production mutation. The UI deliberately shows warming coverage rather than a partial average until it has a complete one-hour window.
Review closeout
origin/main9a09faa3da3b94957e021a98fd00bb5061bff904: no actionable correctness issues.origin/main9a09faa3da3b94957e021a98fd00bb5061bff904and this head: complete,keep_openwith high confidence; no discrete correctness or security defect. Its only requested merge evidence was the exact-head Worker/Durable Object proof above, which has now completed.Risks and rollout
Attribution
Initial investigation was performed by Roboclaw. Martin Cleary (
@brokemac79) authored the branch commits; Codex completed recovery hardening, validation, proof, and review follow-through.