Repository navigation
fix: native JSON reports fail after grouped test runs pass - #138250
Conversation
Fix native JSON publication after successful grouped and direct project runs, including mixed empty selections. Preserve native identities, failure outcomes, coverage and exact case inventory. Fixes #138174.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Good boundary. Project ownership is now derived from terminal modules rather than every loaded config project, which fixes duplicate-name aggregation without weakening incompatible-root validation. The empty-run host fallback stays contained to replay.
|
Land-ready proof for head The fix is four files only: terminal native module owners determine replay projects; wholly empty replay uses Vitest's native host. Exact project/root/pool/task identities, case conservation, native failures, coverage evidence, and incomplete-output protection remain enforced. Product runtime delta is 0; tooling +10 net lines; tests/support +146 net lines. Fresh exact-source local proof: 73/73 native owner tests, all 19 scoped checks, formatting/diff checks, and one default-P0 Codex autoreview with no accepted findings. The committed files match the tested/reviewed hashes. node scripts/run-vitest.mjs test/scripts/vitest-report-owner.test.tsnode scripts/check-changed.mjs -- scripts/lib/vitest-report-capture.mts scripts/lib/vitest-report-owner.mts test/scripts/vitest-report-fixture.ts test/scripts/vitest-report-owner.test.tsgit diff --checkExact-head CI run 33871794397, attempt 1 completed successfully. The separately attributed Linux integration run also published the original ordered 29-file selection: 502 cases, seven successful native children, native merge exit 0, and a complete index, using the byte-identical reporter repair. Its baseline/retention integration and the historical failed aggregation are distinguished in the PR body. Native main/PR checkout, guard, and review-artifact validation passed. Current main still has the reproduced defect. Latest ClawSweeper content is the receipt acknowledgement, not a completed review; there are no published findings or rank-up moves to address at this point. The Vitest 5 migration owner has recorded the terminal-owner and empty-host requirements for later integration. No retention policy, avatar code, dependency patch, or private stress driver is included here. Proceeding through the required native prepare/merge gates; this comment is not a merge-completion claim. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 8:38 AM ET / 12:38 UTC. ClawSweeper reviewWhat this changesThe PR records only Vitest projects that own completed test modules and omits an empty project list for wholly empty native-report replay, allowing grouped and direct runs to publish one JSON aggregate. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 5 items remain Keep this focused bug-fix PR open for maintainer landing. The source repair moves replay-project ownership to completed modules and the added native integration fixtures cover the reported grouped/direct and empty-selection cases; the remaining review limitation is independent inspection of the pinned Vitest implementation, unavailable from this node_modules-less checkout while GitHub DNS was unavailable. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test wrapper splits a selection across Vitest projects, captures native shard outputs, then replays those outputs into one JSON report. This change supplies the replay configuration from the projects that actually produced completed modules. flowchart LR
A[Test selection] --> B[Vitest project shards]
B --> C[Native shard capture]
C --> D[Completed module owners]
D --> E[Merge configuration]
E --> F[Native report replay]
F --> G[Aggregate JSON report]
Decision needed
Why: The changed production tooling executes Vitest APIs, so repository policy normally requires direct dependency-contract inspection; the local dependency tree and upstream network path were unavailable to this reviewer. Before merge
Agent review detailsSecurityNone. PR surfaceTests +146, Other +10. Total +156 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain this shared report-owner repair and its native grouped/empty/identity regressions, with a maintainer confirming the captured native integration evidence or reviewing the pinned Vitest source before merge. Do we have a high-confidence way to reproduce the issue? Unclear for independent reproduction in this review environment: the current-main source retains the documented trigger and the PR supplies a concrete native test path, but this read-only worktree has no dependencies to execute it. Is this the best way to solve the issue? Yes, subject to the dependency-contract evidence gap: deriving replay projects from completed modules repairs the producer that feeds merge configuration, rather than weakening downstream duplicate-identity validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f1e1dca03d2b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…law#138250) Fix native JSON publication after successful grouped and direct project runs, including mixed empty selections. Preserve native identities, failure outcomes, coverage and exact case inventory. Fixes openclaw#138174.
Closes #138174 (native JSON aggregation fails after successful grouped and direct project runs).
Additional instructions
Keep Allow edits from maintainers enabled for this PR.
What Problem This Solves
Resolves a problem where developers requesting a native JSON report across grouped and direct Vitest configurations receive a failed wrapper exit after all tests pass. The original affected run completed 500 tests but could not publish its aggregate because Vitest rejected duplicate project names.
Why This Change Was Made
The capture reporter now records the projects that own terminal native test modules, including an empty owner list for a successful empty selection. The merge owner uses Vitest's default host only for wholly empty replay; original config validation, exact project/root/pool/task identities, case inventory, and completion checks remain authoritative.
This also fixes the empty-grouped-plus-direct case missed by the first candidate's empty-run fallback. Actually executed same-name projects with incompatible roots still fail publication rather than losing or renaming cases. The repair uses native blob replay and native JSON reporting throughout.
User Impact
Developers can obtain a complete native JSON aggregate from these supported grouped/direct invocations, including explicitly successful empty runs. Complete failed runs still produce failing command exits; incomplete evidence retains the originals and leaves an existing output untouched. Session-retention behavior and public configuration are unchanged.
Evidence
On pinned main
72a1d6f78af36fb8723c733a9de981af5a74d42c, with Node 24.20.0, pnpm 12.1.0, Vitest 4.1.11 and Vite 8.2.2:pnpm install --frozen-lockfile --package-import-method=copy— passed with an independent dependency install.node scripts/run-vitest.mjs test/scripts/vitest-report-owner.test.ts— 73/73 passed, one native shard. Covers grouped and mixed/wholly empty runs, incompatible executed roots, exact case union, failure/suite/unhandled errors, config/name/pool drift, coverage artifacts, incomplete/corrupt output, cancellation/crashes/timeouts, overlap, native controls and planner chunks.git diff --checkpassed.5a09662070d8eb96a405d8d508304388ac3764fc; the native CI watcher reportedGREEN.scoped-cleanwith no findings; scanner and restricted empty-workspace isolation remained enabled. This verdict is P0-scoped.The retained pre-fix regression failed for the intended duplicate-name error after successful native children. Its baseline source bytes match this pinned main. The supported empty-group regression likewise failed the first candidate after both children exited zero; the earlier invalid top-level project-filter probe is not counted as regression evidence.
The separately completed Linux integration proof on configured Blacksmith Testbox (run 33866394276) used base
c861706c2d8af6300a8597ebe3bd9f2b96ffcb2d, the session-retention candidate, and this byte-identical four-file repair: 29 files, 502 cases, seven native child exits 0, native merge exit 0,index.complete=true. Source manifests matched before and after. This is prior integration evidence, not a new full-selection run on the PR base. The difference from 500 is explained by three added Kysely cases replacing one earlier case; no selected case was dropped to make aggregation pass.Exact prior Linux integration command (original input order)
LOC: product/runtime 0; report tooling +13/-3 (net +10); tests and fixture +150/-4 (net +146). The tooling growth represents terminal module ownership and native empty-replay hosting. No dependency, version, schema, environment-variable or public configuration surface changed. A product build is not required for this standalone Node/Vitest tooling boundary.
Overlap: #137202 (Vitest 5 migration), checked at
6c0b2946e423e1a6c5f890e8f4ebfe055c551f0b, changes merge configuration loading but leaves this capture producer unchanged. Its integration must retain this identity and empty-replay behavior.ClawSweeper follow-through
Addressed the completed review on unchanged head
5a09662070d8eb96a405d8d508304388ac3764fc. The review reports no actionable code defect; its dependency inspection was blocked by missing local dependencies and DNS failure.dist/chunks/index.UpGiHP7g.js:2025–2057, native BlobReporter serializes the terminaltestModulestasks. At2091–2117, native replay ignores environment graphs for absent projects while preserving the complete files/errors/coverage collections. Indist/chunks/cli-api.CnMVyzaz.js:13380–13388, an omitted project list uses the default project; at13417–13444, native merge reconstructs specifications from the projects owning those file tasks and invokes the normal reporter lifecycle. This confirms both terminal-owner capture and empty-replay hosting without accepting an unverified dependency assumption.createVitestReportOwnercreates a fresh.reports-*artifact directory for each invocation (scripts/lib/vitest-report-owner.mts:105–128);attempt()creates that invocation's native reports, andfinish()reads its own accepted attempts. This change does not alter a SQLite schema/version, session storage, migrations, runtime state, or public configuration. Capture field names and native JSON output format are unchanged. The public test-report artifact contract is covered by exact case inventory, complete failed runs, coverage, and old-output preservation tests. Native Vitest itself rejects cross-version blobs (index.UpGiHP7g.js:2085–2089); there is no new cross-version replay or stored-state upgrade promise to migrate.Inspected dependency-file SHA256 values:
cli-api.CnMVyzaz.js=f06cba2e720559ab6d347e155f8806fa011ce99aa993c6d5f2110d20ef028b87;index.UpGiHP7g.js=cdafaf8e508042dddba72f8c7bbae84e2836ddb6b06c7026520c35d91af4e798. The evidence and maintainer-side decision requests are resolved by this inspection, not by waiving the checks. No separate persistent-store design is included or approved here.