Skip to content

Expose heartbeat template doctor lint findings#98400

Merged
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-heartbeat-template-lint-findings
Jul 3, 2026
Merged

Expose heartbeat template doctor lint findings#98400
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-heartbeat-template-lint-findings

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a default-disabled core/doctor/heartbeat-template structured health check for legacy HEARTBEAT.md documentation-template wrappers
  • reuse the existing heartbeat template analyzer so lint and legacy Doctor repair classify the same file shapes
  • keep actual replacement in the existing legacy doctor --fix path; this PR is lint-only and does not add a structured repair/dry-run hook
  • no config, plugin, SDK, persisted data, or repair-path contract changes

Public surface

  • Default doctor --lint is unchanged.
  • The check runs only with --only core/doctor/heartbeat-template or --all.

Real behavior proof

  • Source CLI with isolated OPENCLAW_CONFIG_PATH, OPENCLAW_STATE_DIR, and workspace containing a legacy fenced HEARTBEAT.md template:
    • doctor --lint --json ran broad default lint with heartbeat=0, proving default lint skips the new default-disabled check.
    • doctor --lint --json --only core/doctor/heartbeat-template ran one selected check, emitted one core/doctor/heartbeat-template warning with requirement: "legacy-template", and exited 1.

Validation after Omar fix

  • node scripts/run-vitest.mjs src/commands/doctor-heartbeat-template-repair.test.ts src/flows/doctor-health-contributions.test.ts (73 tests)
  • changed-file pnpm exec oxfmt --check
  • changed-file pnpm exec oxlint
  • node scripts/plugin-sdk-surface-report.mjs --check
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Jul 1, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 7:42 PM ET / 23:42 UTC.

Summary
The PR adds a default-disabled core/doctor/heartbeat-template Doctor lint check that maps existing legacy HEARTBEAT.md template analysis into structured findings and focused tests.

PR surface: Source +74, Tests +120. Total +194 across 4 files.

Reproducibility: not applicable. this is an additive Doctor lint surface rather than a bug report. The PR body and focused tests cover both the default skip path and explicit --only core/doctor/heartbeat-template warning path.

Review metrics: 1 noteworthy metric.

  • Doctor lint surface: 1 opt-in core check added. The stable check id is user-facing Doctor lint surface, while defaultEnabled: false keeps broad default lint behavior unchanged.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-heartbeat-template-repair.test.ts, migration/backfill/repair: src/commands/doctor-heartbeat-template-repair.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, unknown-data-model-change: src/commands/doctor-heartbeat-template-repair.test.ts, unknown-data-model-change: src/commands/doctor-heartbeat-template-repair.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Risk before merge

  • [P1] The protected maintainer label means this PR should stay on a human maintainer review path even though no code defect was found.

Maintainer options:

  1. Decide the mitigation before merge
    Land the lint-only opt-in check after maintainer review and exact-head checks, preserving the existing legacy doctor --fix path as the only repair owner.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] The protected maintainer label keeps this PR on the human maintainer path, and there is no narrow patch defect for ClawSweeper to repair.

Security
Cleared: Cleared: the diff touches local Doctor lint helper code and tests only, with no dependency, workflow, package, permission, secret, or download-path changes.

Review details

Best possible solution:

Land the lint-only opt-in check after maintainer review and exact-head checks, preserving the existing legacy doctor --fix path as the only repair owner.

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

Not applicable: this is an additive Doctor lint surface rather than a bug report. The PR body and focused tests cover both the default skip path and explicit --only core/doctor/heartbeat-template warning path.

Is this the best way to solve the issue?

Yes: reusing the existing heartbeat-template analyzer behind a default-disabled structured health check is the narrowest maintainable solution. The latest head keeps real mutation in the existing legacy doctor --fix contribution, avoiding the unreachable repair-preview path flagged in review.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a low-risk additive Doctor lint ergonomics change with focused coverage and no default behavior change.
  • 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 (live_output): Sufficient: the PR body includes after-change source CLI proof for default lint skip and explicit heartbeat-template warning behavior, plus focused validation commands.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the PR body includes after-change source CLI proof for default lint skip and explicit heartbeat-template warning behavior, plus focused validation commands.
Evidence reviewed

PR surface:

Source +74, Tests +120. Total +194 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 74 0 +74
Tests 2 120 0 +120
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 194 0 +194

What I checked:

Likely related people:

  • hxy91819: Merged PR fix(agents): separate heartbeat runtime template #85416 added doctor-heartbeat-template-repair.ts, its tests, and the heartbeat Doctor contribution this PR extends. (role: introduced current heartbeat repair behavior; confidence: high; commits: 75221e0550ec; files: src/commands/doctor-heartbeat-template-repair.ts, src/commands/doctor-heartbeat-template-repair.test.ts, src/flows/doctor-health-contributions.ts)
  • giodl73-repo: Merged PRs Keep core doctor health in contribution order #86627 and Doctor: expose workspace status findings #97358 established the ordered core Doctor health-check path and adjacent default-disabled lint exposure pattern. (role: recent Doctor lint/contribution area contributor; confidence: high; commits: e56fd1dc0466, 4ac5cf863673; files: src/flows/doctor-health-contributions.ts, src/flows/doctor-health-contributions.test.ts, src/commands/doctor-lint.ts)
  • omarshahine: Their review comment identified the unreachable structured repair-preview path, and the latest head changed to the lint-only shape in response. (role: recent reviewer; confidence: medium; files: src/flows/doctor-health-contributions.ts, src/commands/doctor-heartbeat-template-repair.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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 1, 2026
@giodl73-repo
giodl73-repo marked this pull request as ready for review July 1, 2026 16:33
@giodl73-repo
giodl73-repo force-pushed the doctor-heartbeat-template-lint-findings branch from 13df304 to 2e9f208 Compare July 2, 2026 00:30
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added dry-run repair effects to the current heartbeat-template PR instead of deferring them to a later follow-up. Pure legacy HEARTBEAT.md templates now preview a file replacement effect/diff; custom-content findings remain manual/skipped.

Head: 2e9f208071911fbd928474c6fca46a83a7658478

Validation: changed-file oxfmt/oxlint, focused heartbeat/contribution Vitest 73 tests, core tsgo, core-test tsgo, and git diff check.

@clawsweeper

clawsweeper Bot commented Jul 2, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 2, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-heartbeat-template-lint-findings branch from 2e9f208 to 8e49026 Compare July 2, 2026 17:25
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 2, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jul 2, 2026
@omarshahine

Copy link
Copy Markdown
Contributor

Codex review finding:

The structured repair preview added here is not reachable from any supported openclaw doctor path. createDoctorHealthContribution only uses runStructuredDoctorHealthContribution when no explicit run is supplied (src/flows/doctor-health-contributions.ts:144-151), but this contribution keeps run: runHeartbeatTemplateRepairHealth (src/flows/doctor-health-contributions.ts:1840-1862). That legacy runner calls maybeRepairHeartbeatTemplate, so the new repairHeartbeatTemplateHealthFindings() path is only exercised by focused tests, not by openclaw doctor --fix or normal Doctor execution. The generic structured repair pass also filters to extension checks (src/flows/doctor-health-contributions.ts:440-453, src/flows/health-check-registry.ts:29-40), and the CLI exposes --only only for --lint (src/cli/program/register.maintenance.ts:42-83), so there is no selected doctor fix --dry-run --only core/doctor/heartbeat-template surface to hit this hook.

Best fix: either wire this core check into the actual repair flow, for example via the default structured runner or an explicit runCoreContributionHealthRepair call, or keep the PR lint-only and remove the unreachable repair hook/tests/body claim.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed Omar's reachability finding by making this PR lint-only again.

What changed:

  • Removed the structured repair() hook from core/doctor/heartbeat-template because core structured repair selection is not currently reachable from the supported Doctor CLI.
  • Removed the unreachable dry-run helper/tests and kept the existing legacy runHeartbeatTemplateRepairHealth / maybeRepairHeartbeatTemplate path as the real doctor --fix owner.
  • The PR now only exposes default-disabled lint findings for heartbeat template readiness.

Validation:

  • node scripts/run-vitest.mjs src/commands/doctor-heartbeat-template-repair.test.ts src/flows/doctor-health-contributions.test.ts (73 tests)
  • changed-file oxfmt --check
  • changed-file oxlint
  • node scripts/plugin-sdk-surface-report.mjs --check
  • git diff --check

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 2, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review final lint-only wording/body synced after Omar fix

@giodl73-repo
giodl73-repo merged commit dce1b0a into openclaw:main Jul 3, 2026
109 of 111 checks passed
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Merged #98400 by head-pinned squash.

  • PR head: f76623016cace286895c53f6641cfab24603b5c6
  • Merge commit: dce1b0a87afb64cbc54b750f5dc2fb2ce6b34bbe
  • Scope: default-disabled core/doctor/heartbeat-template lint findings only; real replacement remains in legacy doctor --fix.

Validation before merge:

  • Hosted PR checks green.
  • node scripts/run-vitest.mjs src/commands/doctor-heartbeat-template-repair.test.ts src/flows/doctor-health-contributions.test.ts (73 passed)
  • changed-file pnpm exec oxfmt --check
  • changed-file pnpm exec oxlint
  • node scripts/plugin-sdk-surface-report.mjs --check
  • git diff --check

Maintainer wrapper note: WSL is currently failing to start on this machine (0x80072745), and Git Bash lacks wrapper dependencies (jq rg node gh), so I used the branch-protection-compatible head-pinned squash path after scoped local proof and green hosted checks.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
Expose default-disabled Doctor lint findings for legacy HEARTBEAT.md documentation-template wrappers.

- Reuses the existing heartbeat template analyzer for structured `HealthFinding` output.
- Keeps replacement/mutation in the existing legacy `doctor --fix` path; no structured dry-run repair hook in this PR.
- Default `doctor --lint` remains unchanged; explicit `--only core/doctor/heartbeat-template` and `--all` can select it.

Validation:
- Hosted PR checks green on head f766230.
- `node scripts/run-vitest.mjs src/commands/doctor-heartbeat-template-repair.test.ts src/flows/doctor-health-contributions.test.ts` (73 passed)
- changed-file `pnpm exec oxfmt --check`
- changed-file `pnpm exec oxlint`
- `node scripts/plugin-sdk-surface-report.mjs --check`
- `git diff --check`
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants