Skip to content

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

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

ruel225 wants to merge 2 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.

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

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]>
@ruel225
ruel225 marked this pull request as ready for review July 30, 2026 02:53
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 11:46 PM ET / July 30, 2026, 03:46 UTC.

ClawSweeper review

What this changes

Threads the transport driver actually created by QA Lab into suite summary and evidence artifacts, so fallback and credential-blocked runs do not claim the requested live driver executed.

Merge readiness

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

Keep open. This focused branch appears to address the linked QA-evidence integrity bug and adds coverage for the prior review concern, but its after-fix evidence is still test-only rather than proof from a real QA suite run that produces the corrected artifact.

Priority: P2
Reviewed head: 39c864b24a07f3b999f53cd4c879e8ea3a744de0

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and the earlier factory-selection concern is covered, but real after-fix behavior proof remains the merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR documents focused tests that exercise artifact-writing paths, but it does not include a redacted after-fix artifact or terminal transcript from a real QA suite run; add that evidence and redact private endpoints, credentials, and identifiers. 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 PR documents focused tests that exercise artifact-writing paths, but it does not include a redacted after-fix artifact or terminal transcript from a real QA suite run; add that evidence and redact private endpoints, credentials, and identifiers. 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 Canonical remaining work: The linked bug remains open and explicitly identifies this PR as its candidate fix; it is maintainer-authored and should remain the canonical tracking item until a fix lands.
Selected-driver propagation: The branch changes the suite transport boundary to return the created adapter together with a driver value, then forwards that prepared fact to all three suite-runner artifact paths.
Artifact precedence: Artifact summary generation now prefers the realized driver over the requested channel-driver parameter, matching the documented distinction between requested configuration and actual execution.
Findings None None.
Security None None.

How this fits together

QA Lab selects a transport adapter for each suite partition and later writes JSON evidence consumed by operators and release-quality tooling. This change carries the selected adapter identity into artifact generation so the recorded execution facts match the transport that actually ran.

flowchart LR
  A[Suite run parameters] --> B[Transport adapter selection]
  B --> C[Realized driver fact]
  C --> D[Suite runners]
  D --> E[Artifact writer]
  E --> F[QA evidence JSON]
  E --> G[Suite summary JSON]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR documents focused tests that exercise artifact-writing paths, but it does not include a redacted after-fix artifact or terminal transcript from a real QA suite run; add that evidence and redact private endpoints, credentials, and identifiers. 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) - Before merge, add redacted after-fix evidence from a real QA suite invocation that writes and inspects qa-evidence.json or qa-suite-summary.json; the PR body currently provides focused tests and CI-oriented validation only.
  • Complete next step (P2) - The remaining blocker is contributor-supplied real-behavior proof, not a narrow code defect that an automated repair worker can establish on the contributor's setup.
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 a focused candidate fix for the open canonical QA-evidence report.

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 the canonical bug open, land this narrow prepared-fact propagation only after a real suite artifact demonstrates the fallback and blocked-partition outputs, then let GitHub close the linked report on merge.
  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 bug open, land this narrow prepared-fact propagation only after a real suite artifact demonstrates the fallback and blocked-partition outputs, then let GitHub close the linked report on merge.

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

No high-confidence live reproduction was established in this review. The linked report and the branch tests give a clear source-level path, but no after-fix real QA suite artifact was supplied.

Is this the best way to solve the issue?

Yes, provisionally: carrying the realized transport fact from adapter creation to artifact writing is narrower and less error-prone than reconstructing execution identity from requested parameters; a real artifact run should confirm every runner path.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label justifications:

  • P2: This corrects deterministic QA evidence integrity for a bounded internal automation surface without an indicated production runtime outage.
  • 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 PR documents focused tests that exercise artifact-writing paths, but it does not include a redacted after-fix artifact or terminal transcript from a real QA suite run; add that evidence and redact private endpoints, credentials, and identifiers. 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:

  • Canonical remaining work: The linked bug remains open and explicitly identifies this PR as its candidate fix; it is maintainer-authored and should remain the canonical tracking item until a fix lands.
  • Selected-driver propagation: The branch changes the suite transport boundary to return the created adapter together with a driver value, then forwards that prepared fact to all three suite-runner artifact paths. (extensions/qa-lab/src/suite.ts:92, 39c864b24a07)
  • Artifact precedence: Artifact summary generation now prefers the realized driver over the requested channel-driver parameter, matching the documented distinction between requested configuration and actual execution. (extensions/qa-lab/src/suite-artifacts.ts:99, 39c864b24a07)
  • Blocked-partition handling: The credential-blocked unified-runner path omits a driver rather than forwarding a requested live driver, while retaining the blocked scenario status. (extensions/qa-lab/src/suite-launch.runtime.ts:818, 39c864b24a07)
  • Prior blocker covered: The latest commit adds regression coverage for a requested live driver whose supplied factories do not match, asserting selection throws rather than returning a fallback while attesting live execution. (extensions/qa-lab/src/suite.test.ts:197, 39c864b24a07)

Likely related people:

  • RomneyDa: Opened the still-open canonical report with a concrete current-main reproduction path and the expected QA-evidence contract. (role: linked bug reporter and canonical-work contact; confidence: low; files: extensions/qa-lab/src/suite.ts, extensions/qa-lab/src/suite-artifacts.ts)

Rank-up moves

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

  • Run a representative QA suite that requests live mode but realizes qa-channel, then attach redacted terminal output and the resulting relevant JSON fields.
  • Run or document a credential-blocked contributed-channel partition and show its artifact records no driver and live: false.

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-07-30T02:57:21.782Z sha 7c8adac :: needs real behavior proof before merge. :: [P1] Record the driver after factory selection

…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]>
@ruel225

ruel225 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@/home/0668001413/.claude/jobs/1e7c40bb/tmp/pr116192_comment.md

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 30, 2026
@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Thanks for the focused work here. Closing as duplicate and incomplete relative to the older canonical repair in #115777. This patch improves several focused paths, but unified, mixed, missing-result, and generic failure artifacts can still report the requested driver instead of the realized driver. The canonical PR carries the realized adapter facts through aggregation and is the route we will continue.

@ruel225

ruel225 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@/home/0668001413/.claude/jobs/1e7c40bb/tmp/pr116192_close.md

ruel225 added a commit to ruel225/openclaw that referenced this pull request Jul 30, 2026
Remove the ClawSweeper/openclaw#116192 reference from the test comment; keep the
technical rationale for the invariant.

Co-Authored-By: Claude <[email protected]>
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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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.

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

2 participants