Skip to content

refactor(update): split update-runner into focused modules under the line limit - #110664

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

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

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

src/infra/update-runner.ts was ~1930 lines with a grandfathered max-lines suppression - the second of the four oversized update/state modules being retired this week (after #110550 split its sibling update-command.ts).

Why This Change Was Made

Behavior-neutral decomposition along the runner's real phase structure: a 104-line public facade (update-runner.ts, unchanged export surface) dispatching into focused modules - shared contracts (-types, 152), command execution/progress (-command, 99), install/root discovery (-install-surface, 151), the git mutation/build/rollback flow (-git, 500), target resolution + disposable-worktree preflight (-git-preflight, 522), schema preflight + branch/tag metadata (-git-target, 107), git command policy (-git-commands, 141), the global package flow (-global, 170), and doctor policy (-doctor, 57). Suppression and config/max-lines-baseline.txt entry removed; no new suppressions. The recent schema-preflight logic moved intact with its phase.

User Impact

None - internal module layout only.

Evidence

  • node scripts/run-vitest.mjs src/infra/update-runner.test.ts src/cli/update-cli.test.ts src/infra/update-check.test.ts: 288/288 green with only import/mock-path adjustments.
  • Max-lines ratchet, oxlint on touched files, deadcode exports (0), pnpm check:test-types (Blacksmith Testbox run 29642211489), git diff --check: all green.
  • Structured Codex autoreview (gpt-5.6-sol, xhigh): clean - "preserves the existing git, global-install, doctor, preflight, rollback, progress, and install-surface behavior", 0.98.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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, 7:42 AM ET / 11:42 UTC.

Summary
The branch splits src/infra/update-runner.ts into focused command, install-surface, git, preflight, target, global-update, doctor-policy, and type modules while retaining a small public facade and removing the max-lines-baseline entry.

PR surface: Source +75, Other -1. Total +74 across 11 files.

Reproducibility: not applicable. This PR is presented as a behavior-neutral internal refactor rather than a report of broken runtime behavior.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/infra/update-runner-doctor.ts, migration/backfill/repair: src/infra/update-runner-git.ts, migration/backfill/repair: src/infra/update-runner-global.ts, migration/backfill/repair: src/infra/update-runner.ts, serialized state: src/infra/update-runner-git-target.ts, unknown-data-model-change: src/infra/update-runner-doctor.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🌊 off-meta tidepool
Patch quality: 🦐 gold shrimp
Result: ready for maintainer review.

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

Rank-up moves:

  • Rebase or otherwise refresh the branch against current main, then confirm the exact-head build and QA checks.
  • Review the resulting three-way merge around git mutation, rollback, global install, and doctor-policy handoffs.

Risk before merge

  • [P1] This refactor moves git mutation, install, rollback, preflight, and doctor-policy paths; final merge review should use a rebased head and confirm the remaining build and QA checks against that exact merge result.

Maintainer options:

  1. Decide the mitigation before merge
    Refresh the branch against current main, compare the update git/global/doctor call paths on the resulting merge candidate, and merge only after the current-head validation remains green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The protected maintainer label and the branch’s current-base drift require human review of the refreshed update-flow merge result rather than automated repair or cleanup.

Security
Cleared: The reviewed change is confined to internal TypeScript module decomposition and the max-lines baseline; it adds no dependency source, workflow, package-resolution, secret, or permission surface.

Review details

Best possible solution:

Refresh the branch against current main, compare the update git/global/doctor call paths on the resulting merge candidate, and merge only after the current-head validation remains green.

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

Not applicable: this PR is presented as a behavior-neutral internal refactor rather than a report of broken runtime behavior.

Is this the best way to solve the issue?

Unclear: splitting the oversized runner by execution phase is a plausible maintainable direction, but the final best-fix judgment depends on a refreshed comparison of the update, rollback, and doctor paths after rebasing.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: The stated objective is internal maintainability cleanup with no intended user-facing feature or configuration change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This PR has the maintainer label and changes internal update-runner structure; the contributor body also records focused update-flow validation and a successful real-behavior-proof check.

Label justifications:

  • P3: The stated objective is internal maintainability cleanup with no intended user-facing feature or configuration change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This PR has the maintainer label and changes internal update-runner structure; the contributor body also records focused update-flow validation and a successful real-behavior-proof check.
Evidence reviewed

PR surface:

Source +75, Other -1. Total +74 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 10 1937 1862 +75
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 11 1937 1863 +74

What I checked:

Likely related people:

  • steipete: Authored the immediately preceding merged update-command decomposition and this adjacent update-runner decomposition, making them the clearest routing candidate for the update-module split sequence. (role: recent update-refactor contributor; confidence: medium; commits: 0d91b07f5bea, ddfc85f4ec15; files: src/cli/update-cli/update-command.ts, src/infra/update-runner.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.

@steipete steipete self-assigned this Jul 18, 2026
@steipete
steipete force-pushed the claude/update-runner-split branch from ddfc85f to a58435b Compare July 18, 2026 11:47
@steipete
steipete merged commit f6de912 into main Jul 18, 2026
117 checks passed
@steipete
steipete deleted the claude/update-runner-split branch July 18, 2026 11:52
@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

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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