Skip to content

refactor(qa): simplify transport adapter contracts - #99632

Merged
RomneyDa merged 4 commits into
mainfrom
dallin/e2e-wave0-transport-contracts
Jul 3, 2026
Merged

RomneyDa merged 4 commits into
mainfrom
dallin/e2e-wave0-transport-contracts

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #99622

What Problem This Solves

QA Lab needs one asynchronous owner boundary for constructing QA Channel and Crabline adapters, but method support should come from the adapter implementation itself. Parallel declarations duplicated the adapter interface and could drift from the methods available on a selected channel.

Crabline Telegram supports native-command injection and outbound preview-sequence observation. Crabline Slack does not. The transport contract now represents that difference directly: channel-specific methods are optional, and an attempted flow call fails clearly at the invocation point when the selected adapter does not implement the method.

Why This Change Was Made

This change keeps an injectable asynchronous adapter factory registry while simplifying the transport contract:

  • QaTransportAdapterFactory retains id, matches, and asynchronous create.
  • The registry retains default QA Channel and Crabline factories and supports injected custom factories.
  • Registry creation returns adapter-owned cleanup.
  • Factory selection and startup errors include the factory, driver, and channel context.
  • Channel-specific methods are optional and exist only on adapters that implement them.
  • Scenario runtime bindings use the adapter and its state directly instead of a second alias surface.
  • QA Channel, Crabline, suite, manual-lane, and self-check creation use the same asynchronous registry path.

The change remains inside the QA Lab plugin boundary. It does not change production channel behavior.

User Impact

No direct end-user behavior changes. QA maintainers and channel contributors get a smaller transport contract, one extensible asynchronous construction boundary, deterministic cleanup ownership, and clear failures when a scenario invokes a method unavailable on the selected channel.

Evidence

  • node scripts/run-vitest.mjs extensions/qa-lab/src/qa-transport-registry.test.ts extensions/qa-lab/src/scenario-flow-runner.test.ts extensions/qa-lab/src/scenario-catalog.test.ts extensions/qa-lab/src/scenario-runtime-api.test.ts extensions/qa-lab/src/qa-channel-transport.test.ts extensions/qa-lab/src/suite-runtime-flow.test.ts extensions/qa-lab/src/manual-lane.runtime.test.ts extensions/qa-lab/src/self-check.test.ts extensions/qa-lab/src/suite.test.ts — 9 files, 86 tests passed.
  • node scripts/run-vitest.mjs extensions/qa-lab/src/crabline-transport.test.ts -t "observes Telegram preview edits through the shared transport adapter|configures OpenClaw's Slack plugin against a Crabline local provider server" — 2 tests passed, 13 skipped.
  • Repository oxfmt, scoped oxlint, and git diff --check passed.
  • Blacksmith Testbox through Crabbox tbx_01kwmvq9cz6xp5nnnvm9917ev0 — check:changed passed with full project typecheck, all oxlint shards, import-cycle validation, and changed guards. Actions run: https://github.com/openclaw/openclaw/actions/runs/28682699653
  • Codex autoreview — clean, no accepted/actionable findings; correctness confidence 0.89.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 6:43 PM ET / 22:43 UTC.

Summary
The branch replaces QA Lab's qa-channel-only synchronous adapter registry with an async QA Channel/Crabline factory registry, removes the separate transport capabilities alias, makes channel-specific adapter methods optional, and updates suite/runtime/tests to use adapter-owned state and cleanup.

PR surface: Source +73, Tests +79. Total +152 across 15 files.

Reproducibility: not applicable. this is a QA Lab refactor/contract PR, not a bug reproduction. Source inspection confirms current main and v2026.6.11 still use the older registry and required-method contract.

Review metrics: 2 noteworthy metrics.

  • Adapter Method Contract: 2 methods changed from required to optional. sendNativeCommand and waitForOutboundSequence now encode channel support by method presence, which changes QA flow failure semantics.
  • Factory Creation Boundary: 1 async registry path added. QA Channel and Crabline creation now share one asynchronous construction path with adapter-owned cleanup.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99622
Summary: This PR is the active candidate implementation for the linked maintainer-owned QA Lab transport adapter contract issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
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:

  • Have a maintainer explicitly accept the optional-method async factory contract, or request preflight validation if invocation-time failure is not desired.

Risk before merge

  • [P1] Merging intentionally changes QA Lab automation semantics: unsupported channel-specific methods become absent on selected adapters and fail when the scenario invokes them, so maintainers should accept method presence as the permanent contract.

Maintainer options:

  1. Accept Optional-Method Contract (recommended)
    Maintainers can accept invocation-time failures for absent channel-specific transport methods as the intended QA Lab automation contract and proceed through normal merge review.
  2. Add Preflight Validation Instead
    If missing channel-specific methods should fail before scenario execution, revise the runner or registry to validate selected scenarios against adapter methods before running.
  3. Pause Contract Refactor
    If the async factory registry is not the desired QA Lab API, keep this PR open or close it in favor of a narrower maintainer-approved contract proposal.

Next step before merge

  • [P2] Manual review is the right next action because this PR is maintainer-protected and changes a QA automation contract; there is no narrow automated repair finding.

Security
Cleared: The diff stays within QA Lab TypeScript runtime/tests and adds no dependency, lockfile, workflow, secret, package-script, or publishing-surface change.

Review details

Best possible solution:

Land this PR after maintainers accept the optional-method async factory contract; if they want earlier validation, revise toward an explicit preflight check before merge.

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

Not applicable: this is a QA Lab refactor/contract PR, not a bug reproduction. Source inspection confirms current main and v2026.6.11 still use the older registry and required-method contract.

Is this the best way to solve the issue?

Yes, pending maintainer acceptance: one async registry and adapter-owned optional methods are a narrower QA Lab boundary cleanup than keeping the duplicated capabilities alias. The main alternative is preflight validation if maintainers want unsupported methods caught before scenario invocation.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR affects QA Lab transport contracts and release/testing automation with limited blast radius, not an urgent end-user runtime regression.
  • merge-risk: 🚨 automation: The diff changes QA scenario transport construction and unsupported-method failure behavior, which requires maintainer acceptance beyond green checks.
  • 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 is a MEMBER-authored maintainer-labeled PR, so the external-contributor proof gate does not apply; the PR body and checks still provide focused test and Testbox validation context.
Evidence reviewed

PR surface:

Source +73, Tests +79. Total +152 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 274 201 +73
Tests 6 127 48 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 401 249 +152

What I checked:

Likely related people:

  • RomneyDa: Recent merged work by this author touched QA transport scenario requirements, transport-flow evidence, and Crabline transport behavior adjacent to this contract refactor. (role: recent QA transport contributor; confidence: high; commits: 843ad143647e, 8604dbdc93fb, 1cab479f7814; files: extensions/qa-lab/src/crabline-transport.ts, extensions/qa-lab/src/scenario-flow-runner.ts, extensions/qa-lab/src/qa-transport.ts)
  • mcaxtr: Merged PR refactor(qa): add shared QA channel contract and harden worker startup #64562 introduced the shared QA transport registry, adapter contract, and QA Channel adapter this PR evolves. (role: introduced shared QA transport contract; confidence: high; commits: 000fc7f23346; files: extensions/qa-lab/src/qa-transport-registry.ts, extensions/qa-lab/src/qa-transport.ts, extensions/qa-lab/src/qa-channel-transport.ts)
  • gumadeiras: Recent merged QA Lab runtime and provider-registry changes touched nearby startup, registry, and runtime-loading paths that interact with transport creation. (role: recent adjacent QA Lab runtime contributor; confidence: medium; commits: d5933af80bf1, bb7e9823a886; files: extensions/qa-lab/src/qa-transport-registry.ts, extensions/qa-lab/src/providers/index.ts, extensions/qa-lab/src/suite.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.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 3, 2026
@RomneyDa RomneyDa changed the title feat(qa): add transport capability and factory contracts refactor(qa): simplify transport adapter contracts Jul 3, 2026
@RomneyDa
RomneyDa force-pushed the dallin/e2e-wave0-transport-contracts branch from 5725c08 to 8ba28e0 Compare July 3, 2026 22:29
@RomneyDa
RomneyDa merged commit 04601ae into main Jul 3, 2026
97 checks passed
@RomneyDa
RomneyDa deleted the dallin/e2e-wave0-transport-contracts branch July 3, 2026 22:54
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
* feat(qa): add transport capability contracts

* fix(qa): scope sequence support by channel

* refactor(qa): simplify transport adapter contracts

* fix(qa): clarify unsupported transport method errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

Simplify QA transport adapter contracts

1 participant