Skip to content

refactor(infra): remove update campaign test constructor seam - #138398

Merged
steipete merged 1 commit into
mainfrom
codex/update-campaign15-a922-20260904
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/update-campaign15-a922-20260904

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested cleanup of automatic-update campaign ownership. The production controller carried UUID, clock, and timer injection options used only by its test fixture, leaving an unnecessary alternate construction path.

Why This Change Was Made

Use the existing default constructor, Node UUID function, and global clock/timer boundaries directly. Keep per-instance UUID function capture, campaign transitions, observer ordering, holds, stale-settlement protection, timer cancellation, and the distinct resetForTest() behavior unchanged. The fixture uses a partial crypto mock and its existing fake timers; all 21 case bodies and literal expectations are retained.

Production: +9/−24 (net −15). Tests: +14/−7 (net +7). No new dependency, configuration, schema, or public RPC surface.

User Impact

No intended user-facing behavior change. Automatic-update scheduling and manual campaign adoption keep the same owner and lifecycle.

Evidence

  • Original owner: 21 passed. The default-constructor fixture then passed all 21 on unchanged production before the production deletion.
  • Candidate and final restored owner: 21 passed; the complete startup/hold/run-campaign sibling command passed 134.
  • Negative controls were discriminating: duplicate IDs caused four intended failures; removing timer cancellation caused the selected timer-count failure. Both were exactly restored before the final passing runs.
  • One ordinary 16-phase full build and the configured 29-stage Testbox changed gate passed on the candidate tree saved unchanged in signed commit 85d3f1a39fbb1fc06808874aa29bca0f6750387a.
  • Separate precommit and exact-commit Codex reviews each completed five managed passes with no actionable P0–P2 findings.
  • Source comparison against locally captured main cf349c0c found the 12 campaign/startup/RPC/schema owner and test files unchanged from the tested base. This is source evidence, not a fresh integration test.

The first original sibling run timed out in a hold test and then observed a twice-called mock. Unchanged warm hold and complete sibling runs subsequently passed; the precise cold scheduling cause remains unproved, and that failure is not waived. Startup/RPC coverage mocks updater/service/network boundaries; no real upgrade or native Windows run is claimed. The changed gate retained a post-success portal-sync timeout warning. Exact-head hosted PR CI 33895229104, attempt 1 passed on 85d3f1a39fbb1fc06808874aa29bca0f6750387a (110 successful jobs, 17 skipped).

Use the default UUID, clock, and timer boundaries directly while retaining
per-instance UUID function capture and campaign lifecycle behavior.

Drive the owner fixture through a partial crypto mock and existing fake timers,
removing the constructor dependency bag without changing the 21 owner cases.
@clawsweeper

clawsweeper Bot commented Sep 4, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 16:27
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 8:51 PM ET / September 5, 2026, 00:51 UTC.

ClawSweeper review

What this changes

Removes test-only clock, timer, and ID constructor inputs from automatic-update scheduling, using test mocks instead without intended scheduling changes.

Merge readiness

✅ Ready for maintainer review

Keep open: this is useful, bounded cleanup that is absent from fetched main and v2026.9.1. No blocking correctness or security finding was identified, and the verified test merge preserves newer base-branch behavior.

Priority: P3
Reviewed head: 85d3f1a39fbb1fc06808874aa29bca0f6750387a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with retained behavioral coverage and reported owner/sibling validation; no actionable introduced defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER status exempts this behavior-neutral controller refactor from external-contributor live proof. Reported owner/sibling tests exercise scheduling and adoption, but are not represented as a real upgrade or native-platform run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER status exempts this behavior-neutral controller refactor from external-contributor live proof. Reported owner/sibling tests exercise scheduling and adoption, but are not represented as a real upgrade or native-platform run.
Evidence reviewed 11 items Pinned introduction and verified merge: The original head has the recorded parent a922cf8. The test merge has exactly the pinned base followed by this head; its controller and test match the head, while startup and RPC code remain identical to its base parent.
Production construction and lifecycle: The complete controller retains per-instance UUID capture, dynamic global clock/timer access, timer cancellation, hold rules, adoption, and stale-settlement checks. Repository-wide constructor search found only the production singleton and two test construction sites; no production caller supplied the removed dependency bag.
Retained owner coverage: Read the complete owner test file. The introduced test changes affect only UUID mocking and fixture construction; all 21 expanded cases retain their assertions, including timer counts, target replacement, adoption, holds, and stale apply settlement. The infra test project explicitly uses isolated workers.
Findings None None.
Security None None.

How this fits together

The update-campaign controller coordinates the waiting period between discovering an available update and starting installation. It combines active-work inspection, deadlines, and administrator actions, then publishes campaign state and invokes the existing updater.

flowchart TD
  A[Available update] --> C[Update campaign controller]
  B[Active work and clock] --> C
  D[Hold or update now] --> C
  C --> E{Wait or apply}
  E -->|Wait| F[Schedule next check]
  F --> C
  E -->|Apply| G[Existing updater]
  C --> H[Published update status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -15, Tests +7. Total -8 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 9 24 -15
Tests 1 14 7 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 23 31 -8

Review metrics

Metric Value Why it matters
Production versus test LOC Production net −15; tests net +7; 21 behavioral cases retained The reduction removes test-only production machinery without deleting behavioral assertions or adding a parallel runtime path.

Technical review

Best possible solution:

Preserve the single campaign owner and its timing, adoption, and cleanup contracts without retaining a test-only constructor API or introducing a replacement abstraction.

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

Not applicable: this PR removes a source-confirmed test-only construction path rather than fixing a reported runtime failure; no new failing behavior was reproduced.

Is this the best way to solve the issue?

Yes: production already uses the default constructor, so deleting the unused injection bag is simpler than preserving or replacing it, while the existing behavioral cases remain intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is bounded internal cleanup with no intended user-facing behavior change or demonstrated urgent regression.
  • 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 supplied MEMBER status exempts this behavior-neutral controller refactor from external-contributor live proof. Reported owner/sibling tests exercise scheduling and adoption, but are not represented as a real upgrade or native-platform run.

Evidence

What I checked:

  • Pinned introduction and verified merge: The original head has the recorded parent a922cf8. The test merge has exactly the pinned base followed by this head; its controller and test match the head, while startup and RPC code remain identical to its base parent. (eea08eff499b)
  • Production construction and lifecycle: The complete controller retains per-instance UUID capture, dynamic global clock/timer access, timer cancellation, hold rules, adoption, and stale-settlement checks. Repository-wide constructor search found only the production singleton and two test construction sites; no production caller supplied the removed dependency bag. (src/infra/update-campaign.ts:49, 85d3f1a39fbb)
  • Retained owner coverage: Read the complete owner test file. The introduced test changes affect only UUID mocking and fixture construction; all 21 expanded cases retain their assertions, including timer counts, target replacement, adoption, holds, and stale apply settlement. The infra test project explicitly uses isolated workers. (src/infra/update-campaign.test.ts:5, 85d3f1a39fbb)
  • Caller, callee, and sibling boundaries: Startup announces both Git and package campaigns and supplies the existing updater callback. The controller calls the shared active-work snapshot; manual update RPCs adopt or hold the same singleton. None of these interfaces changes. Sibling RPC tests retain outcome-before-clear and replacement-campaign protection. (src/infra/update-startup.ts:1200, 85d3f1a39fbb)
  • Existing operator contract: The documented one-minute countdown, 15-minute hard deadline, one-time hold, pinned update target, and failed-apply termination remain represented by the unchanged controller transitions and protocol fields. Public docs: docs/install/updating.md. (docs/install/updating.md:425, 85d3f1a39fbb)
  • Still necessary on fetched main: Fetched main retains the dependency type and constructor. Its controller and owner test are byte-identical to the PR merge-base versions, so this cleanup has not already landed there. (src/infra/update-campaign.ts:31, 4d132d8cbd47)

Likely related people:

  • steipete: 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-04T17:40:04.742Z sha 85d3f1a :: needs maintainer review before merge. :: none

@steipete steipete self-assigned this Sep 5, 2026
@steipete
steipete merged commit 578cb8b into main Sep 5, 2026
253 checks passed
@steipete
steipete deleted the codex/update-campaign15-a922-20260904 branch September 5, 2026 02:00
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…aw#138398)

Use the default UUID, clock, and timer boundaries directly while retaining
per-instance UUID function capture and campaign lifecycle behavior.

Drive the owner fixture through a partial crypto mock and existing fake timers,
removing the constructor dependency bag without changing the 21 owner cases.
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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