Skip to content

refactor(coordinator): isolate durable trust reuse ownership - #1017

Closed
Gajesh2007 wants to merge 9 commits into
refactor/coordinator-profiler-ownerfrom
refactor/coordinator-trust-reuse-owner
Closed

Gajesh2007 wants to merge 9 commits into
refactor/coordinator-profiler-ownerfrom
refactor/coordinator-trust-reuse-owner

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Device-evidence state and its lifecycle are currently spread across api.Server, a 1,408-line trust file and a 446-line journal file. This moves them into providercontrol/trustreuse.Manager, split into decision/cache, grants, revocation/replay, coverage, startup and journal responsibilities. API adapters retain signature and release-policy prerequisites, status/metrics integration and shutdown sequencing.

Stacked on #1013. Reuse decisions, journal bytes, environment defaults, store CAS and grant epochs are preserved. The manager keeps its startup-bound store and live MDM-client predicate. No mutable cache records or locks cross the package boundary.

Before

flowchart TD
  A[Fresh signed challenge / received MDM result] --> B[api.Server trust reuse operations]
  B --> C[Server cache, coverage, journal, replay and authority state]
  C --> D[Store CAS and registry epoch check]
  D --> E[Reuse hardware evidence or continue verification / deny]
  F[Server.Close] --> G[Stop coverage, final device then application sweep]
  G --> H[Stop replay, close MDM / routing, release journal authority]
Loading

After

flowchart TD
  A[Fresh signed challenge / received MDM result] --> B[Thin API prerequisites and adapters]
  B --> C[trustreuse.Manager: private state and lifecycle operations]
  C --> D[Same startup store CAS and registry epoch check]
  D --> E[Same reuse / verification / denial outcome]
  F[Server.Close] --> G[Manager.StopCoverage and FinalCoverageSweep]
  G --> H[API application sweep, Manager.StopReplay]
  H --> I[API MDM / routing teardown, Manager.ReleaseAuthority]
Loading

Replay and inline-retry delays are immutable constants. Journal fixtures retain the production timing and their existing outcome assertions, so a cancelled replay worker cannot race a later test changing shared defaults.

Validation:

  • All 3,506 original coordinator test/benchmark/fuzz/example symbols remain; 46 owner tests move with token-equivalent assertions. All 88 mapped production declarations retain their operation bodies after the explicit receiver/dependency renames.
  • Full Go 1.25 coordinator race suite: 32 test packages pass (API 229.522s, trust owner 2.973s). Final owner race passes after removing two unused copied fixture variables.
  • Two new real-API lifecycle fixtures pass both unchanged baseline and candidate: startup store/live MDM binding, and final coverage order plus journal authority through a blocked route drain. Signed-challenge, late-MDM, routing/readiness and fleet-reconnect fixtures remain at the API boundary.
  • Final parent-merged source passes affected API race (3.221s), owner race (1.533s), and pinned golangci-lint v2.1.6 with uncapped diagnostics (0 issues). The parent merge adds only 149 keyed metric-label annotations and removes one unused adapter; the trust owner and all trust tests remain byte-identical.
  • The fixed-timing owner race suite passes all 46 top-level tests (60 including subtests), with zero skips. The formerly failing journal pair also passes 40 invocations across CPU settings 1/2/4/8; the unchanged baseline reproduces the exact race. Pinned scoped lint and documentation checks pass. These focused checks cover the final timing-only change; production function bodies and shutdown behavior are unchanged.
  • Documentation checks pass across 280 documents; frozen records retain their original bytes. YAML syntax and Go formatting pass.

PostgreSQL-only fixtures retain their existing skips with database URLs unset; this layer changes no SQL or backend implementation. Moved owner unit fixtures keep actual stores and registry while API-only status, metrics and application-sweep callbacks are inert; API fixtures cover those integration boundaries.


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 7:18pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 7:18pm UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 7:18pm 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-14T19:09:49.070009Z 01ef518 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. Keep them coming!

Reviewed commit: 8ad1845842

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: f18229af2b

ℹ️ 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-trust-reuse-owner

# Conflicts:
#	docs/architecture/security/attestation.md
#	docs/developer/build.md
#	docs/developer/test.md
#	docs/reference/configuration.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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01ef518110

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

@codex review

The latest source-reference findings are corrected at c9f6628; documentation checks pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@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 (c9f6628d62093d0fbf14d16307ad90204b0fb96f), 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 — c9f6628d Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — c9f6628d Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — c9f6628d Deployed Sep 14, 2026 by vercel[bot]
benchmarks — c9f6628d Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1325
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