Skip to content

test(daemon): split install reinstall coverage under max-lines - #145113

Merged
steipete merged 1 commit into
mainfrom
steipete/split-daemon-install-test
Sep 11, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/split-daemon-install-test

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Related: #143905, #145061, #145115

Additional instructions

Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Resolves a problem where PR merge-ref CI fails check-lint-core because src/cli/daemon-cli/install.test.ts exceeds the max-lines limit on main since #143905. This blocked unrelated PRs, including #145061. #145115 restored the immediate lint gate during this work; this requested split moves the suite comfortably below the limit as coverage grows.

Why This Change Was Made

Mechanically split the already-installed/reinstall cluster into install.reinstall.test.ts, with shared mocks, fixtures, assertions, and lifecycle setup in install.test-support.ts. The support module retains hoisted mock registration and loads the command afterward, following the existing CLI test-support pattern. Both complete test blocks remain byte-identical to the current base after formatting. No production behavior, suppressions, ratchets, or baselines change.

User Impact

Restores the lint path for contributors without changing runtime behavior or removing coverage. The two test files are 492 and 388 physical lines; shared support is 315 lines.

Evidence

  • Before: node scripts/run-vitest.mjs src/cli/daemon-cli/install.test.ts — 42 cases passed.
  • After: node scripts/run-vitest.mjs src/cli/daemon-cli/install.test.ts src/cli/daemon-cli/install.reinstall.test.ts — 42 cases passed (26 install + 16 reinstall).
  • Byte-for-byte comparison of both complete test blocks against the original passed after formatting.
  • pnpm oxfmt src/cli/daemon-cli/install.test.ts src/cli/daemon-cli/install.reinstall.test.ts src/cli/daemon-cli/install.test-support.ts — passed.
  • node scripts/check-changed.mjs — completed successfully, including max-lines ratchet, core-test typechecks, unused-export scans, and core lint.
  • git diff --check — passed.

The work order quoted 31 tests; the baseline runner reports 42 expanded cases, all retained.

@clawsweeper

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

@steipete
steipete marked this pull request as ready for review September 11, 2026 17:50
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XL maintainer Maintainer-authored PR labels Sep 11, 2026
@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 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 2:17 PM ET / 18:17 UTC (Revision 3).

ClawSweeper review

What this changes

Separates Gateway installation and reinstallation tests into smaller suites with shared setup, leaving more room under the file-length limit.

Merge readiness

✅ Ready for maintainer review

The split remains useful after the immediate lint repair merged. Both test blocks, shared mocks, helpers, and lifecycle hooks are preserved exactly; no actionable defect was found.

Priority: P3
Reviewed head: b77aba7ea4fcd752636f1b6f229fb945ca1dc6de

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test split with verified preservation, reported passing validation, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only split changes no production behavior; the reported before/after suite results and verified source preservation are relevant validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only split changes no production behavior; the reported before/after suite results and verified source preservation are relevant validation.
Evidence reviewed 6 items Verified scope and preservation: Read all three changed files and compared their contents with pinned base 3ac4215 using an in-memory Python comparison. Both complete test blocks, shared mocks/helpers, and lifecycle hooks compare identically. Only suite boundaries, imports, exports, and setup registration change.
Current-main necessity: The fetched main installation suite is byte-identical to the pinned base suite. Neither new split file exists on fetched main or the supplied latest-release tag v2026.9.4. The merged immediate repair at #145115 removes redundant mock defaults but does not perform this split.
Shared-worker isolation: The unit configuration uses the repository's non-isolated runner, which resets module exports and the mock registry after each file. Both suites register their own lifecycle hooks through the shared setup function; the existing exec-approvals suites use the same support-first import pattern.
Findings None None.
Security None None.

How this fits together

Gateway installation turns CLI options and existing configuration into a managed background service. These tests check installation decisions, preserved settings, and refusal paths using mocked service operations.

flowchart LR
  A[Installation scenarios] --> C[Shared mocks and setup]
  B[Reinstallation scenarios] --> C
  C --> D[Gateway install command]
  D --> E[Mock service operations]
  D --> F[Results and warnings]
  E --> G[Existing assertions]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +78. Total +78 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 728 650 +78
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 728 650 +78

Review metrics

Metric Value Why it matters
Production versus test growth Production +0; tests and support +78 net lines The added scaffolding separates existing coverage without expanding runtime code.

Technical review

Best possible solution:

Keep installation and reinstallation coverage in focused suites backed by one shared fixture owner and unchanged assertions.

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

Not applicable to a remaining product bug: this PR reorganizes tests, and the original lint failure has already been repaired on main.

Is this the best way to solve the issue?

Yes. Exact preservation of the test blocks and shared setup makes this a narrow way to create file-length headroom without weakening coverage or changing lint limits.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ebb7cb266fb6.

Labels

Label justifications:

  • P3: This is test organization cleanup; the immediate main-branch lint failure already has a merged repair.
  • 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: This maintainer-authored test-only split changes no production behavior; the reported before/after suite results and verified source preservation are relevant validation.

Evidence

What I checked:

  • Verified scope and preservation: Read all three changed files and compared their contents with pinned base 3ac4215 using an in-memory Python comparison. Both complete test blocks, shared mocks/helpers, and lifecycle hooks compare identically. Only suite boundaries, imports, exports, and setup registration change. (src/cli/daemon-cli/install.test-support.ts:221, b77aba7ea4fc)
  • Current-main necessity: The fetched main installation suite is byte-identical to the pinned base suite. Neither new split file exists on fetched main or the supplied latest-release tag v2026.9.4. The merged immediate repair at fix: restore core lint for daemon install tests #145115 removes redundant mock defaults but does not perform this split. (src/cli/daemon-cli/install.test.ts, ebb7cb266fb6)
  • Shared-worker isolation: The unit configuration uses the repository's non-isolated runner, which resets module exports and the mock registry after each file. Both suites register their own lifecycle hooks through the shared setup function; the existing exec-approvals suites use the same support-first import pattern. (test/non-isolated-runner.ts:486, b77aba7ea4fc)
  • Recorded validation: The captured PR body reports 42 passing cases before and after the split, divided into 26 installation and 16 reinstallation cases, plus successful changed-source checks. Reviewer-side git diff --check passed. Tests were not executed during this read-only review. (b77aba7ea4fc)
  • Recent area history: Available main history records Peter Steinberger's recent fixture, runtime, and lint maintenance and Jason (Json)'s update-authority work in the installation suite. These support routing suggestions, not causal attribution. (src/cli/daemon-cli/install.test.ts, ebb7cb266fb6)
  • Review continuity: The supplied previous completed review contains no findings or published rank-up moves. Comparing its earlier head locally failed because the required Git objects could not be retrieved; the current pinned introduced change was independently inspected. (b77aba7ea4fc)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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 (2 earlier review cycles)
  • reviewed 2026-09-11T17:55:44.772Z sha ed8573ae66590685d67099be7eff3bd62c9772ca :: needs maintainer review before merge. :: none
  • reviewed 2026-09-11T18:09:59.840Z sha db0e8a10849756436e0104f2b60a369b54b06879 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/split-daemon-install-test branch from ed8573a to db0e8a1 Compare September 11, 2026 17:57
@steipete
steipete force-pushed the steipete/split-daemon-install-test branch from db0e8a1 to b77aba7 Compare September 11, 2026 18:10
@steipete
steipete merged commit 3b0b6e8 into main Sep 11, 2026
100 of 102 checks passed
@steipete
steipete deleted the steipete/split-daemon-install-test branch September 11, 2026 18:27
@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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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