Skip to content

refactor: deslop provider, replay and metadata fixtures - #184647

Merged
steipete merged 1 commit into
mainfrom
deslop/t04-68-provider-role-replay-fixtures-20261015
Oct 26, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/t04-68-provider-role-replay-fixtures-20261015

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Nine independent fixture families duplicate provider envelopes, metadata configuration, registries, repositories, replay events, roles and idle dispatchers. Reuse fitting test-support owners; add only two missing narrow pure owners. Every assertion, case, registration and table remains; no distinct scenario is merged or weakened.

100 net test/support lines removed across 25 paths, production net 0. Authorized 100+ residue under the campaign floor waiver, NOT LARGE; it does not count toward the LARGE target. Whole-scope discovery remains open. Phase E standalone session memory backend, factory, registry, expiry, federation and all its tests are untouched.

Raw provider config inputs

Twenty-one input-only config envelopes reuse existing configForProviders while leaving each provider literal authored at its call site. Its generic constraint now uses canonical raw schema input rather than falsely requiring materialized defaults; runtime body is unchanged after erased satisfies, and no duplicate helper/export is added. Six existing normalized direct-consumer modules are type-covered proportionally. All casts stay unchanged, and four variable/spread/invalid-document configs remain untouched. Existing owner provenance #174840. Best-effort tradeoffs accepted: .models projections allocate and discard one tiny root wrapper; no values, field order, defaults, identity, freshness or behavioral expectations change.

Net: 54 test/support lines. Broad assertion-chain calls 175 → 175; custom assertions 8 → 8; callback registrations 51 → 51; custom registration sites 5 → 5; tables/gates 5 → 5.

Discord native-command registries

Two command-routing suites reuse their existing channel registry owner. The exact nested registration/plugin/capabilities inputs and publication timing remain; each invocation allocates a fresh registry/plugin/callback family. Empty-registry setup remains distinct. Best-effort tradeoffs accepted: none; all command and authorization scenarios remain separate.

Net: 12 test/support lines. Broad assertion-chain calls 37 → 37; custom assertions 1 → 1; callback registrations 13 → 13; custom registration sites 0 → 0; tables/gates 3 → 3.

Publication repositories

The preparation and existing-PR fixtures share a pure repository constructor on their already imported requester-publication owner. Non-fork headRepo===baseRepo identity remains; fork overrides and fresh nested owners/permissions are exact. Construction stays after the original awaited Git setup. Provenance: #178298/#178318. Best-effort tradeoffs accepted: none; real Git, requester authority, durable receipts and all outcomes stay unchanged.

Net: 5 test/support lines. Broad assertion-chain calls 99 → 99; custom assertions 0 → 0; callback registrations 10 → 10; custom registration sites 0 → 0; tables/gates 5 → 5.

Admin/member role config

Profile merge and update-requester tests share an identical passive role config beside the Gateway role owner. The module-once users config and fresh per-linkedAdmins-call config keep their lifetimes, nested arrays and later local plugin-policy mutation. Provenance: #159889/#153508. Best-effort tradeoffs accepted: one fifteen-line type-only test owner; no production authorization/revocation/settlement changes.

Net: 3 test/support lines. Broad assertion-chain calls 127 → 127; custom assertions 8 → 8; callback registrations 10 → 10; custom registration sites 1 → 1; tables/gates 4 → 4.

Reset kept-tail replay

Both archive-reader and authenticated Gateway history tests share the same complete six-event input transcript on the existing pure archive fixture owner. Parent IDs, reset timestamp/reason, roles and content remain exact and recursively fresh. The archive case retains its 20KiB padding and 16-byte short-read checks; expected display projections remain independent. Provenance: #178143/#183250, existing owner #182979. Best-effort tradeoffs accepted: none; no reset, retention or transcript policy changes.

Net: 6 test/support lines. Broad assertion-chain calls 153 → 153; custom assertions 3 → 3; callback registrations 32 → 32; custom registration sites 0 → 0; tables/gates 5 → 5.

Generic engine search descriptor

Two generic PostgreSQL test fixtures reuse one fresh text/vector notes descriptor on their already imported engine-store support owner. Module-once construction points, exact field order, dimensions and arrays remain. DDL, IDs, versions, admission, transactions, durability and namespace behavior are untouched. These are generic installation/search tests, not the standalone session memory backend. Provenance: #173745/#173625. Best-effort tradeoffs accepted: none; this is not a schema or storage-behavior change.

Net: 7 test/support lines. Broad assertion-chain calls 25 → 25; custom assertions 1 → 1; callback registrations 5 → 5; custom registration sites 0 → 0; tables/gates 3 → 3.

Idle reply dispatchers

ACP and plugin-hook tests share one import-free dispatcher fixture beside the plugin consumer. Module-once contexts remain module-once; callbacks, per-method counts objects and resolved promises remain fresh. Caller-specific recordProcessed/markIdle spies and no-ops stay local. Best-effort tradeoffs accepted: one eleven-line pure test owner; no SDK export, hook or runtime seam.

Net: 3 test/support lines. Broad assertion-chain calls 74 → 74; custom assertions 0 → 0; callback registrations 15 → 15; custom registration sites 1 → 1; tables/gates 2 → 2.

OAuth credential inputs

The SDK metadata case reuses the unchanged OAuth credential factory with its explicit original accountId. Field presence/order and one Date.now()+60000 evaluation remain at the original construction point. Best-effort tradeoffs accepted: none; callback, CORS, cancellation, timeout and metadata expectations stay unchanged.

Net: 6 test/support lines. Broad assertion-chain calls 79 → 79; custom assertions 0 → 0; callback registrations 13 → 13; custom registration sites 0 → 0; tables/gates 1 → 1.

Metadata lifecycle config

Both lifecycle suites construct their exact module-once config through their existing already-imported auth fixture owner. Every nested object and array remains fresh per call; primary/model/allow literals remain independently authored, and native/different-config scenarios and all auth/currentness expectations remain separate. Provenance: #121057/#164103/#173585, existing owner #158050. Best-effort tradeoffs accepted: none; no runtime import edge, model defaults or behavior changes.

Net: 4 test/support lines. Broad assertion-chain calls 165 → 165; custom assertions 15 → 15; callback registrations 11 → 11; custom registration sites 3 → 3; tables/gates 5 → 5.

Best-effort tradeoffs accepted

Each cut names its tradeoffs above. No production guard, security/authorization boundary, common-path durability, realistic concurrency, persisted schema or public contract is removed. Tiny discarded raw-config root wrappers and two small pure test owners are construction tradeoffs only, not performance claims.

Evidence

Changed-file source census before = after: 934 broad assertion-chain calls, 36 custom assertions, 160 callback registrations, 10 custom registration sites, 33 tables/gates, 21 hooks, 6 mock targets and 3 hoists. These are source sites, not expanded runtime totals. Complete assertion/custom-assertion/registration/table AST arrays are exact; hook/hoist signatures and mock registration targets remain. The push extraction was dropped after changed closed-factory fingerprints failed mock-export policy; original push mocks stay byte-for-byte base, with no new isolation annotation/baseline exception or real-transport import. Per-packet full source/Program inverses, expanded ordered fixture ASTs and recursive freshness checks preserve construction semantics. No new skip, retry, timeout, cast or lint suppression.

Focused canonical Vitest ran serially at nice10/maxWorkers1 with isolated HOME/OpenClaw/XDG state:

Group Passing / failing Files Wrapper seconds
sdk-tests 23 / 0 2 109.977
plugins-tests 9 / 0 1 12.346
reply-tests 17 / 0 2 42.003
gateway-session-tests 43 / 0 3 83.112
infra-tests 11 / 0 1 26.219
agents-root-tests 23 / 0 3 47.491
agents-other-tests 35 / 0 1 24.31
gateway-publication-tests 43 / 0 3 354.373
gateway-methods-tests 71 / 0 4 34.473
gateway-metadata-tests 20 / 0 2 14.627

295 passing cases across twenty-two focused runtime files. Eleven narrow compiler graphs and eight static gates passed: formatting, typed lint, mock exports, timeout ratchet, changed-lane dry-run, lint suppressions, runtime cycles and Madge. No new runtime/Madge cycle. The original proof passed all runtime/type groups, then failed local max-lines at the initial publication owner. Move the unchanged pure constructor to the existing requester owner already imported by both callers; no suppression, limit change or new import edge. The three affected publication roots and compiler graph passed again. Subsequently the mock-export gate rejected the push extraction; drop that slice and add metadata config. Retain eight unaffected runtime groups and nine compiler graphs; reprove methods and metadata roots/type graphs plus all static gates. Ordinary Vitest worker artifacts were prepared by the canonical runner; all selected local roots were prequalified as requiring no product runtime build. The two PostgreSQL conformance roots have targeted compiler proof and are hosted-runtime-only under the local service/build budget. No local broad build, E2E, whole-graph typecheck or paid/live call was run or claimed. Existing integration cases retain their owner/authority/transport composition and introduce no new boot, poller or timer. Hosted CI job-wall accounting follows completion.

Fresh isolated P0–P2 review is scoped-clean with no accepted/actionable findings. Author simplification inspected the complete diff, reused the canonical raw-input constructor rather than adding a same-body helper, and deferred a separate auth-env slice until its natural existing owner is available. Fresh 72-hour collision census: 76 recent open PRs, 93 bounded reads, maximum 2 in flight; no overlaps. No branch rebase or CI rerun solely to obtain green.

Hosted CI on exact head

Exact-head CI 40326699417 passed all planned suites. Summed job-wall time: 18776 seconds (overlapping jobs, not elapsed time). Security 40326688216 completed actual Prepare and Enforce steps successfully; cancelled duplicate/advisory attempts are not claimed as passing runtime proof. Native submission enforces applicable exact-head checks and reviews. No runtime suite was cancelled. All nine fixture cuts retain their recorded assertion/registration counts. The two PostgreSQL roots were compiler-covered locally and runtime-covered by hosted conformance.295 focused local cases passed. Initial local max-lines and closed-mock fingerprint failures were repaired/dropped as described above, without weaker expectations, suppression or baseline exception. No hosted CI rerun, source repush or branch rebase for green.

@clawsweeper

clawsweeper Bot commented Oct 26, 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 26, 2026 12:58
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

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 ✅ Completed 2026-10-26T13:59:24.783915Z 2828dc8 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated test fixtures for provider configuration, command registries, publication repositories, roles, transcript replay, database search, and reply dispatch.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, behavior-preserving test refactor supported by focused validation and current-head CI, with PostgreSQL conformance still pending.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored test-only refactor changes no shipped behavior; focused test results and exact-head CI support fixture equivalence, while inspected predecessor screenshots concern the earlier PR-refresh feature.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction reduces duplicated setup without changing product behavior or weakening the inspected coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed fixture consolidation preserves the inspected scenarios and assertions, with no actionable correctness or security findings.

Priority: P3
Reviewed head: 2828dc86da5bf733044cb3748b4d324036b889ff

Before merge

None.

Findings

None.

Agent review details

How this fits together

Test-support factories supply synthetic configuration, credentials, repositories, transcripts, and dispatchers to existing suites, which exercise production owners against independent expectations.

flowchart LR
  A[Synthetic fixture inputs] --> B[Shared test support]
  B --> C[Existing test suites]
  C --> D[Production owners]
  D --> E[Observed results]
  E --> F[Independent assertions]
Loading

Technical review

Best possible solution:

Retain the focused fixture consolidation and let the existing exact-head CI gates finish.

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

There is no reported runtime defect to reproduce; source comparison confirms repeated fixture construction.

Is this the best way to solve the issue?

The change reuses fitting support owners and two small pure factories while preserving construction lifetimes, nested freshness, and independent expected results.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Provider configuration fixtures changes intended behavior with a stated reason (78dd860: Share provider and model fixtures; this PR explicitly changes the type constraint to canonical raw schema input while retaining the runtime constructor.)
  • Discord command registries keeps the original intent (fix: reject positional arguments for text /exec commands #137562: Preserve explicit slash-command validation and native-surface routing; registry contents and publication points remain equivalent.)
  • Publication repositories keeps the original intent (13c8407: Exercise imported-PR preparation and refresh with real Git workspaces; the related publication tests from feat: update a guest's original pull request #178318 retain their distinct outcomes.)
  • Admin and member role fixtures keeps the original intent (b1694b3: Exercise profile merges and requester authority with distinct administrator and member policies; the extracted values and caller-specific mutation lifetimes are unchanged.)
  • Reset kept-tail replay keeps the original intent (36e277d: Protect session reset history projection; shared input events retain independent archive and authenticated Gateway expectations.)
  • PostgreSQL search descriptor keeps the original intent (3c4be0e: Protect installation isolation and search admission; schema IDs, versions, DDL, search fields, dimensions, and execution points remain unchanged.)
  • Idle reply dispatchers keeps the original intent (82ce30b: Exercise reply-dispatch hooks with an idle dispatcher; the extraction preserves callbacks, fresh count objects, and caller-owned spies.)
  • OAuth credential metadata keeps the original intent (unknown: The base test protects non-secret account metadata reads; the existing credential factory reproduces its fields and expiry evaluation.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned scope and current main: The introduced diff changes only tests and test support; fetched main has no intervening changes to these paths and retains the original provider helper. (src/agents/model-auth.fixtures.test-support.ts:27, 2828dc86da5b)
  • Raw provider input contract: The helper uses the canonical schema input constraint without parsing, materializing defaults, copying providers, or adding runtime imports; existing normalized callers retain their supplied types and values. (src/agents/model-auth.fixtures.test-support.ts:27, 2828dc86da5b)
  • Fixture semantics preserved: Repository construction preserves same-repository identity and fork permissions; replay construction preserves all six events, while archive short-read checks and Gateway display expectations remain independent. (src/gateway/github-publication-requester.test-support.ts:60, 2828dc86da5b)
  • Existing fixture ownership: The provider, archive, metadata, and engine-support owners originate in earlier merged fixture consolidations; publication fixture intent is documented in feat: refresh imported pull request source #178298 and preserved here. (src/agents/model-auth.fixtures.test-support.ts:5, 78dd8604b06d)
  • Validation and merge state: The author reports 295 passing focused cases; current-head checks show successful test-type and changed-test lanes, with PostgreSQL conformance still running and the CI gate pending; GitHub reports mergeable=true. (2828dc86da5b)
  • Policy and inspection limits: Root and applicable scoped AGENTS files were applied; the maintainer-notes directory is absent, and older history traversal encountered unavailable boundary blobs, while the relevant fixture-introduction diffs remained readable. (AGENTS.md:1, 2828dc86da5b)

Likely related people:

  • Peter Steinberger: Raw commit 78dd860 adds src/agents/model-auth.fixtures.test-support.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 78dd8604b06d; files: src/agents/model-auth.fixtures.test-support.ts)
  • Shakker: Raw commit 13c8407 adds src/gateway/github-pr-workspace-preparation.test-support.ts:138 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 13c8407ff4f4; files: src/gateway/github-pr-workspace-preparation.test-support.ts)
  • Ayaan Zaidi: Raw commit 204ff97 adds src/gateway/server-chat-metadata-lifecycle.rebuild.test.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 204ff9770617; files: src/gateway/server-chat-metadata-lifecycle.rebuild.test.ts)

PR surface

Tests -100. Total -100 across 25 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 25 278 378 -100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 278 378 -100

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests and support +278/-378 The reduction comes from shared fixture construction without removing assertions or scenarios.

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no intended user-facing behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 test-maintenance cleanup with no intended user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 26, 2026, 9:17 AM ET / 13:17 UTC.

@steipete
steipete merged commit 4a05a61 into main Oct 26, 2026
226 of 231 checks passed
@steipete
steipete deleted the deslop/t04-68-provider-role-replay-fixtures-20261015 branch October 26, 2026 13:26
@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

agents Agent runtime and tooling gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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