Skip to content

fix: let Doctor publish unchanged plugin migrations in any order - #200658

Merged
roboclaw-bot merged 3 commits into
mainfrom
roboclaw/ur-200606
Nov 17, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
roboclaw/ur-200606

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #200606
Related: #200645

What Problem This Solves

Doctor can block an update when unchanged pending plugin work appears in a different order from the migration ledger. Its refusal can also print changed=[] when an owner was added or removed beyond the displayed plugin ID prefix.

User Impact

Doctor can publish repairs when only plugin order or repair guidance differs. Actual changes to migration owners, protected paths, or migration requirements still block publication and preserve retained inputs. The candidate Doctor must contain this fix; no schema or update protocol changes are needed.

Why This Change Was Made

Compare obligations in plugin ID order using the existing input comparator, and include added/removed owners in the existing bounded diagnostic.

On the supplied main base, src/infra/deferred-plugin-migrations.contract.ts:23 compares ordered arrays, while src/infra/deferred-plugin-migrations.ts:209 only diagnoses matching owners. Discovery retains insertion order (src/commands/doctor-config-preflight-plugin-migrations.ts:137); ledger reads sort by ID (src/infra/deferred-plugin-migrations.ts:261 before this patch).

The Codex command/reason difference comes from Doctor rewriting package-repair guidance to confirmation guidance (src/commands/doctor-config-preflight-plugin-migrations.ts:433–446), using fixed text rather than per-call paths or timestamps. Main already excludes those fields through #190665; this preserves that fix.

Evidence

  • Original regressions against main base 57b9b9bc786796c07ab5b2489244521ca14d739f: 4 failed / 49 passed before the fix; all 53 passed afterward. These prove order-independent comparison and named membership differences while preserving protected-field refusals.
  • CI repair attribution: run 44113033237, checks-node-changed-3 failed because two session-archive consumer cases still expected changed=[]. The actual diagnostic correctly named changed=[fixture-plugin:added]. The named file reproduced the same failures locally. This was a PR-caused stale expectation, and this follow-up changes that assertion only.
  • Fresh named-file rerun: all 75 tests pass: src/commands/doctor-session-sqlite.deferred-plugin.test.ts (22 tests, 79.70 s), src/infra/deferred-plugin-migrations.test.ts (32 tests, 20.28 s), and src/config/io.deferred-plugin-migrations.test.ts (21 tests, 22.88 s). Total wrapper wall time: 125.62 s. The failed consumer reproduced as 2 failed / 20 passed before the assertion correction. Its original CI file duration was 115.33 s; new-head CI timing is pending. The existing consumer exercises real import, publication, retention, and retry paths, which accounts for its duration.
  • The transcript and legacy-store regressions record new requiresStateMigration: true work after archive publication and before unlink. Both still verify that original bytes remain with one link, pending work remains recorded, retries do not replay canonical sessions, and archival finishes after explicit resolution.
  • Exact CI-core typed oxlint/type-check, oxfmt, and git diff --check: pass on all five PR-touched TypeScript files and all six formatted files.
  • Delta autoreview against 0ba809cdbf0bf9bdc2bd06ff7656e63ce78e7d89: independent Codex P0–P2 review is scoped-clean, with no actionable findings. The original full-change review remains applicable to the unchanged production code.
  • pr-simplify: the repair changes one existing diagnostic expectation. The full PR retains the existing publication owner and adds 9 net production lines, 58 net test lines, and 6 documentation lines.

Limits: #200606 remains open for confirmation. Its report omits the fifth owner and complete records; this PR proves an ordering bug and diagnostic blind spot, not that the reported hidden difference was only ordering. The original macOS update and a full stable-to-candidate upgrade were not replayed, and genuine migration conflicts still refuse publication. Broad proof remains with PR CI under the production-host rules. #200645 remains Related: its separate heartbeat receipt can be printed after automation migration but before later config publication; this PR does not fix that misleading output.

Reported by @Fuma2013 and @kip-claw

Work sessions

Linked for team reference; these sessions aren’t public.

@clawsweeper

clawsweeper Bot commented Nov 17, 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 size: S labels Nov 17, 2026
@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR makes plugin migration comparisons independent of owner order and identifies added or removed owners in conflict diagnostics.

Example: Doctor expects unchanged obligations for codex and another-owner, while the ledger returns another-owner before codex.

  • Before: Config publication refuses with a migration conflict despite equivalent protected inputs.
  • After: Publication succeeds while retaining plugin settings and pending obligations.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The production repair is focused, but required runtime and upgrade evidence is absent and an affected consumer regression fails.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Doctor can refuse publication for equivalent pending work and provide no useful distinction when migration owners change.
