Skip to content

test(text): consolidate literal sanitizer cases - #139579

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-visible-text-tables
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-visible-text-tables

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

The assistant-visible-text suite repeats identical assertion bodies for literal sanitizer inputs, adding test code without distinct execution mechanics.

Why This Change Was Made

Put 47 literal name/input/expected triples into two named tables using explicit it(name, ...) registration. Retain every input, expected string, parser option and assertion invocation; other test bodies remain unchanged. Production parser code is unchanged.

User Impact

No production behavior changes or scenarios removed. Long test names remain complete. Net 51 test lines removed.

Evidence

All 129 full test identities match baseline and pass. Structural checks preserve all 47 literal triples, one action/assertion per case and the untouched test program. Registration order changes only within the existing pure-test scopes; no ordering-sensitive state was found.

The full changed gate, formatting/diff checks, deslop and independent P2 review pass. Recorded wrapper timing was 1.41s before and 1.02s after; no meaningful runtime improvement is claimed.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 00:55
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 9:00 PM ET / September 6, 2026, 01:00 UTC.

ClawSweeper review

What this changes

Consolidates 47 sanitizer test cases into two tables while preserving their names, inputs, expected outputs, and parser options.

Merge readiness

✅ Ready for maintainer review

This remains a useful, scoped batch in the maintainer-requested test audit. The complete introduced diff preserves the literal cases and assertion behavior; no actionable defect was found, and the consolidation is absent from fetched main.

Priority: P3
Reviewed head: 55f9c0f12c1f96d6a15f88871becfceaf3f2229b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coverage-preserving cleanup with clear campaign context and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored consolidation changes test registration only; runtime proof is not required, and the supplied test-preservation results are appropriate supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored consolidation changes test registration only; runtime proof is not required, and the supplied test-preservation results are appropriate supplemental validation.
Evidence reviewed 6 items Complete introduced diff: Read the complete pinned merge-base-to-head diff, including the portion truncated in the supplied context. The two loops retain 37 scaffolding cases and 10 opt-in XML cases, each registered separately with its original name and assertion semantics.
Current-main necessity: The sanitizer and its test file are identical between the pinned merge base and fetched main, so main still contains the unconsolidated cases. Host-verified test-merge evidence also limits the merge result to this test file; unrelated UI changes are base-branch work.
Assertion and ordering boundary: Read the full test file and sanitizer implementation. The moved cases use immutable strings, synchronous assertions, and no test lifecycle hooks or mocks. XML parsing state is initialized per invocation, and the second table retains stripFunctionCallsXmlPayloads: true.
Findings None None.
Security None None.

How this fits together

OpenClaw’s shared text sanitizer removes internal tool and reasoning markers while preserving readable replies and literal examples. These tests protect that distinction for delivery and history consumers.

flowchart LR
 A[Assistant text] --> B[Shared text sanitizer]
 B --> C[Recognize internal markers]
 B --> D[Protect literal examples]
 C --> E[Visible reply text]
 D --> E
 F[Named test cases] --> B
 E --> G[Expected text assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -51. Total -51 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 236 287 -51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 236 287 -51

Review metrics

Metric Value Why it matters
Behavioral case retention 47 cases retained across 2 tables The consolidation preserves separate test identities and assertions rather than removing regression scenarios.

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR implements one explicitly listed batch of the broader test-audit campaign.

Members:

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

Technical review

Best possible solution:

Retain independently named behavioral cases while sharing their identical assertion bodies, without claiming a full-suite performance gain.

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

Not applicable: this PR addresses repetitive test bodies rather than a reported runtime defect; the duplication is directly visible in the baseline diff.

Is this the best way to solve the issue?

Yes: two typed tables preserve individual registrations and the existing assertion helpers without introducing production seams or weakening expectations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0df5050a7649.

Labels

Label changes:

  • add P3: This is a bounded test-maintenance cleanup with no production 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: This maintainer-authored consolidation changes test registration only; runtime proof is not required, and the supplied test-preservation results are appropriate supplemental validation.

Label justifications:

  • P3: This is a bounded test-maintenance cleanup with no production 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: This maintainer-authored consolidation changes test registration only; runtime proof is not required, and the supplied test-preservation results are appropriate supplemental validation.

Evidence

What I checked:

  • Complete introduced diff: Read the complete pinned merge-base-to-head diff, including the portion truncated in the supplied context. The two loops retain 37 scaffolding cases and 10 opt-in XML cases, each registered separately with its original name and assertion semantics. (src/shared/text/assistant-visible-text.test.ts:118, 55f9c0f12c1f)
  • Current-main necessity: The sanitizer and its test file are identical between the pinned merge base and fetched main, so main still contains the unconsolidated cases. Host-verified test-merge evidence also limits the merge result to this test file; unrelated UI changes are base-branch work. (src/shared/text/assistant-visible-text.test.ts, 0df5050a7649)
  • Assertion and ordering boundary: Read the full test file and sanitizer implementation. The moved cases use immutable strings, synchronous assertions, and no test lifecycle hooks or mocks. XML parsing state is initialized per invocation, and the second table retains stripFunctionCallsXmlPayloads: true. (src/shared/text/assistant-visible-text.ts:361, 55f9c0f12c1f)
  • Maintainer-requested scope and supplied validation: The supplied discussion explicitly lists this batch under the open test-audit campaign at Test audit: reduce redundant test code and full-suite runtime #139428. The captured PR body reports preservation and passing execution of all 129 full test identities, structural comparison of all 47 triples, and changed-file checks; it explicitly declines to claim meaningful runtime improvement. These execution results were not independently rerun. (55f9c0f12c1f)
  • Area-history routing: Current-main history identifies Peter Steinberger in recent sanitizer maintenance and prior assertion simplification, with Vincent Koc and Anuj Bolewar in earlier literal-example preservation work. Exact line attribution could not be completed because blame required an unavailable historical object; these are routing candidates, not introduction claims. (src/shared/text/assistant-visible-text.test.ts, 0df5050a7649)
  • Read-only validation: The pinned diff passes whitespace checks, and the checkout remains clean. No tests, build scripts, or additional reviewers were executed. (src/shared/text/assistant-visible-text.test.ts, 55f9c0f12c1f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 merged commit d85142c into main Sep 6, 2026
168 checks passed
@steipete
steipete deleted the codex/test-audit-visible-text-tables branch September 6, 2026 01:06
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (302 commits)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  test(qa): make cleanup child logging deterministic (#139566)
  test(cli): keep Unix socket fixtures within path limits (#139565)
  fix: avoid slow incognito key checks in large session stores (#139528)
  feat(macos): open Gateway windows from the Gateways menu (#139522)
  test(workshop): isolate marker casing fixture identities (#139554)
  fix(process): require cleanup evidence before releasing owned work (#139517)
  ...

# Conflicts:
#	scripts/release-check.ts
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 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. 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