Skip to content

fix(test): assert tool-result fidelity at each output - #197771

Merged
vincentkoc merged 2 commits into
mainfrom
test/tool-result-fidelity-20261112
Nov 12, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
test/tool-result-fidelity-20261112

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The tool-result reuse test could pass after losing output text: it searched combined results and stored messages for a secret also present in metadata.

User Impact

The existing regression now detects lost text or metadata independently at trajectory capture, delivery callbacks, terminal output and guarded in-memory storage. Production behavior is unchanged.

Why This Change Was Made

Keep the nested and emitted completion routes in one case, preserve the different display/storage image contracts, await the session append, and remove the redundant direct sanitizer replay and unused mock-reset hook. Production/support delta: zero; test delta: +29 lines; physical and expanded case counts remain one. Maintainer test-audit context and retained proof are in test/test-audit-ledger.md.

Evidence

  • Frozen base: a41c7111235fdfcb5e4103edba0e5ff711d7e02c.
  • Original owner/sibling baseline: 50 cases passed (555.94 seconds). Clean repaired case: passed (330.24 seconds).
  • Fault control: emptying sanitizer text passed the original case (488.40 seconds), then failed the repaired case at the first trajectory assertion (135.74 seconds). Both production mutations were restored byte for byte.
  • node scripts/run-tsgo.mjs --noEmit -p test/tsconfig/tsconfig.core.test.agents-root.json, targeted typed lint, formatting and diff checks passed. The matching installed PR toolchain also passed commit hooks.
  • Independent preservation review: no gaps. Full local ClawSweeper review of a41c7111235fdfcb5e4103edba0e5ff711d7e02c..dbdea04a67b99b9541ea64fba03de9a10a3cfe3f: complete, no actionable findings. The later change only updates ledger evidence.
  • All full dead-code checks passed: dependencies (992.35 seconds), unused files (483.07 seconds), and exports (319.31 seconds), with zero findings. Initial concurrent unused-file/export checks hit their 600-second watchdogs; serial retries passed without changing timeouts or source.
  • Exact-head CI passed all 23 executed jobs; CodeQL passed.

The original routes to agents-core and the repaired case to unit-fast. Different worker-cache states and these single runs do not establish a speedup. Storage proof covers the explicit guarded in-memory append, not disk durability or automatic runner persistence.

@clawsweeper

clawsweeper Bot commented Nov 12, 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.

@vincentkoc vincentkoc self-assigned this Nov 12, 2026
@vincentkoc vincentkoc changed the title test(agents): assert tool-result fidelity at each output fix(test): assert tool-result fidelity at each output Nov 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR records a plan to replace pooled tool-result checks with independent assertions for each output.

Example: A tool result contains build output and the same synthetic credential value in metadata.

  • Before: Searching pooled results for that value does not establish that each output preserved its complete text.
  • After: The ledger records independent payload assertions as pending; executable coverage remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The documentation is accurate and introduces no identified defect, but it delivers only the planning portion of the stated repair.
Proof confidence 🐚 platinum hermit (4/6) The reviewed head changes documentation only; shipped-entry-point proof is not required for this diff, and no implemented test repair is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Docs · Worth it: Yes · Fix scope: Partial
User problem: A regression could lose tool-result text without the existing pooled assertions detecting it.
Reason: The maintainer-authored plan addresses a source-verified coverage gap, but this head only documents the intended repair.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored draft open: its ledger accurately identifies an existing assertion gap, but the planned test repair is not implemented. No introduced defect was found in the documentation change.

Priority: P3
Reviewed head: 586b0241d390f3907e5a3f464e4c1ce02895da7f

Before merge

  • Complete next step - Implement the independent output assertions in the existing reuse regression and validate that targeted output-loss mutations are detected while the unchanged lifecycle scenarios pass.

Findings

None.

Agent review details

How this fits together

Tool lifecycle results feed trajectory recording, delivery callbacks, terminal consumers, and session persistence; the audit ledger tracks planned improvements to their regression coverage.

flowchart TD
  A[Tool result] --> B[Tool lifecycle]
  B --> C[Trajectory recorder]
  B --> D[Delivery callback]
  B --> E[Terminal consumer]
  A --> F[Session persistence]
  G[Reuse regression] --> B
  G --> F
Loading

Technical review

Best possible solution:

Strengthen the existing lifecycle regression with independent expected payloads while preserving both completion routes and the distinct stored and display image contracts.

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

Source inspection confirms that the assertions do not require complete text at each output; no mutation or test run was performed, and this establishes a coverage weakness rather than a production failure.

Is this the best way to solve the issue?

The recorded plan targets the existing regression without introducing another owner, helper, or test case; implementation correctness remains unassessed because no executable repair is included.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Test-audit ledger keeps the original intent (3d8f93c: The surrounding ledger records qualified audit batches and distinguishes pending source-only candidates from completed repairs.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 3d8f93c adds test/test-audit-ledger.md:599 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d8f93c0771a; files: test/test-audit-ledger.md)

PR surface

Tests +11. Total +11 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 11 0 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 11 0 +11

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: The reviewed change documents a test-quality improvement and changes no production behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: The reviewed change documents a test-quality improvement and changes no production behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 12, 2026, 9:37 AM ET / 14:37 UTC.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S and removed size: XS labels Nov 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 12, 2026 15:08
@vincentkoc
vincentkoc merged commit c859dda into main Nov 12, 2026
206 of 208 checks passed
@vincentkoc
vincentkoc deleted the test/tool-result-fidelity-20261112 branch November 12, 2026 15:40
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
* docs(test): record tool-result fidelity audit

* fix(test): assert tool-result fidelity at each output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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