Reason: The maintainer-authored direction repairs concrete source defects with little machinery, while the exact candidate incident remains unconfirmed.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this PR makes a useful, focused repair, but its diagnostic change breaks an existing archive-publication regression.

Priority: P2
Reviewed head: 0ba809cdbf0bf9bdc2bd06ff7656e63ce78e7d89

Before merge

  • Update the archive regression for the new added-owner diagnostic (P2) - When session archival starts with no obligations and another Doctor adds fixture-plugin before unlink, this hunk correctly changes the diagnostic to changed=[fixture-plugin:added], but src/commands/doctor-session-sqlite.deferred-plugin.test.ts:246 still requires changed=[]. Both parameterized cases fail in exact-head checks-node-changed-3. Update that assertion to the new diagnostic while retaining the source-preservation checks, then rerun the affected suite.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Update the archive regression for the new added-owner diagnostic — src/infra/deferred-plugin-migrations.ts:223-224

Tests

  • Missing end-to-end proof: The PR owner should provide redacted CLI output or logs showing reordered-obligation Doctor publication and genuine owner-change refusal, plus a latest-stable-to-candidate upgrade with settings and pending work intact; redact IPs, keys, phone numbers, and non-public endpoints.
Agent review details

How this fits together

Doctor supplies pending migration obligations to the shared publication boundary, which compares them with the SQLite ledger before allowing config or archive effects.

flowchart TD
  A[Doctor discovery] --> B[Expected obligations]
  C[SQLite migration ledger] --> D[Shared input comparison]
  B --> D
  D --> E[Publish config or archive]
  D --> F[Bounded conflict diagnostic]
Loading

Technical review

Best possible solution:

Keep the shared comparator and bounded diagnostic repair, update the affected archive assertion, and confirm the reported candidate failure before closing its issue.

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

Source and the supplied regression results establish order-sensitive publication and missing owner diagnostics, but do not identify the original incident's hidden obligation difference; no target code was executed during this review.

Is this the best way to solve the issue?

Sorting only comparison inputs and extending the existing formatter is the smallest complete repair for the demonstrated defects, preserving protected-field checks without adding state or another owner.

Full review comments:

  • [P2] Update the archive regression for the new added-owner diagnostic — src/infra/deferred-plugin-migrations.ts:223-224
    When session archival starts with no obligations and another Doctor adds fixture-plugin before unlink, this hunk correctly changes the diagnostic to changed=[fixture-plugin:added], but src/commands/doctor-session-sqlite.deferred-plugin.test.ts:246 still requires changed=[]. Both parameterized cases fail in exact-head checks-node-changed-3. Update that assertion to the new diagnostic while retaining the source-preservation checks, then rerun the affected suite.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Migration input equality keeps the original intent (b3991b1: Allow Doctor to rewrite repair guidance without releasing protected inputs or accepting changed obligations.)
  • Bounded conflict diagnostics keeps the original intent (22cd584: Identify publication phase and changed obligation fields without exposing configuration values, paths, or free-form reasons.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • xiaopan-xydt: Raw commit 22cd584 adds src/infra/deferred-plugin-migrations.ts:182 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 22cd584794ef; files: src/infra/deferred-plugin-migrations.ts)

PR surface

Source +9, Tests +58, Docs +6. Total +73 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 11 2 +9
Tests 2 58 0 +58
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 75 2 +73

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This repairs a bounded Doctor publication defect; the linked managed-update incident left the existing Gateway running.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This repairs a bounded Doctor publication defect; the linked managed-update incident left the existing Gateway running.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed November 17, 2026, 10:35 AM ET / 15:35 UTC.

@roboclaw-bot
roboclaw-bot merged commit 3afe212 into main Nov 17, 2026
117 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/ur-200606 branch November 17, 2026 17:06
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…nclaw#200658)

* fix(doctor): compare plugin obligations independent of order

Co-authored-by: steipete <[email protected]>

* test(doctor): expect added migration owners in archive conflicts

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…0658)

* fix(doctor): compare plugin obligations independent of order

Co-authored-by: steipete <[email protected]>

* test(doctor): expect added migration owners in archive conflicts

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>

(cherry picked from commit 3afe212)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 22, 2026
…0658)

* fix(doctor): compare plugin obligations independent of order

Co-authored-by: steipete <[email protected]>

* test(doctor): expect added migration owners in archive conflicts

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
(cherry picked from commit 3afe212)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…nclaw#200658)

* fix(doctor): compare plugin obligations independent of order

Co-authored-by: steipete <[email protected]>

* test(doctor): expect added migration owners in archive conflicts

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>

(cherry picked from commit 3afe212)

Release adaptation: Source production/regressions unchanged; docs retain baseline with only this fix paragraph. No schema or protocol change; tests pending combined scoped run.

Co-authored-by: RomneyDa <[email protected]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
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 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant