Skip to content

test: reuse planner modules between admission cases - #132444

Merged
steipete merged 2 commits into
mainfrom
codex/test-build-admission-imports
Aug 29, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-build-admission-imports

Conversation

@steipete

@steipete steipete commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Build-admission tests clear the entire module graph before every case. Replaying the command therefore reloads its planner dependencies repeatedly, adding several seconds per in-process case.

Why This Change Was Made

Import a fresh URL for the command entry on each invocation while retaining its planner dependencies. Vite keys entry modules by their query-bearing URL. Repository inventories stay unchanged within this isolated test file; environment flags and include-file contents are read per invocation. Existing mock resets, completion waits, environment/argv cleanup, and real subprocess tests remain unchanged.

User Impact

All 65 admission cases fell from 45.30s to 7.90s of local execution, repeating at 6.46s. Production +0/-0; tests +4/-2. No sharding, worker count, case ordering, concurrency, or test-selection changes.

Evidence

  • Baseline and candidate: node scripts/run-vitest.mjs test/scripts/test-projects-build-admission.test.ts (65 passed).
  • Final run also includes test/scripts/test-projects.test.ts: all 386 passed in their existing order/configurations.
  • Bypassing runtime preparation made four original admission assertions fail. Bypassing E2E preparation made four relevant cases fail while the explicit prebuilt case still passed. Production bytes were restored before the final full run.
  • Complete admission entry, tests, prerequisite owner, relevant dependency caches and installed Vite module identity implementation inspected. Independent review and Codex autoreview through P3 found no actionable findings; formatting and whitespace checks passed.
  • Linux changed checks and exact-head CI must pass before landing.

Current-main integration

The first hosted CI run exposed a stale lint-suppression baseline after #132399 added credential-safe packaged-plugin setup errors. The existing auth-bootstrap boundary already omits raw error causes for the same reason. The expected count was corrected from one to two without adding or relaxing a production suppression. That same correction independently landed in #132394, so the final rebase drops our duplicate baseline commit and retains only the admission import change. The original lint test failed before correction, then all 69 admission/lint cases passed. Both real QA CLI auth/plugin failure tests also passed and retained their assertions that credentials appear in neither the error message nor its cause. Fresh Codex autoreview found no actionable findings.

Follow-up from the planner audit: the serial untargeted-full-suite case in test/scripts/test-projects.test.ts deletes two environment variables without restoring their prior values. This pre-existing cleanup issue is outside the admission-import optimization.

The exact final head passed all 390 admission, planner and lint-ratchet tests. Fresh post-rebase Codex autoreview through P3 is clean. The preceding head passed both hosted CI and Linux changed checks; final hosted CI is rerunning after the mechanical rebase. Direct installed Vite source inspection confirms query-bearing module URLs remain distinct while dependency URLs are reused. This addresses ClawSweeper's dependency-inspection gap; its exact-head CI request remains a pre-merge gate.

Shared CI integration repair: #132099 left state-migrations.media-persistence.test.ts above the max-lines limit. Move its existing snapshot reader verbatim into test support; all 15 migration cases, assertions, SQL queries, cleanup hooks and database-close behavior remain unchanged. All 15 cases passed before and after, focused lint passed, and fresh Codex autoreview through P3 is clean. Production and schema delta are zero; tests/support +66/-64. This repair is shared across the pending performance branches so it lands once without waiting on a known broken main check.

Final exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/33240544351. Latest ClawSweeper has no actionable findings; its remaining CI rank-up request is fulfilled. The data-model detector matched relocated test SQL only: there is no runtime/schema change.

@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 29, 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 3:26 AM ET / 07:26 UTC.

ClawSweeper review

What this changes

The PR re-imports the build-admission command entry with a unique module URL per test case while retaining planner modules, and moves an unchanged SQLite snapshot reader into test support.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This maintainer-authored, test-only optimization remains necessary on current main; no introduced correctness defect was established, but exact-head CI is still in progress.

Priority: P3
Reviewed head: 1e9c25300a1b8fe32df965ed428f6ecee51e7ac1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test change with no actionable defect found; pending exact-head CI remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes test infrastructure only; the external-contributor real-behavior-proof gate does not apply.
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 PR changes test infrastructure only; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 6 items Introduced command replay: The introduced hunk removes whole-graph resets and imports a query-unique command-entry URL; the entry still reads argv at invocation time and runs its preparation-before-worker flow.
Owner and callee boundary: The command computes run specifications, awaits E2E or runtime preparation, and only then schedules readers; the prerequisite owner derives its mode from the supplied selections and current environment.
Verbatim test-helper move: The SQLite snapshot reader is moved without changing its queries, returned fields, or database-close finally block.
Findings None None.
Security None None.

How this fits together

Build-admission tests invoke the project-test command under different preparation scenarios. The command selects runtime prerequisites before launching Vitest workers; this change alters only test-side module replay and a migration-test helper location.

flowchart LR
A[Admission test cases] --> B[Fresh command entry]
B --> C[Shared planner modules]
C --> D[Runtime preparation]
D --> E[Vitest workers]
F[Migration test] --> G[Snapshot helper]
G --> H[SQLite assertions]
Loading

Before merge

  • Complete next step (P2) - No repair is indicated; await exact-head CI and normal maintainer merge review.
Agent review details

Security

None.

PR surface

Source +65, Tests -61. Total +4 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 65 0 +65
Tests 2 5 66 -61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 70 66 +4

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; test behavior +4/-2; test-support relocation +65/-64 The only net new code is test replay bookkeeping; the SQLite helper is a behavior-preserving relocation.

Stored data model

Persistent data-model change detected: database schema: src/infra/state-migrations.media-persistence.test-support.ts, serialized state: src/infra/state-migrations.media-persistence.test-support.ts, unknown-data-model-change: src/infra/state-migrations.media-persistence.test-support.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

  • The exact PR head still has incomplete CI checks; merge only after the exact-head required rollup is green.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused test optimization and verbatim helper extraction after exact-head CI confirms the refreshed branch.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the focused test optimization and verbatim helper extraction after exact-head CI confirms the refreshed branch.

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

Not applicable: this PR changes test infrastructure rather than reporting a user-facing bug.

Is this the best way to solve the issue?

Yes. Replaying only the command entry retains the mocked planner dependencies while exercising each case’s argv and environment setup; the companion extraction is a verbatim test-only split.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 69913572f4a8.

Labels

Label justifications:

  • P3: This improves developer test execution and test-file organization without changing product runtime behavior.
  • 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 PR changes test infrastructure only; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the existing merged shared-build admission work and the relevant admission-test history. (role: recent area contributor; confidence: high; commits: af52e62e85ad, 90ea1a9e2c6d; files: scripts/test-projects.mts, test/scripts/test-projects-build-admission.test.ts)
  • sjf-oa: Authored the recent merged media-persistence migration repair whose test now imports the extracted snapshot helper. (role: adjacent migration-test contributor; confidence: medium; commits: 139e38b52483; files: src/infra/state-migrations.media-persistence.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the remaining exact-head CI checks to complete successfully before merging.

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-29T06:42:10.347Z sha 9673f8adcaf7d10260d32834fce42271841ba240 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T07:07:08.745Z sha ff99634a5117c0aedb2edd08bcbfc95c0b5dd600 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/test-build-admission-imports branch from 9673f8a to ff99634 Compare August 29, 2026 06:58
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 29, 2026
@steipete
steipete force-pushed the codex/test-build-admission-imports branch from ff99634 to 90ea1a9 Compare August 29, 2026 07:09
@steipete
steipete merged commit 9d79bf3 into main Aug 29, 2026
182 checks passed
@steipete
steipete deleted the codex/test-build-admission-imports branch August 29, 2026 07:32
@steipete

Copy link
Copy Markdown
Contributor 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: 🐚 platinum hermit Good normal PR readiness with ordinary 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