Skip to content

perf(update): defer optional lint during candidate validation - #155244

Merged
steipete merged 3 commits into
mainfrom
upd/candidate-lint-deferral
Sep 22, 2026
Merged

steipete merged 3 commits into
mainfrom
upd/candidate-lint-deferral

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Installed OpenClaw 2026.9.4 spends part of its fixed 300-second candidate-validation window on optional Doctor inspections that do not prove migration or Gateway readiness.

Related: #154381, #154674, #154114, #144858. Thanks @ZaneMc-AO and @agebreak0083 for the field reports and phase output.

User Impact

During private candidate validation, optional core inspections produce named warnings and commands to run after activation. Required checks still complete before the result is published; their errors and plugin errors remain gating. Standalone Doctor lint and explicit --only selections retain their scope.

This is the lint-deferral change only, based on main 14f8ec46c13366c23d7c22f15c44677fc9d950ef. It has no source dependency on the settlement repair in #155138 and is not stacked on that branch. It contains no settlement or generation-reuse implementation. No new options, dependencies, schemas, persisted operator-state shapes, retries or timeout increases.

Why This Change Was Made

Doctor identifies the selected optional checks before preparing runtime metadata. It avoids the model/tool metadata graph when its optional inspector is deferred, then records an update-inspection-deferred warning with the check ID and follow-up command. The guard uses the complete private-copy marker contract already set by the published updater. The installed parent's migration-rehearsal, lint, config, plugin and canary phase order stays unchanged.

The prior controlled comparison measured a 9.588-second median lint saving while holding generation reuse and settlement repair constant. The standalone comparison below isolates this three-file change: lint medians are 20.250 → 5.573 seconds, with disjoint ranges, and the median within-pair saving is 14.977 seconds. The total validating-ledger medians are 97.142 → 89.217 seconds, with overlapping ranges; these observations establish a lint saving, not a reproducible whole-update speedup.

Evidence

Three uninstrumented observations per variant on one Testbox and unchanged packages/fixture. Original AB pair retained, followed by BA then AB. Seconds: min / median / max.

Phase Main / full lint Lint deferral only Median saving (baseline − candidate)
Npm staging 8.300 / 8.708 / 12.146 8.646 / 9.615 / 9.753 -0.907
Migration rehearsal 27.340 / 33.879 / 41.190 31.238 / 37.781 / 45.601 -3.902
Doctor lint 17.603 / 20.250 / 23.268 5.273 / 5.573 / 11.099 14.677
Config validation 1.622 / 1.745 / 2.407 1.513 / 1.551 / 3.752 0.194
Plugin resolution 0.799 / 0.827 / 0.970 0.728 / 0.728 / 1.791 0.099
Migration continuation 0.730 / 0.833 / 0.904 0.763 / 0.796 / 1.408 0.037
Canary startup 14.482 / 15.657 / 15.733 14.574 / 15.096 / 23.860 0.561
Validating ledger 86.569 / 97.142 / 117.947 78.838 / 89.217 / 121.322 7.925
Post-install Doctor 19.212 / 19.957 / 24.147 24.941 / 26.265 / 32.037 -6.308
Pair Order Baseline lint Candidate lint Lint saved Baseline ledger Candidate ledger
1 baseline → candidate 17.603 11.099 6.504 86.569 121.322
2 candidate → baseline 20.250 5.273 14.977 97.142 89.217
3 baseline → candidate 23.268 5.573 17.695 117.947 78.838

Median within-pair lint saving: 14.977s. The original pair saved 6.504s but its non-lint phases also slowed; it was retained rather than replaced.

Cell Exit Update Validation Settlement fault
lint-baseline-1 0 ok completed False
lint-candidate-1 0 ok completed False
lint-baseline-2 0 ok completed False
lint-candidate-2 0 ok completed False
lint-baseline-3 0 ok completed False
lint-candidate-3 0 ok completed False

The validating ledger includes npm staging and is an upper bound on the combined validator interval. No measurements were discarded.

The first AB pair saved 6.504 seconds in lint while unrelated phases slowed. To examine that variance, the same lease, packages and fixture were retained for two prespecified pairs, BA then AB. Every observation is included above; no source changes, rebuilds or probes were introduced between cells.

All six hops passed using the genuine published [email protected] driver, each restoring identical synthetic state: ten agents/ten v19 databases, 365.8 MiB total and 338.7 MiB largest; seven real npm 2026.9.5 plugins, 477.5 MiB total, including the Codex native bundle. Source, schema and generation-absence guards bind each package to its variant. All 60 resulting agent databases reached v22 with integrity and foreign-key checks passing and transcript/trajectory bytes preserved. There were no settlement faults or surviving marked child processes. Original proof inputs, package hashes and the pristine fixture content manifest were unchanged at completion. No settlement patch is injected, and no update failure is retried away.

Command: openclaw update --tag <candidate.tgz> --yes --json --no-restart --timeout 1800. The published combined-validation clamp remains unchanged. State and canary ports are isolated; no inference or operator Gateway is used. The validating ledger includes npm staging and is a conservative upper bound on the validator interval.

The original-order Doctor process→budget replay passed 14 tests in two files, 34.03s wrapper wall / 31.99s Vitest wall; reported time was 70% transformation and 23% tests. The rehearsal case took 706ms. The longest case, preserving explicit selection, took 5.255s. No slow/flaky test was encountered.

The same rehearsal regression failed on unchanged main at the intended boundary: runtime metadata preparation occurred once, where a deferred inspector requires zero preparations. Its baseline case took 2.192s; the file took 27.77s wall, mostly transformation. The six unselected cases were filtered for this red proof; no test was disabled in source.

The per-check warnings and follow-up commands are verified at the CLI owner boundary. The published 2026.9.4 parent does not retain successful candidate-lint output in its compact result, so that result is not claimed as the warning-serialization proof.

The event-driven regression pauses a required check and verifies that no JSON result appears until it completes. Existing cases verify deferral reasons, skipped/opt-in selection, standalone lint, explicit selection, and required/plugin failures. It adds no timer, process fixture or production seam.

Full check:changed passed on the Testbox, including all 25 core-test type shards and the selected lint, formatting, documentation, schema, storage and auth guards. Commands: node scripts/run-vitest.mjs src/commands/doctor-lint-process.test.ts src/commands/doctor-lint.update-budget.test.ts in original order, followed by node scripts/check-changed.mjs --base 14f8ec46c13366c23d7c22f15c44677fc9d950ef -- docs/cli/update/how-updates-run.md src/commands/doctor-lint.ts src/commands/doctor-lint.update-budget.test.ts. The focused baseline regression produced the expected failure; all candidate gates exited 0.

Fresh P1 autoreview is scoped-clean with no actionable P0/P1 findings. Production +54/−14 (net +40); tests +233/−72 (net +161); docs +9. The seven existing test cases are retained and extended.

Lint-only head: 79d6acbc51bc696377c0021890940be39ba75951.

Blacksmith Testbox leases (both stopped after collection):

  • Paired hops: tbx_01m32y7c8edhgvzbftr4v1wh09 (run); initial pair and counterbalanced continuation both exited 0.
  • Tests/checks: tbx_01m32y7c8an9dxvcs41n9gnd8d (run); wrapper exit 0. Lease cleanup can mark the enclosing Actions job cancelled; the remote commands and collected receipts establish the results.

Hosted PR CI is attached to this exact head and in progress at handoff. The earlier draft event was skipped as expected. Hosted results and test timings are not yet claimed.

Ready-PR authoring endpoint only. No landing or auto-merge.

@clawsweeper

clawsweeper Bot commented Sep 21, 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 docs Improvements or additions to documentation commands Command implementations size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 22:30
@steipete
steipete enabled auto-merge (squash) September 21, 2026 22:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 21, 2026, 9:23 PM ET / September 22, 2026, 01:23 UTC (Revision 4).

ClawSweeper review

What this changes

Doctor, OpenClaw’s diagnostic CLI, defers optional inspections during private update validation, avoids their runtime metadata preparation, and reports follow-up commands.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful work absent from the pinned main branch. No blocking defect was found, and the supplied published-driver upgrade evidence resolves the previous compatibility-proof concern.

Priority: P2
Reviewed head: 05c89a6c49e94676bfc5f51e3f639cd44831275e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with strong comparative upgrade evidence and no blocking correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied Testbox observations exercise Doctor lint through the published 2026.9.4 updater against restored multi-agent state and real plugins, showing lower lint time and successful candidate upgrades with preserved data. The changed files match the proof revision; CLI regressions separately cover warning output and required-check completion.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Testbox observations exercise Doctor lint through the published 2026.9.4 updater against restored multi-agent state and real plugins, showing lower lint time and successful candidate upgrades with preserved data. The changed files match the proof revision; CLI regressions separately cover warning output and required-check completion.
Evidence reviewed 8 items Introduced behavior and current-main necessity: The pinned delta adds optional-check deferral before runtime metadata preparation. Main still prepares that metadata and runs those inspections; its existing budget-based whole-lint deferral does not implement this narrower optimization.
Bounded selection and preserved gates: Deferral requires the complete private-rehearsal marker contract, excludes explicit selections and post-core convergence, and uses existing inspection/standalone classifications. Required and plugin checks remain awaited before output; configuration and canary checks retain their existing owners.
Published-driver behavior proof: The supplied body at sourceRevision 7964dbdc4f987ffd282fe04a813b03d02d74775c00e9e9ce92f74b0bde80954d records six successful published 2026.9.4 updater runs across baseline/candidate variants, restoring ten v19 databases and seven real npm plugins per run. All 60 resulting databases reached v22 with integrity checks and transcript preservation. Lint medians fell from 20.250 to 5.573 seconds; overlapping total-update ranges do not establish a whole-update speedup. The old parent's compact result does not prove warning serialization, which is separately covered at the CLI boundary.
Findings None None.
Security None None.

How this fits together

The updater runs candidate Doctor checks against a private copy of existing state before activation. Doctor selects diagnostics and returns findings to the updater, alongside separate migration, configuration, plugin, and Gateway readiness checks.

flowchart TD
  A[Installed updater] --> B[Private candidate state]
  B --> C[Doctor lint selection]
  C --> D[Required and plugin checks]
  C --> E[Deferred optional inspections]
  D --> F[Readiness result]
  E --> G[Warnings and follow-up commands]
  F --> H[Remaining validation and activation]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +40, Tests +161, Docs +9. Total +210 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 54 14 +40
Tests 1 233 72 +161
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 296 86 +210

Review metrics

Metric Value Why it matters
Measured lint improvement 20.250 → 5.573 seconds median; 3 observations per variant The controlled published-driver comparison supports reduced lint cost without claiming a reproducible whole-update speedup.

Stored data model

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

Technical review

Best possible solution:

Keep optional diagnostics outside the candidate’s critical validation work while retaining mandatory gates and explicit commands to complete deferred inspections.

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

Yes for unnecessary lint work: pinned main prepares runtime metadata and runs optional inspections during candidate validation, and the supplied comparison measures that cost. The reporters’ complete timeout failures were not reproduced by this review.

Is this the best way to solve the issue?

Yes. Reusing the existing inspection classifications and private-copy marker contract avoids a competing policy owner, preserves standalone selection, and works with the already-published updater.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded update-validation optimization with measured benefit and preserved required checks.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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): The supplied Testbox observations exercise Doctor lint through the published 2026.9.4 updater against restored multi-agent state and real plugins, showing lower lint time and successful candidate upgrades with preserved data. The changed files match the proof revision; CLI regressions separately cover warning output and required-check completion.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Testbox observations exercise Doctor lint through the published 2026.9.4 updater against restored multi-agent state and real plugins, showing lower lint time and successful candidate upgrades with preserved data. The changed files match the proof revision; CLI regressions separately cover warning output and required-check completion.

Evidence

What I checked:

  • Introduced behavior and current-main necessity: The pinned delta adds optional-check deferral before runtime metadata preparation. Main still prepares that metadata and runs those inspections; its existing budget-based whole-lint deferral does not implement this narrower optimization. (src/commands/doctor-lint.ts:262, 05c89a6c49e9)
  • Bounded selection and preserved gates: Deferral requires the complete private-rehearsal marker contract, excludes explicit selections and post-core convergence, and uses existing inspection/standalone classifications. Required and plugin checks remain awaited before output; configuration and canary checks retain their existing owners. (src/commands/doctor-lint.ts:455, 05c89a6c49e9)
  • Published-driver behavior proof: The supplied body at sourceRevision 7964dbdc4f987ffd282fe04a813b03d02d74775c00e9e9ce92f74b0bde80954d records six successful published 2026.9.4 updater runs across baseline/candidate variants, restoring ten v19 databases and seven real npm plugins per run. All 60 resulting databases reached v22 with integrity checks and transcript preservation. Lint medians fell from 20.250 to 5.573 seconds; overlapping total-update ranges do not establish a whole-update speedup. The old parent's compact result does not prove warning serialization, which is separately covered at the CLI boundary. (79d6acbc51bc)
  • Proof continuity and previous review: The three reviewed files are unchanged from the lint-only proof revision. The previous review had no findings and requested upgrade compatibility confirmation; the existing published-driver cells supply that evidence. This delta changes neither schemas nor persisted state formats. (src/commands/doctor-lint.ts:262, 05c89a6c49e9)
  • Meaningful regression coverage: The seven cases cover fleet-budget admission, rehearsal deferral, standalone behavior, explicit selection, required failures, and plugin failures. An event-driven pause checks that required work completes before JSON publication. The body reports a baseline failure at runtime preparation, 14 passing owner/sibling tests, and passing changed-file checks; this read-only review did not execute tests. (src/commands/doctor-lint.update-budget.test.ts:169, 05c89a6c49e9)
  • Existing advisory policy and routing history: Main history contains prior Doctor advisory, budget, and cleanup work. GitHub commit metadata verifies steipete as the author of the existing advisory-classification change. Deeper local blame encountered unavailable historical objects, so no claim of original feature introduction is made. (src/commands/doctor-lint.ts:482, 1e48d0cff2e7)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (3 earlier review cycles)
  • reviewed 2026-09-21T22:42:41.204Z sha 79d6acb :: blocked before merge. :: none
  • reviewed 2026-09-21T23:11:24.994Z sha e7d226d :: blocked before merge. :: none
  • reviewed 2026-09-21T23:21:24.602Z sha e7d226d :: blocked before merge. :: none

steipete added a commit that referenced this pull request Sep 22, 2026
…155312)

Record cleanup phase failures through the test runner while preserving failed
SQLite custody and continuing independent cleanup. Keep the lease for the
existing process-death stale-lease sweep pending the retirement-fact decision.
Include the exact lease identity in the host-broker refusal without changing
cleanup authority or aggregation behavior.

Refs #155244, #154920.
@steipete
steipete merged commit 95d7123 into main Sep 22, 2026
180 checks passed
@steipete
steipete deleted the upd/candidate-lint-deferral branch September 22, 2026 01:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…penclaw#155312)

Record cleanup phase failures through the test runner while preserving failed
SQLite custody and continuing independent cleanup. Keep the lease for the
existing process-death stale-lease sweep pending the retirement-fact decision.
Include the exact lease identity in the host-broker refusal without changing
cleanup authority or aggregation behavior.

Refs openclaw#155244, openclaw#154920.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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