Skip to content

feat(dashboard): add bounded durable publication trends - #995

Merged
brokemac79 merged 6 commits into
mainfrom
codex/csw-092-shared-telemetry
Aug 1, 2026
Merged

brokemac79 merged 6 commits into
mainfrom
codex/csw-092-shared-telemetry

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements #898 Workstream 4 as the explicitly sponsored, public,
aggregate-only durable-publication trend contract shared by Overview and
OpenClaw Bay.

Approved contract

  • GET /api/recent-durable-publication-events?window=6h|24h|7d returns one
    trailing window at a time with exactly 24 fixed buckets.
  • Direct durable outcomes: accepted, deduped, superseded, fallback.
    Batch durable outcomes: superseded, retryable, permanent.
  • Each direct/batch source uses its indexed (observed_at, event_id) range
    query with a 10,000 + 1 row cap. Over-cap, malformed, unavailable, or
    mixed sources fail closed: affected values/buckets are Unknown (null) and
    complete=false; no partial counts are exposed.
  • A complete empty window is idle/no events, never a failure. Provenance is
    durable/server-observed and public aggregate-only; identities, receipts,
    fences, revisions, and run IDs are omitted.
  • The queue keeps a best-effort, in-memory 60-second cache per requested
    window. This limits repeat scans; it is not a persistent rollup and has no
    write-path callback or invalidation requirement.

Exclusions and known operational boundary

This reports durable publication attempts/outcomes only. It does not claim
lifecycle completion, Completed, acknowledgement state, targets/revisions,
waiting/current/backlog state, queue depth, inventory, causal attribution, or
workflow-derived lifecycle fact. Workflow activity is never converted to item
completion.

No lifecycle writes, callback, per-item reader/admin inventory, Bay lane/card
semantics (WS5/WS5a), workflow/gate, R2/history/backfill/replay, deployment,
merge, or automerge behavior changed.

A cold request can perform two bounded retained-table scans of up to 10,001
rows. Existing source rate is not capped, so a 7-day (or shorter) source can
exceed the cap and correctly remain visibly Unknown. This WS4 slice does not
claim a production-performance guarantee or add a materialized rollup.

Current-head proof and inspectable artifacts

Current PR head: bab218bcf8188683d31a6062525a5a1874b00ea0 (draft; base
822424ecf89949204e1fbc3d8cc6ed77f4d18ad8). The product code exercised by the
controlled browser run is
ef3b016046258f4d4b98dc473cd269e1863c2028; subsequent commits only add the
queue-status isolation assertion and public proof record, not product behavior.

Claim: the built Worker/Bay surfaces expose a redacted, populated aggregate
card while unavailable/capped aggregates fail closed without making core queue
status fail.

The controlled Linux proof used Crabbox local-container lease
cbx_34f66acb8a77, image mcr.microsoft.com/playwright:v1.60.0-noble, and
the supported docs/proof/openclaw-bay/run-proof.sh: 48 assertions, 23 frames,
zero external GitHub API calls, and zero queue/GitHub/production mutations. It
visibly renders a populated 24-hour aggregate (accepted 3, deduped 1,
retryable 2). Focused Worker/helper tests prove all 6h/24h/7d 24-bucket
shapes, idle behavior, cap/malformed/mixed/unavailable to Unknown/no partial
output, redaction, workflow non-inference, 60-second repeat-cache behavior,
and that an unavailable aggregate leaves /api/status successful with its
real queue /stats result intact. This is synthetic controlled evidence, not
production traffic or performance evidence.

Validation

  • node --test test/dashboard-worker.test.ts — 291 passing
  • node --test test/recent-durable-publication-events.test.ts — 3 passing
  • pnpm run build:repair, pnpm run build:dashboard, and pnpm run lint:dashboard
  • pnpm exec oxfmt --check test/dashboard-worker.test.ts dashboard/exact-review-queue.ts dashboard/recent-durable-publication-events.ts
  • git diff --check
  • codex review --uncommitted — clean
  • git fetch origin main --prune && codex review --base origin/main — no actionable defects

Repository-wide pnpm run format:check remains baseline-noisy (535 existing
format findings outside this scoped diff); the touched source/test files pass
the scoped formatter check above.

Sponsorship

The #898 owner/maintainer explicitly sponsors this narrow WS4 slice in the
recorded roadmap decision
, which records merged WS1/#947, WS2/#952, and
WS3/#991 prerequisites, this exact fail-closed contract, and its bounded
source-rate risk.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:20 AM ET / 08:20 UTC.

ClawSweeper review

What this changes

This PR adds a public, aggregate-only recent durable-publication telemetry endpoint with fixed time buckets, a short in-memory cache, and a matching OpenClaw Bay dashboard card.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer landing review. The proposed aggregate-only telemetry feature is new rather than already present on current main; its source boundary, fail-closed behavior, and visible Bay rendering are coherent, with no discrete correctness defect found. The remaining non-CI concern is the explicitly documented cold-read availability/cost tradeoff, which the linked roadmap sponsorship already identifies.

Priority: P2
Reviewed head: bab218bcf8188683d31a6062525a5a1874b00ea0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-scoped implementation with strong controlled proof; the only material uncertainty is the deliberately accepted cold-read operating cost under real traffic.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Current-head redacted screenshot proof directly shows the populated Bay card, and the linked controlled runtime evidence covers the Worker route, bounded cache behavior, fail-closed aggregate handling, and queue-status isolation; it is sufficient for the visible UI claim, not a production-performance claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Current-head redacted screenshot proof directly shows the populated Bay card, and the linked controlled runtime evidence covers the Worker route, bounded cache behavior, fail-closed aggregate handling, and queue-status isolation; it is sufficient for the visible UI claim, not a production-performance claim.
Evidence reviewed 6 items Bounded aggregate implementation: The PR helper permits only 6h, 24h, and 7d windows, produces 24 buckets, queries each source with a 10,001-row limit, and returns Unknown values rather than partial values when a source is capped, malformed, or unavailable.
Current telemetry source contract: Current main already owns the two retained telemetry tables and their (observed_at, event_id) indexes; the PR reads those existing aggregate-safe sources rather than adding a new persistence model.
Failure isolation: The PR changes status attachment to fetch queue status and optional aggregate telemetry independently with Promise.allSettled, preserving queue status when the aggregate cannot be read.
Findings None None.
Security None None.

How this fits together

Lifecycle telemetry records direct and batch durable-publication outcomes in Durable Object SQL tables. The dashboard worker reads a bounded aggregate from those tables and attaches it to the public status data consumed by the dashboard surfaces.

flowchart LR
  A[Direct durable outcomes] --> C[Bounded telemetry aggregation]
  B[Batch durable outcomes] --> C
  C --> D[Public status endpoint]
  D --> E[Dashboard overview data]
  D --> F[OpenClaw Bay card]
  C --> G[Unknown on invalid or capped source]
Loading

Before merge

  • Resolve merge risk (P1) - A cold public status request can synchronously scan up to 10,001 rows from each of two retained telemetry tables. The cap fails closed and the PR proves controlled behavior, but it does not establish latency or cost under production telemetry rates.
  • Complete next step (P2) - No narrow repair is indicated; this PR needs ordinary maintainer landing review with awareness of the documented bounded cold-read tradeoff.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 12 files affected; 1,658 added and 26 removed Most added volume is focused runtime-proof material, while the product change spans the queue, worker, dashboard rendering, and focused tests.
Bounded source reads 2 retained sources × 10,001 rows maximum per cold window This is the main merge-relevant availability tradeoff not settled by unit tests or the controlled UI proof.
Public response shape 3 windows with 24 fixed buckets each The fixed response contract limits public telemetry exposure and keeps Overview/Bay rendering predictable.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #898
Summary: This PR is the explicitly sponsored Workstream 4 implementation candidate for the shared telemetry portion of the broader active roadmap; the roadmap retains several independent workstreams.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the bounded cold-read contract (recommended)
    Land the sponsored fail-closed design, acknowledging that capped or slow source reads degrade only the optional aggregate and not core queue status.
  2. Pause for a rollup design
    Keep this PR unmerged if maintainers require a measured production latency/cost target or a materialized aggregate before exposing the endpoint publicly.

Technical review

Best possible solution:

Land the sponsored aggregate-only telemetry contract with its fail-closed source caps and 60-second cache, while keeping any future materialized rollup or throughput work separate and driven by observed operating data.

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

Not applicable as a new feature PR. The changed visible behavior is nevertheless demonstrated by a downloaded current-head screenshot and a controlled runtime transcript for the Worker route and Bay rendering.

Is this the best way to solve the issue?

Yes. The implementation reuses the existing retained lifecycle telemetry tables, keeps output aggregate-only, and isolates an unavailable aggregate from core queue status; the sponsored roadmap explicitly scopes out a persistent rollup for this slice.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 822424ecf899.

Labels

Label justifications:

  • P2: This is a sponsored dashboard telemetry improvement with bounded operational impact rather than an urgent regression or release blocker.
  • merge-risk: 🚨 availability: A cache miss performs two capped Durable Object SQL scans, so production latency and cost remain a merge-relevant operational consideration.
  • 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 (screenshot): Current-head redacted screenshot proof directly shows the populated Bay card, and the linked controlled runtime evidence covers the Worker route, bounded cache behavior, fail-closed aggregate handling, and queue-status isolation; it is sufficient for the visible UI claim, not a production-performance claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. Current-head redacted screenshot proof directly shows the populated Bay card, and the linked controlled runtime evidence covers the Worker route, bounded cache behavior, fail-closed aggregate handling, and queue-status isolation; it is sufficient for the visible UI claim, not a production-performance claim.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Current-head redacted screenshot proof directly shows the populated Bay card, and the linked controlled runtime evidence covers the Worker route, bounded cache behavior, fail-closed aggregate handling, and queue-status isolation; it is sufficient for the visible UI claim, not a production-performance claim.

Evidence

What I checked:

  • Bounded aggregate implementation: The PR helper permits only 6h, 24h, and 7d windows, produces 24 buckets, queries each source with a 10,001-row limit, and returns Unknown values rather than partial values when a source is capped, malformed, or unavailable. (dashboard/recent-durable-publication-events.ts:22, bab218bcf818)
  • Current telemetry source contract: Current main already owns the two retained telemetry tables and their (observed_at, event_id) indexes; the PR reads those existing aggregate-safe sources rather than adding a new persistence model. (dashboard/exact-review-lifecycle-telemetry.ts:104, a80c24ebf2f1)
  • Failure isolation: The PR changes status attachment to fetch queue status and optional aggregate telemetry independently with Promise.allSettled, preserving queue status when the aggregate cannot be read. (dashboard/worker.ts:2642, bab218bcf818)
  • Real UI proof inspected: The downloaded current-head proof image visibly shows the populated OpenClaw Bay “Recent durable events” card with a complete 24-hour aggregate and redacted synthetic data. (docs/proof/csw-092/01a-mini-control-board.jpg, bab218bcf818)
  • Feature-history provenance: Lifecycle telemetry was introduced by the current-main feature commit, while the adjacent dashboard/status history has active ownership; the proposed branch builds on that recently introduced surface rather than duplicating an existing endpoint. (dashboard/exact-review-lifecycle-telemetry.ts:9, a80c24ebf2f1)
  • Current-main and release check: The PR head is not an ancestor of current main, so this is not implemented work eligible for cleanup closure; the inspected latest release tag is v0.3.0 at dc82491. (bab218bcf818)

Likely related people:

  • Martin Cleary: Introduced the retained lifecycle telemetry tables and their indexed time-ordering contract in the current main feature history. (role: telemetry feature introducer; confidence: high; commits: a80c24ebf2f1, b07ab751813c; files: dashboard/exact-review-lifecycle-telemetry.ts, dashboard/worker.ts)
  • Peter Steinberger: Recent history shows substantial contribution to the dashboard and worker status surfaces adjacent to the new public aggregate attachment. (role: recent dashboard/status contributor; confidence: medium; commits: 1889fd334cb8, 6ac2cce7f3c7; files: dashboard/worker.ts, dashboard/bay-page.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • If operating traffic may approach the source cap, add a redacted cold-read latency/cost measurement before merge to reduce the availability uncertainty.

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 (4 earlier review cycles)
  • reviewed 2026-08-01T07:29:04.576Z sha 5ce5e29 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T07:44:49.203Z sha 97ebf8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T08:04:42.854Z sha ef3b016 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T08:11:06.292Z sha 60e51c0 :: needs maintainer review before merge. :: none

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 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 repository_dispatch).
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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@brokemac79
brokemac79 force-pushed the codex/csw-092-shared-telemetry branch from 25bd8ce to ef3b016 Compare August 1, 2026 08:00
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 1, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 1, 2026 08:21
@brokemac79
brokemac79 merged commit b347894 into main Aug 1, 2026
11 of 13 checks passed
@brokemac79
brokemac79 deleted the codex/csw-092-shared-telemetry branch August 1, 2026 08:22
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* feat(dashboard): add bounded publication event trends

* test(dashboard): cover durable event card in Bay proof

* docs(proof): add CSW-092 runtime evidence

* perf(dashboard): bound durable event aggregate reads

* docs(proof): record populated CSW-092 runtime evidence

* test(proof): isolate durable event aggregate failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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