Skip to content

Freeze legacy MDM eligibility and require App Attest for base rewards - #1344

Merged
Gajesh2007 merged 8 commits into
masterfrom
codex/legacy-mdm-freeze
Oct 5, 2026
Merged

Gajesh2007 merged 8 commits into
masterfrom
codex/legacy-mdm-freeze

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Freeze legacy MDM eligibility at the first upgraded coordinator startup. Only authenticated account/machine-key associations with retained successful MDM evidence may continue on that path. New providers require macOS 27 or later and current qualified App Attest, including owner self/prefer routing. OS version alone is not approval; consumers of inference do not need macOS 27.

  • Persist the cutoff and immutable account/SE-key/serial cohort transactionally, including an empty cohort. Restarts, later verification, and account transfers cannot expand it.
  • Require linked provider credentials and fresh P-256 proof for profile issuance. darkbloom enroll checks coordinator eligibility even when a Darkbloom profile is already installed; success skips reinstallation, denial writes no profile.
  • Gate registration recovery, scheduling, live/late MDM grants, cached reuse, owner visibility, and final inference authorization. Preserve current revocation, runtime, code qualification, posture, and privacy safeguards.
  • Require macOS 27+ and current qualified App Attest for every provider's base rewards, old and new, rechecked before settlement. The OS version is taken from the same assertion-authenticated app status as the current lease, never unsigned registration or inventory. Missing, malformed, or below-27 versions fail closed. This is an authenticated qualified-app claim, not an independently Apple-certified OS measurement. MDM-only machines may retain grandfathered serving; inference-work earnings and already-earned balances are unchanged.
  • CLI help, errors, installation docs, and hardware requirements explain the macOS 27 requirement, temporary legacy exception, and reward distinction. An eligible machine with an expired proof gets clock/retry advice, not misleading upgrade advice.
  • Validate production App Attest serving and 100% rollout before freezing. Deployment defaults to production; explicit development and the actual opt-in memory backend do not freeze the cohort. Leave grace-period expiry unset, as requested. No release, version bump, or production deployment is included.

Before

flowchart TD
  setup["EnrollmentService.enroll"] --> local{"Local Darkbloom profile?"}
  local -->|Yes| success["Already enrolled without eligibility check"]
  local -->|No| profile["Anonymous generic profile"]
  profile --> mdm["MicroMDM enrollment"]
  register["Provider registration"] --> restore["Legacy serial recovery"]
  restore --> verify["SecurityInfo / cached trust reuse"]
  mdm --> verify
  verify --> route["Legacy hardware trust or relaxed owner route"]
  route --> serve["Serving and possible base rewards without App Attest"]
  classDef flow fill:#dbeafe,stroke:#2563eb,color:#172554;
  classDef legacy fill:#fef3c7,stroke:#b45309,color:#451a03;
  classDef outcome fill:#dcfce7,stroke:#15803d,color:#14532d;
  class setup,register flow;
  class local,profile,mdm,restore,verify,route legacy;
  class success,serve outcome;
Loading

After

flowchart TD
  boot["Production startup: replay revocations and validate App Attest config"] --> backfill["Drain eligible historical inventory backlog"]
  backfill --> freeze["Policy.Initialize / FreezeLegacyMDMCohort"]
  freeze --> cohort[("Immutable old account/key/serial cohort")]
  enroll["Legacy enroll, including existing profiles"] --> proof["Bearer token and signed existing-key proof"]
  proof --> eligible{"Policy.AuthorizeEnrollment passes?"}
  cohort -.-> eligible
  eligible -->|No| deny["401/403; no installation; 503 on unavailable storage"]
  eligible -->|Yes| local{"Profile already installed?"}
  local -->|Yes| keep["Confirm eligibility; keep existing profile"]
  local -->|No| profile["Download profile and offer installation"]
  register["Authenticated provider registration"] --> legacy{"Frozen account/key/serial?"}
  cohort -.-> legacy
  legacy -->|Yes| mdm["Existing MDM verification safeguards"]
  legacy -->|No| required["RequireAppAttestServingAuthorization"]
  required --> lease{"Current qualified App Attest lease?"}
  lease -->|No| pending["Unroutable, including self/prefer"]
  lease -->|Yes| route["Shared routing and final handoff gates"]
  mdm --> route
  route --> serve["Authorized serving"]
  lease -->|Yes| rewards["rewardSnapshotEligible: proof-bound macOS 27+ and settlement recheck"]
  mdm --> noRewards["MDM alone: no base rewards"]
  classDef flow fill:#dbeafe,stroke:#2563eb,color:#172554;
  classDef policy fill:#ede9fe,stroke:#7c3aed,color:#3b0764;
  classDef legacy fill:#fef3c7,stroke:#b45309,color:#451a03;
  classDef denied fill:#fee2e2,stroke:#dc2626,color:#450a0a;
  classDef outcome fill:#dcfce7,stroke:#15803d,color:#14532d;
  class boot,backfill,enroll,proof,register,route flow;
  class freeze,cohort,eligible,local,legacy,required,lease policy;
  class profile,mdm legacy;
  class deny,pending,noRewards denied;
  class keep,serve,rewards outcome;
Loading

Blue: request/code flow. Purple: eligibility policy. Amber: legacy verification. Red: denied/pending. Green: permitted outcomes. Frozen eligibility is not a current trust grant.

CI Failures Fixed

The failing provider job had two legitimate causes, not just a need for longer timeouts:

  1. The enrollment integration fixture used host credentials/enrollment state and still expected anonymous setup. It now uses an explicit local fixture account and P-256 signer, exercises real HTTP and profile IO, and verifies the exact signed transcript.
  2. A pre-existing native engine race read cancellation separately for retirement and queue removal. Cancellation between those reads removed a waiting request without terminal delivery, retirement acknowledgement, or capacity release. Pin mlx-swift-lm to e407e899c4e3f9ee4d95f8974ed4f01e7e60e702, containing only the fix and required formatting on top of the previous pin. Dependency PR: Fix cancelled native requests losing retirement during queue removal mlx-swift-lm#290.

A subsequently merged master change also caused Release Integrity to fail on Linux by using macOS-only cp -c. The staging script now uses ordinary copy on non-Darwin hosts and attempts cloning with an ordinary-copy fallback on Darwin. Byte comparison, temporary-file cleanup, and atomic replacement remain intact. Twelve script regressions pass, including unsupported cloning and failed/corrupt copies preserving the old destination.

Validated review fixes are included: production-only cutoff classification uses EIGENINFERENCE_DEPLOYMENT_ENVIRONMENT (closed production/development values, default production), never telemetry; the installer defers legacy reenrollment to login plus the signed CLI; transient token-store failures close registration with retryable WebSocket 1013 before cohort selection, and enrollment returns 503 instead of misreporting invalid credentials. All three review threads have concrete regression evidence and were resolved after the fixes were pushed.

The additional inventory-ordering finding is fixed too: startup synchronously drains existing eligible historical backfill in 100-row batches before freezing, under the same 30-second budget. Errors/cancellation leave no new freeze marker. A real PostgreSQL regression covers 124 records and verifies that late aliases cannot widen an existing cohort. Historical backfill preserves its existing stored-account/endpoint-bound-key rules and recent/open-session filters; it is not independent evidence of a historical token login, and zero rows is not a claim that every possible history gap was recovered.

flowchart LR
  subgraph BeforeNative["Before: native cancellation"]
    A["First scan sees not cancelled"] --> B["Cancellation races"] --> C["Second scan removes without finishWaiting"] --> D["Reservation remains held"]
  end
  subgraph AfterNative["After: native cancellation"]
    E["One cancellation observation"] --> F["finishWaiting before removing control"] --> G["Terminal, retirement, capacity released"]
  end
  classDef bad fill:#fee2e2,stroke:#dc2626,color:#450a0a;
  classDef good fill:#dcfce7,stroke:#15803d,color:#14532d;
  class A,B,C,D bad;
  class E,F,G good;
Loading

The 2,048-request SDK stress regression failed before the fix with six orphaned reservations (600 bytes). It passed 20 independent runs afterward. This is scheduling-dependent stress, not a deterministic injected interleaving; no assertion or timeout was weakened.

Validation

  • Full local make provider-test passed with CI fixture environment: 3,697 Swift tests in 487 suites; XCTest reported 553 tests, 125 existing skips, zero failures; all runner-isolated groups also passed. Missing MiMo fixture environment caused the first local attempt to fail; rerunning with the exact CI metadata/payload fixtures passed.
  • Enrollment/CLI/integration focused suite: 26 tests in four suites passed.
  • SDK native lifecycle/deadline suites: 14 tests in two suites passed, including after required formatting.
  • Coordinator enrollment proof regression passed with race detection; go vet ./coordinator/... passed.
  • Final full make coordinator-test passed after merging current master and adding the explicit proof-bound macOS gate; targeted base-reward and authorization race suites passed.
  • Full coordinator suite also passed against task-owned PostgreSQL after the startup, installer, and token-retry review fixes. Installer onboarding tests, atomic installer tests, embed parity, and shell syntax passed. The merged staging suite preserves twelve portability/failure tests.
  • Full coordinator suite previously passed against isolated PostgreSQL; follow-up pre-push coordinator suite passed.
  • Base reward race suite passed, including ten repeated runs and authorization loss during settlement.
  • make docs-check, make docs-impact-check BASE=origin/master, and git diff --check passed.
  • Dedicated refactor passes completed for API, registry, store, Swift enrollment, SDK race fix, and documentation; final focused checks were rerun. Commits are signed.

Rollout And Limitations

  • POST /v1/enroll requires a provider Bearer token and {se_public_key,timestamp,signature}. The signature binds token hash/key/timestamp/enrollment domain; freshness is five minutes in either direction.
  • Schema migration creates cohort/cutoff tables. Production startup performs the one-time freeze after revocation replay, bounded to 30 seconds. Explicit development and the actual opted-in memory fallback preserve local startup and leave membership unfrozen; a later production startup freezes at its own cutoff. Verify cohort coverage before approving production cutover: missing retained proof or authenticated historical association fails closed.
  • Replacement keys do not inherit eligibility. No grace-period expiry is implemented yet.
  • Generic copied profiles can still enroll directly through MicroMDM SCEP/check-in endpoints. This PR prevents new machines from obtaining coordinator MDM authorization; literal check-in rejection remains separate enrollment-layer work.
  • Production host Caddy is separate from checked-in container configuration. Ingress changes require separate explicit human approval.
  • Ready for review at the user's request. Latest-head remote checks and reviews must finish before merge; local validation is not a deployment approval.

@vercel

vercel Bot commented Oct 4, 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 Oct 5, 2026 5:35am UTC
d-inference-console-ui-dev Ready Ready Preview Oct 5, 2026 5:35am UTC
d-inference-landing Ready Ready Preview Oct 5, 2026 5:35am UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 5, 2026 5:35am UTC

Request Review

@Gajesh2007

Copy link
Copy Markdown
Member Author

Follow-up: legacy-MDM-only machines are now excluded from new base rewards. A current qualified App Attest authorization is required at candidate selection and again before settlement credit; completed inference earnings and existing reward balances are unchanged. The full integrated coordinator suite passed against isolated PostgreSQL, and reward race regressions cover expiry or loss of qualification during settlement. The initial CI lint findings were corrected in 2b0e6ee; go vet ./coordinator/... and the pre-push coordinator suite pass. Both commits are GitHub-Verified. Both published Mermaid diagrams were checked in a real browser and render as SVG. This remains a draft for the documented full-provider test blocker and separate MicroMDM check-in limitation; latest-head CI is still running.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-10-05T05:47:07.140856Z 80598e8 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.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head 80598e89172b against base f3bd7a12545b.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Ten-PR pilot complete; maintainer evaluation required

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

The historical-backfill ordering finding is fixed in 1ef14bd; 80598e8 only clarifies the provenance comment. The 124-record PostgreSQL regression covers multiple batches and immutable restarts, while error/cancellation regressions preserve retryability before freezing. Existing historical backfill rules are unchanged, and their evidence limits are documented. All known findings are resolved on the remote branch; please check the latest head.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 80598e8917

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

Ready for review at 80598e8. Latest main CI and E2E integration workflows passed; signatures, docs, static analysis, provider unit/SDK/prompt-parity tests, and release integrity are green. The latest Codex review completed with no major issues, and all four validated findings are fixed and resolved. The only pending workflow is E2E Benchmarks, which is waiting for human approval of the benchmarks environment. Base rewards require proof-bound macOS 27+ and current qualified App Attest for every provider, old and new. Grandfathered legacy serving and earned balances remain unchanged. The SDK cancellation fix PR Layr-Labs/mlx-swift-lm#290 is separately merged. No production deployment was performed by this work.

@Gajesh2007
Gajesh2007 merged commit 3ca05b0 into master Oct 5, 2026
32 of 33 checks passed
@Gajesh2007
Gajesh2007 deleted the codex/legacy-mdm-freeze branch October 5, 2026 19:41
jonathan308 added a commit that referenced this pull request Oct 5, 2026
Two documentation pages conflicted with the App Attest cutover change
(#1344):

- docs/reference/configuration.md: master's "Deployment environment"
  section and this branch's TMPDIR section are both kept.
- docs/provider/cli-reference.md: only the "Last updated" stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Oct 6, 2026
Master is at dccc9ee (#1328 goose migrations, #1352, #1351, #1355, #1344). No conflicts. The merge brings master's submodule pin libs/mlx-swift-lm e407e899 (a formatting-only commit on top of 1ee8675a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidtai added a commit that referenced this pull request Oct 6, 2026
Brings in master through #1328 (goose migrations, store in
store/postgres/), #1344, #1351, #1352 and others.

Conflicts:
- ci.yml (Report coverage): master inlined the empty-profile,
  coordinator-row and statement-format checks (#1252). This PR moved
  the same checks into scripts/coordinator-statement-coverage.sh,
  which ci.yml and integration.yml both call. Keep the script call.
- docs/developer/test.md (coverage command): keep the script call.
- docs/developer/test.md (CI workflow map): keep master's ci.yml row
  (adds the provider coverage table) and this PR's integration.yml row
  (adds the e2e coverage row and artifact).

The #1284 store contract tests and coverage tests build and vet
against master's store layout with no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

4 active deployments
Preview – d-inference — 80598e89 Deployed Oct 5, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 80598e89 Deployed Oct 5, 2026 by vercel[bot]
Preview – d-inference-landing — 80598e89 Deployed Oct 5, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 80598e89 Deployed Oct 5, 2026 by vercel[bot]
benchmarks — 80598e89 Deployed Oct 5, 2026 by Gajesh2007 via E2E Benchmarks #2275
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.

2 participants