Skip to content

refactor(qa): consolidate scenario runtime helpers - #119623

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0805-qa-runtime-dmvazq
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0805-qa-runtime-dmvazq

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Consolidate the QA scenario runtime around its existing dependency owner instead of maintaining duplicate dependency declarations and property mappings.
  • Remove redundant private readiness wrappers and error-conversion code without changing QA scenario or transport behavior.
  • Production delta: -161 lines; test delta: -2 lines across 10 files.

Root cause and architecture

The QA runtime mirrored each dependency in both its public scenario-context type and its constructed context, while carrying a separate readiness wrapper and a local error converter identical to the existing plugin SDK implementation. The scenario runtime now derives its dependency surface directly from the typed dependency owner; QA Channel and Crabline derive readiness parameter types from their shared adapter; gateway failures use the canonical SDK toErrorObject; and the gateway-client type remains private to its only production consumer.

Compatibility and safety

  • Strict transport readiness continues to require the exact account, connected/running state, ready lifecycle, and no pending restart; no Crabline account fallback was restored.
  • All 81 existing waitForQaChannelReady YAML calls retain their public scenario alias and now use the same canonical transport-ready function.
  • The complete 92-property scenario API and its exact property order are preserved.
  • The removed QA error converter and canonical SDK converter have byte-identical function bodies, preserving error identity, fallback messages, causes, and enumerable structured properties.
  • The full gate exposed one now-unused exported gateway-client type; it was correctly demoted to a module-private type after confirming its only two consumers are in the same module.

Validation

  • Final focused remote run: 146/146 tests passed across 7 QA suites, covering scenario API aliases, scenario-flow wiring, gateway restarts and errors, gateway-child lifecycle, QA Channel, strict account ownership, and Crabline readiness.
  • Final full remote gate: pnpm check:changed passed, including production and extension-test typechecking, formatting, lint, zero dead exports, plugin boundaries, SDK contracts, and runtime import-cycle checks.
  • Fresh exact-head structured review: .agents/skills/autoreview/scripts/autoreview --mode local --engine codex --model gpt-5.6-sol --thinking xhigh — clean, confidence 0.98.
  • Trusted Blacksmith Testbox: tbx_01kz914prh51ny526hbz9eb658; remote validation run; lease stopped and independently verified completed.

After-fix gateway and strict transport-readiness artifact

Executed the actual repo-backed channel-chat-baseline scenario on exact PR head deacd676bd72a86da9d5c492a5e5244fc3375c24 after independently verifying all 10 changed Git blobs. The scenario starts a real ephemeral QA Lab, mock OpenAI provider, Gateway, and QA Channel; its existing YAML calls waitForGatewayHealthy and waitForQaChannelReady in both scenario steps. Loopback ports and runner paths below are redacted; no external provider, personal gateway, or real account was used.

$ OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_QA_DEBUG=1 \
    pnpm openclaw qa suite --provider-mode mock-openai \
    --scenario channel-chat-baseline --concurrency 1 --fast \
    --output-dir .artifacts/qa-e2e/pr119623

{"proofPhase":"exact-published-source","head":"deacd676bd72a86da9d5c492a5e5244fc3375c24","verifiedChangedBlobs":10,"scenario":"channel-chat-baseline","providerMode":"mock-openai","transport":"qa-channel"}
[qa-suite] run start: scenarios=1 concurrency=1 transport=qa-channel
[qa-suite] lab ready: http://127.0.0.1:<redacted>
[qa-suite] provider ready: http://127.0.0.1:<redacted>
[qa-suite] gateway ready: http://127.0.0.1:<redacted>
[qa-suite] scenario start (1/1): channel-chat-baseline
[qa-suite] start scenario="Channel baseline conversation" step="ignores unmentioned channel chatter"
[qa-suite] pass scenario="Channel baseline conversation" step="ignores unmentioned channel chatter"
[qa-suite] start scenario="Channel baseline conversation" step="replies when mentioned in channel"
[qa-suite] pass scenario="Channel baseline conversation" step="replies when mentioned in channel"
[qa-suite] scenario pass (1/1): channel-chat-baseline
[qa-suite] run complete: passed=1 failed=0 skipped=0 total=1

qa-suite-summary.json:
{"scenarioCount":1,"scenarios":[{"name":"Channel baseline conversation","status":"pass","steps":[{"name":"ignores unmentioned channel chatter","status":"pass"},{"name":"replies when mentioned in channel","status":"pass","marker":"QA-CHANNEL-BASELINE-OK"}]}]}

The same exact-head Testbox also exercised the real production readiness adapter with focused negative/positive lifecycle fixtures:

✓ qa channel transport > waits until the qa-channel default account is connected and ready
✓ qa channel transport > does not report another running account as the default account
Test Files  1 passed (1)
     Tests  2 passed | 16 skipped (18)

Runtime proof: trusted Blacksmith Testbox tbx_01kz95e4r9765tv6mqk3t3hw3s; after-fix gateway scenario run; lease stopped and independently verified completed.

@steipete
steipete marked this pull request as ready for review August 5, 2026 13:42
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:21 AM ET / 14:21 UTC.

ClawSweeper review

What this changes

This PR removes duplicated QA scenario-runtime dependency mappings, readiness wrappers, and error conversion while retaining the existing scenario aliases and strict transport readiness behavior.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The patch is a clean, behavior-preserving QA refactor with no blocking source or security finding. It remains open because the protected maintainer label requires explicit handling and the reported Testbox tests are not inspectable after-fix behavior proof.

Priority: P3
Reviewed head: deacd676bd72a86da9d5c492a5e5244fc3375c24

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and validation claims are strong, but the missing inspectable real-behavior evidence remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The body reports a trusted Testbox run and tests, but no inspectable after-fix runtime trace or artifact demonstrates the changed gateway/transport behavior; add redacted output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The body reports a trusted Testbox run and tests, but no inspectable after-fix runtime trace or artifact demonstrates the changed gateway/transport behavior; add redacted output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Scenario alias preserved: The branch maps both legacy QA-channel readiness and the generic channel readiness aliases to the same canonical transport-ready dependency; the focused test asserts the legacy alias identity.
Canonical error contract: The deleted QA-local coercer is byte-equivalent to the SDK-backed normalization helper, which preserves Error identity, string messages, causes, and enumerable structured fields.
Strict readiness remains owned by transport: The canonical readiness predicate still requires the exact account to be running, connected, lifecycle-ready, and free of a pending restart; the two adapters only derive their parameter type from that owner.
Findings None None.
Security None None.

How this fits together

QA Lab runs scenario YAML against an ephemeral OpenClaw gateway and transport adapters. The scenario runtime exposes those dependencies as action helpers, which then drive readiness checks, gateway lifecycle operations, and assertions.

flowchart LR
  Scenarios[QA scenario YAML] --> Runtime[Scenario runtime API]
  Runtime --> Dependencies[Runtime dependencies]
  Runtime --> Transport[Transport adapter]
  Transport --> Readiness[Strict account readiness]
  Dependencies --> Gateway[Ephemeral gateway]
  Gateway --> Results[Scenario assertions and logs]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The body reports a trusted Testbox run and tests, but no inspectable after-fix runtime trace or artifact demonstrates the changed gateway/transport behavior; add redacted output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body reports focused Testbox tests and a full gate, but it does not provide inspectable after-fix gateway/transport output proving the runtime path outside mocks.
  • Complete next step (P2) - No mechanical repair is indicated; the protected label and missing inspectable behavior proof require maintainer handling before merge.
Agent review details

Security

None.

PR surface

Source -161, Tests -2. Total -163 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 8 54 215 -161
Tests 2 3 5 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 57 220 -163

Review metrics

Metric Value Why it matters
Production versus test LOC production +54/-215 (net -161); tests +3/-5 (net -2) The net production reduction removes duplicate ownership and wrappers without adding a config, dependency, or public API surface.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the canonical dependency-owner refactor, preserving the existing scenario aliases, and attach a redacted after-fix QA scenario trace or Testbox artifact that shows the gateway and transport path completing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the canonical dependency-owner refactor, preserving the existing scenario aliases, and attach a redacted after-fix QA scenario trace or Testbox artifact that shows the gateway and transport path completing.

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

Not applicable: this PR is a QA runtime refactor rather than a reported user defect; source inspection traces the preserved aliases through the strict transport-ready owner.

Is this the best way to solve the issue?

Yes: deriving the scenario API from its typed dependency owner and deleting equivalent wrappers is the narrowest canonical solution, while retaining the public alias used by existing scenarios.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-neutral QA infrastructure cleanup with no demonstrated user-facing regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports a trusted Testbox run and tests, but no inspectable after-fix runtime trace or artifact demonstrates the changed gateway/transport behavior; add redacted output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a behavior-neutral QA infrastructure cleanup with no demonstrated user-facing regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports a trusted Testbox run and tests, but no inspectable after-fix runtime trace or artifact demonstrates the changed gateway/transport behavior; add redacted output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Scenario alias preserved: The branch maps both legacy QA-channel readiness and the generic channel readiness aliases to the same canonical transport-ready dependency; the focused test asserts the legacy alias identity. (extensions/qa-lab/src/scenario-runtime-api.ts:174, deacd676bd72)
  • Canonical error contract: The deleted QA-local coercer is byte-equivalent to the SDK-backed normalization helper, which preserves Error identity, string messages, causes, and enumerable structured fields. (packages/normalization-core/src/error-coercion.ts:109, 1b4a60be15a1)
  • Strict readiness remains owned by transport: The canonical readiness predicate still requires the exact account to be running, connected, lifecycle-ready, and free of a pending restart; the two adapters only derive their parameter type from that owner. (extensions/qa-lab/src/qa-transport.ts:33, 1b4a60be15a1)
  • Feature provenance: The redundant QA runtime surface dates to the recent QA cleanup commit, which introduced the relevant runtime files and canonical error helper. (extensions/qa-lab/src/scenario-runtime-api.ts:114, 57122c965c65)
  • Current-main and release check: The PR head is not an ancestor of current main and no release tag contains it, so this remains active branch work rather than an already-implemented change. (deacd676bd72)

Likely related people:

  • steipete: Commit 57122c9 introduced the QA runtime surface and canonical coercion helper; this PR continues work in the same owner boundary. (role: feature introducer and recent area contributor; confidence: high; commits: 57122c965c65; files: extensions/qa-lab/src/scenario-runtime-api.ts, packages/normalization-core/src/error-coercion.ts)

Rank-up moves

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

  • Attach a redacted Testbox artifact or terminal trace showing an after-fix QA scenario exercise the gateway and strict transport-ready path.

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.

@steipete
steipete merged commit ce06e79 into main Aug 5, 2026
193 of 198 checks passed
@steipete
steipete deleted the codex/loc-0805-qa-runtime-dmvazq branch August 5, 2026 15:02
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
* origin/main: (130 commits)
  refactor(qa): consolidate scenario runtime helpers (openclaw#119623)
  fix(telegram): bind Mini App auth to dashboard launches
  refactor(agent-core): unify session projection and compaction summaries (openclaw#119639)
  fix(codex): allow natural reactions in the current conversation (openclaw#119649)
  refactor(providers): deduplicate bundled model catalogs (openclaw#119627)
  fix(ui): observe the active service worker after asset refresh (openclaw#119622)
  fix(agents): strip echoed base64 image payloads so photo-heavy turns no longer hit the per-turn output cap (openclaw#119488)
  improve: make state-heavy test suites faster (openclaw#119617)
  perf(agents): add concurrency benchmark (openclaw#119569)
  fix(browser): visibly report failed pairing and tab-sharing actions (openclaw#119526)
  refactor(lobster): consolidate embedded workflow execution (openclaw#119630)
  fix(plugin-sdk): stabilize tuple-derived API baseline ordering (openclaw#119635)
  docs(skills): make full-authority maintainer runs unattended (openclaw#119629)
  fix(managed-child): honor process groups that vanish before cleanup (openclaw#119614)
  fix(ci): stop label-driven automation churn (openclaw#119610)
  fix(media): keep the ttl sweep out of the managed outgoing tree (openclaw#119127)
  fix(claws): remove owner-qualified skills (openclaw#119606)
  fix(clawrouter): show stable error for malformed usage responses (openclaw#119580)
  fix(gateway): claim malformed plugin icon routes (openclaw#119559)
  fix(telegram): preserve truthful empty-content delivery (openclaw#88810)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant