Skip to content

refactor(matrix): consolidate monitor test fixtures - #118175

Merged
steipete merged 1 commit into
mainfrom
codex/goal100k-matrix-monitor-fixture-wave19-2d45
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/goal100k-matrix-monitor-fixture-wave19-2d45

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Matrix monitor regression tests repeated large direct-room, group-history, and subagent-binding fixture payloads, making security and lifecycle cases harder to audit and maintain.

Why This Change Was Made

Consolidates only test-local fixtures in the three affected suites. All 74 test titles and all 123 static assertions remain exact; runtime, config, crypto, and schema code are unchanged.

User Impact

No user-visible behavior change. The same DM privacy, history watermark/retry, cross-account session binding, delivery, and failure behavior remains covered with 377 fewer test LOC.

Evidence

  • Diff: +238/-615, net -377 test LOC; production/config/crypto/schema delta 0.
  • Exact parity: 74 test titles and 123 static assertions.
  • Blacksmith Testbox lease tbx_01kz20z8espeq65y5fa0tk1m6k; hydration run https://github.com/openclaw/openclaw/actions/runs/30764603641.
  • Focused proof: 3 files, 74/74 tests passed.
  • Full Matrix proof: 120 files, 1,832/1,832 tests passed, including verification and crypto suites.
  • Channels proof: 84 files, 1,032/1,032 tests passed.
  • Changed gate passed: extension typecheck green; lint 0 warnings and 0 errors.
  • Autoreview clean at 0.99 confidence; two independent xhigh reviews clean.
  • Exact-path open-PR collision census: zero at 2026-08-02T20:12:46Z.
  • Synthetic merge tree against origin/main b8a6ea1 completed without conflicts.

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: L maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 20:13
@steipete steipete self-assigned this Aug 2, 2026
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 4:19 PM ET / 20:19 UTC.

ClawSweeper review

What this changes

This PR replaces repeated Matrix monitor test inputs with shared fixture helpers while keeping the same direct-message, group-history, and subagent-binding assertions.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness or security finding surfaced. This focused test-only refactor preserves the Matrix monitor scenarios while reducing repeated fixture setup; it should remain open for ordinary maintainer review because it is explicitly labeled maintainer and assigned.

Priority: P3
Reviewed head: 6734f26ea7736d0e1d48b20f4cf972272e8992d6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, test-only consolidation with preserved scenario coverage and successful reported validation.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.
Evidence reviewed 5 items Test-only scope: The sole PR commit changes only three Matrix test files; no production, configuration, schema, crypto, package, or workflow path is touched.
Shared direct-message input is safe: The direct-room tracker only reads and destructures its check input, so replacing repeated object literals with one shared immutable-by-convention fixture does not retain or mutate test state.
Group-history helper preserves scenario overrides: The new harness helper applies the common history, policy, direct-message, and final-reply defaults before spreading each test's explicit options, retaining per-scenario overrides.
Findings None None.
Security None None.

How this fits together

The Matrix plugin receives room events and subagent lifecycle events, then applies direct-message classification, group-history preparation, and session-binding delivery rules. The changed tests exercise those boundaries without modifying the plugin runtime, configuration, persistence, or delivery code.

flowchart LR
  A[Matrix room events] --> B[Direct-message classifier]
  A --> C[Group-history handler]
  D[Subagent lifecycle events] --> E[Session-binding hooks]
  B --> F[Matrix monitor behavior]
  C --> F
  E --> F
  G[Shared test fixtures] --> B
  G --> C
  G --> E
Loading

Before merge

  • Complete next step (P2) - No mechanical repair is needed; the remaining action is routine review of a protected, assigned maintainer PR.
Agent review details

Security

None.

PR surface

Tests -377. Total -377 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 238 615 -377
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 238 615 -377

Review metrics

None.

Technical review

Best possible solution:

Land the fixture consolidation as a test-only cleanup once the assigned maintainer completes normal review, retaining the shared helpers as the canonical setup for these Matrix regression scenarios.

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

Not applicable: this PR refactors regression-test fixtures rather than reporting or changing a runtime behavior. The focused Matrix test path is explicit in the changed suites and has reported after-fix test proof.

Is this the best way to solve the issue?

Yes. Consolidating repeated test-local inputs at each suite's existing owner boundary keeps the assertions and runtime coverage intact without introducing a production abstraction or parallel behavior path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is low-risk test maintenance with no runtime or user-facing behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.

Label justifications:

  • P3: This is low-risk test maintenance with no runtime or user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.
  • proof: sufficient: Contributor real behavior proof is sufficient. For this test-only refactor, the PR supplies after-fix focused and broader Matrix/channel test results, and the supplied exact-head check state includes a successful Real behavior proof run.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Feature-history shortlog shows the strongest contribution volume across the three affected Matrix test files, and this PR continues that test-maintenance work. (role: frequent Matrix test contributor; confidence: high; commits: 6734f26ea773; files: extensions/matrix/src/matrix/monitor/direct.test.ts, extensions/matrix/src/matrix/monitor/handler.group-history.test.ts, extensions/matrix/src/matrix/subagent-hooks.test.ts)
  • Shakker: Current-main blame and recent history tie the latest nearby session-mutation safeguards to this Matrix subagent test surface. (role: recent area contributor; confidence: medium; commits: c0104d567582; files: extensions/matrix/src/matrix/subagent-hooks.test.ts, extensions/matrix/src/matrix/subagent-hooks.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.

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper before-merge item addressed: ordinary maintainer review is complete on exact head 6734f26ea7736d0e1d48b20f4cf972272e8992d6. Two independent xhigh reviews are clean after the concurrent bind-mock strictness correction; native review artifacts are validated; focused 74/74, Matrix 1,832/1,832, channels 1,032/1,032, changed gate, and exact-head openclaw/ci-gate are green. No mechanical repair or re-review is needed.

@steipete
steipete merged commit 04b9491 into main Aug 2, 2026
157 of 166 checks passed
@steipete
steipete deleted the codex/goal100k-matrix-monitor-fixture-wave19-2d45 branch August 2, 2026 20:24
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 2, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (#118193)
  fix(config): preserve secret ownership when configuration rows move (#118149)
  fix(cron): deliver failure alerts after persistence (#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (#118098)
  perf(gateway): remove streaming hot-path rescans (#118192)
  test(gateway): use in-memory task registry (#118191)
  test(macos): fix three races in the bounded process suites (#118196)
  refactor(migrate-hermes): consolidate test fixtures (#118182)
  test(android): share Wear transport fixtures (#118177)
  test(ui): deduplicate control UI e2e setup (#118180)
  fix(plugins): unblock prerelease validation (#118103)
  test(cli): reduce redundant process launches (#118141)
  test(gateway): compact terminal observer fixtures (#118179)
  fix(agents): make requested threads sidebar-visible (#118073)
  test(plugins): canonicalize native resolver fixtures (#118174)
  test: deduplicate agent runner fixtures (#118176)
  refactor(policy): consolidate doctor test fixtures (#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (#118127)
  refactor(matrix): consolidate monitor test fixtures (#118175)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (openclaw#118193)
  fix(config): preserve secret ownership when configuration rows move (openclaw#118149)
  fix(cron): deliver failure alerts after persistence (openclaw#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (openclaw#118098)
  perf(gateway): remove streaming hot-path rescans (openclaw#118192)
  test(gateway): use in-memory task registry (openclaw#118191)
  test(macos): fix three races in the bounded process suites (openclaw#118196)
  refactor(migrate-hermes): consolidate test fixtures (openclaw#118182)
  test(android): share Wear transport fixtures (openclaw#118177)
  test(ui): deduplicate control UI e2e setup (openclaw#118180)
  fix(plugins): unblock prerelease validation (openclaw#118103)
  test(cli): reduce redundant process launches (openclaw#118141)
  test(gateway): compact terminal observer fixtures (openclaw#118179)
  fix(agents): make requested threads sidebar-visible (openclaw#118073)
  test(plugins): canonicalize native resolver fixtures (openclaw#118174)
  test: deduplicate agent runner fixtures (openclaw#118176)
  refactor(policy): consolidate doctor test fixtures (openclaw#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (openclaw#118127)
  refactor(matrix): consolidate monitor test fixtures (openclaw#118175)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

1 participant