Skip to content

fix(update): defer database diagnostics until gateway readiness - #184527

Merged
vincentkoc merged 2 commits into
mainfrom
fix/doctor-database-engine-update-inspection-20261026
Oct 26, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/doctor-database-engine-update-inspection-20261026

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Updates run advisory database-engine diagnostics while the Gateway is stopped, even when the updater owns a post-readiness lint pass. Large stores can make that avoidable downtime expensive.

User Impact

The owned update flow runs these diagnostics after verified Gateway readiness and retains their findings in the update report. Ordinary Doctor still runs them; callers without the owned receipt retain existing inspection-budget behavior.

Why This Change Was Made

The diagnostic contribution was missing its inspection classification. Its normal and lint paths already use the same read-only finding collector, so the existing scheduler and selector receipt can carry it after restart. Required migrations, integrity checks, and readiness checks stay under their current owners. Production change: one metadata line; no new scheduler or cache.

Evidence

  • Extended the actual contribution scheduling tests for owned receipts, missing receipts/markers, copied-state rehearsal, and ordinary Doctor. Applied the review suggestion to remove the redundant manually seeded subprocess case; existing generic post-activation runner coverage remains.
  • Independent scoped review found no actionable P0–P2 issue. Pinned repository formatter and git diff --check passed.
  • Exact-head CI passed at 89c02954831c80cfbb78bd79db40930a260955d5: 35 successful jobs, 29 skipped, no failures. The actual contribution-budget suite passed 11/11 tests. Existing generic post-activation coverage also passed on the preceding head; its implementation is unchanged.
  • Local runtime tests, types, lint, line-cap, and red-on-base execution were not run: the code-only checkout has no qualified dependencies, and Testbox bootstrap refused stale tooling before allocation. Hosted proof supplies the runtime result.
  • The required published-driver-to-candidate compatibility cell failed for legacy-operator-state: baseline [email protected], release commit 157d8c2bc3ea2fa183afdc11088e69690bf8e64e, candidate 89c02954831c80cfbb78bd79db40930a260955d5. Candidate Doctor passed in 75.262 seconds; candidate lint failed in 11.582 seconds on core/doctor/heartbeat-cadence-migration / heartbeat-retirement-inspection because default cron partition selection was unresolved. This was a product-check failure, not a timeout. The earlier dispatch stopped before testing on a workflow-identity mismatch.
  • Source attribution found a separate cron provenance gap: the published updater relocates the copied state and invokes candidate code, but its snapshot input omits the original state/config environment selectors. The later v34 cron migration derives its selector from the private root. A physical source root alone does not establish the original selector for supported config-only overrides. The retained receipt confirms the warning already occurred during Doctor; exact partition counts and absent-versus-invalid binding status remain UNKNOWN because diagnostics were redacted/truncated. The fixture's unpinned job agent owner is a separate fact.
  • The frozen-base compatibility cell used the identical reviewed harness, published [email protected], legacy-operator-state, and candidate 881caa4fd1945dc1d642165eceaed282b5922123. Its terminal receipt reproduces the same primary failure: step 4/5 candidate-doctor-lint, exit 1, core/doctor/heartbeat-cadence-migration, doctor-failed, heartbeat-retirement-inspection, unresolved default cron selection. This is matching baseline failure evidence, not a successful upgrade. The touched scheduling owners do not change cron transport or migration.
  • Exact-head ClawSweeper review has no findings or remaining Before merge/Rank-up items.

Inherited Compatibility Failure / Follow-up

Preserve the pre-relocation cron selector through the updater/candidate snapshot owner, with explicit compatibility for older published drivers. Reuse authoritative selector facts; do not infer a binding from a physical path or partition count, change selection policy, write live state, or bump the schema. This requires separate contract work and is not included in this scheduling change. The matching frozen-base proof establishes that this failure is inherited and independent of this scheduling change. Maintainer landing assessment retains the failed upgrade result and uses green exact-head required CI; it does not waive cron selection policy or claim upgrade compatibility. No deployment, elapsed-time improvement, or live latency result is claimed.

Classify read-only database-engine diagnostics with the existing agent inspection policy so update Doctor records them for the owned post-readiness lint pass. Ordinary Doctor and missing-receipt callers retain existing admission behavior.

Validation: scoped autoreview P0-P2 clean; pinned formatter and diff checks passed. Focused tests and line-cap guard remain pending exact-head CI because local tooling dependencies are stale. Normal commit hook refused the formatter donor; separate pinned formatting proof completed before the scoped hook bypass.
@vincentkoc vincentkoc self-assigned this Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Oct 26, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 26, 2026 10:46
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Classifies database-engine diagnostics as inspections so the existing updater can defer them until Gateway readiness.

Example: An owned update records deferred Doctor checks before restarting the Gateway.

  • Before: Database-engine diagnostics run while the Gateway is stopped.
  • After: core/doctor/database-engine enters the deferred receipt and runs through target Doctor lint after readiness.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch is source-consistent and introduces no identified defect; required update behavior evidence is still incomplete.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updates run advisory database diagnostics while the Gateway is stopped even when the updater can finish them after readiness.
Reason: The maintainer-authored direction completes an existing product contract with the smallest production change.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes a current scheduling omission with a minimal production change; no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 89c02954831c80cfbb78bd79db40930a260955d5

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The required published-driver update with database inspection after readiness and preserved operator state remains pending, and no red-on-base/green-on-head scheduling run is supplied.
Agent review details

How this fits together

Doctor contributions supply work classifications and health checks to the scheduler, which executes required work or records selectors for the updater's post-readiness lint pass and report.

flowchart TD
 A[Update Doctor] --> B[Contribution scheduler]
 B --> C[Required repairs]
 B --> D[Deferred inspection receipt]
 C --> E[Gateway readiness]
 D --> F[Target Doctor lint]
 E --> F
 F --> G[Update report]
Loading

Technical review

Best possible solution:

Keep the one-line classification repair and its focused scheduling regression within the existing updater ownership.

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

Current-main source shows the unclassified contribution bypassing inspection deferral; this review ran no target code and establishes no measured downtime improvement.

Is this the best way to solve the issue?

The metadata repair uses the existing scheduler and shared finding collector, preserving repair and readiness owners without adding a parallel mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7b95dbd3fdfe.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests +9. Total +10 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 44 35 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 45 35 +10

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Optional database inspection adds avoidable work to the stopped update window, without evidence of an urgent outage or data-loss regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-26T11:01:50.511Z sha ce779b1 :: needs maintainer review before merge. :: none

Reviewed October 26, 2026, 7:21 AM ET / 11:21 UTC (Revision 2).

Remove the redundant manually seeded subprocess case identified during review. The real contribution scheduling regression and existing generic post-activation runner coverage remain.

Validation: pinned formatter and diff checks passed; this removes only the added test and restores the file to the frozen base. Normal hook refused the stale formatter donor; scoped bypass follows separate formatting proof. Exact-head CI and published-driver upgrade proof remain required.
@openclaw-barnacle openclaw-barnacle Bot removed the cli CLI command changes label Oct 26, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@vincentkoc
vincentkoc merged commit 2c9649d into main Oct 26, 2026
198 of 202 checks passed
@vincentkoc
vincentkoc deleted the fix/doctor-database-engine-update-inspection-20261026 branch October 26, 2026 13:55
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…claw#184527)

* fix(update): defer database diagnostics until gateway readiness

Classify read-only database-engine diagnostics with the existing agent inspection policy so update Doctor records them for the owned post-readiness lint pass. Ordinary Doctor and missing-receipt callers retain existing admission behavior.

Validation: scoped autoreview P0-P2 clean; pinned formatter and diff checks passed. Focused tests and line-cap guard remain pending exact-head CI because local tooling dependencies are stale. Normal commit hook refused the formatter donor; separate pinned formatting proof completed before the scoped hook bypass.

* test(update): keep database deferral proof at scheduling owner

Remove the redundant manually seeded subprocess case identified during review. The real contribution scheduling regression and existing generic post-activation runner coverage remain.

Validation: pinned formatter and diff checks passed; this removes only the added test and restores the file to the frozen base. Normal hook refused the stale formatter donor; scoped bypass follows separate formatting proof. Exact-head CI and published-driver upgrade proof remain required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

1 participant