Skip to content

refactor(update): split update-command into focused modules under the line limit - #110550

Merged
steipete merged 1 commit into
mainfrom
claude/update-command-split
Jul 18, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/update-command-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

src/cli/update-cli/update-command.ts was 1693 lines with a grandfathered max-lines suppression - the largest and most change-prone of the update surfaces (three separate feature rounds landed in it this week alone). Repo policy treats those suppressions as TODOs: split the file, remove the entry.

Why This Change Was Made

Behavior-preserving split into focused siblings, each owning one phase of the update flow: update-command-dry-run.ts (179, preview assembly), update-command-git.ts (219, git flow + schema guards), update-command-package.ts (208, package install/doctor pipeline), update-command-execution.ts (255, mutable-update/service-stop orchestration), update-command-post-update.ts (427, plugin convergence/restart/final output), update-command-resume.ts (106, fresh-process post-core resume), with update-command.ts (590) as the public entry and orchestrator. The suppression is removed and the config/max-lines-baseline.txt entry deleted (ratchet shrinks). No behavior, output text, or exit-code changes.

User Impact

None - pure refactor of internal module layout.

Evidence

  • node scripts/run-vitest.mjs src/cli/update-cli.test.ts src/infra/update-check.test.ts src/infra/update-runner.test.ts: 288 passed, unchanged assertions (imports/mock targets follow moved code only).
  • Max-lines ratchet passes with the removed entry; oxlint clean on all touched files; no new suppressions.
  • node scripts/check-deadcode-exports.mjs 0 findings; pnpm check:test-types green (Blacksmith Testbox); git diff --check clean.
  • Structured Codex autoreview (gpt-5.6-sol, xhigh): clean - "behavior-preserving split... flows remain equivalent", 0.98.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XL maintainer Maintainer-authored PR labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 4:48 AM ET / 08:48 UTC.

Summary
The branch splits src/cli/update-cli/update-command.ts into focused update-flow modules and removes that file’s max-lines baseline exemption.

PR surface: Source +291, Other -1. Total +290 across 8 files.

Reproducibility: not applicable. This PR is a behavior-preserving refactor rather than a report of a failing user path. The remaining verification need is an after-fix operational update run, not reproduction of a pre-existing defect.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/cli/update-cli/update-command-package.ts, migration/backfill/repair: src/cli/update-cli/update-command.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Post redacted terminal output or logs from disposable git and package update runs, including post-update doctor and managed-service state.
  • [P1] Rebase onto current main and refresh the exact-head review before merge.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body reports focused tests, static checks, and CI, but provides no after-fix real update transcript, runtime log, recording, or linked artifact for the moved package/git and service-recovery paths. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Moving package/git update execution and managed-service recovery without observed operational proof leaves compatibility and availability regressions possible even if focused tests pass.
  • [P1] The PR is reported as mergeable but behind main; refresh the review after rebasing so the exact merge result is validated.

Maintainer options:

  1. Add operational update proof (recommended)
    Run and post redacted evidence for representative git and package update flows, including the resulting doctor and service-recovery state, after rebasing onto current main.
  2. Accept test-only refactor risk
    A maintainer may explicitly accept the residual upgrade and service-recovery risk based on the focused tests and completed CI checks.

Next step before merge

  • [P1] The remaining blocker is contributor-supplied operational proof and a current-main review refresh, not a discrete file-level repair for an automated worker.

Security
Cleared: The supplied diff surface adds no dependency, workflow, publishing, permission, secret-handling, or artifact-execution change; no concrete security or supply-chain concern is evident.

Review details

Best possible solution:

Keep the phase-based split, rebase it onto current main, and add redacted real-update evidence from disposable git and package installs that shows the post-update doctor and managed-service outcome.

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

Not applicable: this PR is a behavior-preserving refactor rather than a report of a failing user path. The remaining verification need is an after-fix operational update run, not reproduction of a pre-existing defect.

Is this the best way to solve the issue?

Yes in principle: separating the command by update phase is a maintainable way to retire the line-limit exemption. It is not ready to rely on until the split is demonstrated against real git/package update and service-recovery behavior.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 91ded689905b.

Label changes

Label justifications:

  • P3: This is an internal maintainability refactor with no claimed feature or user-visible behavior change.
  • merge-risk: 🚨 compatibility: The refactor relocates existing git/package update, schema-guard, and doctor paths that existing installations depend on during upgrades.
  • merge-risk: 🚨 availability: The moved execution and post-update code includes managed-service stop, restart, and failure-recovery orchestration.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, static checks, and CI, but provides no after-fix real update transcript, runtime log, recording, or linked artifact for the moved package/git and service-recovery paths. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +291, Other -1. Total +290 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 7 1473 1182 +291
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 8 1473 1183 +290

What I checked:

  • Refactor surface: The branch reduces the public orchestrator and moves dry-run, git, package, mutable-execution, post-update, and fresh-process resume phases into dedicated siblings; this is a behavior-sensitive CLI update boundary. (src/cli/update-cli/update-command.ts:1, a3754e0f9155)
  • Operational paths moved: The moved modules retain package installation/doctor work, git mutation/schema guards, managed-service stop/restart recovery, and post-core resume responsibilities, so equivalence needs evidence beyond import-moving unit tests. (src/cli/update-cli/update-command-execution.ts:1, a3754e0f9155)
  • Static and CI evidence: The PR body reports 288 focused test passes plus type, lint, dead-export, diff, and max-lines checks; supplied GitHub status also shows the completed relevant quality/security checks passing, but this is mock/static evidence rather than an observed update execution. (src/cli/update-cli/update-command.ts:1, a3754e0f9155)
  • Proof gap: No comment, linked artifact, terminal transcript, recording, or redacted runtime log in the supplied PR context demonstrates an after-fix git or package update followed by the relevant doctor/service outcome. (a3754e0f9155)
  • Review limitation: The read-only command sandbox failed before repository files and git history could be inspected, so this review does not claim source-level equivalence beyond the supplied PR metadata and diff excerpts.

Likely related people:

  • steipete: The supplied context identifies steipete as the sole author of the proposed update-command refactor and its current head commit; no current-main history trail could be inspected to establish stronger ownership. (role: recent area contributor; confidence: low; commits: a3754e0f9155; files: src/cli/update-cli/update-command.ts, src/cli/update-cli/update-command-execution.ts, src/cli/update-cli/update-command-post-update.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-18T07:59:05.813Z sha 7a6e9822e9a6b97900e9593e1c0f833d4a789c4d :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the claude/update-command-split branch from 7a6e982 to a3754e0 Compare July 18, 2026 08:44
@steipete
steipete merged commit 0d91b07 into main Jul 18, 2026
117 checks passed
@steipete
steipete deleted the claude/update-command-split branch July 18, 2026 08:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant