Skip to content

fix(qa): recognize canonical nested tool receipts - #158641

Merged
joshavant merged 1 commit into
mainfrom
codex/qa-nested-receipts
Sep 26, 2026
Merged

joshavant merged 1 commit into
mainfrom
codex/qa-nested-receipts

Conversation

@joshavant

@joshavant joshavant commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes false QA failures when code mode persists a completed tool invocation as canonical nested activity.

User Impact

QA runtime-tool, redaction, and memory-ranking scenarios recognize correlated nested success and error receipts. Product behavior, provider defaults, and scenario expectations stay unchanged.

There are no stored schema, embedding metadata, retention, or migration changes. The ranking YAML change only projects existing chat history before its unchanged assertions; no data-model compatibility migration is needed.

Why This Change Was Made

One QA-owned reader validates the persisted receipt contract and projects it into the call/result view consumed by existing assertions. The session summary reuses that reader. No core-internal imports, tool/provider branches, synthetic persisted turns, timeout increases, or model overrides are introduced.

The runtime evidence reader and existing transcript test writers are extracted into their owning modules to keep the existing files within repository size gates. The previous nested-aware summary work in #155976 did not cover these other QA readers.

Evidence

  • Frozen base: 37259b7cab6b1816211d381200848048a05f197d.
  • Current head: 1211615329dfa69d9c900621342c2193a9ce85b4; its only difference from the live-tested head is the two-line missing-field fixture correction. The complete selected changed-file gate passed after that correction.
  • Deterministic pre-fix proof: the initial three-file regression run failed 18 tests at the missing nested runtime/read/search evidence. An earlier five-case runtime table also failed against the original reader: canonical success/error was ignored, and unrelated or malformed display rows were accepted. ClawSweeper later identified that two missing-field controls also had a mixed raw/public content shape. Those controls now retain canonical persisted content and omit only the named result or run ID. Temporarily removing the corresponding validation made exactly those two cases fail (three others passed); restoring it passes all five.
  • Final focused proof: 179 tests passed across seven files (27.51 seconds including wrapper). Existing direct-tool, known-gap, summary, flow registration, redaction/no-leak, and ranking negatives remain covered. Corrected sanitized-history fixtures first reproduced 16 failures before the public-history adapter was repaired; new controls reject mismatched nested call and run IDs.
  • Changed checks: full typechecking passed (core, UI, all 25 core test graphs, extensions, scripts, and root tests), as did formatting, size/boundary/contract guards, all three dead-export scans, extension lint, and script lint. The command exited 124 because the monolithic core lint shard reached its fixed 900-second cap after sustained CPU progress and zero diagnostics. Classification: non-attributable infrastructure/tooling timeout. This QA Lab extension/test/scenario candidate does not change core; no rerun, rebase, branch refresh, timeout increase, or code change is warranted for this timeout. The original full-check log was removed during completed-task cleanup before the subsequent retention instruction; the observed exit status and investigation summary are retained here and in native review evidence. That shard's src, ui, packages, configuration, and runner sources are unchanged from the frozen base. A process sample and increasing CPU time showed active evaluation; bounded investigation did not identify a deadlock or a source defect. No timeout was raised or failure hidden. The public-history correction then passed its selected guards, production/test typechecks, dead-export scans, formatting, and changed-file lint after fixing two convention violations; all 35 affected tests passed again. Exact-head CI passed both core lint shard 1 and core lint shard 2, all six extension lint shards, and the remaining lint job.
  • Final live-frontier run at 7759a9410cfa4b97d04858d90295652a9155c820: 8 passed / 0 failed / 0 skipped, CLI exit 0. Exact scenarios: runtime-tool-apply-patch, runtime-tool-sessions-spawn, runtime-tool-web-fetch, runtime-tool-session-status, runtime-tool-web-search, secret-redaction-tool-logs, personal-redaction-no-secret-leak, and session-memory-ranking. Source-owned defaults, isolated Gateway/config/state, and narrowly injected provider auth were used. The first run was 5/8; its three failures exposed the sanitized-history fixture gap, which was fixed and re-proven before this full rerun.
  • One autoreview completed with two P2 findings. Fixed canonical metadata validation and restored the valid mismatched-result-ID negative control; focused proof passed afterward. ClawSweeper's later P2 fixture-shape finding is also fixed: both runtime fixture suites passed 67 tests (17.71 seconds runner), the validation mutation failed exactly the intended two controls, and the restored final five-case suite passed (12.76 seconds runner). The final correction changes only that test file; production and scenario bytes are identical to the 8/8 live-tested head, so that proof is reused.
  • LOC: QA production/tooling +436/-295 (net +141); tests/support +348/-83 (net +265); scenario YAML +7/-4 (net +3). Total +791/-382 (net +409), 15 files. Core changes: zero.
  • Exact-head CI: all four QA test shards and all lint shards passed. Core tooling shard compact-small-42 failed one suppression-inventory assertion; four other core shards were canceled. Its checkout was merge 73fe1d4b of this head into main b458b9f1c6b. Main's progress-snapshot change added no-implicit-coercion without updating the inventory, producing 78 entries versus 77 expected. Both affected files and the scanner are unchanged by this PR, and the suppression is absent at its frozen base and head. The exact inventory test passes all four cases at this PR head (4.71 seconds Vitest, 5.89 seconds runner); that passing isolation is attribution evidence, not a claim to repair main. The original CI shard had 48 passing files and one failing file. No same-order full-shard replay was attempted because the assertion directly scans the checkout's source bytes; no shared-state cause is indicated. The bounded history/GitHub search found no owning fix, and current main 9f6554c164c4 still carries the mismatch. CI remains blocked by that upstream defect; no expectations were weakened, and no CI retry or refresh was requested.
  • Final-head CI run 36219236698: all four QA shards passed, including all five corrected nested-receipt cases. The final core tooling shard repeated the same upstream suppression-inventory failure described above: merge 76c00d84 includes main 5da1262bc896, where the extra suppression remains. It had 48 passing files and one failing file; seven other core shards were canceled, leaving openclaw/ci-gate blocked. This run was triggered by the verified fixture correction, not a retry for green.
  • ClawSweeper's exact-head review, completed at 2026-09-26T05:02:22.608Z, found no actionable correctness or security findings and marked the proof sufficient and ready for maintainer look. Its residual path-based data-model checklist is a false positive: the changed ranking YAML only projects existing history in memory; there are no stored-data writes, schema, embedding metadata, retention, or migration changes, as the technical review itself confirms. Both earlier substantive findings are fixed and proven above.
  • Native scripts/pr review validation and prepare-run completed at final head, preserving the frozen base and recording github_pending without a successful gate stamp. The lane stops Ready for maintainer review, with the upstream CI blocker disclosed. No merge, queue, or auto-merge action was requested. Isolated Gateway/state and completed live artifacts are removed; the open PR's source and native recovery state are retained.
Contract inspection and test audit

Personally inspected sibling ../codex at 39598ed17885970828acd42a6370131ed0190a98: dynamic request/response contract, lines 45–75, handler correlation and completed/failed result, lines 174–250, and app-server call/result contract, lines 1652–1679. These retain call/turn correlation, tool arguments, content, and success state. The OpenClaw canonical persisted shape is nested-tool-activity.ts, lines 7–31 and 51–86.

Test-audit authoring answers:

Public history is a separate published representation: the Gateway creates correlated blocks and publishes run ownership, then removes private receipt details. The QA adapter validates that exact call/result pair against its envelope before using the same terminal metadata validator as persisted receipts.

  1. Observable contract: the actual runtime fixture and loaded scenario flows consume canonical correlated success/error receipts while retaining tool linkage, failed-result rejection, completed secret-read proof, outbound no-leak checks, and competing-memory ranking assertions.
  2. Credible regressions: ignoring nested rows; treating arbitrary custom display blocks as execution; dropping receipt error state; accepting mismatched result IDs; or bypassing redaction/ranking negative assertions.
  3. Coverage gap and owner: existing inputs modeled direct tool turns. Existing scenario tables now also exercise public-history nested rows; the runtime table exercises raw persisted rows through the actual session-store/fixture boundary. There is no duplicate projector-only suite. Existing transcript setup was consolidated into the shared test helper.
  4. Production seams: none exist solely for tests. The generic projection and extracted evidence reader are called by production QA flows. Synthetic receipts are inputs to the reader contract under test; they do not substitute for a producer the test claims to verify.

No source-grep assertions, expected-value self-comparisons, provider-specific helper replays, new timers, polling, or per-test Gateway/model boots were added. The persisted runtime boundary uses the real session store because ignoring a persisted custom row is the defect.

Per-file cost measured with the supported node scripts/run-vitest.mjs <file> --maxWorkers=1 entry point (the pnpm test wrapper's runner), a lane-owned cache, and dependency reconciliation disabled:

Changed test file Tests Local wall seconds CI containing-shard test-step seconds
runtime-tool-fixture.nested.test.ts 5 13.21 110
runtime-tool-fixture.test.ts 62 15.69 113
scenario-flow-runner-redaction-proof.test.ts 30 10.68 85
scenario-catalog-memory-ranking-proof.test.ts 32 10.58 104

Local wall measurements include runner, transform, and startup time and reuse lane-owned compiler outputs; the final fixture-only correction additionally passed its five-case run in 12.76 seconds through the runner. All four linked CI jobs passed at final head 1211615329dfa69d9c900621342c2193a9ce85b4. CI reports the containing shard rather than per-file aggregate runtime; total job durations were 196, 192, 182, and 183 seconds respectively.

@clawsweeper

clawsweeper Bot commented Sep 26, 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.

@joshavant
joshavant marked this pull request as ready for review September 26, 2026 04:15
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 1:19 AM ET / 05:19 UTC (Revision 3).

ClawSweeper review

What this changes

QA Lab now recognizes correlated nested tool receipts in persisted transcripts and public chat history for runtime-tool, redaction, and memory-ranking checks.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open. Current main still lacks this QA reader coverage; the earlier merged fix addressed session-summary accounting only. The current branch has focused tests, reported live proof, and no actionable patch finding.

Priority: P2
Reviewed head: 1211615329dfa69d9c900621342c2193a9ce85b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused boundary coverage and reported live scenario results support a coherent QA repair with no remaining patch finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed QA reader feeds the runtime fixture and loaded scenarios; the PR body reports eight named live-frontier scenarios passing through an isolated Gateway after earlier failures exposed a fixture gap. The prior review assessed this same head as proof-sufficient. The ranking YAML only projects history in memory, so no stored-data compatibility proof is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed QA reader feeds the runtime fixture and loaded scenarios; the PR body reports eight named live-frontier scenarios passing through an isolated Gateway after earlier failures exposed a fixture gap. The prior review assessed this same head as proof-sufficient. The ranking YAML only projects history in memory, so no stored-data compatibility proof is required.
Evidence reviewed 8 items Introduced QA reader: The pinned merge-base-to-head diff adds a QA-owned validator and projector for persisted and published nested receipts.
Current main still needs the fix: The main-branch runtime reader extracts direct calls and results without projecting canonical nested custom receipts.
Receipt producer contract: OpenClaw creates canonical custom receipts with correlated IDs, input, result content, and error state.
Findings None None.
Security None None.

How this fits together

QA Lab runs scenarios against an isolated OpenClaw Gateway. It reads session transcripts and chat history to decide whether tool activity satisfies runtime and safety assertions.

flowchart LR
A[Code Mode tool execution] --> B[Persisted nested receipt]
B --> D[QA receipt reader]
C[Gateway chat history] --> D
D --> E[Correlated tool call and result]
E --> F[Runtime and safety checks]
F --> G[QA pass or failure]
Loading

Before merge

  • Complete next step (P2) - Repair main's lint suppression inventory mismatch and obtain a passing required gate on this PR's merge ref.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +141, Tests +265, Other +3. Total +409 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 5 436 295 +141
Tests 7 348 83 +265
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 7 4 +3
Total 15 791 382 +409

Review metrics

Metric Value Why it matters
QA reader and test growth production/tooling net +141; tests/support net +265 The production growth establishes one shared receipt reader, while the added coverage checks persisted and published shapes.

Stored data model

Persistent data-model change detected: vector/embedding metadata: qa/scenarios/memory/session-memory-ranking.yaml. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #158641
Summary: The prior merged PR addressed nested receipts in session summaries; this PR addresses the remaining QA readers.

Members:

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

Technical review

Best possible solution:

Keep QA's runtime, redaction, and ranking gates keyed to validated call/result correlation across persisted receipts and published history.

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

Yes. Current main's runtime reader only extracts direct tool calls and results, while OpenClaw persists nested execution as a custom receipt; this review did not execute the scenario.

Is this the best way to solve the issue?

Yes. A QA-owned reader at the evidence boundary serves the affected checks while retaining their direct-tool path and correlation requirements.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: False QA failures affect a bounded validation workflow rather than user-facing runtime behavior.
  • merge-risk: 🚨 automation: The changed evidence projection feeds QA pass/fail decisions, so incorrect correlation could misclassify scenario results.
  • 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 changed QA reader feeds the runtime fixture and loaded scenarios; the PR body reports eight named live-frontier scenarios passing through an isolated Gateway after earlier failures exposed a fixture gap. The prior review assessed this same head as proof-sufficient. The ranking YAML only projects history in memory, so no stored-data compatibility proof is required.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed QA reader feeds the runtime fixture and loaded scenarios; the PR body reports eight named live-frontier scenarios passing through an isolated Gateway after earlier failures exposed a fixture gap. The prior review assessed this same head as proof-sufficient. The ranking YAML only projects history in memory, so no stored-data compatibility proof is required.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-26T04:27:16.982Z sha 77e9109206b7bba71a89bf57602fe6ea9e5e1bf7 :: blocked before merge. :: [P1] Read sanitized nested history blocks before dropping them
  • reviewed 2026-09-26T05:02:22.608Z sha 1211615 :: blocked before merge. :: none

@joshavant
joshavant force-pushed the codex/qa-nested-receipts branch from 77e9109 to 7759a94 Compare September 26, 2026 04:28
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Please review final head 7759a9410cfa4b97d04858d90295652a9155c820. The public-history finding is fixed: sanitized fixtures omit private details, and the QA adapter validates the published call/result pair against its envelope before consuming it. Correlated call/run mismatch negatives remain enforced.

All eight requested live-frontier scenarios passed with source-owned defaults and isolated Gateway/state, zero skips, CLI exit 0. The final focused suite passed 179 tests, and all 35 affected tests passed again after lint-only fixes. The PR body records pre-fix failures, checks, costs, and exact source contracts.

The data-model warning is a path-based false positive: the ranking YAML only projects existing chat history before unchanged assertions. This PR changes no stored schema, embeddings, retention, or migration contract.

Review only; this lane stops Ready and has no merge, queue, or automerge authority.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@joshavant
joshavant force-pushed the codex/qa-nested-receipts branch from 7759a94 to 1211615 Compare September 26, 2026 04:54
@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. and removed 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 Sep 26, 2026
@joshavant
joshavant merged commit 0e31c78 into main Sep 26, 2026
245 of 256 checks passed
@joshavant
joshavant deleted the codex/qa-nested-receipts branch September 26, 2026 09:02
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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