Skip to content

refactor(coordinator): give provider connections a session owner - #1046

Closed
Gajesh2007 wants to merge 11 commits into
refactor/coordinator-subsystems-integratedfrom
refactor/coordinator-provider-session
Closed

Gajesh2007 wants to merge 11 commits into
refactor/coordinator-subsystems-integratedfrom
refactor/coordinator-provider-session

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Provider registration, heartbeat, cache receipts, model-status messages and teardown previously shared the 2,009-line API provider file with inference frames. One providercontrol/session.Session now owns each accepted connection, with focused files for those responsibilities; api/provider.go is 1,219 lines and retains the upgrade, inference-frame handlers and public attestation roster.

providerSessionDependencies binds the existing verification, challenge, code-identity, release-policy, MDM scheduler and inference owners. Store/registry/logger/config reads remain current; scheduler claims retain their startup store. The original provider pointer, per-connection challenge tracker and exact scheduler generation survive through cancellation, unbind, resume cleanup, device/code coverage stop, registry disconnect and socket close. Protocol guards, callback order, trust policy, budgets, metric values and wire schemas are preserved.

Stacked on #1038. The source move includes a regression using an actual local WebSocket and a MemoryStore provider-session row: a store binding changed during registration must receive the specific close reason after the provider is offline. It passes the unchanged original implementation and rejects a captured-store mutation. Current source maps and security-review selectors follow the new owner; frozen records are unchanged.

Validation:

  • Full coordinator race: 3,475 top-level / 5,840 results, with 5,734 passes and 106 existing opt-in skips; API 219.121s. Final focused checks after deleting one uncalled API delegation: 20 top-level / 48 results, all pass. Subsequent source follow-up changes one citation comment only.
  • The reviewed Session source cut has an actual-Git strict Go token proof, including semicolons: 10,892 retained declarations and 42 mapped operations match; all 3,548 original test/benchmark/fuzz/example entries survive, plus the new boundary fixture. Independent source peer is clean.
  • Parent refreshes preserve the reviewed Session source and combined owners. The final dispatch parent 791f77dcb has an exact 5,086-entry composition proof, including deletions, symlinks and gitlinks; all 25 remaining provider operations match that parent. The four cache receipts now reach the moved dispatch.LowCardinalityCacheTier through their existing binding. Final focused race: 114 top-level / 184 results pass without test skips (API 11.807s).
  • Command build and pinned golangci-lint v2.1.6 pass with zero issues. Two heartbeat benchmark arms run as fixture smoke only; no performance claim.
  • All 281 docs pass. YAML parses and the actual CI threat selector matches all ten moved owner/binding paths while retaining existing selectors. No native provider, model, live Apple service or production execution.

Before:

flowchart TD
  WS[Provider WebSocket] --> API[api.handleProviderWS]
  API --> Loop[api.providerReadLoop in provider.go]
  Loop --> Reg[Registration, account linkage and runtime checks]
  Reg --> Trust[Shared verification, challenge and MDM owners]
  Loop --> HB[Heartbeat, cache receipts and model status]
  Loop --> Frames[Existing API inference handlers]
  Loop --> Close[Cancel, unbind, clear coverage, disconnect, close]
Loading

After:

flowchart TD
  WS[Provider WebSocket] --> API[api.handleProviderWS]
  API --> Bind[providerSessionDependencies]
  Bind --> Session[One session.Session.Run]
  Session --> Reg[registration.go: same registration and trust sequence]
  Reg --> Trust[Existing shared policy and verification owners]
  Session --> State[heartbeat.go, cache_receipts.go, model_status.go]
  Session --> Frames[Four typed callbacks to the same API inference handlers]
  Session --> Close[disconnect.go: same ordered teardown]
Loading

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 14, 2026 6:56pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 6:56pm UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 6:56pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T18:58:46.032309Z 49d85dd Manual request
ℹ️ 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.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 91030c8a81

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…/coordinator-provider-session

# Conflicts:
#	docs/developer/test.md
#	docs/reference/api-contracts.md
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Refreshed the parent branch and resolved documentation/source-map conflicts. Existing subsystem implementations and regression tests are preserved. Exact parent composition and independent review pass; all coordinator test packages compile and documentation checks pass. The account-deletion fixture also carries the previously reviewed asynchronous-registration race fix; all seven deletion tests pass under the race detector.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 49d85dd918

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gajesh2007

Copy link
Copy Markdown
Member Author

Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head (49d85dd91869db6573dac2016247356119e37eb4), including its reviewed fixes, with implementations and regressions reconciled into the coordinator subsystem owners. Closing the component PR to collapse the stack; its branch, commits and review history are retained. Follow #1056 for combined validation and merge status.

@Gajesh2007 Gajesh2007 closed this Sep 16, 2026

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference — 49d85dd9 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 49d85dd9 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — 49d85dd9 Deployed Sep 14, 2026 by vercel[bot]
benchmarks — 49d85dd9 Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant