Skip to content

test(matrix): delivery trace goldens for generation-scoped edit streaming#104596

Merged
steipete merged 1 commit into
mainfrom
claude/chanref-p0-traces-matrix
Jul 11, 2026
Merged

test(matrix): delivery trace goldens for generation-scoped edit streaming#104596
steipete merged 1 commit into
mainfrom
claude/chanref-p0-traces-matrix

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #104318

What Problem This Solves

Extends the delivery trace harness (#104478) to Matrix — the per-generation edit-streaming channel whose five-path finalization (in-place, replace, redact+resend on mention activation, media, abandon) is the richest lifecycle the planned core preview engine must express.

Why This Change Was Made

Four golden scenarios drive the real room-message handler deliver wiring with a recording plain-room client (E2EE out of scope) under fake timers: multi-generation streaming (per-generation preview events, cumulative slices, m.replace edits, block finalize-in-place, final replace-edit); final-in-place (live-marker clear); final-mentions-fresh (mentions-inert preview → redact → fresh event carrying m.mentions); cancel/abandon. Edit-minted event ids are canonicalized while the stable m.relates_to target is preserved — the receipt-stability seam v2's Receipt design needs. Warts pinned as oracles include: a getEvent round-trip before every edit even when the mention-diff result is unused; the abandon path flushing a throttled edit and immediately redacting it; MSC4357 marker duplication into m.new_content in plain rooms; empty m.mentions stamped on replace-edits.

User Impact

None at runtime — test infrastructure.

Evidence

  • Testbox tbx_01kx92tk52bh4e4e2xw9k96p6s: full matrix suite + pnpm check:changed green; stability run tbx_01kx937xkfkca4p3cyerrtvnsr: trace tests 4/4 twice in verify mode, goldens byte-stable, repo-wide format:check clean (that shard bit two sibling trace PRs — proven green here up front).
  • Autoreview (codex gpt-5.6-sol, xhigh): clean (0.91).

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: M maintainer Maintainer-authored PR labels Jul 11, 2026
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 1:49 PM ET / 17:49 UTC.

Summary
The PR adds an end-to-end Matrix delivery-trace test and four deterministic JSONL goldens covering multi-generation streaming, final-in-place, final mention activation, and cancellation.

PR surface: Source +62, Tests +362. Total +424 across 5 files.

Reproducibility: not applicable. This PR records established Matrix delivery behavior rather than reporting or fixing a runtime defect.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104318
Summary: This PR is the Matrix Phase 0 behavior-lock implementation candidate for the canonical channel-refactor program and directly extends the merged shared trace harness.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
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:

  • none.

Next step before merge

  • [P1] No automated repair is needed; normal protected-label maintainer review and merge gating remain.

Security
Cleared: The diff only adds test logic and inert JSONL fixtures, with no dependency, workflow, permissions, secret, install, release, or production execution changes.

Review details

Best possible solution:

Merge the focused Matrix conformance oracle after normal protected-label review; it accurately captures current lifecycle behavior through the canonical shared harness without changing production code.

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

Not applicable; this PR records established Matrix delivery behavior rather than reporting or fixing a runtime defect.

Is this the best way to solve the issue?

Yes; using the shared trace runner with the real Matrix handler and client boundary is the narrowest maintainable approach, and it complements existing focused unit tests without duplicating production logic.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: The PR is low-risk test and refactor-safety infrastructure with no production or user-facing behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The protected maintainer-labeled, test-only PR is exempt from the external contributor real-behavior proof gate; its cited Testbox full-suite and byte-stability runs are suitable supplemental validation.

Label justifications:

  • P3: The PR is low-risk test and refactor-safety infrastructure with no production or user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The protected maintainer-labeled, test-only PR is exempt from the external contributor real-behavior proof gate; its cited Testbox full-suite and byte-stability runs are suitable supplemental validation.
Evidence reviewed

PR surface:

Source +62, Tests +362. Total +424 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 62 0 +62
Tests 1 362 0 +362
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 424 0 +424

What I checked:

  • Production-path coverage: The new test drives the real Matrix room-message handler through captured dispatcher callbacks and records the Matrix client boundary rather than reimplementing delivery behavior. (extensions/matrix/src/delivery-trace.test.ts:149, 61befa4f3b53)
  • Shared runner contract: The common trace runner executes generic scripted steps under deterministic fake timers and verifies canonically serialized committed goldens; scenario names are opaque to the runner. (src/channels/plugins/contracts/trace/delivery-trace.ts:223, ba826be268a7)
  • Matrix behavior fidelity: Current Matrix draft streaming creates and edits a stable logical preview event, keeps preview mentions inert, supports live-marker finalization, and exposes reset/redaction behavior matching the proposed scenarios. (extensions/matrix/src/matrix/draft-stream.ts:31, 49ff54e63af5)
  • Edit wire semantics: Current Matrix edits fetch the original event, preserve its m.replace target, calculate mention changes when enabled, and mint a replacement event through sendMessage, matching the recorded wire traces. (extensions/matrix/src/matrix/send.ts:591, 49ff54e63af5)
  • Complementary existing tests: Adjacent handler tests already assert generation changes, block ownership, and late block boundaries; the PR adds the missing full ordered wire trace across those callbacks. (extensions/matrix/src/matrix/monitor/handler.test.ts:3875, 49ff54e63af5)
  • Current-main drift: No relevant Matrix source, shared trace-contract, SDK-facade, or package-export changes occurred between the PR base and current main, so the reviewed behavior context remains current. (49ff54e63af5)

Likely related people:

  • vincentkoc: GitHub history and blame identify this contributor with the current Matrix draft-stream, edit, and handler finalization implementation covered by the new traces. (role: recent Matrix behavior contributor; confidence: high; commits: e8c83ac0b4fd; files: extensions/matrix/src/matrix/draft-stream.ts, extensions/matrix/src/matrix/monitor/handler.ts, extensions/matrix/src/matrix/send.ts)
  • steipete: Introduced the merged delivery-trace framework and sibling Feishu and Mattermost golden suites that this PR extends. (role: shared harness introducer; confidence: high; commits: ba826be268a7; files: src/channels/plugins/contracts/trace/delivery-trace.ts, extensions/feishu/src/delivery-trace.test.ts, extensions/mattermost/src/delivery-trace.test.ts)
  • gumadeiras: Introduced the partial-versus-quiet Matrix preview mode split configured by the new trace suite. (role: Matrix preview-streaming contributor; confidence: medium; commits: 8a841b531fd2; files: extensions/matrix/src/matrix/draft-stream.ts, extensions/matrix/src/matrix/monitor/handler.ts)
  • TigerInYourDream: Introduced the MSC4357 live streaming marker behavior captured by the proposed goldens. (role: Matrix live-marker contributor; confidence: medium; commits: 65ef70b0702d; files: extensions/matrix/src/matrix/draft-stream.ts, extensions/matrix/src/matrix/send.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.

@steipete
steipete merged commit 8bebdd0 into main Jul 11, 2026
138 of 146 checks passed
@steipete
steipete deleted the claude/chanref-p0-traces-matrix branch July 11, 2026 17:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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