Skip to content

refactor: deslop provider, gateway and secrets fixtures - #184692

Merged
steipete merged 2 commits into
mainfrom
deslop/t04-69-auth-role-fixtures-20261015
Oct 26, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/t04-69-auth-role-fixtures-20261015

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Six independent fixture families repeat provider envelopes, authentication environments, model results, requested bootstrap profiles, policy registries and vault manifest inputs. Reuse fitting existing owners and add only the two missing narrow passive owners. Every assertion, test case, registration and table remains; no scenario is merged or weakened.

102 net test/support lines removed across 38 paths; production net 0. Authorized 100+ residue under the campaign floor waiver, NOT LARGE. Whole-scope discovery remains open.

Raw provider input envelopes

Seven provider suites reuse the existing unchanged raw-input constructor. Explicit provider bodies, own-key order, absent fields, casts, spreads and freshness remain; malformed inputs stay local. Provenance: #183871, #145305, #173164, #172152, #174818, #173327 and #137071. Best-effort tradeoffs accepted: input-only .models projections allocate and discard a tiny root wrapper; no public or serialized contract changes.

Net 31 test/support lines. Broad assertion-chain calls 287 → 287; custom assertions 0 → 0; callback registrations 62 → 62; custom registration sites 0 → 0; tables 13 → 13.

Passive authentication environments

Repeated environment families move to the existing Gateway env owner. Direct singleton reads stay direct; fresh spreads stay fresh, including ordered fields, own undefined values and capture/restoration. Provenance: #149591, #177339, #148093, #148167 and #122178. Best-effort tradeoffs accepted: none; no environment policy, secret handling or real-state access changes.

Net 23 test/support lines. Broad assertion-chain calls 910 → 910; custom assertions 52 → 52; callback registrations 112 → 112; custom registration sites 11 → 11; tables 28 → 28.

Goal model result inputs

Successful model results use the existing Goal fixture owner, with explicit text/session inputs and fresh nested arrays/metadata at the original settlement points. Aborted results stay separate. Provenance: #181688/#131370. Best-effort tradeoffs accepted: the plain sessionId parameter is read as an argument immediately before allocation rather than midway through it; no getter or allocation observer exists at these sites.

Net 5 test/support lines. Broad assertion-chain calls 318 → 318; custom assertions 11 → 11; callback registrations 18 → 18; custom registration sites 5 → 5; tables 5 → 5.

Overbroad bootstrap inputs

Two security scenarios share only the exact overbroad requested-profile INPUT. Independent expected normalized profiles/grants stay authored locally, so production must still strip forbidden scope requests. Provenance: #72919/#182737. Best-effort tradeoffs accepted: one import-free input owner; no security guard, permission, issuance, approval or persistence change.

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

Sparse external policy registries

Two tests share an import-free sparse-registry constructor. Each getter reads its caller-owned current root on invocation and allocates fresh snapshot arrays. Existing importOriginal spreads keep real exports. Best-effort tradeoffs accepted: one passive owner; no captured root, transport import, registry behavior change or mock-isolation exception.

Net 6 test/support lines. Broad assertion-chain calls 12 → 12; custom assertions 0 → 0; callback registrations 5 → 5; custom registration sites 0 → 0; tables 0 → 0.

Vault manifest inputs

Seven manifest secretProviderIntegrations INPUT maps share the existing plugin-secret-provider fixture owner. Entrypoint and providerAlias remain explicit; each call creates a fresh map, vault record and args array at the original allocation point. Independent expected provider configs, trust-origin/disable checks, symlink/hardlink/path-mode scenarios and exec/security expectations remain local. Provenance: #82326, #117563 and #179129. Best-effort tradeoffs accepted: none; no production normalization, path validation, credentials, schema or secret-execution contract changes.

Net 31 test/support lines. Broad assertion-chain calls 49 → 49; custom assertions 0 → 0; callback registrations 15 → 15; custom registration sites 0 → 0; tables 9 → 9.

Best-effort tradeoffs accepted

Each cut names its construction tradeoff above. No production guard, security/authorization boundary, common-path durability, realistic concurrency, persisted shape, schema or public contract is removed. No performance claim.

Before publication, the entire seven-path role-helper proposal was withdrawn byte-exact to main because its shared rewind fixture is consumed by an actual protected session-memory backend test. None of that proposal remains in this PR. The standalone Phase E memory backend, factory, registry, expiry, federation and all its tests remain unchanged; protected/ambiguous shared owners are not carved up.

Configure remains byte-for-byte unchanged for open test-pruning PR #184682, whose inspected exact-head diff already moves that scenario onto the existing createPluginSecretProviderFixture owner. This PR preserves that fixture signature/behavior and centralizes only its seven other selected manifest inputs. No configure migration is credited here.

Evidence

Changed-source counts before=after: 2037 broad assertion-chain calls; 63 custom assertions; 274 callback registrations; 19 custom registration sites; 60 tables; 27 hooks; 13 mock targets; 10 hoists. Source sites are not expanded runtime cases. All scenarios, assertions, tables and registrations remain. Full source/Program inverses preserve input values/order/presence, singleton-versus-per-call allocation and fresh nested records/arrays/promises. Nonprovider assertions are raw-AST exact; raw-provider input assertions are exact after constructor expansion. No new skip, retry, timeout, cast, lint suppression or baseline/isolation exception.

Focused canonical Vitest, serial nice10/maxWorkers1 and isolated HOME/OpenClaw/XDG:

Group Passing / failing Executed files Wrapper seconds
agents-tools-tests 22 / 0 4 13.474
gateway-root-tests 65 / 0 4 213.507
gateway-other-tests 2 / 0 1 33.579
gateway-methods-tests 328 / 0 21 341.627
infra-tests 68 / 0 2 48.805
plugins-platform-tests 80 / 0 9 63.481
Root account-authority repair 10 / 0 1 34.122

575 measured passing cases across 42 executed roots. Earlier six runtime groups reuse only unchanged KEPT source inputs; their original 41 roots include nine extra withdrawn/unchanged roots. All current original32 selected roots remain covered, and the additional account-authority root passed after this repair. The Codex Gateway root requires canonical runtime artifacts, so it is narrow-compiler-covered locally and its runtime proof is delegated to exact-head hosted CI, not to a forbidden local product build/E2E. Six prior narrow compiler graphs retain unchanged inputs; the new root-test-other compiler graph passes with the canonical ambient declarations and exclusions preserved. Current format/typed lint for the two new files, full mock-export/timeout/suppression/cycle gates and changed-lane classification passed. Earlier unchanged36-file format/lint/planning proof is reused explicitly. Runtime/Madge cycles remain zero.

Fresh isolated original37-path P0-P2 review scoped-clean, narrowed to byte-identical retained36 after withdrawing configure for collision. Fresh two-root import-only repair review also scoped-clean/findings[]. Native formatter then only reordered the new passive env import; exact new-import and all other Program ASTs preserved after removing that import. This mechanical ordering reuse is documented, not a byte-identical review claim. Author simplification confirmed the repair is only two canonical-owner imports: no compatibility re-export/alias, defaults, wrappers or test-only production seam.

CI repair attribution

Exact run/job Failure Attribution / repair
40334672512 / 121614689897 TS2305: two root tests import WITHOUT_OPENAI_ENV_AUTH from its retired owner PR-caused, not inherited. Complete their imports onto the existing canonical env owner. No test expectation or security guard changed.

The initial six-graph local selection missed these two out-of-scope root-test consumers; the repair explicitly includes both under orphan-cutover authority. The focused integration now passes all10 cases, and both files pass targeted root-test types. A temporary narrow compiler config initially omitted canonical UI ambient declarations; corrected only the ignored proof config, without tracked type/suppression changes. An initial format check sorted only the new passive import; no product/test failure was hidden. Fresh72hour collision census: 65 recent open PRs/82 bounded reads/max2; only overlap is this existing target PR, no other campaign owner. No hosted CI rerun or branch rebase. The repair push obtains new exact-head CI because source really changed; old-head failures are not passing proof. Hosted broad CI/security/job-wall evidence follows the repaired head.

Hosted CI on exact repaired head

Exact-head CI 40336832506 passed all planned suites. Summed job-wall time: 13768 seconds (overlapping jobs, not elapsed). Security 40336828253 successfully executed both Prepare and Enforce for this exact PR/head. Skipped later no-op40336831060 is not claimed as proof; cancelled advisory dispatch/context jobs are not runtime suites. Native submission enforces applicable checks and reviews. The former TS2305 in old-head job121614689897 was PR-caused and repaired by migrating two stale imports; no inherited-failure waiver, CI rerun, rebase or source repush for green. Narrow proof totals575passing cases/42executed roots, seven compiler selections, all preservation counts and explicit unchanged-input reuse retained above. Codex Gateway runtime was compiler-covered locally and delegated to this hosted exact-head gate.

@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 13:54
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label 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:21.254506Z ba8b6f3 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: 🦐 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 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 provider, Gateway, bootstrap, policy-registry, and secret-provider test inputs into shared fixtures.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused test maintenance with preserved expectations and no findings; validation is harness-based and the aggregate CI gate is still pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only refactor changes no shipped behavior; supplied focused-test results and current-head CI support fixture parity, and no target code was executed during this review.
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-approved direction removes repeated setup without changing runtime behavior, test scenarios, or expected outcomes.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a coherent test-only simplification, with no actionable correctness or security findings; the existing CI gate remains pending.

Priority: P3
Reviewed head: a8197359d4bb39fea20229e910388cda2795c4e1

Before merge

None.

Findings

None.

Agent review details

How this fits together

Test suites construct configuration, environment, and authentication inputs, exercise production owners, and compare results against independently authored expectations.

flowchart LR
  A[Test scenarios] --> B[Shared input fixtures]
  B --> C[Production owners]
  C --> D[Observed results]
  A --> E[Independent expectations]
  D --> F[Assertions]
  E --> F
Loading

Technical review

Best possible solution:

Retain the focused fixture consolidation and complete the existing current-head CI gate.

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

This PR addresses repeated test setup rather than a product defect; the introduced diff directly establishes that duplication and its consolidation.

Is this the best way to solve the issue?

The change uses existing fixture owners where available and two small import-free constructors where needed, preserving allocation lifetimes and independent expectations.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Raw provider configuration inputs keeps the original intent (4a05a61: The existing constructor accepts canonical raw schema inputs while preserving explicit provider literals and fresh wrappers.)
  • OpenAI authentication environment isolation keeps the original intent (8c56730: Model-catalog tests isolate ambient OpenAI and Codex authentication; the moved constant retains its exact keys and values.)
  • Goal model-result fixtures keeps the original intent (ed3e84a: Goal replacement coverage controls model completion and settlement; result construction remains at the same settlement points.)
  • Overbroad bootstrap requests keeps the original intent (b8372a7: Bootstrap scope tests verify forbidden requested privileges are stripped; only their common input is extracted.)
  • Cold external-provider policy registry keeps the original intent (b253b11: Trusted external-provider policy must resolve while runtime remains cold; each snapshot still reads the caller's current root and constructs fresh registry arrays.)
  • Secret-provider manifest fixtures keeps the original intent (6037a74: Manifest-driven secret-provider integration coverage protects plugin ownership and execution constraints; extracted manifest inputs preserve those tests and their independent expectations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4a05a61 adds src/agents/model-auth.fixtures.test-support.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4a05a6169ece; files: src/agents/model-auth.fixtures.test-support.ts)
  • Josh Avant: Raw commit b253b11 adds src/plugins/provider-runtime.external-policy.test.ts:38 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b253b1116cd7; files: src/plugins/provider-runtime.external-policy.test.ts)
  • Agustin Rivera: Raw commit b8372a7 adds src/infra/device-bootstrap.test.ts:359 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b8372a714ccc; files: src/infra/device-bootstrap.test.ts)

PR surface

Source +29, Tests -131. Total -102 across 38 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 1 29 0 +29
Tests 37 204 335 -131
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 38 233 335 -102

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests and support +233/-335, net -102 Small shared input constructors remove duplication while retaining independent expected results and existing test cases.

Labels

Label changes:

  • add P3: This is low-risk test maintenance with no user-facing runtime 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 runtime 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 26, 2026, 10:25 AM ET / 14:25 UTC.

@steipete
steipete merged commit 8f737e1 into main Oct 26, 2026
145 of 147 checks passed
@steipete
steipete deleted the deslop/t04-69-auth-role-fixtures-20261015 branch October 26, 2026 14:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
)

* refactor: deslop provider, gateway and secrets fixtures

* test: finish auth environment fixture cutover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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