Skip to content

refactor(plugins): forward auth and catalog to their owners - #190205

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/inference-x45-provider-runtime-owners
Nov 9, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/inference-x45-provider-runtime-owners

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Related: #188252

What Problem This Solves

Provider auth and model-catalog forwarding route through the aggregate runtime even though both have existing execution owners. The SDK catalog entrypoint also reaches that aggregate.

User Impact

No intended behavior or public API change. Provider selection, credentials, auth authority, catalog rows, failure isolation and deferred invocation retain their existing contracts. No CPU, latency, startup or total load-graph improvement is claimed.

Why This Change Was Made

Route the lazy facade to the existing auth and catalog owners and the SDK catalog export directly to the catalog owner. Move the formatter into the auth owner while preserving lookup, optional-hook behavior, arguments and plugin receiver; retain its aggregate export.

One real-registration regression traps aggregate loading while exercising the formatter and both catalog entrypoints, including receiver identity, stable results and cleanup. Remove the obsolete six-line aggregate mock. Production grows by 12 LF; tests grow by 50 LF, recorded in the existing allocation without changing the shared baseline. The correction extracts the formatter hook before calling it, preserving receiver binding while satisfying lint.

Evidence

  • The real-registration test fails on the exact base owner implementation at the intended aggregate-import trap and passes on the changed owner path. The original source was restored after the base control.
  • Native owning/consumer review: 291 tests across nine files passed at 3e5fadc2. After the formatter correction, both affected suites passed all 32 tests.
  • Policy single-worker measurements at 4aa2b086: catalog 43.171s command wall / 9.09s Vitest duration, auth 7.510s wall / 4.60s Vitest duration. The catalog file exercises real registration and resource/lifecycle cleanup; runner preparation is included in command wall time. Exact-head CI run42642964630 passed; its timestamp interval was765s (workflow wall interval, not per-file CPU or cost).
  • Targeted lint, formatting, core types, whitespace and test-line ratchet passed. The original no-useless-call lint failure is fixed by the signed hook-extraction correction.
  • Normal full build passed, including declaration generation, CLI import checks, all 161 SDK subpaths and the built public consumer compilation. SDK export registration check passed. Emitted facade imports defer to the auth/catalog chunks; the SDK entry imports the catalog chunk directly. This establishes those direct edges only.
  • Fresh independent full-range review covered all seven files and both commits through 4aa2b086b5c34bd2ef495ecbed0f099e1699ce1b, with no actionable correctness or security findings.
  • Canonical SDK API comparison completed: no entrypoints added/removed and all public export declarations/kinds unchanged. It reports 167 reachable closure changes from two module declaration diffs: moving the formatter into the auth owner and retaining its aggregate re-export. The lookup fields and credential parameter are equivalent; digest d08a78f7. No API baseline was changed.

Native publication and preparation completed at exact 4aa2b086b5c34bd2ef495ecbed0f099e1699ce1b. Exact-head CI passed; normal squash landing merged this head as f63e5cd0f6d38f1d0438978255d9e244183864c3. Normal native completion is verified. No skipped or pending result is counted as passing proof.

@vincentkoc vincentkoc self-assigned this Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR forwards provider authentication and catalog operations directly to their existing owners while preserving current exports.

Example: A registered provider formats fixture-access-key and supplies the catalog row fixture/row.

  • Before: The formatter and catalog entrypoints reach their implementations through the aggregate provider runtime.
  • After: They return the same formatted key and catalog row through the auth and catalog owners directly.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source change appears coherent and preserves existing contracts, but executable validation and changed-behavior proof are absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) The source change appears coherent and preserves existing contracts, but executable validation and changed-behavior proof are absent.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No end-user failure is established; narrow auth and catalog entrypoints unnecessarily depend on unrelated aggregate runtime code.
Reason: The maintainer-authored direction fits the parent campaign, removes an unnecessary dependency, and retains observable behavior without adding public capability or configuration.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored draft open: it is a focused refactor through existing owners, with no actionable correctness finding from source inspection.

Priority: P3
Reviewed head: 3e5fadc206fd976bdac645b6bffbe48e78362f1a

Before merge

  • Improve patch quality - Provide the changed-path runtime evidence described in the proof assessment.
  • Improve patch quality - Run the cold regression on base and head, affected auth/catalog and caller suites, targeted typecheck/lint and ratchets, then the required build and SDK API comparison on the reviewed head.

Findings

None.

Tests

  • Missing end-to-end proof: Neither a failing-base/passing-head cold-registration run nor a shipped CLI or Gateway run exercising the changed auth and catalog paths is supplied.
Agent review details

How this fits together

The deferred provider facade and public SDK catalog entrypoint connect credential and model-catalog callers to registered provider hooks, returning authentication results and supplemental catalog rows.

flowchart TD
  A[Credential callers] --> B[Deferred provider facade]
  C[Model catalog callers] --> B
  B --> D[Auth owner]
  B --> E[Catalog owner]
  F[SDK catalog entrypoint] --> E
  D --> G[Registered provider hooks]
  E --> G
Loading

Technical review

Best possible solution:

Preserve the existing facade and SDK contracts while forwarding directly to the auth and catalog owners.

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

This PR addresses an import dependency rather than a reported runtime bug; source confirms that current main routes the affected entrypoints through the aggregate.

Is this the best way to solve the issue?

The unnecessary dependency is the aggregate import; redirecting the existing facade and SDK export, relocating the formatter, and retaining its compatibility re-export is a small, coherent solution using existing owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Deferred provider forwarding keeps the original intent (2cb316f: Share transparent method binding while retaining asynchronous import loading and rejected-import recovery.)
  • API-key formatter dispatch keeps the original intent (05a2844: Consolidate provider hook forwarding while retaining plugin receiver binding and lifecycle ownership; the formatter itself appears in earlier commit e627a50.)
  • SDK catalog export keeps the original intent (e27fe55: Simplify plugin cache boundaries and remove the test-reset export while retaining catalog augmentation; the current PR changes its source module without changing the callable contract.)
  • Auth-suite aggregate mock keeps the original intent (c18456c: Exercise the real auth owner through the lazy facade without loading the aggregate while testing worker-authority enforcement; direct owner forwarding makes that aggregate mock obsolete.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2cb316f adds src/plugins/provider-runtime.runtime.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2cb316f0df1c; files: src/plugins/provider-runtime.runtime.ts)
  • Vincent Koc: Raw commit 4766165 adds src/plugins/provider-runtime-auth.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 476616530173; files: src/plugins/provider-runtime-auth.ts)
  • Masato Hoshino: Raw commit 9e28ade adds src/plugins/provider-runtime-auth.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9e28ade68145; files: src/plugins/provider-runtime-auth.ts)

PR surface

Source +11, Tests +50, Other +1. Total +62 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 25 14 +11
Tests 2 56 6 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 7 82 20 +62

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is behavior-preserving ownership cleanup without an established user-facing failure or claimed performance improvement.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 November 1, 2026, 4:58 AM ET / 09:58 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 9, 2026 15:16
@vincentkoc
vincentkoc enabled auto-merge (squash) November 9, 2026 15:21
@vincentkoc
vincentkoc merged commit f63e5cd into main Nov 9, 2026
208 of 209 checks passed
@vincentkoc
vincentkoc deleted the refactor/inference-x45-provider-runtime-owners branch November 9, 2026 15:30
@vincentkoc

Copy link
Copy Markdown
Member 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

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant