Skip to content

fix(doctor): inspect packaged and full protocol UI freshness - #117003

Merged
steipete merged 1 commit into
mainfrom
codex/wave3-doctor-ui-freshness
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/wave3-doctor-ui-freshness

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw doctor silently missed missing bundled Control UI assets in published installations because it first required Gateway protocol source files that published packages intentionally exclude. Source checkouts also missed stale built assets whenever a nested protocol schema or package entrypoint changed without touching the single schema.ts barrel.

Why This Change Was Made

  • Detect missing UI assets before consulting source-only package files.
  • Provide packaged installations an actionable reinstall hint instead of an unavailable pnpm ui:build instruction.
  • Delete the obsolete single-file mtime assumption and inspect Git history for the entire canonical packages/gateway-protocol/src owner.
  • Preserve the healthy packaged fast path and existing no-history/no-false-warning behavior.

User Impact

Two independent read-only diagnostics become truthful: broken published Control UI installations are reported with a recovery action, and source-built UI assets are flagged when any consumed Gateway protocol source changed after they were built. Healthy packages remain quiet and no assets, protocol, configuration, or persisted state are modified.

Evidence

  • Frozen base: 36b80ada3ceae2de21b3d8710b883d778e4c4578; immutable clean candidate: f2ec9d10ffa9364ee3a2fffa279681d9271706f0.
  • Exact owner proof: 11/11 tests passed.
PATH=/Users/steipete/.local/bin:/usr/local/bin:$PATH node scripts/run-vitest.mjs src/commands/doctor-ui.test.ts
  • Real production owner fixtures demonstrate before/after packaged missing assets, actionable recovery, nested schema changes, and protocol entrypoint changes.
  • A temporary real Git repository commits a nested protocol file and validates the actual production complete-package history pathspec; developer signing is explicitly disabled only for that fixture.
  • Genuine final full-branch Codex Sol/high P3 review: zero findings, confidence 0.94, real TruffleHog clean.
  • Independent lane coordinator repeated the exact packaged fixture and real Git nested-schema production proof.
  • Production delta is exactly neutral: 10 added / 10 deleted; focused regression tests add 122 lines.

Explicit Exclusions

No generated UI asset changes, protocol/schema modifications, config or public CLI contracts, authentication/security changes, persistence/SQLite, plugin SDK, dependency changes, or service lifecycle mutation.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Jul 31, 2026
@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 backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 3:13 PM ET / 19:13 UTC.

ClawSweeper review

What this changes

The PR makes the Control UI freshness diagnostic detect missing packaged assets without source-only protocol files and checks the whole Gateway protocol source directory for source-build staleness.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this draft PR open for a focused correction: it newly detects missing packaged Control UI assets, but the legacy openclaw doctor path still prints the unavailable pnpm ui:build instruction before skipping the build. The protected maintainer label also requires human handling; likely related people are Peter Steinberger (steipete, high confidence) and Gio Della-Libera (medium confidence).

Priority: P2
Reviewed head: f2ec9d10ffa9364ee3a2fffa279681d9271706f0

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and has relevant fixture coverage, but it misses one live doctor output path and has no after-fix packaged-command proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused fixture tests, including a temporary Git repository, but it does not provide an after-fix openclaw doctor transcript from a packaged missing-assets setup; add redacted terminal output that shows the actual recovery text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused fixture tests, including a temporary Git repository, but it does not provide an after-fix openclaw doctor transcript from a packaged missing-assets setup; add redacted terminal output that shows the actual recovery text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Legacy doctor path remains active: The interactive doctor flow dynamically imports and invokes maybeRepairUiProtocolFreshness, so recovery wording in that function remains user-visible alongside the structured health check.
Packaged recovery output is still incorrect: For every missing-assets issue, maybeRepairUiProtocolFreshness emits formatUiProtocolFreshnessIssue before checking canBuild; that formatter unconditionally says Run: pnpm ui:build, while the following branch only then says sources are absent. This contradicts the PR's packaged-install recovery goal.
Changed detection newly reaches the bad path: The supplied PR patch removes the source-schema prerequisite and returns a missing-assets issue with canBuild: false for a packaged installation, which makes the existing legacy formatter reachable for the stated scenario.
Findings 1 actionable finding [P2] Correct the legacy packaged-install recovery message
Security None None.

How this fits together

openclaw doctor runs both a structured health-check flow and a legacy interactive diagnostic flow for Control UI assets. Both consume the same freshness detection result, then either offer a source build or report what a packaged installation operator should do next.

flowchart LR
  A[OpenClaw installation] --> B[Doctor UI freshness detection]
  B --> C{Control UI assets present?}
  C -->|No| D[Missing-assets issue]
  C -->|Yes| E[Protocol source history check]
  D --> F[Structured health finding]
  D --> G[Legacy interactive doctor output]
  E --> F
  F --> H[Operator recovery guidance]
  G --> H
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused fixture tests, including a temporary Git repository, but it does not provide an after-fix openclaw doctor transcript from a packaged missing-assets setup; add redacted terminal output that shows the actual recovery text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Correct the legacy packaged-install recovery message (P2) - The new canBuild: false branch now reports missing packaged assets, but maybeRepairUiProtocolFreshness first emits the existing formatter, which still tells the operator to run pnpm ui:build; it only then says ui/ sources are absent. Make the formatter conditional on canBuild (or route both paths through one recovery message) and cover the legacy output, so published installs receive the promised reinstall guidance.
  • Resolve merge risk (P1) - A published installation with missing UI assets can still be told to run pnpm ui:build, then be told that UI sources are absent; the intended reinstall recovery is therefore not consistent across doctor entry paths.
  • Resolve merge risk (P1) - The PR is draft and carries the protected maintainer label, so it needs explicit human review rather than automated cleanup or repair dispatch.
  • Complete next step (P2) - The PR has a concrete repair but is draft and protected by the maintainer label, so the next action is human review of the finding and proof rather than automated repair dispatch.

Findings

  • [P2] Correct the legacy packaged-install recovery message — src/commands/doctor-ui.ts:66
Agent review details

Security

None.

PR surface

Source 0, Tests +122. Total +122 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 10 0
Tests 1 122 0 +122
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 132 10 +122

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-ui.test.ts, migration/backfill/repair: src/commands/doctor-ui.ts, unknown-data-model-change: src/commands/doctor-ui.test.ts, unknown-data-model-change: src/commands/doctor-ui.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Make missing-assets wording conditional on canBuild at the shared formatter/legacy-output boundary, then add a regression that exercises the packaged missing-assets doctor output and proves it gives only the reinstall recovery path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Make missing-assets wording conditional on canBuild at the shared formatter/legacy-output boundary, then add a regression that exercises the packaged missing-assets doctor output and proves it gives only the reinstall recovery path.

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

Yes—source tracing provides a high-confidence path: a packaged root without ui/ produces missing-assets with canBuild: false, then the legacy doctor flow prints the unconditional build command before skipping the unavailable build.

Is this the best way to solve the issue?

No—the detection change is appropriate, but it is incomplete because the existing legacy output path still owns part of the operator-facing recovery message. A shared conditional formatter is the narrowest maintainable repair.

Full review comments:

  • [P2] Correct the legacy packaged-install recovery message — src/commands/doctor-ui.ts:66
    The new canBuild: false branch now reports missing packaged assets, but maybeRepairUiProtocolFreshness first emits the existing formatter, which still tells the operator to run pnpm ui:build; it only then says ui/ sources are absent. Make the formatter conditional on canBuild (or route both paths through one recovery message) and cover the legacy output, so published installs receive the promised reinstall guidance.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The PR repairs a bounded but user-visible packaged-install diagnostic path; the remaining defect gives incorrect recovery guidance rather than causing data loss or an outage.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused fixture tests, including a temporary Git repository, but it does not provide an after-fix openclaw doctor transcript from a packaged missing-assets setup; add redacted terminal output that shows the actual recovery text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: The PR repairs a bounded but user-visible packaged-install diagnostic path; the remaining defect gives incorrect recovery guidance rather than causing data loss or an outage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused fixture tests, including a temporary Git repository, but it does not provide an after-fix openclaw doctor transcript from a packaged missing-assets setup; add redacted terminal output that shows the actual recovery text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Legacy doctor path remains active: The interactive doctor flow dynamically imports and invokes maybeRepairUiProtocolFreshness, so recovery wording in that function remains user-visible alongside the structured health check. (src/flows/doctor-health.ts:47, 652a47e6449d)
  • Packaged recovery output is still incorrect: For every missing-assets issue, maybeRepairUiProtocolFreshness emits formatUiProtocolFreshnessIssue before checking canBuild; that formatter unconditionally says Run: pnpm ui:build, while the following branch only then says sources are absent. This contradicts the PR's packaged-install recovery goal. (src/commands/doctor-ui.ts:157, 652a47e6449d)
  • Changed detection newly reaches the bad path: The supplied PR patch removes the source-schema prerequisite and returns a missing-assets issue with canBuild: false for a packaged installation, which makes the existing legacy formatter reachable for the stated scenario. (src/commands/doctor-ui.ts:66, f2ec9d10ffa9)
  • Structured path alone is not the whole operator experience: The core health check maps the same detection result through uiProtocolFreshnessIssueToHealthFinding, but that does not replace the earlier legacy doctor call. (src/flows/doctor-core-checks.ts:1214, 652a47e6449d)
  • Feature-history routing: The UI freshness health surface was introduced by Gio Della-Libera in commit 2d3fa4832f410d87bb6ecf70822fffcaf159e9c2; Peter Steinberger has repeatedly refactored and maintained doctor-ui.ts, including the current PR. (src/commands/doctor-ui.ts:31, 2d3fa4832f41)

Likely related people:

  • steipete: Peter Steinberger has the deepest visible history on doctor-ui.ts and authored this focused repair PR. (role: recent area contributor; confidence: high; commits: f2ec9d10ffa9, 96522b9fcea1, bfdbaa5ab611; files: src/commands/doctor-ui.ts, src/commands/doctor-ui.test.ts)
  • Gio Della-Libera: Gio introduced the structured UI freshness health findings that share this detection result. (role: feature introducer; confidence: medium; commits: 2d3fa4832f41; files: src/commands/doctor-ui.ts, src/flows/doctor-core-checks.ts)

Rank-up moves

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

  • Update the legacy missing-assets formatter so canBuild: false presents reinstall guidance rather than a source-build command.
  • Add a regression covering the interactive doctor output for missing packaged assets.
  • Post a redacted terminal transcript of openclaw doctor against the packaged missing-assets scenario; updating the PR body should trigger a fresh ClawSweeper review.

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.

@steipete
steipete marked this pull request as ready for review July 31, 2026 19:26
@steipete
steipete merged commit 9e626c3 into main Jul 31, 2026
188 of 195 checks passed
@steipete
steipete deleted the codex/wave3-doctor-ui-freshness branch July 31, 2026 19:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant