Skip to content

fix(qa): preserve script evidence coverage - #120286

Merged
vincentkoc merged 1 commit into
mainfrom
fix/qa-evidence-coverage-metadata-20260807
Aug 7, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/qa-evidence-coverage-metadata-20260807

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Related: #99374
Related: #110280

What Problem This Solves

Fixes an operational issue where standalone script-produced schema-v2 qa-evidence.json could report status: pass with coverage: [], even though the scenario catalog already defined the canonical coverage. That left otherwise valid QA evidence semantically incomplete for direct artifact consumers.

Why This Change Was Made

#99374 introduced the shared script evidence writer with caller-owned coverage metadata. #110280 then made the scenario catalog the semantic coverage owner and replaced producer coverage during aggregate ingestion, but standalone writer output bypassed that aggregate overwrite and could remain empty.

The canonical fix is at createQaScriptEvidenceWriter, the earliest shared catalog-aware boundary for standalone script producers:

  • resolve canonical coverage once by exact scenario ID when the writer is created;
  • construct a fresh evidence target so hidden caller-supplied coverage fields cannot leak through;
  • fail closed for unknown catalog IDs;
  • allow coverage-free output only through an explicit coverageBinding: "none" opt-out used by the synthetic writer unit fixture;
  • remove duplicate browser and TUI coverage metadata now owned by the catalog.

This is the best fix because it repairs direct artifacts at their producer while preserving aggregate overwrite as defense in depth. Rejected alternatives were restoring per-producer coverage fields, which would recreate drift and reverse #110280; relying only on aggregate overwrite, which leaves standalone artifacts broken; and moving catalog lookup into the generic summary builder, which would couple a generic formatter to catalog-only semantics and break intentional uncataloged fixtures.

Scope is deliberately limited to QA producer/tooling and tests. There are no product runtime behavior, config, dependency, workflow, protocol, release, or OTEL changes.

User Impact

QA and release operators can trust standalone script evidence to carry the same canonical coverage semantics as aggregate evidence. There is no shipped product runtime behavior change.

Evidence

  • Exact signed head: 7205d8616ea98bd74f8f0673cdd1d6c62628e053.
  • Single synchronization rebase base: 8c68f74ef914763e846f4b3c2fef8b80ace56f5e (fix(ci): align hosted gates with workflow applicability #120313); that infrastructure fix is an ancestor of the fetched origin/main.
  • Patch preservation across the rebase:
    • git range-diff: 9213088b4e4 = 7205d8616ea;
    • stable patch ID: 88cbe84fa1bf0ee65339f708b8f43540a030799e before and after;
    • binary diff SHA-256: b4a83018f8d644d1915d913b27f732cc13b221f81fa928fa4154d217bc1c96da before and after;
    • unchanged scope: seven QA files, +88/-12.
  • Exact-head hosted-gate classifier:
    • CI run 31215248362: success;
    • Workflow Sanity run 31215248247: success;
    • Blacksmith Testbox: not applicable;
    • Blacksmith ARM Testbox: not applicable;
    • Blacksmith Build Artifacts Testbox: not applicable;
    • selection mode: exact-head; no fallback, bypass, or manual hosted dispatch.
  • Supported-Node focused proof:
    • command: fnm exec --using v24.15.0 node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/script-evidence.test.ts test/e2e/qa-lab/runtime/diagnostic-events-boundary-runtime.test.ts;
    • result: 2 files, 15 tests passed.
  • Representative actual producer artifact:
    • command: OPENCLAW_QA_REF=7205d8616ea98bd74f8f0673cdd1d6c62628e053 OPENCLAW_QA_PACKAGE_SOURCE_KIND=source-checkout OPENCLAW_QA_PACKAGE_SOURCE_SHA=7205d8616ea98bd74f8f0673cdd1d6c62628e053 fnm exec --using v24.15.0 node --import tsx test/e2e/qa-lab/runtime/diagnostic-events-boundary-runtime.ts --output-dir .artifacts/qa-e2e/pr120286-diagnostic-events-boundary;
    • schema v2, result.status = pass;
    • seven ordered primary coverage IDs: observability.async-dispatch, observability.diagnostic-event-types, observability.model-call-diagnostic-events, observability.plugin-sdk-diagnostic-runtime-exports, observability.trusted-diagnostic-event-subscription, observability.trusted-trace-context, observability.w3c-trace-context-creation;
    • exact head SHA in both execution environment and source-checkout package metadata;
    • log and summary artifacts present;
    • qa-evidence.json SHA-256: 73f735b1ca66109cd8bdcffe3cc372dd548116d7be3b3840bc1a0271817ef12a.
  • Patch-identical prior broad focused proof: 8 files, 172 tests passed.
  • Targeted oxfmt --check, git diff --check, and the changed-gate dry-run passed without changing the patch.
  • Fresh exact-head autoreview: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main; clean, no accepted/actionable findings (overall 0.98).

Change Size

  • Total: +88/-12.
  • QA producer/tooling: +15/-5.
  • Tests: +73/-7.
  • Product runtime: +0/-0.

Changelog

No CHANGELOG.md entry. The changelog is release-only, and this changes QA tooling/test evidence behavior rather than shipped product behavior.

AI Assistance

AI-assisted: yes. Codex assisted implementation, review, and proof. A sanitized local agent transcript is included below.

Agent Transcript

Redacted codex session transcript
source: [LOCAL_SESSION]
redaction: local paths, emails, phone-shaped strings, token-shaped strings, auth headers, auth query params
omitted: raw tool outputs, system/developer prompts, local paths, secrets, browser/session/auth details
stats: {"agent":"codex","entries":3,"user":1,"assistant":1,"toolCalls":123,"toolOutputsDropped":123,"web":0,"redactions":0,"omittedUnsafe":0,"rawEntries":19}

[user]
[instructions recap omitted; policy/config text, not task dialogue]

[assistant]
hi, i’m grounding the exact branch, prior QA-evidence context, repo policy, and available agent lanes first. then i’ll hand the audited scope to an executor, verify the result independently, and amend the existing commit only.

the branch is exactly at the draft SHA, one commit ahead and one behind `origin/main`; the worktree is clean, dependencies are correctly symlinked, and disk is fine. i’m now mapping the writer, catalog owner, all callers, and #110280 history before anyone edits.

the historical intent is confirmed at `132d91e4275` (#110280): catalog YAML became the sole semantic coverage owner. the current draft only changes a type and a synthetic test, so it cannot fix the writer’s runtime artifact. next i’m freezing the precise writer/caller map and fallback contract for the review agents.

the likely contract is now sharp: catalog lookup should be the writer’s default and unknown IDs should throw; noncatalog tests must explicitly opt out. i’m checking all 66 script scenarios and the two legacy callers that currently shuttle coverage themselves so the executor can remove duplication instead of adding another path.

the owner boundary is clear now: the shared script writer must resolve catalog coverage, while synthetic targets need an explicit opt-out. i’m capturing a real pre-fix artifact next, then i’ll have the independent audit lanes challenge the exact patch scope before the executor edits.

the representative producer is a good one: `diagnostic-events-boundary` already writes both a summary artifact and schema-v2 evidence, and its catalog owns seven primary coverage IDs. i’m running that unchanged path now so the before/after proof is from real bytes, not a mocked writer assertion.

the baseline is confirmed on disk: schema v2, passing result, exact ref `a6f6721…`, source-checkout package binding, both script artifacts present, and `coverage: []`. i’m now checking every writer caller for whether its target ID is catalog-backed or intentionally synthetic; that decides whether the default should fail closed.

one audit lane confirmed the important edge case: bind by target ID, not script path, because `heartbeat-active-hours` has a valid catalog ID but a Vitest catalog execution. unknown IDs should fail by default; only the writer’s synthetic unit target needs an explicit no-catalog escape hatch.

the audits converge. proposed patch is six tight surfaces: writer binding, two duplicate-metadata removals, an explicit synthetic opt-out, one actual producer regression, and updates to the two existing tests whose assumptions change. i’m sending that exact scope through an independent plan review before any file edit.

the scope is holding: no core QA-lab change, no scenario edits, no path matching, no fallback. the likely tooling delta is a single catalog snapshot plus deletion of the two existing metadata duplicates; the rest is proof that the real artifact contract changed.

the reviewed edit is now locked to seven files. the writer will eagerly snapshot catalog coverage by ID, explicit `none` will forcibly clear coverage, hidden caller fields cannot leak, and the two old duplicate metadata shuttles are being deleted. no OTEL or workflow surface is in scope.

the executor is applying the reviewed patch now. once it lands, i’ll review the combined diff first, then run only the affected writer/producer tests under Node 24.15 before touching commit history.

focused verification is clean: 5 files, 51 tests, with the writer split across the repo’s fast and tooling Vitest shards. i’m doing the required ownership audit now; only the seven reviewed paths will be staged into the amended commit.

[tool summary]
51 read, 5 write, 49 execute, 18 other; raw tool outputs dropped: 123

@vincentkoc vincentkoc self-assigned this Aug 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 9213088b4e4bd4e3e8769a4dd39d926f35cc3103.

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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 Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 4:36 PM ET / 20:36 UTC.

ClawSweeper review

What this changes

The PR binds standalone QA script evidence coverage to the canonical scenario catalog and removes duplicated coverage metadata from individual producers.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No actionable findings: the patch repairs the shared producer boundary that current main leaves coverage-empty, and the protected member-authored PR needs ordinary maintainer merge judgment.

Priority: P3
Reviewed head: 7205d8616ea98bd74f8f0673cdd1d6c62628e053
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch is a focused owner-boundary repair with direct artifact regression coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored internal QA tooling PR is exempt from the external-contributor proof gate; its body nevertheless supplies exact-head artifact and focused-test evidence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored internal QA tooling PR is exempt from the external-contributor proof gate; its body nevertheless supplies exact-head artifact and focused-test evidence.
Evidence reviewed 5 items Current-main gap: Current main forwards the producer target to the summary builder, which derives coverage only from target coverage fields; catalog-backed standalone scripts can therefore emit empty coverage.
Canonical owner-boundary repair: The PR resolves coverage by exact scenario ID, reconstructs a fresh target from catalog coverage and producer execution references, then passes only that target to the summary builder.
Catalog and regression contract: Unknown scenario IDs fail at exact catalog lookup, while the new diagnostic-events regression parses the emitted on-disk artifact and verifies catalog-derived coverage.
Findings None None.
Security None None.

How this fits together

QA script producers write schema-v2 evidence artifacts for QA and release operators. The shared writer combines producer execution facts with catalog-owned scenario coverage before downstream artifact consumers read the result.

flowchart LR
  A[QA script producer] --> B[Shared evidence writer]
  C[Scenario catalog] --> B
  B --> D[Schema-v2 evidence artifact]
  D --> E[QA and release consumers]
Loading

Decision needed

Question Recommendation
Should this protected QA-evidence repair be merged after its current-main merge result is confirmed? Merge after current-base confirmation: Confirm the current three-way merge and required exact-head gates, then land the catalog-owned writer repair.

Why: The PR is member-authored and carries the protected maintainer label, so ordinary maintainer judgment remains required despite clean source and proof evidence.

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch behind main; review the current three-way merge result and required gates before landing.
Agent review details

Security

None.

PR surface

Tests +76. Total +76 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 88 12 +76
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 88 12 +76

Review metrics

Metric Value Why it matters
QA tooling vs tests QA tooling +15/-5; tests +73/-7 The small tooling increase establishes one canonical coverage-owner boundary while most of the change is artifact-level regression coverage.

Stored data model

Persistent data-model change detected: database schema: test/e2e/qa-lab/runtime/diagnostic-events-boundary-runtime.test.ts, serialized state: test/e2e/qa-lab/runtime/diagnostic-events-boundary-runtime.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep catalog coverage owned and resolved by the shared writer, then merge once the current-base result remains clean.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep catalog coverage owned and resolved by the shared writer, then merge once the current-base result remains clean.

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

Yes—current main's writer-to-summary path is source-reproducible as emitting empty coverage for catalog-backed producers, and the PR adds an on-disk artifact regression for that path.

Is this the best way to solve the issue?

Yes—the shared writer is the earliest common catalog-aware producer boundary; restoring per-producer metadata would recreate semantic drift.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This fixes internal QA evidence completeness without changing shipped product runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored internal QA tooling PR is exempt from the external-contributor proof gate; its body nevertheless supplies exact-head artifact and focused-test evidence.

Evidence

What I checked:

Likely related people:

  • RomneyDa: Merged history introduced the shared writer and later made the scenario catalog the semantic coverage owner. (role: writer and catalog-semantics originator; confidence: high; commits: 5361e5a0b455, 132d91e42756; files: test/e2e/qa-lab/runtime/script-evidence.ts, extensions/qa-lab/src/scenario-catalog.ts)
  • vincentkoc: Current-main history recreated the relevant writer path and this PR adds the catalog-binding repair. (role: recent shared-writer contributor; confidence: high; commits: bb7aff140b97, 7205d8616ea9; files: test/e2e/qa-lab/runtime/script-evidence.ts)

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-08-07T17:40:22.755Z sha 9213088 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-07T18:47:19.421Z sha 9213088 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper disposition for reviewed head 9213088b4e4bd4e3e8769a4dd39d926f35cc3103 (unchanged):

@vincentkoc
vincentkoc marked this pull request as ready for review August 7, 2026 17:54
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 7, 2026
@vincentkoc
vincentkoc force-pushed the fix/qa-evidence-coverage-metadata-20260807 branch from 9213088 to 7205d86 Compare August 7, 2026 20:17
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 7205d8616ea98bd74f8f0673cdd1d6c62628e053. CI and Workflow Sanity are green; the repo classifier records Blacksmith Testbox, Blacksmith ARM Testbox, and Blacksmith Build Artifacts Testbox as not applicable for this QA-only diff.

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper exact-head disposition for 7205d8616ea98bd74f8f0673cdd1d6c62628e053:

  • Findings: none.
  • Decision needed: accepted under the maintainer-authorized unattended landing request; proceed through the repository-native review, prepare, and squash-merge gates.
  • Before merge - Resolve merge risk (P1): disposed. The branch was rebased once onto 8c68f74ef914763e846f4b3c2fef8b80ace56f5e; range-diff is equal, the binary patch is byte-identical, GitHub reports MERGEABLE, and exact-head CI plus Workflow Sanity are green. Per task and repository policy, there will be no second rebase for unrelated main drift; scripts/pr will validate the current three-way merge and strict landing guards.
  • Stored data-model note: no database schema, migration, SQLite, or shipped runtime surface changes. The flagged path is a test that validates serialized QA evidence.
  • Rank-up moves: none listed.

Review: #120286 (comment)
Exact review run: https://github.com/openclaw/clawsweeper/actions/runs/31216285990

@vincentkoc
vincentkoc merged commit 588d8bb into main Aug 7, 2026
103 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-evidence-coverage-metadata-20260807 branch August 7, 2026 20:42
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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