Repository navigation
refactor(nostr): share doctor state migration flow - #148647
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 14, 2026, 11:08 PM ET / September 15, 2026, 03:08 UTC (Revision 2). ClawSweeper reviewWhat this changesShares Nostr’s legacy bus and profile state migration flow while preserving existing import behavior and adding failure-path coverage. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this requested refactor remains useful, and both reported lint corrections are present at the pinned head. No introduced correctness defect was found; the previously requested update-path validation remains outstanding. Priority: P3 Review scores
Verification
How this fits togetherNostr’s Doctor migrations import legacy account files into OpenClaw’s SQLite-backed plugin state and archive successfully handled sources. The channel subsequently reads that state for subscription timing and profile publication history. flowchart TD
A[Doctor migration request] --> B[Discover legacy Nostr files]
B --> C[Parse and normalize account keys]
C --> D{Enough state capacity?}
D -->|No| E[Warn and preserve sources]
D -->|Yes| F[Import missing entries]
F --> G[Archive handled sources]
F --> H[Nostr runtime state]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -45, Tests +193, Other 0. Total +148 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the private Nostr migration factory and unchanged storage contracts, backed by the repository-required upgrade-path validation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes duplicated migration orchestration rather than reporting a runtime defect; the duplication remains visible on current main. Is this the best way to solve the issue? Yes: a private factory preserves Nostr’s multi-file migration semantics without expanding the SDK or introducing a competing state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dfaec136991a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
* commit '0cd944c01416c4f9c1f6dc9d1dea9670c5b99cab': improve: speed up session search for restricted operators (#148826) fix(update): avoid retry guidance for historical abandoned runs (#146982) fix(android): reduce queued-message send overhead (#148899) refactor(slack): count table cells only for native output (#148872) fix: correct update status and apply saved model keys (#148830) refactor(nostr): share doctor state migration flow (#148647) refactor(gateway): centralize device token denial responses (#148644) test: make kitchen sink assertions runtime portable (#148891) refactor(agents): share preferred block chunk boundaries (#148391) fix(ui): use the selected timezone for Usage date shortcuts (#148277) test: probe active Node in release preflight (#148892) fix(test): restore services typecheck shard headroom (#148889)
* refactor(nostr): share doctor state migration flow * fix(nostr): satisfy doctor migration lint contracts
What Problem This Solves
This maintainer-requested refactor is part of the approved duplication and complexity reduction deliverable. Nostr's bus-state and profile-state Doctor migrations repeat the same discovery, capacity check, import and archival flow.
User Impact
No intended migration behavior change. Existing state wins over legacy files, normalized-key collisions keep the first discovered value, and insufficient capacity leaves all legacy sources in place. Registration completes before each source is archived; archive failures remain warnings, while registration failures stop later imports.
Why This Change Was Made
One private migration factory receives each existing namespace, label and parser. Descriptor IDs, order, parsing, account-key normalization and messages are preserved. The validated entries pass through the canonical unknown-valued registration boundary without the former assertions or an unnecessary generic. The SDK's single-file helper has different archival semantics and would not preserve this multi-file flow.
Production: -45 lines. Tests: +193 lines. The assertion baseline changes only this owner's count from four to two; intervening rows are preserved. No schema version or persisted value shape changes.
Evidence
12daee6db8284d640cd1c1d13b947e990c59d99ffound compatible caller/store drift and unchanged owner/test preimages. This source review is separate from the frozen runtime execution below.a1fac8538ce52cd797892ed6a4d1eac1cf207d18. Actual tested merge38620ba0a72605d087e3cbdea3e87511ae9e49b2contains the reviewed owner/test bytes and the row-only baseline composition. Selected static checks passed, including the pinned oxfmt 0.66.0 and oxlint 1.81.0. That CI selection omitted the two database-worker test files; the focused proof below covers them.38620ba0a72605d087e3cbdea3e87511ae9e49b2, tree5e4a2998487399e0c0a62b35e4eb7724f110a689. The canonical source capsule used carrier7ffd04f976a0b2f2d3ffd6350ea91ae419ca31dafor native package and registry identity; it did not substitute a different source tree. The reviewed private harness stayed separate from the clean candidate.[email protected]andnostr-state, with zero omitted scenarios. Package preparation and the joined survivor process both exited zero. Final full candidate/harness source checks, carrier HEAD and clean candidate index passed after the survivor and before the result assertions.Published Updater and Data Compatibility
These results address the three Before merge proof requests and the Rank-up move in the existing exact-head ClawSweeper review. That review found no introduced correctness defect. The exact-head P2 review also completed without findings; its static scope remains separate from execution.
Retained Limits
The first private proof invocation exited 2 because its external verifier incorrectly required an auxiliary post-core snapshot. Its original updater and survivor succeeded, but final source checks were not reached, so that invocation is not qualified. A reviewed verifier-only correction used the canonical explicit update result and correlated process exits, and moved the existing final source checks before derived assertions. The unchanged workload then completed successfully; this invocation also captured a consistent auxiliary snapshot. Follow-up: the first invocation's auxiliary snapshot omission remains unexplained.
The successful capture contains 37 complete hash-verified artifact streams; SHA256
87a285be576f47f3e56d278c23d34c9b2f634c13fe0f88b9f0493a4230e6aa9f. Native lease stop completed. Portal synchronization timed out, so portal publication is unconfirmed; the backing workflow may show cancellation from the owned Testbox shutdown. No live Nostr provider or performance result is claimed.