Repository navigation
refactor: simplify diagnostic, backup, and runtime ownership - #140369
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 6, 2026, 2:44 PM ET / 18:44 UTC. ClawSweeper reviewWhat this changesThe PR consolidates diagnostic, notification, backup, session, plugin, and subprocess helpers while replacing private test interfaces with coverage through existing entrypoints. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this remains useful, maintainer-sponsored cleanup, and the inspected changes reveal no blocking correctness defect. The related merged refactor does not supersede this work. Likely related people: Peter Steinberger and Vincent Koc are routing candidates based on relevant main-branch history; exact line introduction remains unverified. Priority: P3 Review scores
Verification
How this fits togetherThese internal services turn configuration, agent replies, and operator requests into diagnostics, device notifications, backup archives, session views, and subprocess results. The refactor consolidates their implementation while retaining existing output and lifecycle owners. flowchart TD
A[Configuration and operator requests] --> B[Diagnostic and backup services]
C[Agent replies and device registrations] --> D[Session and notification services]
B --> E[Warnings and verified archives]
D --> F[Transcript updates and device pushes]
A --> G[Plugin and subprocess helpers]
G --> H[Search and command results]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -241, Tests +108, Other -1. Total -134 across 29 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain one implementation owner for each internal decision, with observable contracts protected through the existing production entrypoints. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup, and source inspection found no concrete introduced failure to reproduce. Is this the best way to solve the issue? Yes: the consolidation reuses existing owners and removes private test-only plumbing while retaining production guards, ordering, and public plugin metadata. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ce8f214eaf1b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…w#140369) * refactor: simplify diagnostic and runtime ownership * refactor: remove backup test interfaces * refactor: reuse workspace scratch cleanup
What Problem This Solves
Diagnostic, push, backup, and session paths repeat transport selection, value construction, and ordering logic. Several private options and fallback branches survive only for tests. This cleanup gives those decisions one owner while preserving their observable behavior.
Related: #139597
Why This Change Was Made
Production is 241 lines smaller. Tests/support grow by 108 lines, retaining existing cases and strengthening actual boundary coverage. No public API, configuration option, schema, dependency, retention policy, or authorization change is introduced.
The APNs dispatcher accepts lifecycle controls separately from transport data, so approval notifications continue ignoring even extraneous JavaScript control fields. Its signing, HTTP/2, relay, registration, and result owners stay unchanged. Backup's existing publication owner remains responsible for unidentified or delayed cleanup receipts; only the unused ownerless branch is removed.
User Impact
No intended change to user-visible behavior. Existing diagnostics, pushes, backups, media history, search setup, migration, and subprocess I/O retain their current outcomes with less internal plumbing.
Evidence
pnpm build:ci-artifacts; build metadata identifies commit4a83819421621ab742c40473710e20250bc46eb8.Filesystem, loopback transport, and subprocess checks use owned synthetic fixtures. The cleanup does not change external provider wire behavior or require operator-state changes. The complete change removes 134 lines overall, including tests/support and one retired assertion-budget entry.
Review follow-up
The data-model compatibility item in the ClawSweeper review is a path-classification false positive. No stored representation, schema, migration, backfill, embedding/vector metadata, retention, or upgrade behavior changes:
doctor-platform-notes.tsonly reads platform/service/environment state and builds or emits warnings. The removed arguments are private test injection; service-environment precedence, bounded probes, warning text, and ordering remain covered by the baseline/candidate suites. Suggested repair commands are warning text, not executed mutations.extensions/migrate-claude/memory.tsreplaces a duplicatereadMemoryDirwith the existing identical reader atsource.ts:98. Both use the samereaddiroptions and error/cause. The item IDs, targets, scan limits, metadata fields, plan construction, and import executor are unchanged. Existing provider tests pass, including actual project imports, overwrite backups, source disappearance, path boundaries, unreadable memory, and oversized scans.