Skip to content

fix(qa-lab): record realized channel driver in evidence, not requested (#115753) - #116262

Closed
ruel225 wants to merge 8 commits into
openclaw:mainfrom
ruel225:fix/qa-evidence-realized-channel-driver
Closed

ruel225 wants to merge 8 commits into
openclaw:mainfrom
ruel225:fix/qa-evidence-realized-channel-driver

Conversation

@ruel225

@ruel225 ruel225 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

QA suite evidence (qa-evidence.json, qa-suite-summary.json) derived execution.channel.driver / live from the requested channelDriver param instead of the transport adapter actually created. When channelDriver: "live" was requested but no live adapter factory matched (so the built-in qa-channel fallback ran), evidence still reported driver: "live", live: true — falsely attesting a live channel executed. A credential-blocked partition likewise recorded its requested driver as executed despite never creating an adapter.

The contract (docs/concepts/qa-e2e-automation.md) states qa-evidence.json records "channel, driver actually used".

Fixes #115753

Why This Change Was Made

The realized driver (live | crabline | qa-channel) is computed inside createQaSuiteTransportAdapter but was previously passed only into the transport factory context and discarded — artifact writers only ever saw the requested channelDriver. The fix surfaces the realized driver as a prepared fact at the transport-creation boundary and threads it through the three suite runners into writeQaSuiteArtifacts, where summary and evidence now prefer it over the requested driver.

The realized driver is only set to "live" when a matching live factory actually creates the adapter: when usesLiveAdapter is true, createQaTransportAdapter goes through requireQaTransportFactory, which throws (no QA transport factory for live:<channelId>) if no factory matches the channel — it never falls back to the shared qa-channel transport while still reporting live. So the inferred realizedDriver cannot diverge from the adapter that was actually created.

This follows AGENTS.md's "carry prepared facts forward" guidance: the realized driver is known at transport creation and should not be rediscovered (or, worse, replaced by the requested value) at the evidence-writing layer.

User Impact

  • Before: qa-evidence.json / qa-suite-summary.json could report a live channel executed when only the qa-channel fallback ran; blocked partitions falsely claimed their requested driver executed.
  • After: Evidence records the driver that actually ran. A blocked partition (no transport created) records driver: undefined, live: false instead of forwarding the requested driver; the per-scenario status: "blocked" still conveys the blocked state.

No schema change — qaEvidenceChannelSchema.driver already accepted any non-empty string; a realized driver string flows through unchanged. No public type widened: QaTransportAdapterFactoryResult / QaChannelDriverRuntime (exposed via runtime-api.ts) are unchanged; the realized driver is surfaced only via a suite-local intersection return type on createQaSuiteTransportAdapter.

Evidence

Behavior addressed: evidence records the realized transport driver, not the requested one; the qa-channel fallback for a requested live driver is now reported as qa-channel, and a credential-blocked partition no longer attests a live channel ran.

Validation (trusted source, local checkout on Node 24.18.0):

node scripts/run-vitest.mjs extensions/qa-lab/src/suite.test.ts extensions/qa-lab/src/suite.summary-json.test.ts
# Test Files 2 passed (2) | Tests 43 passed (43)

node scripts/run-vitest.mjs extensions/qa-lab/src/evidence-summary.test.ts extensions/qa-lab/src/suite-launch.runtime.test.ts
# Test Files 2 passed (2) | Tests 63 passed (63)

pnpm tsgo:extensions   # type-check, no errors
oxfmt write <touched files>   # formatted
git diff --check       # clean

Real behavior proof — these tests exercise the real production paths, not mocked output:

  • suite-launch.runtime.test.ts > "reuses unavailable channel credential evidence across serial partitions" drives the real unified partition launcher with a credential-blocked live partition, writes a real qa-evidence.json file to disk, parses it back, and asserts the blocked entry has execution.channel.live === false with driver undefined — proving the fix end-to-end through artifact generation. (The prior buggy behavior asserted driver: "live", live: true here.)
  • suite.test.ts > "keeps metadata-only live channel drivers on the shared QA transport" asserts the realized driver is "qa-channel" when live is requested but no live adapter is selected.
  • suite.test.ts > "rejects a requested live driver whose channel has no matching factory instead of recording live" (new) locks the realization invariant: a requested live driver with a channelId and supplied-but-nonmatching factories throws at adapter selection (no QA transport factory for live:whatsapp) rather than falling back to qa-channel while reporting live. This is the case ClawSweeper flagged — it cannot produce a false live attestation because requireQaTransportFactory throws before any driver is returned.
  • suite.summary-json.test.ts adds a case where realizedDriver: "qa-channel" overrides a requested channelDriver: "live" in the summary.

Real behavior proof (trusted source, local checkout on Node 24.18.0):

A script drives the real production evidence/summary builders that writeQaSuiteArtifacts calls internally — buildQaSuiteEvidenceSummary and buildQaSuiteSummaryJson — with a requested channelDriver: "live" but a realized qa-channel fallback (no live adapter matched). It writes the produced qa-evidence.json and qa-suite-summary.json to a temp dir using the real JSON shape the artifact writer emits, then reads them back:

{
  "proof": "qa-evidence-realized-driver",
  "issue": "#115753",
  "requestedDriver": "live",
  "realizedDriver": "qa-channel",
  "evidenceExecutionChannel": { "id": "qa-channel", "live": false, "driver": "qa-channel" },
  "summaryRunChannelDriver": "qa-channel",
  "verdict": {
    "evidenceRecordsRealized": true,
    "summaryRecordsRealized": true,
    "requestedLiveNotAttested": true
  }
}

The evidence execution.channel records driver: "qa-channel", live: false — the realized fallback — instead of the requested "live". The summary run.channelDriver is "qa-channel" (realized wins over requested "live"). The requested live is no longer falsely attested. No real gateway/provider/transport started; no credentials or endpoints.

This complements suite-launch.runtime.test.ts, which drives the real unified partition launcher with a credential-blocked live partition, writes a real qa-evidence.json to disk, parses it back, and asserts execution.channel.live === false with driver undefined.

Boundary: change is internal to extensions/qa-lab/src/; createQaSuiteTransportAdapter is not re-exported through api.ts / runtime-api.ts.

@ruel225
ruel225 marked this pull request as ready for review July 30, 2026 06:22
@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. P2 Normal backlog priority with limited blast radius. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 12:12 PM ET / 16:12 UTC.

ClawSweeper review

What this changes

The PR makes QA Lab evidence and suite summaries record the transport driver that actually ran, rather than the requested channel-driver setting.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer review. Current main still derives QA artifact channel evidence from the requested driver, while this patch carries the driver selected at transport creation into every artifact-writing runner; the implementation is focused, internally scoped, and has no blocking correctness finding. The branch is cleanly mergeable but behind main, so landing should rely on GitHub’s exact three-way merge result and current required-check gate.

Priority: P2
Reviewed head: 992119e65a50d28565f291c8f2e4e9d5bf061229

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary repair with direct artifact proof and relevant regression coverage; its only remaining consideration is normal exact-merge review against newer main.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body includes after-fix artifact output from the production evidence and summary builders plus a runtime-path test that writes and rereads qa-evidence.json; the output directly shows requested live becoming realized qa-channel and blocked execution remaining non-live.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body includes after-fix artifact output from the production evidence and summary builders plus a runtime-path test that writes and rereads qa-evidence.json; the output directly shows requested live becoming realized qa-channel and blocked execution remaining non-live.
Evidence reviewed 5 items Current-main defect path: Current main computes the adapter driver during transport creation, but buildQaSuiteSummaryJson and the evidence writer receive the requested channelDriver; the evidence mapper marks a channel live when that value is live, so requested state can be emitted as realized execution.
Documented artifact contract: The QA automation documentation says that evidence records the channel and driver actually used, which matches the patch’s realized-driver boundary.
Patch owner-boundary repair: The PR head returns the selected driver with the adapter result, then passes it to the artifact writer; a requested live driver with a nonmatching factory throws before a live driver can be returned.
Findings None None.
Security None None.

How this fits together

QA Lab selects a transport adapter from suite configuration, runs scenarios through it, and writes evidence artifacts consumed by QA and release-quality workflows. This change carries the selected transport identity from adapter creation through the suite runners to qa-evidence.json and qa-suite-summary.json.

flowchart LR
  A[Suite configuration] --> B[Transport adapter selection]
  B --> C[Realized driver]
  C --> D[Standard, isolated, and parity runners]
  D --> E[Artifact writer]
  E --> F[QA evidence JSON]
  E --> G[Suite summary JSON]
Loading

Before merge

  • Resolve merge risk (P1) - The PR is mergeable but behind current main, and main changed affected QA Lab files after the PR base; land only through GitHub’s exact clean three-way merge with the required checks for the resulting head.
  • Complete next step (P2) - No mechanical repair is indicated: the patch has no actionable review finding, and the remaining action is ordinary maintainer review of GitHub’s exact merge result.
Agent review details

Security

None.

PR surface

Source +31, Tests +39. Total +70 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 43 12 +31
Tests 3 43 4 +39
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 86 16 +70

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #115753
Summary: This PR is the concrete candidate fix for the canonical QA evidence-integrity bug; the later module-flow capability proposal is adjacent but explicitly independent.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one authoritative realized-driver fact at transport creation, pass it through all suite execution modes, and emit that fact in both QA artifact formats while retaining requested configuration only as separate metadata where needed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one authoritative realized-driver fact at transport creation, pass it through all suite execution modes, and emit that fact in both QA artifact formats while retaining requested configuration only as separate metadata where needed.

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

Yes. Current main has a focused source path: a requested live driver can select the built-in qa-channel transport, while artifact generation still forwards the requested value into evidence; the PR adds focused tests for the fallback and credential-blocked paths.

Is this the best way to solve the issue?

Yes. Carrying the prepared driver from the adapter-creation owner is narrower and safer than reconstructing execution identity at the artifact layer, and it avoids widening the plugin SDK or adding a parallel public contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 38a5d39b3328.

Labels

Label justifications:

  • P2: This corrects deterministic QA evidence integrity for channel-suite operators without affecting the production message-delivery runtime.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix artifact output from the production evidence and summary builders plus a runtime-path test that writes and rereads qa-evidence.json; the output directly shows requested live becoming realized qa-channel and blocked execution remaining non-live.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix artifact output from the production evidence and summary builders plus a runtime-path test that writes and rereads qa-evidence.json; the output directly shows requested live becoming realized qa-channel and blocked execution remaining non-live.

Evidence

What I checked:

  • Current-main defect path: Current main computes the adapter driver during transport creation, but buildQaSuiteSummaryJson and the evidence writer receive the requested channelDriver; the evidence mapper marks a channel live when that value is live, so requested state can be emitted as realized execution. (extensions/qa-lab/src/suite-artifacts.ts:97, 38a5d39b3328)
  • Documented artifact contract: The QA automation documentation says that evidence records the channel and driver actually used, which matches the patch’s realized-driver boundary. Public docs: docs/concepts/qa-e2e-automation.md. (docs/concepts/qa-e2e-automation.md:425, 38a5d39b3328)
  • Patch owner-boundary repair: The PR head returns the selected driver with the adapter result, then passes it to the artifact writer; a requested live driver with a nonmatching factory throws before a live driver can be returned. (extensions/qa-lab/src/suite.ts:93, 992119e65a50)
  • Shared transport contract: The registry creates the built-in qa-channel transport only for that driver and otherwise requires a matching factory, throwing when no live factory matches. This supports the PR’s invariant that live is only recorded after live-adapter selection succeeds. (extensions/qa-lab/src/qa-transport-registry.ts:37, 38a5d39b3328)
  • History and current-main comparison: Blame shows the currently faulty requested-driver lines were carried into main by current QA Lab work, while feature history shows sustained transport and suite ownership by Peter Steinberger and Dallin Romney. The functional PR commit is not an ancestor of current main; GitHub context reports this PR as mergeable but behind. (extensions/qa-lab/src/suite.ts:95, c8688051ed67)

Likely related people:

  • Peter Steinberger: History shows the largest contribution count across the transport, suite, artifact, and evidence files, plus multiple recent transport-cleanup and QA Lab refactors. (role: long-running QA Lab contributor; confidence: high; commits: 307353dd1c1a, a676afd54df3, a788617325f8; files: extensions/qa-lab/src/suite.ts, extensions/qa-lab/src/suite-artifacts.ts, extensions/qa-lab/src/qa-transport-registry.ts)
  • Dallin Romney: Recent history includes the live-channel selector routing and canonical live-adapter refactors that define the transport-selection boundary this patch preserves. (role: recent QA transport feature contributor; confidence: high; commits: af71400c8eb6, b29d472e41f7, edf434b1a301; files: extensions/qa-lab/src/suite.ts, extensions/qa-lab/src/qa-transport-registry.ts, extensions/qa-lab/src/suite-launch.runtime.ts)

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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-30T08:38:34.673Z sha 911fa63a2b221b8f9e39d6b80cb9ceb1449ba674 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T11:43:00.277Z sha 615cad4 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T14:01:54.657Z sha 615cad4 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T01:53:39.791Z sha 075cd13 :: needs changes before merge. :: [P3] Remove ticket references from inline comments
  • reviewed 2026-07-31T02:15:29.254Z sha 075cd13 :: needs changes before merge. :: [P3] Remove issue references from inline comments
  • reviewed 2026-07-31T02:34:18.901Z sha d92c8ce :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T02:46:50.959Z sha 992119e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T09:56:22.578Z sha 992119e :: needs maintainer review before merge. :: none

@ruel225

ruel225 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@ruel225

ruel225 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Added real behavior proof to the PR body: a script drives the real production evidence/summary builders (buildQaSuiteEvidenceSummary + buildQaSuiteSummaryJson, the functions writeQaSuiteArtifacts calls internally) with a requested channelDriver: "live" but a realized qa-channel fallback. It writes the real qa-evidence.json + qa-suite-summary.json to disk and reads them back: execution.channel records driver: "qa-channel", live: false (the realized fallback, not the requested live), and run.channelDriver is qa-channel. The requested live is no longer falsely attested. This also complements suite-launch.runtime.test.ts, which already writes a real qa-evidence.json via the unified partition launcher and asserts live: false on the blocked path. The issue/bot lore was removed from the test comment.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 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. labels Jul 30, 2026
ruel225 and others added 5 commits July 30, 2026 19:37
QA suite evidence (qa-evidence.json, qa-suite-summary.json) derived
execution.channel.driver/live from the requested channelDriver param
instead of the transport adapter actually created. A qa-channel fallback
created when no live adapter matched was therefore reported as
driver: "live", live: true, falsely attesting a live channel executed.

Surface the realized driver (live | crabline | qa-channel) from
createQaSuiteTransportAdapter and thread it through the three suite
runners into writeQaSuiteArtifacts, where summary and evidence now
prefer it over the requested driver. The credential-blocked path
(no transport created) records driver: undefined, live: false instead
of forwarding the requested driver.

Fixes openclaw#115753

Co-Authored-By: Claude <[email protected]>
…tory

Add a regression covering a requested live driver with a channelId and
supplied factories where none match: adapter selection throws instead of
falling back to qa-channel while reporting driver live. This documents
that realizedDriver 'live' is only returned when a matching factory
actually creates the adapter.

Co-Authored-By: Claude <[email protected]>
Previous check-lint failed with exit 143 (SIGTERM): the runner received a
shutdown signal while oxlint:core was still running (285s). No lint error
was reported. Re-triggering via synchronize.

Co-Authored-By: Claude <[email protected]>
Remove the ClawSweeper/openclaw#116192 reference from the test comment; keep the
technical rationale for the invariant.

Co-Authored-By: Claude <[email protected]>
@ruel225
ruel225 force-pushed the fix/qa-evidence-realized-channel-driver branch from 911fa63 to 615cad4 Compare July 30, 2026 11:38
ruel225 and others added 2 commits July 31, 2026 09:48
check-lint failed with exit 143 (SIGTERM runner shutdown); a separate
shard hit an unrelated git-worktree CI env mismatch in
server.sessions.create.test.ts. Neither is from this PR's qa-lab changes.

Co-Authored-By: Claude <[email protected]>
Remove ticket-specific issue references from inline comments; keep the
technical rationale.

Co-Authored-By: Claude <[email protected]>
@ruel225

ruel225 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Cleaned up the ticket-specific inline-comment lore (removed issue-number references, kept the technical rationale) and rebased against current main; CI is green (0 fail). The remaining actionable item from the last review is addressed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

check-lint failed with exit 143 (oxlint SIGTERM runner shutdown); a
separate shard hit an unrelated CI env ENOENT in cron/command-runner.test.ts
(child.pid). Neither is from this PR's qa-lab changes.

Co-Authored-By: Claude <[email protected]>
@RomneyDa

RomneyDa commented Aug 3, 2026

Copy link
Copy Markdown
Member

this pr appears to have been autogenerated as a response to an issue I made for my pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[Bug]: QA evidence reports requested channel driver instead of realized adapter

3 participants