Skip to content

fix(dashboard): link apply health cards to source runs - #481

Merged
brokemac79 merged 4 commits into
mainfrom
codex/fix-apply-health-link
Jul 10, 2026
Merged

brokemac79 merged 4 commits into
mainfrom
codex/fix-apply-health-link

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep every apply-health dashboard alert linked to the workflow run that generated that health snapshot.
  • Preserve the mutable top-level status link only as a fallback for older snapshots.
  • Prevent later review/status writes from replacing a retained apply-health source link.

Problem

The dashboard retained an apply-health warning while later review/status writes replaced the top-level run_url. The "Pruning sweep blocked" card therefore opened a later, unrelated review run. In the captured production case it linked to run 29091926566, a successful hot-review run whose apply job was skipped.

Before fix: dashboard alert pointing at an unrelated workflow run

After-fix behavior proof

The redacted local dashboard below is generated by dashboard/worker.ts from the captured production status shape: the apply warning originated in run 29091427650, while a later status write pointed at run 29091585991. No live state, workflow, or deployment was changed to create this proof.

After fix: generated dashboard card

Browser verification from that generated card:

element: link "open run"
href: https://github.com/openclaw/clawsweeper/actions/runs/29091427650
click result: https://github.com/openclaw/clawsweeper/actions/runs/29091427650
later root status URL: https://github.com/openclaw/clawsweeper/actions/runs/29091585991

This demonstrates both the rendered link target and successful navigation to the originating apply run, rather than the later status run.

Implementation

  • Stamp run_url into a fresh apply-health snapshot.
  • Read the nested immutable health URL before the mutable root status URL.
  • Retain an existing health object unchanged during non-apply status updates; only a fresh health payload gets the current run URL.
  • Add reader precedence and writer-preservation coverage in focused dashboard and sweep-status test files.

Validation

  • pnpm run build:all
  • node --test test/sweep-status.test.ts test/dashboard-worker.test.ts (64 passing)
  • pnpm run lint:src
  • pnpm run lint:dashboard
  • pnpm exec oxfmt --check src/clawsweeper.ts test/clawsweeper.test.ts test/sweep-status.test.ts dashboard/worker.ts test/dashboard-worker.test.ts
  • git diff --check

Review closeout

  • codex review --uncommitted: clean; no actionable findings.
  • codex review --base origin/main: clean; no actionable findings.

The branch review also attempted the broad unit suite. Its workflow-helper cases are blocked on this Windows host because bash resolves through WSL, whose default docker-desktop distribution has no /bin/bash; the focused changed-surface proof above passed.

Risks and rollout

New snapshots gain a nested source URL. Existing snapshots continue using the top-level URL fallback, so the change is backward compatible. It affects dashboard observability only; sweep, comment, label, and close behavior are unchanged.

Links

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 11:32 AM ET / 15:32 UTC.

Summary
The PR stores the source workflow URL on fresh apply-health snapshots, preserves retained snapshots across later status writes, makes dashboard cards prefer the nested URL with a legacy fallback, and adds focused regression tests and proof.

Reproducibility: yes. at the source and captured-state level. Current main clearly permits retained health data to coexist with a later root run URL, and the production screenshot corroborates the affected dashboard surface.

Review metrics: 3 noteworthy metrics.

  • Review blockers: 2 resolved, 0 remaining. The contributor added direct navigation proof and moved the new status coverage into the focused test file requested previously.
  • Compatibility path: 1 nested URL added, 1 legacy fallback retained. New health snapshots gain stable provenance without making older persisted status snapshots unreadable.
  • Patch scope: 74 additions, 21 deletions across 7 files. The production change is localized to one writer and one reader, with the remaining surface consisting of focused tests and proof assets.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The branch base predates several current-main commits touching the same large files; GitHub reports it mergeable, but required checks should validate the exact three-way merge result before landing.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the snapshot-scoped provenance fix after required checks complete, retaining the nested URL, legacy fallback, focused regression coverage, and supplied browser proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair or product decision remains; this PR should proceed through normal maintainer merge handling once required checks complete.

Security
Cleared: The patch introduces no dependency, workflow, permission, secret, publishing, downloaded-code, or third-party execution changes.

Review details

Best possible solution:

Merge the snapshot-scoped provenance fix after required checks complete, retaining the nested URL, legacy fallback, focused regression coverage, and supplied browser proof.

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

Yes at the source and captured-state level. Current main clearly permits retained health data to coexist with a later root run URL, and the production screenshot corroborates the affected dashboard surface.

Is this the best way to solve the issue?

Yes. Binding provenance to the snapshot that owns the warning, while retaining the root URL only as a legacy fallback, is the narrowest backward-compatible correction.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR provides a real generated dashboard view and copied browser output showing the card href and successful navigation to the originating apply run rather than the later root status run.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides a real generated dashboard view and copied browser output showing the card href and successful navigation to the originating apply run rather than the later root status run.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: This fixes a misleading operational dashboard link with limited blast radius and no change to sweep or apply execution.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides a real generated dashboard view and copied browser output showing the card href and successful navigation to the originating apply run rather than the later root status run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides a real generated dashboard view and copied browser output showing the card href and successful navigation to the originating apply run rather than the later root status run.
Evidence reviewed

What I checked:

  • Current-main bug path: Current main retains an earlier apply-health snapshot while later writes replace the root run_url, and the dashboard reader uses that mutable root URL for the retained warning. (src/clawsweeper.ts:2086, 7ee8bb2b00c0)
  • Snapshot-scoped writer fix: The latest head stamps run_url only onto a newly supplied health payload; omitted payloads preserve the prior object unchanged and explicit null continues to clear it. (src/clawsweeper.ts:2040, 7b5f9577985c)
  • Backward-compatible reader fix: The dashboard reads health.run_url first while retaining status.run_url as the fallback for snapshots written before this field existed. (dashboard/worker.ts:4297, 7b5f9577985c)
  • Focused regression coverage: Tests cover preserving retained provenance, stamping fresh health payloads, reader precedence, and existing clearing behavior in focused status and dashboard test files. (test/sweep-status.test.ts:6, 7b5f9577985c)
  • Previous finding resolved: Commit 7b5f957 moves the writer regression out of the broad test/clawsweeper.test.ts suite into the focused test/sweep-status.test.ts file. (test/sweep-status.test.ts:1, 7b5f9577985c)
  • Real browser proof: The PR body reports the rendered open-run link href and successful click destination as workflow run 29091427650, while separately identifying 29091585991 as the later root status URL; the inspected image shows the generated card and control. (docs/proof/dashboard-apply-health-run-link/after-fix-local-dashboard.png, 7b5f9577985c)

Likely related people:

  • brokemac79: Prior merged commit 373716b introduced the retained close-apply-health status and dashboard paths central to this bug, independently of authoring this PR. (role: introduced behavior; confidence: high; commits: 373716be22af; files: src/clawsweeper.ts, dashboard/worker.ts, test/dashboard-worker.test.ts)
  • Peter Steinberger: Authored the newest current-main changes across the central status writer and dashboard worker paths, including current main commit 7ee8bb2. (role: recent area contributor; confidence: high; commits: 7ee8bb2b00c0, 6389c876f488, 493d27f0ccdb; files: src/clawsweeper.ts, dashboard/worker.ts, test/dashboard-worker.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-10T12:55:19.419Z sha 88b1d5d :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-07-10T14:52:25.831Z sha 00e80a1 :: needs real behavior proof before merge. :: [P3] Move the writer regression into a focused test file

@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 Jul 10, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 10, 2026
@brokemac79
brokemac79 merged commit ff160f0 into main Jul 10, 2026
13 checks passed
@brokemac79
brokemac79 deleted the codex/fix-apply-health-link branch July 10, 2026 15:58
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* fix(dashboard): retain apply health source run

* docs: add dashboard apply health proof

* fix: preserve apply health source run

* test: isolate sweep status coverage
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: 🦞 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant