Skip to content

refactor: deslop update, UI and AI test fixtures - #183565

Merged
steipete merged 1 commit into
mainfrom
deslop/t04-25-package-fixtures-20261015
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/t04-25-package-fixtures-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Test suites repeat fixture construction, promise gates, and mock cleanup already owned by shared test support.

User Impact

No user-visible change, production change, migration, configuration, protocol, dependency, or timeout change. Every assertion, scenario, table, and registration remains. The standalone session-memory backend is untouched.

Why This Change Was Made

Seven independent fixture cuts remove 108 net lines (169 additions, 277 deletions; 32 files; 0 production lines). This is an explicitly authorized 100+ residue under campaign rule 14, not a LARGE PR. Each slice is independently removable.

AI continuation fixture — 17 net

Inline the one-use model spread and symbol property instead of retaining a generic wrapper. The private-network opt-in, authored model, and real-API test stay unchanged.

Best-effort tradeoffs accepted: none; the same fresh object and symbol property are constructed at the original call site.

Disk-space fixtures — 10 net

Move the two identical statfs record builders to one narrow disk-space.test-support owner. Preserve all eight keys, key order, defaults, and fresh records; the CLI fixture retains its property name.

Best-effort tradeoffs accepted: the statfs function reference is now shared rather than allocated per CLI fixture; no consumer observes that identity. Returned data stays fresh per call.

Git identity fixtures — 10 net

Reuse the existing Git fixture owner's isolateGitIdentity in two consumers that already import that owner. Keep the same five environment stubs at the original conditional and allocation positions.

Best-effort tradeoffs accepted: none; ordered environment effects and fixture lifetimes are preserved.

UI mock cleanup — 19 net

One six-line, hook-free owner performs restoreAllMocks followed by unstubAllGlobals. Twelve original fresh-arrow hooks retain their lexical scopes and positions across eleven tests. Solid-root, DOM, timer, and storage cleanup remain with their existing owners.

Best-effort tradeoffs accepted: none; exception behavior and cleanup ordering remain identical.

UI deferred gates — 15 net

Seven Node/test-realm E2E callbacks use the existing native deferred owner at their original promise-allocation positions. Releases, optional calls, and finally cleanup remain. The two browser-serialized resolver closures are deliberately unchanged.

Best-effort tradeoffs accepted: none; every invocation still creates a fresh promise and resolver pair.

UI session envelopes — 29 net

Reuse unchanged fixed-one and fresh-clock response owners only for exact matching inputs. Rows, defaults, expected arrays, clocks, and placement/model fields remain independently authored. The fresh-clock owner samples after row construction, as before; the navigation array is dense and preserves its exact count.

Best-effort tradeoffs accepted: independent row/default allocation and unobserved key-enumeration order follow the fixed-one owner. Consumers inspect parsed fields, not those orders. No scenario data becomes shared mutable state.

Restart protocol-error fixtures — 8 net

The existing, already-imported restart-health test owner constructs both protocol-mismatch inputs. Each call retains the actual error subclass, fresh details, and correlated-response metadata required by the production classifier. No protocol guard or mismatch scenario is removed.

Best-effort tradeoffs accepted: the unasserted error-stack frame moves to the helper; error identity remains fresh per scenario.

Evidence

The complete assertion AST and ordered registration/table AST compare exactly before/after, without operand normalization. Counts below cover each cut's affected proof closure, including supporting registration roots; they are lexical declarations, not expanded runtime-case counts. Overlapping closures are not additive.

Cut Assertions before → after Custom assertion calls Tests Suites (including custom) Hooks + test-finished Mocks Tables
AI 12 → 12 0 → 0 1 → 1 1 → 1 1 → 1 0 → 0 0 → 0
Statfs 81 → 81 6 → 6 11 → 11 2 → 2 1 → 1 0 → 0 4 → 4
Git identity 209 → 209 12 → 12 16 → 16 3 → 3 7 → 7 12 → 12 11 → 11
UI cleanup 506 → 506 0 → 0 74 → 74 11 → 11 26 → 26 0 → 0 36 → 36
UI gates 215 → 215 67 → 67 41 → 41 0 → 0 0 → 0 0 → 0 7 → 7
UI envelopes 274 → 274 18 → 18 17 → 17 0 → 0 1 → 1 0 → 0 9 → 9
Protocol errors 129 → 129 2 → 2 25 → 25 1 → 1 4 → 4 18 → 18 12 → 12

Additional registrations also remain exactly equal: statfs 3 register calls/2 hoists; Git 2 register calls/1 hoist; cleanup 1 register call; gates 7 suite definitions; envelopes 4 suite definitions. The broader 41-path preservation closure, including unchanged supporting/excluded files, retains 1,722 assertions, 131 custom assertion calls, 219 tests, 19 suites, 40 hooks, 3 test-finished callbacks, 30 mocks, 86 tables, 6 register calls, 16 suite definitions, and 3 hoists.

Completed proof: canonical focused CLI/disk tests 36 passed / 3 files (712.247 seconds wrapper; 659.76 seconds Vitest), narrow infra/CLI types and typed lint; AI package narrow types/lint and successful live-config collection with its existing opt-in test skipped. This is not authenticated live API proof.

UI focused tests: 142 passed / 11 files (22.030 seconds wrapper; 14.28 seconds Vitest). Protocol/restart sibling tests: 64 passed / 3 files (69.540 seconds wrapper; 58.27 seconds Vitest). Seven additional narrow UI/services/update test typechecks passed. Typed lint initially caught seven redundant default void type arguments; they were removed, both affected E2E typechecks and all-path lint passed again. The correction has identical erased JavaScript AST and unchanged assertion/registration AST; completed runtime proof is reused.

Mock-export checks, timeout ratchet, changed-check dry planner, format, git diff --check, 14 suppression tests, runtime cycles (0), and Madge no-new-component check passed. The broad changed-check plan was classified, not executed locally. Independent managed P0–P2 review finished scoped-clean, with no actionable findings; the subsequent type-only lint correction was verified mechanically against that reviewed source. Hosted exact-head CI remains the broad gate; CI timing is not yet available.

No local browser E2E or broad runtime build was run. The unchanged updater recovery registration root was attempted, then stopped when the canonical wrapper selected its broad runtime prerequisite; no pass is claimed. Exact-head ci:full must supply that recovery/browser and broad proof. Long updater tests retain their real migration/activation boundaries; no cheaper mocked substitute or timeout change was introduced.

Fresh publication collision census: 67 recent open PRs, 82 bounded reads, maximum two in flight; no overlap with these 32 paths. Four collision-owned UI consumers and the Mistral candidate remain excluded.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@steipete
steipete marked this pull request as ready for review October 25, 2026 11:39
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-25T11:40:07.483732Z bdaabe3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui cli CLI command changes size: M labels Oct 25, 2026
@steipete
steipete enabled auto-merge (squash) October 25, 2026 11:50
@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 Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated update, UI, and AI test fixtures while preserving existing scenarios and assertions.

Example: Restart verification receives a protocol mismatch with client protocol 5 and Gateway protocol 4.

  • Before: Two tests independently construct the same correlated GatewayClientRequestError.
  • After: Both tests obtain fresh, equivalent errors from the existing restart-health test helper.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, source-verified test consolidation with focused test evidence; evidence is primarily test and harness execution rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only refactor changes no shipped behavior; reported focused test results and inspected CI support fixture preservation without claiming an authenticated live API run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: Maintainer-approved maintenance reduces repeated test setup while retaining independent scenario data, assertions, and lifecycle boundaries.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: the fixture consolidation is useful, and the pinned diff introduces no actionable correctness or security finding.

Priority: P3
Reviewed head: bdaabe3c7e68b7535f59b3ee9a004b57d3ca4fb7

Before merge

None.

Findings

None.

Agent review details

How this fits together

Test support supplies filesystem records, Git environments, deferred promises, session responses, and errors to existing CLI, UI, and AI tests.

flowchart TD
  A[Shared test helpers] --> B[CLI update tests]
  A --> C[UI lifecycle tests]
  A --> D[Browser E2E scenarios]
  E[Inline model fixture] --> F[AI continuation live test]
  B --> G[Existing behavior assertions]
  C --> G
  D --> G
Loading

Technical review

Best possible solution:

Land the behavior-preserving fixture consolidation once the existing required CI gates pass.

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

There is no product bug to reproduce; source inspection confirms repeated fixtures are replaced with equivalent constructions.

Is this the best way to solve the issue?

The change uses existing fixture owners where available and adds only narrow shared support for duplicated records and cleanup operations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b3ba4d622638.

Provenance checked

  • AI continuation model fixture keeps the original intent (cc26392: The original continuation feature exercises explicit compatible-endpoint opt-in against the real Responses API without importing agent internals into the AI package.)
  • Restart protocol mismatch fixtures keeps the original intent (fix(update): updates fail verification on a healthy Gateway after a protocol version change #182399: Protocol-changing updates need HTTP identity verification when the retained updater's RPC handshake is rejected; the refactor preserves the error subclass and response correlation.)
  • Update verification diagnostic fixture keeps the original intent (fix(update): name the last health probe when Gateway readiness times out #182858: Readiness timeouts retain the last health-probe error rather than reporting only the interrupted read.)
  • Disk-space fixtures keeps the original intent (b979f29: Disk-space checks warn before runtime dependency staging; both extracted record builders retain their fields and defaults.)
  • Git rollback identity setup keeps the original intent (fix: restore the Gateway after activation Doctor fails #160671: Rollback tests isolate Git identity while checking restoration after activation Doctor failure; the existing helper performs the same ordered environment stubs.)
  • UI session response envelopes keeps the original intent (b658f4a: Earlier test consolidation established the fixed-one session fixture; current reuse retains authored rows and defaults, including worker placement and empty thinking choices.)
  • UI cleanup and deferred gates keeps the original intent (unknown: Existing hooks and gates isolate mock/global state and hold specific asynchronous boundaries; local log and content searches could not establish every introduction because older blobs are unavailable.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head hunks; changes are confined to tests and test support, with no production, dependency, workflow, configuration, or schema edits. (bdaabe3c7e68)
  • Existing fixture contracts: modelSessionList preserves the fixed timestamp, count, defaults, and independently authored row; chatSessionListResponse preserves defaults and samples its timestamp after row construction. (ui/src/e2e/chat-runtime-fixtures.test-support.ts:45, bdaabe3c7e68)
  • Cleanup and lifetime preservation: Cleanup remains restoreAllMocks followed by unstubAllGlobals inside the original hooks; deferred gates reuse the existing native Promise.withResolvers owner without moving allocation or release sites. (ui/src/test-helpers/mock-cleanup.ts:3, bdaabe3c7e68)
  • Accepted fixture tradeoffs: The maintainer-authored body explicitly accepts shared statfs function identity, unobserved envelope key order, and the relocated error-stack frame; source inspection supports these narrow changes. (src/cli/daemon-cli/restart-health.test-helpers.ts:35, bdaabe3c7e68)
  • Current-main compatibility: Comparison with fetched main shows the shared chat support owner's intervening exactButton relocation leaves the reused session-envelope contract unchanged. (ui/src/e2e/chat-flow.test-support.ts, b3ba4d622638)
  • Live review and CI state: The head remains pinned and mergeable. Paginated check reads show no failed check; required CI remains pending, with typechecks, lint, UI unit lanes, and both real-Gateway UI lanes successful. (bdaabe3c7e68)

Likely related people:

  • Peter Steinberger: Raw commit a5f3623 adds src/cli/daemon-cli/restart-health-probe.test.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a5f3623302fd; files: src/cli/daemon-cli/restart-health-probe.test.ts)
  • Markus Hartung: Raw commit cc26392 adds packages/ai/src/transports/openai-responses-client.continuation.live.test.ts:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cc2639283d95; files: packages/ai/src/transports/openai-responses-client.continuation.live.test.ts)
  • SunnyShu: Raw commit 823fbf7 adds src/cli/daemon-cli/restart-health-probe.test.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 823fbf745d4e; files: src/cli/daemon-cli/restart-health-probe.test.ts)

PR surface

Tests -108. Total -108 across 32 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 32 169 277 -108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 32 169 277 -108

Review metrics

Metric Value Why it matters
Production versus test changes Production +0/-0; tests and support +169/-277 The reduction removes repeated fixture construction without changing runtime behavior or adding test scenarios.

Labels

Label changes:

  • add P3: This is low-risk test maintenance with no user-facing behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is low-risk test maintenance with no user-facing behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 25, 2026, 7:55 AM ET / 11:55 UTC.

@steipete
steipete merged commit 5ee2701 into main Oct 25, 2026
212 of 216 checks passed
@steipete
steipete deleted the deslop/t04-25-package-fixtures-20261015 branch October 25, 2026 12:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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