Skip to content

refactor(qa): migrate Matrix scenarios into QA Lab - #103589

Merged
RomneyDa merged 32 commits into
mainfrom
dallin/unify-matrix-release-qa-pr2-scenarios
Jul 15, 2026
Merged

RomneyDa merged 32 commits into
mainfrom
dallin/unify-matrix-release-qa-pr2-scenarios

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Stack 2 of 4. Depends on #101253.

What Problem This Solves

Matrix QA scenarios and profile selection still live in the legacy qa-matrix
runner, so QA Lab cannot own or validate the complete Matrix catalog through the
same declarative flow system used by other channel drivers.

Why This Change Was Made

Move the Matrix scenario implementations, Docker substrate, and 94-scenario
parity catalog into QA Lab, with deterministic profile selection and
module-backed YAML flows. Keep qa-matrix as a thin CLI/registration shim for
the remaining stacked callers; workflow migration and package removal stay in
successor PRs 3 and 4.

User Impact

There is no production messaging behavior change. QA maintainers get one
canonical Matrix scenario catalog in QA Lab, while the existing
openclaw qa matrix command and generic live Matrix adapter remain compatible
during the stack.

Evidence

  • Parity tests cover all 94 legacy scenario ids: 81 module-backed Matrix flows
    plus 13 intentional mappings to portable QA Lab scenarios.
  • Profile tests preserve the legacy counts and explicit-only exclusions.
  • Blacksmith Testbox focused proof passed 24 files / 232 tests across QA Lab,
    the compatibility shim, and the plugin SDK runtime surface.
  • The real release-profile command passed 2/2 Docker-backed scenarios on
    Blacksmith Testbox: channel-chat-baseline and
    matrix-allowlist-hot-reload.
  • Exact-head changed-surface proof passed all static guards and the full tsgo
    project build. The two lint diagnostics were fixed and rechecked with focused
    tests plus zero-warning targeted lint.
  • Fresh autoreview completed clean after the fixes, with no accepted or
    actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts extensions: qa-lab size: XL maintainer Maintainer-authored PR labels Jul 10, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review July 10, 2026 09:10
@RomneyDa
RomneyDa requested a review from a team as a code owner July 10, 2026 09:10
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/qa-lab/package.json
  • extensions/qa-matrix/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 10, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes are blocked

OpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph.

Detected dependency graph changes:

  • pnpm-lock.yaml changed.
  • extensions/qa-lab/package.json changed dependencies.
  • extensions/qa-matrix/package.json changed dependencies, devDependencies, peerDependencies, peerDependenciesMeta, name, version.

Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:

  • extensions/qa-lab/package.json changed dependencies.
  • extensions/qa-matrix/package.json changed dependencies, devDependencies, peerDependencies, peerDependenciesMeta, name, version.

Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed.

To remove lockfile changes, restore them from the target branch:

git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git push

If this PR intentionally needs a dependency graph change, ask a repository admin or member of @openclaw/openclaw-secops to comment:

/allow-dependencies-change

The action will approve the current head SHA (c6a0c1040f39291a22f2a8977396bbffe2c8cc03) when it reruns. A later push requires a fresh approval.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 15, 2026, 12:16 AM ET / 04:16 UTC.

Summary
Moves the Matrix QA scenario catalog, profiles, Docker substrate, and adapter runtime into QA Lab, keeps qa-matrix as a compatibility shim, adds a generic flow-preparation adapter hook, and detaches reloaded channel startup from request-root work admission.

Reproducibility: not applicable. this is a refactor rather than a reported current-main bug. The branch provides high-confidence parity, focused tests, and Docker-backed live execution for the migrated behavior.

Review metrics: 3 noteworthy metrics.

  • Plugin API surface: 1 optional adapter hook added. prepareFlow becomes a new compatibility-sensitive extension point that needs an explicit durable-contract decision.
  • Gateway lifecycle surface: 1 helper added, 2 restart call sites changed. The PR changes which async context owns production channel startup during reloads.
  • Dependency ownership: 2 manifests and 1 lockfile changed. Matrix QA dependencies move between plugin packages and require exact-head dependency authorization.

Stored data model
Persistent data-model change detected: migration/backfill/repair: extensions/qa-lab/src/live-transports/matrix/legacy-scenario-parity.test.ts, serialized state: extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-config.ts, serialized state: extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-e2ee-destructive-recovery.ts, serialized state: extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-e2ee-destructive.ts, serialized state: extensions/qa-matrix/src/runners/contract/scenario-runtime-e2ee-destructive.ts, unknown-truncated-pull-files, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #103589
Summary: This PR is the canonical stack-2 Matrix scenario migration; the merged prerequisite and open workflow successor are adjacent stack stages rather than duplicates.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
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:

  • Resolve the current-main conflicts without broadening scope, then rerun exact-head focused and live proof.
  • Obtain repository admin or security authorization for the final dependency graph SHA.
  • Record the maintainer decision on whether the Gateway lifecycle change stays integrated or moves to a separate PR.

Risk before merge

  • [P1] The new optional QA adapter prepareFlow hook expands a plugin-facing contract; maintainers must confirm this is the intended durable API rather than a Matrix-specific migration seam.
  • [P1] Starting reloaded channels outside request-root admission changes production Gateway restart ownership; an incorrect lifecycle boundary could allow channel work to outlive or race shutdown and reload drains.
  • [P1] The dependency ownership move changes two package manifests and the resolved graph and still requires exact-head repository admin or security authorization.
  • [P1] The branch is conflict-dirty against current main, so its proof and scope must be refreshed after resolving the three-way merge.

Maintainer options:

  1. Approve, rebase, and re-prove (recommended)
    Accept the plugin and Gateway lifecycle boundaries, resolve current-main conflicts, authorize the exact dependency graph, and rerun the focused live and lifecycle proof.
  2. Separate production lifecycle scope
    Extract the Gateway admission helper and channel-restart changes so the QA migration can be reviewed independently from process availability semantics.
  3. Pause the stack
    Close or redesign the stack if maintainers do not want the new plugin contract or QA Lab ownership model.

Next step before merge

  • [P2] A maintainer must decide the permanent plugin and Gateway lifecycle boundaries, authorize the final dependency graph, and review the conflict-resolved exact head; there is no narrow autonomous repair to dispatch.

Maintainer decision needed

  • Question: Should this stack land with the new generic prepareFlow plugin API and production runOutsideGatewayRootWorkAdmission channel-restart behavior, after exact-head dependency authorization and conflict resolution?
  • Rationale: Tests establish the proposed behavior, but automation cannot decide whether these compatibility-sensitive API and Gateway lifecycle boundaries are the intended permanent architecture or whether the production change should be reviewed separately.
  • Likely owner: RomneyDa — They own the merged prerequisite and current migration stack and are best positioned to present the intended boundary for final owner approval.
  • Options:
    • Approve the integrated scope (recommended): Confirm both architectural boundaries, resolve the conflicts, authorize the final dependency graph, and rerun exact-head proof before merge.
    • Split the Gateway lifecycle change: Keep the Matrix catalog migration and adapter hook here, but move the production work-admission helper and reload call sites into a separately reviewed PR.
    • Pause the migration stack: Do not land this stack if QA Lab should not own Matrix scenarios through this generic API or if the compatibility shim plan is no longer desired.

Security
Needs attention: No vulnerability is identified, but the intentional dependency graph move remains blocked until an authorized reviewer approves the exact final head.

Review details

Best possible solution:

Land a conflict-free stack where QA Lab owns the complete Matrix catalog, qa-matrix remains only the temporary registration shim, the generic flow-preparation contract is explicitly accepted and tested, the Gateway lifecycle change is either independently approved or split out, and the final dependency graph is authorized for the exact head.

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

Not applicable: this is a refactor rather than a reported current-main bug. The branch provides high-confidence parity, focused tests, and Docker-backed live execution for the migrated behavior.

Is this the best way to solve the issue?

Unclear pending maintainer intent: consolidating Matrix QA into QA Lab is coherent and well-proven, but the best implementation depends on whether the generic plugin hook and production Gateway lifecycle change should land together or be split.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded but large QA architecture refactor with limited production surface and no demonstrated user-facing regression.
  • merge-risk: 🚨 compatibility: The PR adds a plugin adapter hook, moves package dependency ownership, and preserves a temporary compatibility shim across a stacked migration.
  • merge-risk: 🚨 availability: The PR changes production channel restart work-admission ownership, which could affect reload and shutdown availability if the lifecycle boundary is wrong.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR includes after-change Docker-backed execution of both release-profile Matrix scenarios plus exact-head Testbox and CI output covering the migrated runtime; private runtime details should remain redacted in any refreshed evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes after-change Docker-backed execution of both release-profile Matrix scenarios plus exact-head Testbox and CI output covering the migrated runtime; private runtime details should remain redacted in any refreshed evidence.
Evidence reviewed

Security concerns:

  • [medium] Authorize the final dependency graph — extensions/qa-lab/package.json:8
    The PR moves Matrix QA dependencies between plugin packages and changes the lockfile; repository policy requires admin or security approval for the exact rebased head before merge.
    Confidence: 0.99

What I checked:

Likely related people:

  • RomneyDa: Authored the merged stack-1 prerequisite that established shared Matrix flows on current main and has carried the Matrix QA migration, parity repairs, and current stack through repeated review cycles. (role: feature owner and recent area contributor; confidence: high; commits: c46453636198, 54d31a130693; files: extensions/qa-lab/src/live-transports/matrix/adapter.runtime.ts, extensions/qa-lab/src/live-transports/matrix/profiles.ts, src/plugin-sdk/qa-runner-runtime.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.
Review history (30 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-14T23:13:21.679Z sha 0555b8a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T23:25:27.613Z sha 0555b8a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T23:39:04.140Z sha 0555b8a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T23:52:46.239Z sha 0555b8a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T00:19:51.296Z sha 550299c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T00:50:49.355Z sha 550299c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T01:56:02.691Z sha b262fd2 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T03:04:38.306Z sha b262fd2 :: needs maintainer review before merge. :: none

@RomneyDa

RomneyDa commented Jul 10, 2026 •

Copy link
Copy Markdown
Member Author

The PR head is now 150e3331f85 after repairing the package-boundary declaration artifacts and UTF-16-safe preview parity identified by CI and ClawSweeper. The intentional dependency ownership move is unchanged: Matrix QA dependencies move from the temporary qa-matrix package into qa-lab with the scenario implementation.

Repository admin or @openclaw/openclaw-secops approval is still required for this exact head. After reviewing the dependency move, please comment:

/allow-dependencies-change

@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed both ClawSweeper findings on current head 150e3331f85:

  • bec1c0523ea adds the Matrix test API to the canonical package-boundary map and prepares its declaration artifacts.
  • 150e3331f85 restores UTF-16-safe truncation for all 11 moved Matrix preview fields with shared regression coverage.

Proof:

  • pnpm test src/plugins/contracts/extension-package-project-boundaries.test.ts: 8/8 passed.
  • pnpm test test/scripts/prepare-extension-package-boundary-artifacts.test.ts: 16/16 passed.
  • pnpm test:extensions:package-boundary:compile: all 120 extension packages passed, including QA Lab.
  • Focused Matrix shared/scenario tests passed on Blacksmith Testbox tbx_01kx6cppxpgcn5anykcxq978t0.
  • Fresh autoreview completed clean after each repair with no accepted/actionable findings.
  • Exact-head CI is green except the intentional dependency authorization gate. The current-head approval request is above.

Fresh ClawSweeper review event: https://github.com/openclaw/clawsweeper/actions/runs/29106660363

@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 10, 2026
@RomneyDa
RomneyDa force-pushed the dallin/unify-matrix-release-qa branch 3 times, most recently from 2af8061 to 4c775be Compare July 13, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix channel: qa-channel Channel integration: qa-channel dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant