Skip to content

test(channels): verify built sanitizer semantics - #119151

Merged
steipete merged 1 commit into
mainfrom
codex/qa-campaign-100
Aug 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-campaign-100

Conversation

@steipete

@steipete steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the bundled-channel sanitizer contract's cross-module mock with the real shared sanitizer semantics
  • keep the assertion meaningful by using internal scaffolding that must collapse to one visible answer
  • make the contract identical for source surfaces and generated dist public artifacts

Fixes #119145.

Root cause

The contract mocked the source openclaw/plugin-sdk/text-chunking module. After OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build, five channel public surfaces loaded compiled dist/plugin-sdk/text-chunking.js instead, so the mock could not intercept them. The test therefore failed according to artifact resolution rather than shipped sanitizer behavior.

Proof

  • before: source-only contract passed 144/144; the same head after a private-QA build failed 5 sanitizer assertions
  • node scripts/run-vitest.mjs src/channels/plugins/contracts/plugin-shape.contract.test.ts — 144/144 passed
  • Blacksmith Testbox private-QA build — passed
  • built-artifact contract on Testbox — 144/144 passed
  • pnpm check:changed on Testbox — passed (typecheck, lint, import-cycle and guard lanes)
  • AutoReview, branch against origin/main — clean, no accepted/actionable findings
  • production LOC delta: 0; test diff: +15/-16
  • public model identifier gate: PASS; the diff contains no model identifiers

Risk is low and test-only. No changelog entry is needed.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 4, 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. labels Aug 4, 2026
@steipete

steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 1c1671d9f612ae5ae05d7ea7c0d7dd1f5c06f450:

  • Root cause: the source SDK mock and compiled bundled-plugin artifacts occupy different module graphs after a private-QA build, so five correct channel sanitizers could not hit the mock.
  • Canonical fix: assert the public channel surfaces against real shared sanitizer semantics; no production path changed.
  • Exact-head build: OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build passed on Blacksmith Testbox tbx_01kz5wqbsh2pf4efc0awwaqth3 (run 30890265271).
  • Exact-head regression: pnpm test src/channels/plugins/contracts/plugin-shape.contract.test.ts passed 144/144 on the same built checkout and lease.
  • Broad gate: pnpm check:changed passed typecheck, lint, import-cycle, and guard lanes before the final no-conflict rebase; exact-head hosted CI is green or still completing below.
  • AutoReview: fresh branch review against origin/main at the pushed head is clean with no accepted/actionable findings.
  • Public model identifier audit: PASS; the diff adds no model identifiers.
  • Diff: one test file, +15/-16; production LOC delta 0. No changelog entry is needed for a test-only repair.

Observed proof gap: the external Testbox portal sync warning is a coordinator-auth warning after successful commands; it did not affect the lease, build, or test result.

@clawsweeper clawsweeper Bot added 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 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 4:09 AM ET / 08:09 UTC.

ClawSweeper review

What this changes

The PR replaces a mock-based bundled-channel sanitizer assertion with an assertion that source and built public artifacts produce the canonical visible-text result.

Regression provenance

Possible regression — probable (reproduction; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this focused PR open: it repairs a current-main contract test that falsely depends on source-module mock identity after built artifacts load a separate module graph. No blocking patch defect was found. Likely related people: Peter Steinberger for the original contract surface and Vincent Koc for the current mock and sanitizer regression coverage.

Priority: P3
Reviewed head: 1c1671d9f612ae5ae05d7ea7c0d7dd1f5c06f450

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair with relevant built-artifact proof and no supported correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.
Evidence reviewed 5 items Semantic contract on PR head: The changed test derives its expected value from the public SDK sanitizer, asserts the mixed tool-scaffolding fixture reduces to visible prose, then compares every listed channel hook against that result.
Canonical sanitizer and independent regression coverage: The SDK facade exports the delivery sanitizer, whose established regression test uses the same Minimax XML, tool-result, bracketed call, Arguments, and think-tag fixture and expects only the visible answer.
Artifact and delivery owner boundary: The contract helper loads generated public plugin artifacts, while normal outbound delivery invokes the channel-provided sanitizer before payload normalization; comparing outcomes is therefore the correct cross-artifact contract.
Findings None None.
Security None None.

How this fits together

Bundled channel plugins sanitize internal tool scaffolding before sending an agent reply. The contract loader imports each channel’s public artifact and the test verifies its outbound hook preserves the shared visible-text behavior.

flowchart LR
A[Agent reply text] --> B[Canonical visible-text sanitizer]
B --> C[Channel outbound hook]
C --> D[Source or built public artifact]
D --> E[Channel delivery]
D --> F[Contract test]
F --> G[Shared visible reply result]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied context omits the body of the latest ClawSweeper bot comment, so any Rank-up moves in that comment should be checked before landing.
  • Complete next step (P2) - No repair worker is needed because this is already a focused active implementation PR; it only needs normal exact-head landing validation.
Agent review details

Security

None.

PR surface

Tests -1. Total -1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 16 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 15 16 -1

Review metrics

Metric Value Why it matters
Production vs test LOC delta production +0/-0, tests +15/-16 The PR replaces one resolver-dependent test contract with a behavior-level assertion and adds no runtime surface.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the semantic visible-text assertion and merge it once exact-head checks and any current ClawSweeper Rank-up moves are clear.
  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 semantic visible-text assertion and merge it once exact-head checks and any current ClawSweeper Rank-up moves are clear.

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

Yes. The linked report gives a concrete private-QA build plus contract-test path, and source shows why built artifacts bypass the source-module mock; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Comparing canonical visible-text output is the best fix because source and built artifacts need not share Vitest’s mocked module instance, while delivery behavior must remain identical.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a low-risk test-contract repair with no production behavior, configuration, or delivery-path change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.
  • 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): The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.

Label justifications:

  • P3: This is a low-risk test-contract repair with no production behavior, configuration, or delivery-path 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): The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports an after-fix private-QA build and built-artifact contract run with 144/144 passing, which directly exercises the affected non-visual behavior.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced the bundled artifact parity and plugin-shape contract suite, then carried subsequent sanitizer-wiring and bundled-channel refactors. (role: original contract-surface author and recent channel refactor contributor; confidence: high; commits: 6bd14d9129d2, 446816f751db, 9e4381eb1c8c; files: src/channels/plugins/contracts/plugin-shape.contract.test.ts)
  • Vincent Koc: Blame attributes both the resolver-sensitive mock and the identical canonical sanitizer regression fixture to this recent area work. (role: recent sanitizer-contract contributor; confidence: high; commits: dc11c7892777, a1c689e375ec; files: src/channels/plugins/contracts/plugin-shape.contract.test.ts, src/shared/text/assistant-visible-text.test.ts)
  • Anuj Bolewar: Recent visible-text sanitizer work covers the same tool-marker preservation and removal boundary. (role: recent adjacent sanitizer contributor; confidence: medium; commits: 5a535d9fd42a; files: src/shared/text/assistant-visible-text.test.ts)

Rank-up moves

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

  • Before landing, check the latest ClawSweeper comment and clear any Rank-up moves for this exact head.

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 4, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper Rank-up moves: checked for reviewed head 1c1671d9f612ae5ae05d7ea7c0d7dd1f5c06f450.

  • The only rank-up move is the recursive instruction to check the latest ClawSweeper comment; this is that latest comment and contains no additional patch or proof request.
  • The listed exact-head landing validation is complete: private-QA build passed, the built-artifact contract passed 144/144, fresh AutoReview is clean, and openclaw/ci-gate is green.

No move is being skipped.

@steipete
steipete merged commit b0c5d48 into main Aug 4, 2026
127 of 131 checks passed
@steipete
steipete deleted the codex/qa-campaign-100 branch August 4, 2026 08:20
@steipete

steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
…checkpoint

* origin/main: (46 commits)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  fix(scripts): prevent gateway benchmarks from stalling on probes (#119063)
  test(channels): verify built sanitizer semantics (#119151)
  fix: prevent live updater from leaving Gateway offline indefinitely (#119116)
  test(qa): restore memory tools primary ownership (#119142)
  fix(agents): settle yielded fanout at harness boundary (#118703)
  fix(codex): cap compaction override warning cache via createDedupeCache (#101745)
  fix(daemon): skip unlabeled launchd plists (#119091)
  test(qa): repair QA catalog integrity (#119140)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: XS 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.

Test: built channel artifacts bypass sanitizer contract mock

1 participant