Skip to content

refactor(embeddings): separate invocation contracts from host creation - #190394

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/embedding-invocation-contracts
Nov 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/embedding-invocation-contracts

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Related: #188252

What Problem This Solves

Embedding invocation contracts share type owners with host configuration, provider creation and registration.

User Impact

No intended user-visible behavior change. Existing SDK names, optional fields, mutable inputs, cancellation and deadline behavior stay compatible.

Why This Change Was Made

Use the existing generic and memory invocation owners for the complete data contracts, with creation and registration depending downward on them. Migrate affected callers, retire the private creation-options alias and obsolete internal type forwards, and keep the existing SDK facades.

The sole deadline symbol allocation and legacy memory alias remain one runtime identity. Transport, authority, readiness, cache identity and settlement algorithms are unchanged.

Evidence

  • Exactly 21 existing files: production 151 additions/163 deletions; tests 14 additions/19 deletions. Test edits change imports/type uses only; existing cases and assertions remain.
  • Complete independent committed-range source review found no actionable correctness or security findings. Signed commit hooks, formatter, syntax, whitespace and source-parity checks passed.
  • Qualified native proof passed 158 tests across 11 files, nine owning type profiles, exact-path typed lint, format and the test-line ratchet.
  • The normal full build passed, including package declarations and the maintained strict consumer check for all 161 public SDK subpaths.
  • Actual emitted SDK package exports share the same unique deadline symbol and pass the real pause/resume control-channel check without a source loader.
  • The maintained parent-to-candidate API comparison completed. It reports 230 reachable-closure changes and no direct public signature/kind or entrypoint/export additions/removals. These reflect canonical ownership and removed backedges; this is a nonempty declaration diff. API digest: 7b33a50e.
  • Native preparation completed at the unchanged authored head. Current-head CI is green (run); enforced review/security/writer checks remain required at native merge admission.

No runtime-performance or startup improvement is claimed.

@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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M labels Nov 1, 2026
@clawsweeper clawsweeper Bot added 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR separates embedding invocation contracts from provider creation and registration while preserving existing SDK exports.

Example: Memory search uses an Ollama embedding provider with managed-service readiness.

  • Before: Invocation options and the deadline symbol are defined alongside provider creation contracts.
  • After: They live in the invocation contract owner, with the same readiness notifications and intended embedding results.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source change is focused and appears correct, but the explicitly pending native validation leaves it unready to merge.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible failure is claimed; invocation contracts currently share ownership with host creation and registration.
Reason: The maintainer-authored direction matches the linked campaign and improves dependency ownership without adding capability, configuration, or a competing implementation.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: it delivers a coherent, authorized contract refactor, and source review found no actionable correctness or security defects.

Priority: P3
Reviewed head: 410bf88d797f8b2f7a349f5fe5b6dd0247b31539

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply built SDK-loader identity/control evidence and a shipped embedding-flow trace covering readiness and cancellation; no red/green regression is expected for this behavior-preserving refactor.
Agent review details

How this fits together

Embedding adapters create providers from host configuration; memory and Gateway callers invoke them with inputs, cancellation, deadline controls, and usage observers to obtain vectors.

flowchart LR
  A[Host configuration] --> B[Provider creation contracts]
  B --> C[Created embedding provider]
  D[Invocation contracts] --> C
  E[Memory and Gateway callers] --> C
  C --> F[Embedding transport]
  F --> G[Vectors and usage]
Loading

Technical review

Best possible solution:

Keep invocation contracts in the existing runtime owners, with creation depending on them and SDK facades retaining one shared deadline symbol.

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

This PR addresses source ownership rather than a runtime bug; the base and current-main declarations confirm the coupling it removes.

Is this the best way to solve the issue?

The diff is the smallest coherent ownership cut: it reuses existing modules, migrates affected callers, removes superseded internal forwards, and retains public facade names and structural contracts.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e4d1b7e adds src/plugins/registry-contribution-types.ts:154 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e4d1b7e0d38c; files: src/plugins/registry-contribution-types.ts)

PR surface

Source -12, Tests -5. Total -17 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 15 151 163 -12
Tests 6 14 19 -5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 165 182 -17

Review metrics

Metric Value Why it matters
Production versus test changes Production +151/-163; tests +14/-19 Existing declarations are relocated and obsolete forwards removed; test changes only migrate imports and type uses, with no added scaffolding or assertions.

Root-cause cluster

Relationship: partial_overlap
Canonical: #188252
Summary: This PR implements the embedding invocation-contract portion of the broader inference-contract campaign.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P3: This is behavior-preserving contract cleanup without an established user-facing failure or urgent regression.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 behavior-preserving contract cleanup without an established user-facing failure or urgent regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Provide built SDK-loader symbol identity and notification evidence together with the embedding readiness/cancellation trace.
  • Complete the strict SDK consumer, owning type/lint checks, SDK build, and declaration compatibility comparison.

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, 9:29 AM ET / 14:29 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 2, 2026 15:05
@vincentkoc
vincentkoc merged commit f90d6c0 into main Nov 2, 2026
237 checks passed
@vincentkoc
vincentkoc deleted the refactor/embedding-invocation-contracts branch November 2, 2026 16:00
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 2, 2026
Reconcile the private memory-host bridge guard with the two type-only imports of canonical EmbeddingProviderCreateOptions introduced by #190394. Keep exact inventory equality, private exports, and combined runtime-barrel rejection intact.

The existing guard fails on the base with the exact 21-versus-19 CI mismatch and passes all 8 cases on Node and Bun with this change. Targeted types, lint, format, and the test-line ratchet pass; no allocation or shared ceiling change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
Reconcile the private memory-host bridge guard with the two type-only imports of canonical EmbeddingProviderCreateOptions introduced by openclaw#190394. Keep exact inventory equality, private exports, and combined runtime-barrel rejection intact.

The existing guard fails on the base with the exact 21-versus-19 CI mismatch and passes all 8 cases on Node and Bun with this change. Targeted types, lint, format, and the test-line ratchet pass; no allocation or shared ceiling change.
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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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