Skip to content

Preserve MCP source identity through owner cleanup and restore - #1209

Draft
zlareb1 wants to merge 10 commits into
mainfrom
feat/mcp-source-lifecycle
Draft

zlareb1 wants to merge 10 commits into
mainfrom
feat/mcp-source-lifecycle

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Related: #1190
Related: #1194
Related: #1068

Changelog category

  • Improvement

Changelog entry

Preserve versioned MCP source metadata through connected-account lifecycle operations and refuse it in native source execution and access paths. This is storage and cleanup preparation; it enables no MCP connection or source.

Why

Multiple remote connections need independent owner-scoped account keys, generation fences and opaque source metadata. A generic source kind alone neither preserves unknown payloads during full-row writes nor includes them in historical erasure and restore inventory. Those lifecycle guarantees must precede source admission.

This prerequisite reuses connected accounts, source registrations, account and namespace leases, retirement work and raw-history censuses. It adds no credential vault, document store or grant plane. The architecture page records identity, storage, upgrade and access boundaries. The bounded outbound client remains a separate prerequisite.

Scope and risk

A connection slot is an opaque mcp: key with a stable random identifier, within the existing organization/owner/account-kind key. Its connection generation retains the established fence format. A strict versioned sealing envelope binds that identity to an approved profile digest, exact endpoint and audience. A separate bounded source contract stores metadata and ordered selected identities in the existing configuration and selection columns. Neither codec confers read or publication authority.

The additive source columns identify the connection slot and contract version without decoding content. Unknown versions and corrupt payloads survive lifecycle row writes byte-for-byte. Native execution, management and read preparation refuse opaque rows and repeat the refusal after rereading current registrations. Generic credentials cannot reach native revocation dispatch. Local credential removal establishes no remote revocation.

Historical selectors, retirement and erasure compare the exact organization, owner and slot. Restore inventories raw registrations hidden by replacement rows, validates generation-prefix ownership, fences before retirement and proves cleanup with raw-history censuses. Retrying after the stop fence lands reuses that stopped value rather than attempting an unsupported same-value compare-and-swap.

Owner erasure now inventories raw source-history identities even when no account row survives, resolves verified aliases per organization and rechecks cutoff standing under the account lease. A permanent cutoff permits source-only cleanup; a dated cutoff refuses unknown connection age, while lifted cutoffs and newer accounts are preserved. The scoped path shares lifecycle primitives with restore; it never invokes deployment-wide offline restore. This draft remains unqualified for merge.

PR #1068 retains its connected-account selection work and unresolved cleanup qualification. This preparation neither merges nor discards that work. The final source replacement must reuse its applicable ownership, invalidation and selection behavior.

Compatibility, rollout and rollback

  • Wire: no operation or request-field changes; no ignored_args entry is needed.
  • Storage: additive source metadata columns with empty-slot/version-zero defaults for native rows. The canonical schema must come from the normal schema generator.
  • Admission: no connection enrollment, generic source registration, worker dispatch or runtime activation is added. Schema installation alone never authorizes generic writes.
  • Rolling upgrade: a later admission path must require the lifecycle-aware build across live deployments and establish a maintenance-tool and rollback floor. The preceding build cannot preserve or erase generic authority correctly.
  • Retention: no upgrade cleanup deletes documents, originals, uploads, credentials, checkpoints or account history. Native reconfiguration must retain those records, use owner-authorized new bindings and never infer endpoints or reuse retired credentials.
  • Operator steps: none for this preparation. Activation and native worker drain remain a separate qualified cutover. Rollback after generic authority exists must retain lifecycle-aware maintenance tools.

Tests

The current candidate contains two generated-output corrections: the actual analyzer manifest from the prior exact-head artifact (three added and three removed shapes), and the defaults snapshot produced by the prescribed settings snapshot generator. The isolated defaults check passes two cases in 0.78 seconds. No manifest or snapshot was hand-edited.

The prior candidate passed the six-phase owned-store lifecycle qualification under both supported authorities, with zero retained test residue and zero native source calls. Schema generation also passed there. Its ordinary CI failed the analyzer manifest and defaults snapshot; those failures remain recorded in quality comments and motivated these corrections. Prior-head results are historical evidence, not the current merge gate.

The implementation is unchanged by the corrections and current-main composition. Full/native/storage checks remain hosted. No unchanged local suite was repeated; no paid/provider run, production data or runtime change occurred. The actual analyzer candidate exporter preserves the original failed gate and exports only generated shapes. It does not turn a failure green.

A fresh independent entire-source review and all nonempty exact-head hosted checks must pass before merge. This preparation remains inactive and does not qualify source admission, supported client readiness, native replacement or deployment.

AI assistance in the code

  • AI-generated: Codex wrote the implementation and synthetic qualification. Independent entire-source review and exact-head hosted results are required.

  • I can explain the change and its interaction with the existing lifecycle.

Checklist

  • Canonical schema and documentation are regenerated through their actual generators.
  • Focused postimage checks pass.
  • Fresh independent entire-source review has no findings.
  • Exact-head required hosted checks pass.
  • No MCP admission, native removal or runtime activation is claimed.
  • Existing source content and credentials are retained by the migration.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 23, 2026 6:31am UTC

Request Review

@zlareb1
zlareb1 force-pushed the feat/mcp-source-lifecycle branch 2 times, most recently from e4ecf3a to 5b1930a Compare November 23, 2026 01:58

@zlareb1 zlareb1 left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

@zlareb1
zlareb1 force-pushed the feat/mcp-source-lifecycle branch from 5b1930a to 5387484 Compare November 23, 2026 02:24

@zlareb1 zlareb1 left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

@zlareb1 zlareb1 left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

Keep versioned payloads opaque, include source-only history in scoped erasure and qualify restore and key rotation on isolated hosted stores.

Signed-off-by: zlareb1 <[email protected]>
Generate the documentation entry from the new architecture page.

Signed-off-by: zlareb1 <[email protected]>
Count every retained connection generation before cleanup, preserve strict UUID identity checks with the normal row conversion and record the hosted schema output.

Signed-off-by: zlareb1 <[email protected]>
Use the actual analyzer generator artifact from the lifecycle prerequisite head. The ordinary analyzer gate remains required, and later source changes need their own generated manifest.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1

zlareb1 commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

The external worker design supersedes this draft. Keep the lifecycle requirement: disconnect, owner cleanup and restore must never reactivate a different connection. The worker owns and erases upstream credentials. Loom retains only opaque account bindings and the metadata needed to deny stale work and preserve selected copies according to policy.

The replacement work is split across #1298 (worker), #1302 (live access), and #1310 (refresh leases). Those changes do not yet qualify the full lifecycle or complete the replacement. Coverage for disconnect, erasure, restore and stale reads must run against the new boundary before activation.

GitHub reports four failed checks at e744e0e6982b0ef185cc40d1c46269912c9510e1: unit part 3, integration part 4, PostgreSQL 16 storage, and PostgreSQL 18 storage. This draft is retained for its design and evidence. It is not in the merge stack.

This branch has not been deployed

No deployments
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