| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-8482624 |
| 4 | status: adopted |
| 5 | title: Group / instance / federation — the full sketch |
| 6 | created: 2026-07-02 |
| 7 | source: PR #1 |
| 8 | --- |
| 9 | |
| 10 | # Federation — group, instance, federation |
| 11 | |
| 12 | > Thin form: [architecture.md § federation: the group is the unit](../../design/architecture.md#federation-the-group-is-the-unit). This node carries the full sketch from PR #1's `design/federation.md` (plus the cross-repo and discovery reframings from its `design/openquestions.md` changes), preserved at full fidelity; the mechanics below return as a design doc when rung S5+ of the [scenario ladder](../../design/user-scenarios.md) is the top priority. |
| 13 | |
| 14 | The design docs so far stop at the repo. But a repo is not the largest unit that matters: a team has many repos, a company has many teams, and changes, trust, and feedback cross those boundaries. This sketch introduces the organizational layer **above** the repo and the distribution model that goes with it. |
| 15 | |
| 16 | ## The basic unit is the group |
| 17 | |
| 18 | A **group** is whatever organization owns a set of repos and shares one trust domain — a team, a company, a personal namespace, a working group. The group, not the repo, is the basic unit of federation. |
| 19 | |
| 20 | Each group has exactly one **instance**: a 1-to-1 binding. A group's instance runs, for that group: |
| 21 | |
| 22 | - the **bus** (NATS JetStream) carrying its cross-system events, |
| 23 | - the **integrator** (one controller, many per-repo policies), |
| 24 | - **git hosting** for the group's repos (bare git over SSH, as in [contribute.md](../../design/contribute.md)). |
| 25 | |
| 26 | Everything in the design — the event log, the integrator's queues, the knowledge graph, trust scores — lives *inside* one instance. "The bus" and "the integrator" elsewhere in the docs mean *this group's* bus and integrator. |
| 27 | |
| 28 | ``` |
| 29 | group: acme-platform |
| 30 | └── instance (1-to-1) |
| 31 | ├── bus (NATS JetStream) |
| 32 | ├── integrator (per-repo policies) |
| 33 | ├── git hosting (bare repos over SSH) |
| 34 | └── knowledge graph + trust scores ← scoped to this group |
| 35 | ``` |
| 36 | |
| 37 | ## One machine or many — same design |
| 38 | |
| 39 | An instance is **instantiable on a single machine**: NATS, the integrator, and a handful of bare repos fit on one Tailscale-reachable box, which is exactly the solo-dev and small-team case the rest of the design targets. |
| 40 | |
| 41 | The same instance is **runnable as a distributed system**: NATS JetStream clusters, the integrator scales to one controller per protected ref (queues are already independent per ref), git hosting shards across hosts. Nothing in the architecture assumes co-location; the controller-and-log pattern was distributed-friendly from the start. The design scales **down and up** without changing shape — the difference between a hobby instance and a company instance is deployment, not design. |
| 42 | |
| 43 | ## Intra-group vs inter-group |
| 44 | |
| 45 | The "cross-repo" open questions were really two questions wearing one name. The group/instance boundary separates them: |
| 46 | |
| 47 | | Question | Intra-group (within one instance) | Inter-group (federation across instances) | |
| 48 | | --- | --- | --- | |
| 49 | | Integration | Two requests in two repos that must succeed together — one integrator, shared bus, a wrapper controller conditions one on the other | Producer and consumer in *different* groups — needs events to cross an instance boundary | |
| 50 | | Feedback | A change in repo A breaks consumer B; both on the same bus, routing is local | B is in another group; the breakage event must federate to A's instance | |
| 51 | | Knowledge nodes | A bug in repo A blocks work in repo B; same graph, IDs need a repo namespace | The blocking node lives in another group's graph entirely | |
| 52 | |
| 53 | **Intra-group** is the tractable near-term case: one bus, one integrator, one knowledge graph, IDs namespaced by repo. Most of what gets deferred as "cross-repo, v2" is really intra-group and becomes tractable once the group is the frame. |
| 54 | |
| 55 | **Inter-group** is genuine federation: events, trust, and node references crossing between independent instances. This is the harder, later problem, and federation is the layer that governs it. |
| 56 | |
| 57 | ## Trust is group-scoped; federation governs the boundary |
| 58 | |
| 59 | Trust scores ([verification.md](../../design/verification.md)) are **scoped within a group**. A signer's confirm rate is meaningful relative to one group's re-verifiers and one group's policy; it does not automatically mean anything in another group. |
| 60 | |
| 61 | Federation governs how trust and events cross group boundaries — explicitly, never implicitly: |
| 62 | |
| 63 | - A group may **import** another group's attestations and decide, by its own policy, how much they count. |
| 64 | - A group may **subscribe** to a subset of another group's events (e.g. "schema-updated on acme/contracts") rather than its whole bus. |
| 65 | - Crossing the boundary is a policy decision on *both* sides, expressed the same way every other policy is — as nodes the integrator and routers query. |
| 66 | |
| 67 | Importing another group's attestations raises a question this design does not yet answer: a trust score is meaningful only against *one* group's signer identities and re-verifier pool, so an imported attestation arrives with a foreign signer fingerprint and a foreign confirm-rate that mean nothing locally. How external identities are verified and mapped into local trust policy — **federated identity mapping and cross-group trust translation** — is left open. Candidate shapes from the original sketch: a translation function, a per-source discount factor, an explicit identity-linking node, or no automatic credit at all. *Inter-group only.* |
| 68 | |
| 69 | This keeps the permissive, low-ceremony intra-group model (anyone with push access can request integration — see [scenarios.md](../../design/scenarios.md)) without leaking that permissiveness across organizational lines. |
| 70 | |
| 71 | ## Discovery is scoped by group and federation |
| 72 | |
| 73 | "Without GitHub-the-social-graph, how do humans find each other's repos?" is a **federation** question. Within a group, discovery is trivial — the instance knows its own repos. Across groups, discovery is the inter-group problem: how one instance learns another exists and what it federates. The shape is open; the framing is that discovery operates at the federation layer, not the repo layer. |
| 74 | |
| 75 | ## Related |
| 76 | |
| 77 | - Disposition of this material: [[dcr-2113c52]] ([decisions/dcr-2113c52-pr1-relanding.md](../decisions/dcr-2113c52-pr1-relanding.md)) |
| 78 | - The engine this layer hosts: [[ida-eac723e]] ([ida-eac723e-outcome-dag.md](./ida-eac723e-outcome-dag.md)) |
| 79 | - A federated change is still a transparent one: [self-transparency.md](../../design/self-transparency.md) |