Skip to content

refactor(signal): strengthen probe assertions and simplify mocks - #156399

Merged
vincentkoc merged 5 commits into
mainfrom
test/signal-suite-cleanup-20260923
Nov 3, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
test/signal-suite-cleanup-20260923

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The two cold-runtime Signal probe tests could return the expected version even when the wrong request arguments were forwarded.

User Impact

No user-visible behavior change. This strengthens existing tests and removes an unused native-client mock; production code and permanent case inventory are unchanged.

Why This Change Was Made

Both existing managed-native/container rows now assert exactly one health check and version RPC with the complete URL, timeout and transport arguments. The shared monitor harness keeps its adapter mock and the real SignalSseRejectionError; its unused native-client function mock is removed.

The original eight-file proposal was reconciled against frozen baseline eb370ce611393818f488854aaa530afe36c3c7c2. Only these two residual files remain. The other six paths already have stronger canonical coverage; their retired cases and mocks are not restored.

Original-intent reconciliation
  • Approval-reaction mock cleanup landed in #175702.
  • Config-schema/send duplicate cases and core self-comparison cleanup landed in #158764; the current two probe rows were consolidated in #173331.
  • Send-reaction and ingress-replay mock cleanup landed in #179340.
  • Container-client intent is satisfied by the canonical RPC owner and retained real-HTTP transport, quote, attachment-byte and filename contracts from #158764 and #162138. This is semantic supersession, not whole-patch identity. Current send outcomes use the real HTTP/RPC coverage consolidated in #183573.

These are source/history findings. The unchanged six surfaces are not claimed as newly executed local suites.

Evidence

Exact signed candidate: 862ecc63205ce9e48790cfe61659d5633d5e1e4a. Independent guarded source review found no actionable issue in the reviewed scope.

Focused runs used actual Node 26.12.1 orchestration and the pinned Bun 1.4.4-canary.1+191755ec1 test runtime. Baseline and candidate passed the same 65 cases with the same per-file case counts, with zero filtered cases or unexpected errors.

Suite Cases Baseline file time Candidate file time
core 32 0.157 s 0.134 s
client-adapter 4 0.010 s 0.028 s
monitor.tool-result.autostart 28 12.156 s 12.138 s
monitor.attachment-base64 1 2.152 s 2.599 s

Native command wall times were 79.485 s and 39.443 s, including preparation and report aggregation. Each ordinary phase executed two routed test invocations once; native report merging replayed recorded reporter events, not test cases. These timings are observations, not a speedup claim.

Two temporary mutations of the real probe owner then demonstrated assertion sensitivity:

Control Observed result Filtered Command wall time
Health-check timeout 1000 → 1001 Both existing version rows failed at the new health-check assertion 30 10.277 s
RPC method version → profile Both existing version rows failed at the new RPC assertion 30 10.270 s

Each control intentionally exited 1 with exactly two expected assertion failures and no file/JUnit errors. The ordinary candidate used the exact signed head; controls used its temporary one-line producer mutations. Both mutations were restored and all owned processes settled. This is assertion-strength and harness-sibling proof, not a production bug or live Signal-device demonstration.

Canonical oxfmt passed. The native aggregate ratchet passed: 6,440,436 ≤ 6,440,877, slack 441. Production delta is 0; core test growth is +10 counted LF, and the harness removes 7 lines outside the counter's test patterns. No allocation was added.

The existing review's rank-up requests are addressed by the reconciliation, surviving-consumer coverage, controls and measured timings above. That older comment reviewed 7438f67; it is not an exact-candidate verdict.

Hosted CI passed: run 41695986526, attempt 2 on the exact signed candidate: 28 successful and 30 intentionally skipped jobs, with the required aggregate gate successful. Full plugin lint/type preparation, the ratchet and security checks passed. Attempt 1 failed during pinned-Bun setup with HTTP 500 before that job ran tests. One job-specific recovery rerun completed that job and its native dependency graph; earlier passing jobs were retained. Skipped jobs are not proof, and no CI exception was used.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 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 channel: signal Channel integration: signal size: L labels Sep 23, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 4:31 AM ET / 08:31 UTC (Revision 3).

ClawSweeper review

What this changes

The branch replaces Signal test wrappers with direct production-contract calls, removes duplicate scenarios, and simplifies test mocks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cleanup has clear campaign value and no concrete introduced finding, but candidate validation is not established.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This member-authored test-only PR is outside the external-contributor runtime-proof gate. The supplied baseline run does not establish candidate validation; no stored-data contract or production authority changes.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes
Reason: The linked maintainer-requested audit supports removing duplicate tests and fixture-only mappings while preserving meaningful contracts. No user-facing improvement or runtime speedup is claimed.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this member-authored PR belongs to an explicitly requested test-audit campaign. No concrete introduced defect was found, but candidate validation remains unexecuted and overlapping changes on current main still require reconciliation.

Priority: P3
Reviewed head: 7438f67be12674704eed4647a523eb93e18746a8

Before merge

  • Resolve merge risk (P1) - Coverage preservation after resolving overlapping current-main changes has not been verified on a reconciled candidate.
  • Complete next step (P2) - Reconcile the overlapping current-main changes, preserve surviving contract coverage, and record candidate survivor/fault-control results plus the pending mapped checks and measured test cost.

Findings

None.

Provenance

  • extensions/signal/src/send-reactions.test.ts: original intent not found (unknown: File history was inspected, but missing historical blobs and blocked promisor fetches prevented establishing the original reason for this unused configuration mock.)

Tests

  • Missing end-to-end proof: No candidate run establishes survivor coverage or targeted fault-control sensitivity. Validate the reconciled Signal suite, retained real-HTTP/native-RPC scenarios, durable approval replay, and every shared-harness consumer; record measured test cost and the pending mapped checks. This test-only cleanup does not require a new live Signal-device demonstration.
Agent review details

How this fits together

The Signal plugin translates OpenClaw messages and reactions into native Signal requests or container HTTP requests. These tests check request translation, delivery results, configuration validation, and approval replay.

flowchart TD
  A[Signal test scenarios] --> B[Plugin status and send operations]
  A --> C[Container request translator]
  B --> D[Native transport adapter]
  C --> E[HTTP request boundary]
  D --> F[Delivery and approval results]
  E --> F
  F --> G[Retained contract assertions]
Loading

Technical review

Best possible solution:

Retain only cleanup still needed on current main, preserve the stronger surviving contracts, and validate the reconciled candidate.

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

Not applicable: this PR reports redundant test coverage rather than a product defect; candidate execution remains pending.

Is this the best way to solve the issue?

Yes for the reviewed baseline: direct owner calls and stronger surviving scenarios provide a coherent cleanup, but current-main overlap requires a refreshed patch assessment.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain only cleanup still needed on current main, preserve the stronger surviving contracts, and validate the reconciled candidate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

  • extensions/signal/src/client-container.test.ts keeps the original intent (a2b4c4e: Privatize unused production exports and redirect tests through retained production owners; later quote and filename regressions protect container serialization.)
  • extensions/signal/src/send.test.ts keeps the original intent (a8fd30c: Reject per-recipient delivery failures while preserving partial group success to avoid duplicate retries.)
  • extensions/signal/src/config-schema.test.ts keeps the original intent (4a2a600: Move setup and transport configuration ownership into the selected channel.)
  • extensions/signal/src/core.test.ts keeps the original intent (9e16374: Restore cold-runtime Signal status probing.)
  • extensions/signal/src/approval-reactions.test.ts and signal-ingress.approval-reaction-replay.test.ts keeps the original intent (92d81bd: Preserve expired-approval cleanup while allowing the durable ingress owner to replay transient Gateway failures; earlier lifecycle work preserved complete shared error-module exports.)
  • extensions/signal/src/monitor.tool-result.test-harness.ts keeps the original intent (4540c6b: Move Signal implementation and tests into the extension while preserving existing behavior; later transport work retains adapter-owned dispatch.)

Testing

Proof path: none. Added test files: 7.

Security

None.

Evidence

What I checked:

  • Introduced patch and clean checkout: The pinned merge-base-to-head diff changes only tests and test support. The whitespace check passed, and the final checkout status remained clean. (7438f67be126)
  • Surviving filename and quote coverage: The unchanged real-HTTP filename matrix retains the removed filename inputs and checks decoded attachment bytes; the retained container quote test asserts quote_timestamp, quote_author, and quote_message. (extensions/signal/src/client-container.real-server.test.ts:270, 7438f67be126)
  • Surviving native delivery coverage: The retained real JSON-RPC test exercises ten responses covering recipient failures, legacy failure results, partial group success, complete group failure, and successful receipts. (extensions/signal/src/send.test.ts:641, 7438f67be126)
  • Surviving configuration transition: The remaining test validates the same schema with OPENCLAW_UPDATE_IN_PROGRESS set to 1 and then 0 without reloading modules, preserving both removed assertions. (extensions/signal/src/config-schema.test.ts:334, 7438f67be126)
  • Current-main overlap: Current main already uses direct container request calls and literal cold-probe results. Its container tests have also undergone further restructuring; no formally linked merged PR establishes complete supersession of this proposal. (extensions/signal/src/client-container.test.ts:15, fc3e09736432)
  • Feature-history routing: History records Peter Steinberger's Signal export cleanup and later WebSocket test extraction, and Vincent Koc's prior merged canonical-ingress-idle cleanup. These support area routing independently of this PR's authorship. (extensions/signal/src/monitor.tool-result.test-harness.ts, 8a57cad73684)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Tests -286. Total -286 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 286 572 -286
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 286 572 -286

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is test-maintenance work with no production behavior change or demonstrated urgent user impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Reconcile current-main test restructuring while preserving retained WebSocket and shared-harness coverage.
  • Record reconciled-candidate survivor and targeted fault-control results, measured test cost, and pending mapped validation.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-23T10:10:39.730Z sha 7438f67 :: needs changes before merge. :: none
  • reviewed 2026-09-28T00:04:56.023Z sha 7438f67 :: blocked before merge. :: none

@vincentkoc vincentkoc changed the title test(signal): exercise canonical contracts and remove duplicate coverage refactor(signal): strengthen probe assertions and simplify mocks Nov 3, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 3, 2026 18:40
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@vincentkoc
vincentkoc merged commit 258c4ed into main Nov 3, 2026
250 of 252 checks passed
@vincentkoc
vincentkoc deleted the test/signal-suite-cleanup-20260923 branch November 3, 2026 19:08
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…nclaw#156399)

* test(signal): exercise canonical RPC contracts

* test(signal): use real approval error classification

* test(signal): remove redundant probe and fixture coverage

* test(signal): verify probe forwarding and remove unused mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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