Skip to content

fix: keep Doctor migration capture within plugin data - #163780

Merged
fuller-stack-dev merged 1 commit into
mainfrom
openclaw/doctor-capture-land-20261002
Oct 2, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
openclaw/doctor-capture-land-20261002

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Related: #144005

What Problem This Solves

Fixes incomplete Doctor migration capture inventories and an overbroad Teams token footprint that can include plugin code links and fail strict candidate inspection.

User Impact

Doctor capture can identify the exact active Wiki cache files and Teams delegated-token data without treating the entire state directory as migration data. Retired Nostr and Teams importers stay retired. Teams archives now stay in a dedicated <token-file>.archives directory; no manual migration is required.

Why This Change Was Made

Declare the resources each plugin actually changes. Teams includes its token file and bounded archive directory, including collision suffixes. The shared archive helper keeps existing callers unchanged and refuses symlink sources before creating an archive directory, preserving the source and reporting the archive failure truthfully.

This is an independently safe extraction of Peter Steinberger's work in #144005, with current-source reconciliation and regression fixes by Jason (Json). It does not complete the original capture/recovery or newer-write preservation journey, and leaves that original work unfinished with its existing owners.

Evidence

  • Current-base independent review: no actionable P0–P2 findings; complete touched test files and affected consumers reviewed.
  • Focused behavioral tests passed: Teams 13, Wiki 10, Nostr 2, archive helper 4. One-worker run: 88.98 seconds including compiler preparation.
  • Real producer plus strict inspector regression passed (76.01 seconds total; 16.86-second test body), with explicit private parent/child handoff stores. This covers admitted plugin code links outside the declared migration footprint.
  • Overbroad Teams capture and relative-symlink archive regressions were reproduced before their fixes and passed afterward. Current candidate reruns are green.
  • Complete selected node scripts/check-changed.mjs --base aac001b30ba8d90e33aa4e7f8b1a8956f2b3c61f -- <eight PR paths> passed in 1,022.78 seconds, including declaration/closure, type, lint, dead-export and native-schema guards. No skip flags; source unchanged.
  • ClawSweeper completed review of the exact public head with no actionable findings. Exact-head CI passed (37 successful jobs, 24 workflow skips; no failures), and native merge admission completed.

Declare active Wiki cache files and bounded Teams delegated-token archive
resources while leaving retired migration inventories empty. Preserve
archive collision handling and refuse symlink sources before creating the
archive directory.

Extract the coherent migration resource declarations from Peter Steinberger's
#144005, with current-source reconciliation and regressions fixed by Jason
(Json). This does not complete or close the original recovery journey.

Co-authored-by: Peter Steinberger <[email protected]>
@fuller-stack-dev fuller-stack-dev self-assigned this Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 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.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review October 2, 2026 20:56
@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr extensions: memory-wiki size: M labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 5:03 PM ET / 21:03 UTC.

ClawSweeper review

What this changes

The PR declares Doctor’s plugin data inventory for Wiki, Teams, and retired Nostr migrations, and confines new Teams token archives to a dedicated directory.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, bounded extraction absent from inspected current main, and no introduced correctness defect was found. Member-authored work also requires explicit maintainer judgment before closure.

Priority: P2
Reviewed head: a6526fbaa50e5c9f2ab3b30f4a03cae01afc473c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, compatible repair with meaningful preservation regressions and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary contributor proof gate is exempt for this MEMBER-authored PR. Reported producer/inspector and filesystem regressions supplement source review; existing-state compatibility is supported by preserved root archives, unchanged token storage, and collision/failure cases. No stored schema or token format changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor proof gate is exempt for this MEMBER-authored PR. Reported producer/inspector and filesystem regressions supplement source review; existing-state compatibility is supported by preserved root archives, unchanged token storage, and collision/failure cases. No stored schema or token format changes.
Evidence reviewed 8 items Verified introduction: The pinned merge-base-to-head diff introduces only the declared migration inventories, Teams archive directory support, and associated regressions. The verified test-merge comparison reports the same eight paths, without base-only deletions.
Current main still lacks Teams inventory: The inspected main Teams contract has no backup-resource declarations and calls the archive helper without a dedicated archive directory. This extraction therefore remains useful; no merged fixing PR was established.
Bounded migration resources: Teams declares its token file and dedicated archive directory, including future collision suffixes. Wiki uses its existing configured-vault resolver and cache-path constants; retired Teams and Nostr importers declare empty inventories without restoring retired behavior.
Findings None None.
Security None None.

How this fits together

Doctor repairs legacy plugin state during maintenance and updates. Plugins declare the files needed for migration capture, while the shared archive helper records successful archival or preserves the source with a warning.

flowchart TD
  A[Plugin configuration and legacy files] --> B[Plugin migration inventory]
  B --> C[Doctor capture and rehearsal]
  C --> D[Plugin state repair]
  D --> E[Verified canonical state]
  E --> F[Archive legacy source]
  F --> G[Archive or preserved source with warning]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +46, Tests +85. Total +131 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 50 4 +46
Tests 3 125 40 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 175 44 +131

Review metrics

Metric Value Why it matters
Production and regression growth production net +46 lines; tests net +85 lines Production growth implements bounded inventories and optional archive placement; regression growth covers preserved data and archival failure cases.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/msteams/doctor-backup-resources.ts, migration/backfill/repair: extensions/msteams/doctor-contract-api.ts, migration/backfill/repair: extensions/nostr/doctor-contract-api.ts, migration/backfill/repair: src/plugins/doctor-state-migration-fs.ts, unknown-data-model-change: src/plugins/doctor-state-migration-fs.ts, vector/embedding metadata: extensions/memory-wiki/doctor-contract-api.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep migration inventories plugin-owned and precise, preserve existing archive callers and data, and deliver full rollback recovery through its separately tracked work.

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

Yes, source establishes missing resource declarations on inspected main and the existing consumer’s treatment of undeclared resources. The PR reports failing-before/passing-after regressions; this review did not execute them.

Is this the best way to solve the issue?

Yes, the extraction uses existing plugin inventory contracts and a backward-compatible archive-helper parameter, while preserving retired migration behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded Doctor migration-inventory repair with no demonstrated urgent user-facing outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate is exempt for this MEMBER-authored PR. Reported producer/inspector and filesystem regressions supplement source review; existing-state compatibility is supported by preserved root archives, unchanged token storage, and collision/failure cases. No stored schema or token format changes.

Label justifications:

  • P2: This is a bounded Doctor migration-inventory repair with no demonstrated urgent user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate is exempt for this MEMBER-authored PR. Reported producer/inspector and filesystem regressions supplement source review; existing-state compatibility is supported by preserved root archives, unchanged token storage, and collision/failure cases. No stored schema or token format changes.

Evidence

What I checked:

  • Verified introduction: The pinned merge-base-to-head diff introduces only the declared migration inventories, Teams archive directory support, and associated regressions. The verified test-merge comparison reports the same eight paths, without base-only deletions. (a6526fbaa50e)
  • Current main still lacks Teams inventory: The inspected main Teams contract has no backup-resource declarations and calls the archive helper without a dedicated archive directory. This extraction therefore remains useful; no merged fixing PR was established. (extensions/msteams/doctor-contract-api.ts:117, d5c6cbfb4b8c)
  • Bounded migration resources: Teams declares its token file and dedicated archive directory, including future collision suffixes. Wiki uses its existing configured-vault resolver and cache-path constants; retired Teams and Nostr importers declare empty inventories without restoring retired behavior. (extensions/msteams/doctor-backup-resources.ts:15, a6526fbaa50e)
  • Archive compatibility: The new archiveDirectory parameter is optional; callers omitting it retain their existing archive location. Teams still verifies imported token state before archival. Added cases preserve old root archives, handle destination collisions, and preserve sources with warnings for blocked directories and relative symlinks. The PR reports these regressions passing; this read-only review inspected their source without executing them. (extensions/msteams/doctor-contract-api.test.ts:140, a6526fbaa50e)
  • Shared helper preserves existing callers: The helper rejects symlink sources before creating the optional archive directory, retains identical-byte convergence and suffix collision handling, and records archival failures as warnings. (src/plugins/doctor-state-migration-fs.ts:34, a6526fbaa50e)
  • Existing rehearsal consumer: Doctor prepares declared resources before rehearsal detection, defers plugins whose data is outside the rehearsal root, and rechecks the prepared scope. The patch uses this existing owner rather than adding a competing capture mechanism. (src/infra/state-migrations.plugin-doctor.ts:175, a6526fbaa50e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@fuller-stack-dev
fuller-stack-dev merged commit e8b1cc0 into main Oct 2, 2026
205 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the openclaw/doctor-capture-land-20261002 branch October 2, 2026 21:12
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 2, 2026
* commit '79be075e5aa46be9e42dbd53ed6e30e81469210a': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (#163780)
  fix(ui): gate system information at the shared reader (#160982)
  chore(db): reclassify worker inventory sites with caller evidence (#163754)
  refactor(channels): deslop Slack and Matrix (#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (#129120)
  perf(nodes): load only what a worker turn needs (#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (#163649)
  refactor(discord): deslop discord (#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (#163761)
  test(gateway): add sustained heap retention diagnostics (#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (#163718)
  feat(macos): add a --no-activate launch flag for background automation (#163758)
  fix(agents): preserve host authority across module reloads (#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (#163690)
  fix: keep video widgets scrollable and preload initial frames (#163762)
  feat(memory): add a provider-neutral memory provider runtime (#162175)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
Declare active Wiki cache files and bounded Teams delegated-token archive
resources while leaving retired migration inventories empty. Preserve
archive collision handling and refuse symlink sources before creating the
archive directory.

Extract the coherent migration resource declarations from Peter Steinberger's
openclaw#144005, with current-source reconciliation and regressions fixed by Jason
(Json). This does not complete or close the original recovery journey.

Co-authored-by: Peter Steinberger <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 3, 2026
* commit '1fda703fb4d3630e4633461967b2a2186e8f15fd': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (openclaw#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (openclaw#163780)
  fix(ui): gate system information at the shared reader (openclaw#160982)
  chore(db): reclassify worker inventory sites with caller evidence (openclaw#163754)
  refactor(channels): deslop Slack and Matrix (openclaw#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (openclaw#129120)
  perf(nodes): load only what a worker turn needs (openclaw#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (openclaw#163649)
  refactor(discord): deslop discord (openclaw#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (openclaw#163761)
  test(gateway): add sustained heap retention diagnostics (openclaw#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (openclaw#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (openclaw#163718)
  feat(macos): add a --no-activate launch flag for background automation (openclaw#163758)
  fix(agents): preserve host authority across module reloads (openclaw#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (openclaw#163690)
  fix: keep video widgets scrollable and preload initial frames (openclaw#163762)
  feat(memory): add a provider-neutral memory provider runtime (openclaw#162175)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr extensions: memory-wiki P2 Normal backlog priority with limited blast radius. 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