LearnNewsExamplesServices
Frontmatter
id15150
titleAdd tenant-scoped community source registration
stateOpen
labels
enhancementaiarchitecturesecurity
assignees[]
createdAt7:30 AM
updatedAt8:29 AM
githubUrlhttps://github.com/neomjs/neo/issues/15150
authorneo-gpt
commentsCount0
parentIssue15145
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[ ] 15149 Measure community-activity shadow coverage and cost
blocking[ ] 15156 Push hosted GitHub community batches securely, [ ] 15151 Admit idempotent community batches into durable history
milestonev13.2

Add tenant-scoped community source registration

Open Backlog/active-chunk-6 enhancementaiarchitecturesecurity
neo-gpt
neo-gpt commented on 7:30 AM

Context

The selected T/R/U shape requires Memory Core to own neutral source identity and lifecycle. Local single-user bootstrap may equate subject and tenant only when that deployment mode is explicit.

This is one fully closeable PR leaf under Epic #15145. The live parent-child and blocked-by graph is authoritative; this body owns only this leaf's contract.

The Problem

A connector-owned registry, tenantRepos[], KB SourceRegistry, or AiConfig leaf cannot preserve neutral identity across connector replacement, repository rename, grant rotation, and hosted tenancy. Authentication or MCP tool tier also does not confer source-admin authority.

The Architectural Reality

This is a dedicated Memory-Core operational table/service, not a Native Edge Graph ontology and not ai/services/knowledge-base/source/SourceRegistry.mjs. New service placement under ai/services/memory-core/ matches MailboxService.mjs; every table read/write must reapply a server-authoritative tenant/source predicate because GraphService RLS does not protect new tables.

The Agent OS structure map was run on 2026-07-14. New service/script/test placement must use the named sibling-file-lift fast paths; no service logic moves into MCP server entrypoint directories.

The Fix

Implement stable server-owned sourceInstanceId, canonical provider host/resource kind/provider object identity, mutable display locator, connector/grant attestations without secrets, lifecycle REQUESTED -> PROVISIONED -> ACTIVE -> REVOKED, monotonically fenced registrationEpoch, and an explicit local single-user bootstrap path.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Source registration row Discussion #15139 R/T Tenant-private neutral identity with lifecycle and epoch Unknown/revoked source refuses admission Service JSDoc + operator schema Lifecycle, rename, revocation, RLS tests
Local bootstrap Option U Subject equals tenant only in explicit local-single-user mode Hosted/ambiguous mode refuses Deployment docs Local-vs-hosted authorization tests
Provider identity OQ3/OQ9 Stable provider object identity is separate from slug, grant, delivery, cursor, and batch ids Rename updates display route without forking identity Contract docs Rename/grant-rotation fixtures

Decision Record impact

Depends on ADR 0036; aligned with ADR 0015 and ADR 0019; creates no graph ontology.

Decision Record

Required: ADR 0036. This leaf is not code-ready until the ADR-0036 child of #15145 is accepted at the human merge gate.

Discussion Criteria Mapping

Upstream graduated criterion This leaf's executable contract
OQ3 Creates server-owned sourceInstanceId and keeps mutable/provider/retry identities distinct.
OQ8 Enforces tenant/source RLS on every dedicated-table read/write; never shared/team visible.
OQ9 R/T/U Implements neutral lifecycle and explicit local bootstrap; V/X remain unavailable.

Source authority: Discussion #15139 body at the version-bound graduation anchor plus Grace's STEP_BACK and GRADUATION_APPROVED.

Acceptance Criteria

  • AC1 — Registration identity survives repository/project rename and connector/grant rotation.
  • AC2 — Lifecycle transitions are validated and registrationEpoch increases monotonically.
  • AC3 — Only the current ACTIVE epoch can be used by later admission.
  • AC4 — Every read/write is server-tenant- and source-scoped with cross-tenant denial tests.
  • AC5 — Rows are never sharedEntity or visibility:'team' and contain no provider secret.
  • AC6 — Explicit local single-user bootstrap is supported without granting hosted power.
  • AC7 — Hosted tenant-role and self-service mutation remain unavailable with stable errors.
  • AC8 — Crash/retry behavior cannot reactivate a revoked or stale epoch.

Out of Scope

Provider acquisition, event admission, tenant self-service, tenant-role inference, connector secrets, or AiConfig registration.

Avoided Traps

Do not reuse the KB SourceRegistry, tenantRepos[], static GitOps config, global Neo roster, MCP admin, or mutable slug as authority.

Related

Origin Session ID: 837ad74b-c2d2-413d-9aab-b7165a93a82a

Handoff Retrieval Hints

  • community sourceInstanceId registration epoch tenant RLS
  • Discussion 15139 R T U W source lifecycle

Creation Freshness

Creation duplicate sweep: immediately before filing at 2026-07-14T05:30:01.676Z, checked the latest 20 open issues and last 30 all-state A2A messages. The independent broader audit at 2026-07-14T05:13:00Z covered open and closed issues, pull requests, A2A, ADRs, and code; no equivalent owner or foreign claim existed.