Skip to content

test(cli): reuse canonical pairing call guard - #137210

Merged
steipete merged 1 commit into
mainfrom
codex/test-pairing-cli-call-guard
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-pairing-cli-call-guard

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Replace the single-use Pairing CLI mock-call guard with the existing expectDefined<unknown[]> helper. The test still selects the first call and first argument and preserves the exact scoped-owner, log-order, and non-overwrite assertions. All 18 CLI cases remain; no production code changes.

Validation: the complete Pairing CLI, Doctor command-owner, and shared-helper suites passed 26 tests before and after in identical order. The normal local changed-file gate and a fresh independent Codex review through P2 passed. Test delta: +3/-10 lines.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

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

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 7:59 AM ET / 11:59 UTC.

ClawSweeper review

What this changes

The PR replaces a one-use Pairing CLI test helper with the shared expectDefined assertion while preserving the first configuration-write call assertion.

Merge readiness

✅ Ready for maintainer review

No blocking correctness or security findings. The cleanup is not yet on current main, and the maintainer label and active assignment keep this PR open for normal maintainer handling.

Priority: P3
Reviewed head: 0666817ff6714923ceafdc0cd58ca74c511edae3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent test cleanup that reuses the canonical assertion without weakening the protected pairing-owner behavior.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned, test-only cleanup changes no production behavior; source inspection ties the retained assertion to the unchanged Pairing CLI configuration-write path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned, test-only cleanup changes no production behavior; source inspection ties the retained assertion to the unchanged Pairing CLI configuration-write path.
Evidence reviewed 5 items Introduced test cleanup: The only introduced hunk deletes the single-use guard and uses the shared helper on the first mocked configuration-write call; the assertion still selects argument zero and verifies the scoped owner entry.
Shared helper contract: expectDefined returns its supplied value and throws only for null or undefined, matching the valid mock-call-array invariant used by this test; it is exported through the package’s public barrel.
Protected production behavior: The CLI calls the owner bootstrap after approval, and that owner writes the approved sender only when no command owner is configured; the unchanged neighboring test still verifies the no-overwrite path.
Findings None None.
Security None None.

How this fits together

The Pairing CLI approves a channel sender, then asks the command-owner bootstrap to write an owner allowlist only when one is absent. The affected test verifies that configuration side effect and its visible approval output.

flowchart LR
  A[Pairing approve command] --> B[Pairing CLI]
  B --> C[Command-owner bootstrap]
  C --> D[Configuration writer]
  E[Pairing CLI test] --> F[First writer-call assertion]
  F --> D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -7. Total -7 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 10 -7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 10 -7

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +3/-10 The change is a net-negative test-support cleanup with no production behavior or configuration-surface change.

Technical review

Best possible solution:

Keep the shared assertion and remove the duplicated local helper, preserving the existing pairing-owner behavior tests.

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

Not applicable: this PR refactors a test assertion and does not report or alter a user-facing failure. Source inspection confirms the production pairing and command-owner paths are unchanged.

Is this the best way to solve the issue?

Yes. The shared helper has the required defined-value contract and removes duplicated test support while retaining the same first-call and first-argument assertion.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a low-risk, test-only cleanup that does not alter operator-visible behavior.
  • 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-owned, test-only cleanup changes no production behavior; source inspection ties the retained assertion to the unchanged Pairing CLI configuration-write path.

Evidence

What I checked:

  • Introduced test cleanup: The only introduced hunk deletes the single-use guard and uses the shared helper on the first mocked configuration-write call; the assertion still selects argument zero and verifies the scoped owner entry. (src/cli/pairing-cli.test.ts:294, 0666817ff671)
  • Shared helper contract: expectDefined returns its supplied value and throws only for null or undefined, matching the valid mock-call-array invariant used by this test; it is exported through the package’s public barrel. (packages/normalization-core/src/expect.ts:2, 0666817ff671)
  • Protected production behavior: The CLI calls the owner bootstrap after approval, and that owner writes the approved sender only when no command owner is configured; the unchanged neighboring test still verifies the no-overwrite path. (src/pairing/command-owner.ts:24, 0666817ff671)
  • Current-main and release provenance: Current main and the latest stable tag both retain the file-local guard and its use, so this unmerged test cleanup has not been subsumed or shipped. (src/cli/pairing-cli.test.ts:47, 1aea7351628f)
  • Area history: Recent history shows Peter Steinberger repeatedly maintaining this Pairing CLI test surface, while Sarah Fortune made the newest merged touch to the file. The partial clone could not retrieve an older raw patch for stronger line-introduction attribution. (src/cli/pairing-cli.test.ts:1, a968d15f6383)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Sarah Fortune: 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-03T09:24:39.399Z sha 0666817 :: needs maintainer review before merge. :: none

@steipete steipete self-assigned this Sep 3, 2026
@steipete steipete closed this Sep 3, 2026
@steipete steipete reopened this Sep 3, 2026
@steipete
steipete merged commit 9893726 into main Sep 3, 2026
213 of 214 checks passed
@steipete
steipete deleted the codex/test-pairing-cli-call-guard branch September 3, 2026 12:27
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
…36761-session-mode-local-20260903

* commit '58187248c8cafd7b8cfbba3de8d001762fb08b48':
  improve(testing): add watchOS Gateway upgrade survivor (#137203)
  improve(ui): structure Devices rows with an actions menu and a facts panel (#137084)
  test(cli): reuse canonical pairing call guard (#137210)
  fix(sessions): prevent gateway stalls during large session cleanup (#126035)
  fix(qa): resolve Slack runtime dependency (#137283)
  fix: fence Session Observer catalog requests (#137243)
  fix(memory): make watcher pressure guidance actionable (#137181)
  test(entry): type the respawn exit mock directly (#137258)
  fix(release): install first-hop fixtures through the candidate registry (#137286)

# Conflicts:
#	scripts/e2e/lib/upgrade-survivor/assertions.mjs
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
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: XS 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