Skip to content

fix(dashboard): report fresh publication failures with retained Bay data - #1411

Merged
vincentkoc merged 1 commit into
mainfrom
fix/dashboard-health-fresh-queue
Sep 4, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/dashboard-health-fresh-queue

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Related: #1372

What Problem This Solves

Fixes an issue where operators viewing /api/status could see publication_health_unavailable even though the current queue probe reported critical publication health and open dead letters. This happened when the Bay correctly retained a prior complete public activity projection during an incomplete worker census.

Why This Change Was Made

Dashboard health now grades the fresh fulfilled queue sample from the current request. The existing Bay fallback and replacement logic remains unchanged, and rejected or unbound queue probes still summarize as unavailable.

The dashboard attachment path remains the architectural owner. No queue schema, public projection, dashboard health policy, docs, or Bay output changed.

User Impact

Operators now see current publication-critical and DLQ signals in dashboard health even when the public Bay activity projection must remain on its prior complete sample.

OpenClaw Bay Impact

OpenClaw Bay is unaffected. The controlled /api/status proof retains the prior Bay item set and activity counts exactly, while the public response continues to omit raw publication health and dead-letter internals.

Documentation Impact

No documentation update is needed. The existing observer-only Bay and status contracts are unchanged; this repair only corrects which already-collected queue sample feeds the existing health summary.

Evidence

  • Frozen base: 0bf6bf603a1237017e269387109ee0156201b89f
  • Current head: 83d7053f0c8978ecb61a0cc2a85c52a8a48d8f03
  • node --test test/dashboard-health.test.ts test/dashboard-worker-observability.test.ts test/dashboard-worker-status-privacy.test.ts: 65 passed
  • node scripts/check-dashboard-queue-boundary.ts: passed
  • node scripts/check-dashboard-strict.mjs: passed
  • ./node_modules/.bin/tsc -p tsconfig.dashboard.json: passed
  • git diff --check: passed
  • Independent uncommitted and committed-head Codex reviews: no actionable findings
  • Production delta: dashboard/worker.ts +4/-3
  • Test delta: test/dashboard-worker-observability.test.ts +134/-0

pnpm run check was not run locally because this Codex worktree uses the required shared node_modules symlink and pnpm attempted to reconcile the shared install against the frozen head. The focused commands above used the existing binaries directly without mutating that shared dependency tree; hosted CI remains the full gate.

Real Behavior Proof

Claim: /api/status reports current publication-critical and open-DLQ health while preserving a prior complete public Bay projection during an incomplete active-worker census.

Exercised surface: a disposable archive of exact head 83d7053f0c8978ecb61a0cc2a85c52a8a48d8f03 ran under real wrangler 4.107.0 dev --local, Miniflare 4.20260701.0, and workerd 2026-07-01. The run used the production signed /internal/exact-review/enqueue, public /api/exact-review-queue, and production /api/status routes with real StatusStore and ExactReviewQueue SQLite Durable Objects.

Scenario: a signed synthetic protocol-v2 publication was accepted with HTTP 202. With the Worker stopped, the unambiguous queue SQLite database was edited transactionally to contain one pending publication aged 25,201 seconds, with its retry still scheduled in the future, and one open dead letter. The prior stored public snapshot had bay.active_census_complete = false and a complete prior Bay activity projection.

Observed result:

  • Raw queue telemetry reported one pending publication, health = critical, reason = oldest_pending_over_6h, and dead_letters.open = 1.
  • Production /api/status retained the prior Bay activity and prior Bay item set exactly.
  • dashboard_health.reasons included publication_critical and publication_dlq_open, and excluded publication_health_unavailable.
  • The public response omitted raw publication health, raw dead-letter data, and all synthetic identifiers.
  • The harness hard-failed and counted outbound Worker fetches; the final outbound GitHub request count was 0.
  • Both Wrangler process groups stopped, the loopback port closed, temporary runtime/state was removed, and the source head/tree remained unchanged.

Scrubbed artifacts:

74b919b320a71ad331f759c53ff4765cb5fc24061adbb84feee75d79c2f3f27f  proof.json
ff3c20515b1967885818e4a98a2ceb6b44ce8627b61b50b93f604fefbc80f236  transcript.txt
cf41858dfb17d261095f2b6f4baf3dd7245330591ccf35f08aa4c53cdf2e8b8d  wrangler.log

Source archive SHA-256: c2cd79aecb617985b4276cc999759779ad3898e7c17a5c8d093cd758d8be9f31. Temporary harness entry SHA-256: 241bb37817d623549728262eeb0266fcb6dc6082762c2743a590b8a5f746d5fd.

Limits: controlled local workerd and SQLite Durable Objects with synthetic signed input and loopback-only token-gated proof hooks for status seeding and raw aggregate inspection. This does not claim deployed Cloudflare edge behavior.

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

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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 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, 4:38 AM ET / 08:38 UTC.

ClawSweeper review

What this changes

The dashboard grades publication health from fresh queue telemetry while preserving retained public Bay activity, with a regression test for that combination.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main still permits retained Bay data to mask fresh publication failures. No actionable patch defect was found, and the supplied production-path proof supports the change.

Priority: P2
Reviewed head: 83d7053f0c8978ecb61a0cc2a85c52a8a48d8f03

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable repair with focused regression coverage and relevant real-runtime evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured PR body records exact-head /api/status execution under local workerd with real SQLite Durable Objects: injected publication backlog and a dead letter produce both failure reasons while preserving Bay activity and redaction. This proves the changed attachment path within the stated local-runtime limits.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured PR body records exact-head /api/status execution under local workerd with real SQLite Durable Objects: injected publication backlog and a dead letter produce both failure reasons while preserving Bay activity and redaction. This proves the changed attachment path within the stated local-runtime limits.
Evidence reviewed 9 items Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md files or maintainer-notes directory were found. Applied the narrow-change, observer-only Bay, proof, and maintainer-authored keep-open guidance.
Verified introduced scope: The pinned base-to-head delta changes only dashboard/worker.ts and its observability test. Raw parent inspection matches the supplied original-head and test-merge parent records; current-main drift does not change these reviewed files.
Current main still needs the repair: Fetched main retains priorExactReviewQueue when the active census is incomplete, then passes that retained document into summarizeDashboardHealth. The retained public document omits publication health and dead-letter details, explaining the incorrect unavailable signal.
Findings None None.
Security None None.

How this fits together

The dashboard Worker combines queue telemetry and cached worker activity into operator status. It summarizes health internally and filters the result before returning public dashboard and Bay data.

flowchart TD
  A[Fresh queue telemetry] --> B[Dashboard attachment]
  C[Prior Bay snapshot] --> B
  D[Worker census completeness] --> B
  B --> E[Health from fresh telemetry]
  B --> F[Retained or current Bay activity]
  E --> G[Public status projection]
  F --> G
  G --> H[Dashboard and Bay]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +4/-3; tests +134/-0 One net production line separates telemetry selection from Bay retention, with focused regression coverage.

Technical review

Best possible solution:

Keep health grading tied to the current queue observation while retaining generation-consistent Bay activity behind the existing public filter.

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

Yes, from source: an incomplete worker census plus retained complete Bay activity replaces fresh queue telemetry with a public document lacking publication health. This review did not execute a failing current-main run.

Is this the best way to solve the issue?

Yes. Separating the summarizer's input repairs the existing attachment boundary without duplicating health policy or changing the Bay response contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs misleading operator health reporting without changing publication execution or queue ownership.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 captured PR body records exact-head /api/status execution under local workerd with real SQLite Durable Objects: injected publication backlog and a dead letter produce both failure reasons while preserving Bay activity and redaction. This proves the changed attachment path within the stated local-runtime limits.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body records exact-head /api/status execution under local workerd with real SQLite Durable Objects: injected publication backlog and a dead letter produce both failure reasons while preserving Bay activity and redaction. This proves the changed attachment path within the stated local-runtime limits.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md files or maintainer-notes directory were found. Applied the narrow-change, observer-only Bay, proof, and maintainer-authored keep-open guidance. (AGENTS.md:1, 83d7053f0c89)
  • Verified introduced scope: The pinned base-to-head delta changes only dashboard/worker.ts and its observability test. Raw parent inspection matches the supplied original-head and test-merge parent records; current-main drift does not change these reviewed files. (dashboard/worker.ts:7578, 83d7053f0c89)
  • Current main still needs the repair: Fetched main retains priorExactReviewQueue when the active census is incomplete, then passes that retained document into summarizeDashboardHealth. The retained public document omits publication health and dead-letter details, explaining the incorrect unavailable signal. (dashboard/worker.ts:7632, e0f3def169eb)
  • Existing health contract and privacy boundary: The health summarizer already maps critical publication status and open dead letters to fixed reasons, and treats null or rejected telemetry as unavailable. The patch changes its input without changing public projection, authorization, persistence schema, or queue side effects. (dashboard/dashboard-health.ts:15, 83d7053f0c89)
  • Focused regression coverage: The added test exercises /api/status with incomplete worker census, retained complete Bay activity, and fresh critical publication telemetry. It checks retained items/counts, both health reasons, and omission of raw publication internals; adjacent tests cover rejected and unbound probes. Tests were inspected, not executed during this read-only review. (test/dashboard-worker-observability.test.ts:2825, 83d7053f0c89)
  • Captured real behavior proof: The supplied body at sourceRevision d29caa2686df24a35128b43a622f5de9c783f7093f530f701f0bc57dec72acf2 records exact-head Wrangler/workerd execution with real SQLite Durable Objects, signed enqueue, an aged pending publication, and an open dead letter. It reports both expected health reasons, identical retained Bay activity/items, omitted private internals, and zero outbound GitHub requests. Artifact hashes are reported identities; artifact files were not independently inspected. (83d7053f0c89)

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)

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 (2 earlier review cycles)
  • reviewed 2026-09-04T07:53:56.939Z sha 83d7053 :: needs changes before merge. :: none
  • reviewed 2026-09-04T08:16:50.905Z sha 83d7053 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 4, 2026 08:32
@vincentkoc
vincentkoc merged commit a30f882 into main Sep 4, 2026
36 of 38 checks passed
@vincentkoc
vincentkoc deleted the fix/dashboard-health-fresh-queue branch September 4, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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