| 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: |
| 13 | > [architecture.md § federation: the group is the unit](../../design/architecture.md#federation-the-group-is-the-unit). |
| 14 | > This node carries the full sketch from PR #1's `design/federation.md` (plus the cross-repo and |
| 15 | > discovery reframings from its `design/openquestions.md` changes), preserved at full fidelity; the |
| 16 | > mechanics below return as a design doc when rung S5+ of the |
| 17 | > [scenario ladder](../../design/user-scenarios.md) is the top priority. |
| 18 | |
| 19 | The design docs so far stop at the repo. But a repo is not the largest unit that matters: a team has |
| 20 | many repos, a company has many teams, and changes, trust, and feedback cross those boundaries. This |
| 21 | sketch introduces the organizational layer **above** the repo and the distribution model that goes |
| 22 | with it. |
| 23 | |
| 24 | ## The basic unit is the group |
| 25 | |
| 26 | A **group** is whatever organization owns a set of repos and shares one trust domain — a team, a |
| 27 | company, a personal namespace, a working group. The group, not the repo, is the basic unit of |
| 28 | federation. |
| 29 | |
| 30 | Each group has exactly one **instance**: a 1-to-1 binding. A group's instance runs, for that group: |
| 31 | |
| 32 | - the **bus** (NATS JetStream) carrying its cross-system events, |
| 33 | - the **integrator** (one controller, many per-repo policies), |
| 34 | - **git hosting** for the group's repos (bare git over SSH, as in |
| 35 | [contribute.md](../../design/contribute.md)), |
| 36 | - a **build cache** for the group's artifacts, so a derivation built once is available to every |
| 37 | machine and every verifier in the group. |
| 38 | |
| 39 | Everything in the design — the event log, the integrator's queues, the knowledge graph, trust scores |
| 40 | — lives _inside_ one instance. "The bus" and "the integrator" elsewhere in the docs mean _this |
| 41 | group's_ bus and integrator. |
| 42 | |
| 43 | ``` |
| 44 | group: acme-platform |
| 45 | └── instance (1-to-1) |
| 46 | ├── bus (NATS JetStream) |
| 47 | ├── integrator (per-repo policies) |
| 48 | ├── git hosting (bare repos over SSH) |
| 49 | ├── build cache (the group's artifacts) |
| 50 | └── knowledge graph + trust scores ← scoped to this group |
| 51 | ``` |
| 52 | |
| 53 | A cache scoped to the group is the natural boundary: the group is already the trust domain, |
| 54 | artifacts are content-addressed, and this is the same scope that owns the bus and the integrator. |
| 55 | The cache is not merely a convenience — pure attestations promise that any verifier can re-derive a |
| 56 | result and confirm it ([verification.md](../../design/verification.md)), and re-derivation means |
| 57 | rebuilding, so a verifier that had to fetch or rebuild every input from scratch would make the |
| 58 | witness model impractical. What the cache promises about retention is not settled here: |
| 59 | [openquestions.md](../../design/openquestions.md), under _Attestation expiry_, asks what happens to |
| 60 | re-derivation when inputs referenced by an attestation are garbage-collected from a Nix cache. |
| 61 | Scoping the cache to the group is what gives that question an owner, since the retention promise |
| 62 | becomes a property of the group's instance — and it covers repositories that migrate into a group |
| 63 | later, where infrastructure repositories that live outside one today would become group projects on |
| 64 | the same cache. |
| 65 | |
| 66 | ## One machine or many — same design |
| 67 | |
| 68 | An instance is **instantiable on a single machine**: NATS, the integrator, and a handful of bare |
| 69 | repos fit on one Tailscale-reachable box, which is exactly the solo-dev and small-team case the rest |
| 70 | of the design targets. |
| 71 | |
| 72 | The same instance is **runnable as a distributed system**: NATS JetStream clusters, the integrator |
| 73 | scales to one controller per protected ref (queues are already independent per ref), git hosting |
| 74 | shards across hosts. Nothing in the architecture assumes co-location; the controller-and-log pattern |
| 75 | was distributed-friendly from the start. The design scales **down and up** without changing shape — |
| 76 | the difference between a hobby instance and a company instance is deployment, not design. |
| 77 | |
| 78 | ## Intra-group vs inter-group |
| 79 | |
| 80 | The "cross-repo" open questions were really two questions wearing one name. The group/instance |
| 81 | boundary separates them: |
| 82 | |
| 83 | | Question | Intra-group (within one instance) | Inter-group (federation across instances) | |
| 84 | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | |
| 85 | | 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 | |
| 86 | | 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 | |
| 87 | | 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 | |
| 88 | |
| 89 | **Intra-group** is the tractable near-term case: one bus, one integrator, one knowledge graph, IDs |
| 90 | namespaced by repo. Most of what gets deferred as "cross-repo, v2" is really intra-group and becomes |
| 91 | tractable once the group is the frame. |
| 92 | |
| 93 | **Inter-group** is genuine federation: events, trust, and node references crossing between |
| 94 | independent instances. This is the harder, later problem, and federation is the layer that governs |
| 95 | it. |
| 96 | |
| 97 | ## Trust is group-scoped; federation governs the boundary |
| 98 | |
| 99 | Trust scores ([verification.md](../../design/verification.md)) are **scoped within a group**. A |
| 100 | signer's confirm rate is meaningful relative to one group's re-verifiers and one group's policy; it |
| 101 | does not automatically mean anything in another group. |
| 102 | |
| 103 | Federation governs how trust and events cross group boundaries — explicitly, never implicitly: |
| 104 | |
| 105 | - A group may **import** another group's attestations and decide, by its own policy, how much they |
| 106 | count. |
| 107 | - A group may **subscribe** to a subset of another group's events (e.g. "schema-updated on |
| 108 | acme/contracts") rather than its whole bus. |
| 109 | - Crossing the boundary is a policy decision on _both_ sides, expressed the same way every other |
| 110 | policy is — as nodes the integrator and routers query. |
| 111 | |
| 112 | Importing another group's attestations raises a question this design does not yet answer: a trust |
| 113 | score is meaningful only against _one_ group's signer identities and re-verifier pool, so an |
| 114 | imported attestation arrives with a foreign signer fingerprint and a foreign confirm-rate that mean |
| 115 | nothing locally. How external identities are verified and mapped into local trust policy — |
| 116 | **federated identity mapping and cross-group trust translation** — is left open. Candidate shapes |
| 117 | from the original sketch: a translation function, a per-source discount factor, an explicit |
| 118 | identity-linking node, or no automatic credit at all. _Inter-group only._ |
| 119 | |
| 120 | This keeps the permissive, low-ceremony intra-group model (anyone with push access can request |
| 121 | integration — see [user-scenarios.md](../../design/user-scenarios.md)) without leaking that |
| 122 | permissiveness across organizational lines. |
| 123 | |
| 124 | ## Discovery is scoped by group and federation |
| 125 | |
| 126 | "Without GitHub-the-social-graph, how do humans find each other's repos?" is a **federation** |
| 127 | question. Within a group, discovery is trivial — the instance knows its own repos. Across groups, |
| 128 | discovery is the inter-group problem: how one instance learns another exists and what it federates. |
| 129 | The shape is open; the framing is that discovery operates at the federation layer, not the repo |
| 130 | layer. |
| 131 | |
| 132 | ## Related |
| 133 | |
| 134 | - Disposition of this material: [[dcr-2113c52]] |
| 135 | ([decisions/dcr-2113c52-pr1-relanding.md](../decisions/dcr-2113c52-pr1-relanding.md)) |
| 136 | - The engine this layer hosts: [[ida-eac723e]] |
| 137 | ([ida-eac723e-outcome-dag.md](./ida-eac723e-outcome-dag.md)) |
| 138 | - A federated change is still a transparent one: |
| 139 | [self-transparency.md](../../design/self-transparency.md) |