Skip to content

refactor(cli): consolidate security-sensitive regression fixtures - #114411

Merged
steipete merged 2 commits into
mainfrom
codex/test-dedup-cli-phase2-b461
Aug 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-dedup-cli-phase2-b461

Conversation

@steipete

@steipete steipete commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainers spend unnecessary time reviewing repeated capability, gateway, update, and model-provider fixtures across security-sensitive CLI regression suites.

Why This Change Was Made

Consolidate only equivalent fixtures in the four owning test suites while preserving every current named case and assertion contract. The conflict repair keeps the original branch history with one fast-forward commit, drops the superseded plugin-test cleanup by making that blob identical to current main, and retains newer stopped-service, npm-channel, and bundled-sidecar coverage.

User Impact

No production or public CLI behavior changes. The same regression coverage is 714 test lines smaller and easier to review.

Evidence

  • Exact head: d42f6919382c870e9110fa042c85455f3594c221, a single direct child of original head 7ba2172c1f288c4acd7d818a8c6c3219132c5fab; no rebase or force-push.
  • Clean synthetic merge against current main 86a95b459c94ff7d03b5279d5166b03a39ba1473: exactly four test files, +504/-1,218, net -714; production delta 0.
  • Per-file net delta: capability -157, CLI exit -195, update -68, model picker -294. src/cli/plugins-cli.install.test.ts is byte-identical to main and absent from the merged diff.
  • Compiler-AST parity: all 489 test declarations remain in identical order; all 40 .each tables and payloads are equivalent; 30 newer current-main declarations remain. Assertion behavior and timer usage are preserved.
  • Blacksmith Testbox tbx_01kz0ptbrbdbt07v4cyjardect: 613/613 focused cases passed across all four suites (run).
  • Blacksmith Testbox tbx_01kz0qt9bza2q2k5qpvsx6abch: full pnpm check:changed passed on the regenerated merge after current-main fix fix: remove duplicate plugin CLI registry mock #117894 (run).
  • Two independent xhigh reviews are CLEAN/BEST FIX: commands_wave11_arch_review and commands_wave11_semantic_review.
  • OpenAI/Codex provider, backend, auth, catalog filtering, visibility, and default-selection contracts were checked directly at Codex SHA ee0247f95a6fe2b094ba2253d82cae2a2b4c2dff: codex-rs/model-provider-info/src/lib.rs:35, :244, codex-rs/protocol/src/auth.rs:38, codex-rs/models-manager/src/manager.rs:123, codex-rs/protocol/src/openai_models.rs:687, and codex-rs/app-server/src/models.rs:13.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 3:51 AM ET / 07:51 UTC.

ClawSweeper review

What this changes

This branch consolidates repeated mock and setup fixtures across five CLI and model-picker regression test suites while keeping the tested CLI behavior unchanged.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open for human review rather than closing it: it is a test-only cleanup with no concrete patch defect found, but the supplied PR state is currently dirty against main, carries the protected maintainer label, and still lacks inspectable exact-head behavior proof.

Priority: P3
Reviewed head: 7ba2172c1f288c4acd7d818a8c6c3219132c5fab
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The fixture refactor appears bounded, but merge confidence remains limited by the dirty branch and missing inspectable exact-head proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body claims focused test runs, but no inspectable exact-head terminal output, artifact, recording, or redacted log is available; add redacted evidence and update the PR body for a refreshed review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body claims focused test runs, but no inspectable exact-head terminal output, artifact, recording, or redacted log is available; add redacted evidence and update the PR body for a refreshed review.
Evidence reviewed 5 items Current-main fixture ownership: All five touched test files have current-main history at the same later fixture-refactor commit, so any rebase must preserve those current-main test additions rather than overwrite them.
Current isolation baseline: Current main resets the capability gateway mock in the per-test setup and supplies default gateway responses, establishing the isolation boundary that the branch must retain after conflict resolution.
Feature provenance: The current-main rewrite of the touched fixture files is attributed to Peter Steinberger and post-dates this PR head; this is a routing signal, not a finding of fault.
Findings None None.
Security None None.

How this fits together

These test suites drive OpenClaw CLI entry points with mocked gateway, plugin, update, and model-selection dependencies, then assert command output and failure behavior. Their fixtures determine whether each test begins from isolated state before exercising the production CLI paths.

flowchart LR
  A[CLI test cases] --> B[Shared mock fixtures]
  B --> C[CLI command entry points]
  C --> D[Gateway, plugin, update, and model adapters]
  D --> E[Assertions on output and exits]
  B --> F[Per-test reset and cleanup]
Loading

Decision needed

Question Recommendation
Should this protected test-fixture refactor be rebased onto current main and accepted after exact-head focused proof, or should its overlapping cleanup be abandoned in favor of the later mainline fixture work? Rebase and prove: Rebase while retaining the current-main tests, then post redacted exact-head focused terminal output before merge.

Why: The branch is currently dirty and current main has later changes across every touched test file; choosing whether the remaining consolidation is worth preserving requires owner judgment rather than an automated code repair.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body claims focused test runs, but no inspectable exact-head terminal output, artifact, recording, or redacted log is available; add redacted evidence and update the PR body for a refreshed review.
  • Resolve merge risk (P1) - GitHub currently reports the branch as dirty, so it cannot merge until a rebase or conflict resolution preserves the current-main fixture coverage.
  • Resolve merge risk (P1) - The reported test results are not accompanied by inspectable exact-head output or an artifact, so the claimed regression coverage cannot yet be independently checked.
  • Complete next step (P2) - A protected, currently dirty branch needs its owner to choose whether to rebase the overlapping fixture work and provide exact-head evidence; there is no narrow automated repair to apply safely.
Agent review details

Security

None.

PR surface

Tests -813. Total -813 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 551 1364 -813
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 551 1364 -813

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase the focused fixture cleanup onto current main, preserve the later test coverage in all five suites, and attach redacted exact-head focused test output that demonstrates the resulting suites pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase the focused fixture cleanup onto current main, preserve the later test coverage in all five suites, and attach redacted exact-head focused test output that demonstrates the resulting suites pass.

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

Not applicable: this PR refactors test fixtures rather than reporting a user-facing defect. Exact-head test execution was not independently reproducible in this checkout because the partial clone could not fetch the PR tree.

Is this the best way to solve the issue?

Unclear: the supplied fixture extractions appear behavior-preserving, but the branch must first be reconciled with the later current-main rewrites before this can be judged the best remaining cleanup.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9fd56e6d6529.

Labels

Label justifications:

  • P3: This is a behavior-neutral regression-test fixture cleanup with no demonstrated user-facing failure.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body claims focused test runs, but no inspectable exact-head terminal output, artifact, recording, or redacted log is available; add redacted evidence and update the PR body for a refreshed review.

Evidence

What I checked:

  • Current-main fixture ownership: All five touched test files have current-main history at the same later fixture-refactor commit, so any rebase must preserve those current-main test additions rather than overwrite them. (src/cli/capability-cli.test.ts:506, ddf54f264b1f)
  • Current isolation baseline: Current main resets the capability gateway mock in the per-test setup and supplies default gateway responses, establishing the isolation boundary that the branch must retain after conflict resolution. (src/cli/capability-cli.test.ts:506, 9fd56e6d6529)
  • Feature provenance: The current-main rewrite of the touched fixture files is attributed to Peter Steinberger and post-dates this PR head; this is a routing signal, not a finding of fault. (src/cli/run-main.exit.test.ts:410, ddf54f264b1f)
  • Exact-head inspection limitation: The local partial clone could read current main but could not fetch the PR tree or generate a full three-way comparison because DNS access to the promisor remote failed. The supplied GitHub state also reports this head as dirty. (7ba2172c1f28)
  • Proof remains non-inspectable: The PR body reports focused test results, but the supplied review context contains no attached terminal output, artifact, recording, or redacted runtime log for the exact final head; the prior review requested that evidence. (7ba2172c1f28)

Likely related people:

  • steipete: Peter Steinberger is the recorded author of the current-main refactor that last touched all five affected test files, and is therefore the strongest routing candidate for resolving the rebase and retaining current coverage. (role: recent area contributor; confidence: high; commits: ddf54f264b1f; files: src/cli/capability-cli.test.ts, src/cli/plugins-cli.install.test.ts, src/cli/run-main.exit.test.ts)

Rank-up moves

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

  • Rebase onto current main without dropping the later fixture coverage.
  • Attach redacted exact-head terminal output for the focused CLI and model-picker suites.

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 (3 earlier review cycles)
  • reviewed 2026-07-27T07:34:12.508Z sha 7ba2172 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T18:22:59.038Z sha 7ba2172 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T18:55:58.675Z sha 7ba2172 :: needs real behavior proof before merge. :: none

@steipete steipete self-assigned this Aug 2, 2026
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 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:

@steipete
steipete merged commit 6b62535 into main Aug 2, 2026
101 checks passed
@steipete
steipete deleted the codex/test-dedup-cli-phase2-b461 branch August 2, 2026 08:20
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to yetval/openclaw that referenced this pull request Aug 2, 2026
…r-117788-empty-startup-race

* commit '9517b10778ba69b94471cb1f122a5f1e19aa22a4':
  fix(hooks): show eventless status consistently (openclaw#116127)
  refactor(cli): consolidate security-sensitive regression fixtures (openclaw#114411)
  perf(plugins): list from installed metadata (openclaw#117900)
  fix(memory): remove interrupted Dreaming sessions after Gateway restart (openclaw#117885)
  test(gateway): reuse startup plugin metadata snapshot (openclaw#117897)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…enclaw#114411)

* refactor(cli): consolidate security-sensitive regression fixtures

* refactor(cli): refresh fixture cleanup against main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant