| 1 | # Roadmap |
| 2 | |
| 3 | The [README](../README.md) says: *"This document is the design space, not a plan."* This is the plan. It exists to **incrementally validate the design** — not to commit to it. |
| 4 | |
| 5 | ## The shape of the plan |
| 6 | |
| 7 | The design is a stack of claims: git-as-event-source, signed-local-checks-instead-of-CI, pull-based integration, reactive controllers, transparency-backed trust, a knowledge graph. Each is falsifiable. The roadmap turns each into a phase you can actually run and check. |
| 8 | |
| 9 | Three rules govern every phase: |
| 10 | |
| 11 | 1. **Independently valuable.** The phase ships something worth having even if the next phase never happens. Phase 0 is durable self-hosting; you'd want that regardless of whether attestations ever exist. |
| 12 | 2. **Independently stoppable.** You can stop after any phase and be left with a coherent system, not a half-wired one. |
| 13 | 3. **Validates exactly one distinct claim.** A phase that validates two claims can't tell you *which* one broke. |
| 14 | |
| 15 | Heavy iteration on the later phases is expected, and that's a **feature, not a risk**. The point of validating Phase 1 before building Phase 3 is that Phase 3 gets designed against a spine that has actually run. This is a living first cut. It will be wrong in places, and the plan is structured so that being wrong is cheap. |
| 16 | |
| 17 | **Sequencing is by validation gate, not calendar date.** There are no time estimates here on purpose. Each phase is done when its exit criteria are checkable and checked — "validated when …", not "shipped by …". |
| 18 | |
| 19 | ## Phases at a glance |
| 20 | |
| 21 | | Phase | Ships | Validates | Gate | |
| 22 | | --- | --- | --- | --- | |
| 23 | | 0 | Repos off GitHub, durably | Self-hosting is durable enough to trust | Verified restore + a week off GitHub for the pilot | |
| 24 | | 1 | The event log | git-as-event-source; "a log, not a workflow engine" | `valley tail` shows real ref updates as events | |
| 25 | | 2 | Signed local attestations | The contributor protocol's ergonomics | `nix run .#attest` replaces "wait for CI" for real work | |
| 26 | | 3 | The integrator | Pull-based integration; staleness-as-failure-mode | You stop pushing to `main` directly, even solo | |
| 27 | | 4 | Effectful reactions | Reactive controllers replace push-based CI/CD | commit→build→deploy→notify is one queryable history | |
| 28 | | 5 | Trust backstop | The security model (~SLSA-3 for pure checks) | An untrusted-signer change lands only via the trust flow | |
| 29 | | 6 | Knowledge & feedback | Observability + project-knowledge unbundling | A PR-shaped interaction happens with no PR object | |
| 30 | |
| 31 | The named systems: **klaus** (agent dispatch, run budget), **armstrong** (the Go controller that becomes the effectful-reactions successor), **tesseract** ([transparency-dev/tesseract](https://github.com/transparency-dev/tesseract), the Tessera-backed tlog), **cosmo** (the Nix/NixOS infra), and **classic-laddie** (a ZFS-based NixOS box on the tailnet, already running the klaus webhook relay). classic-laddie is the host for every server-side phase below. |
| 32 | |
| 33 | --- |
| 34 | |
| 35 | ## Phase 0 — MVP: repos off GitHub |
| 36 | |
| 37 | **This is the priority.** Everything downstream is developed against it. |
| 38 | |
| 39 | **Goal.** Get the crown-jewel git data off GitHub and onto infrastructure you control, durably enough that you'd trust it with the only copy — before there's ever only one copy. |
| 40 | |
| 41 | **What gets built.** Hosting only. Bare git over SSH on classic-laddie. Identity is Tailscale ACLs + SSH keys (the README's *Hosting* and *Identity* rows, nothing more). **No bus, no attestations, no integrator.** The contributor — one solo dev — pushes directly to `main`. `cgit` or similar for browsing if wanted. The integrator and the protected-ref invariant arrive in [Phase 3](#phase-3--the-integrator); pushing straight to `main` now is correct, not a shortcut. |
| 42 | |
| 43 | The Tailscale identity layer is deliberately thin. The user has noted it's thin enough to swap later — so it's an acceptable v1 choice, not a lock-in. When identity needs to grow (untrusted contributors, agent keys), it grows in [Phase 5](#phase-5--trust-backstop). |
| 44 | |
| 45 | **Durability is part of the MVP, not an afterthought.** The git data is the crown jewel; losing it is the one unrecoverable failure. The target is 3-2-1: primary bare repos on classic-laddie, replicated offsite to **Hetzner**, with **GitHub retained as a transitional mirror** during migration — three copies early on. Three concrete mechanisms to iterate on (not hard-picked): |
| 46 | |
| 47 | | Mechanism | What it gets you | Cost | |
| 48 | | --- | --- | --- | |
| 49 | | (a) periodic `git push --mirror` to a Hetzner Storage Box or small VPS running bare git | A usable second remote you can `git fetch` from directly; git-native, trivially verifiable | Not encrypted at rest by default; per-repo push config | |
| 50 | | (b) ZFS snapshot + `zfs send` to Hetzner (classic-laddie is already ZFS, from cosmo) | Block-level, cheap, incremental, snapshots the whole repo dir atomically | Restore needs ZFS on the far end; not a live git remote | |
| 51 | | (c) restic/borg encrypted backup of the bare-repo dir to Hetzner object storage | Encrypted + deduplicated offsite | Not a live remote; restore is a two-step (restic → git) | |
| 52 | |
| 53 | They're not exclusive — (a) gives a hot second remote, (b) or (c) gives cheap offsite depth. The mechanism choice is an [open question](#open-questions). Light RPO/RTO framing: for a solo dev, an RPO of "since last hourly mirror" and an RTO of "clone from the second remote" is plenty; don't over-engineer past that. |
| 54 | |
| 55 | **Migration strategy: mirror-first, then cut over.** Add classic-laddie as an additional remote and dual-push. Keep GitHub live as backup. Flip the canonical `origin` per-repo once confident. Reversible at every step; supports iteration. |
| 56 | |
| 57 | **Pilot: the-valley itself.** the-valley's own repo is the first off GitHub — dogfooding, low stakes, and every later phase is developed against it. Later repos roll out after the pilot proves the workflow. |
| 58 | |
| 59 | **The design claim it validates.** Self-hosted bare git on the existing tailnet is durable and ergonomic enough to be the canonical home for real work — the README's premise that hosting lock-in is the only thing GitHub does well, and it's swappable. |
| 60 | |
| 61 | **Exit criteria.** |
| 62 | - the-valley's canonical `origin` is classic-laddie. |
| 63 | - A restore from the Hetzner backup has actually been *performed and verified* — not merely configured. |
| 64 | - The user works ~a week without touching GitHub for the pilot repo. |
| 65 | - The migration runbook is written and repeatable for the next repo. |
| 66 | |
| 67 | **Links.** [README](../README.md) (*Hosting*, *Identity* rows). |
| 68 | |
| 69 | **New open questions.** The Hetzner backup mechanism (a/b/c above). Phase-0 identity being Tailscale-ACL-based for now (thin, swappable). Both belong in [openquestions.md](./openquestions.md); see [Open questions](#open-questions). |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Phase 1 — The event log (the spine) |
| 74 | |
| 75 | **Goal.** Make git a source of events. Nothing reacts yet — this phase only proves the events are real and legible. |
| 76 | |
| 77 | **What gets built.** NATS JetStream on classic-laddie. A `post-receive` hook projecting ref updates into bus events: `ref-updated` now, `attestation-published` / `integration-requested` later (per [contribute.md §8](./contribute.md)). A dumb `valley tail` inspector to watch events scroll by. That's it. No subscriber acts on anything. |
| 78 | |
| 79 | **The design claim it validates.** git-as-event-source — that ref updates project cleanly onto a log, and that a log is the right substrate ("a log, not a workflow engine" — [README](../README.md), *Why a log*). If the projection is awkward or lossy here, everything downstream inherits the problem, so it's worth isolating. |
| 80 | |
| 81 | **A note on durability.** The bus is the source of truth only for *ephemeral cross-system events*. Per-repo events (refs, attestations, integration requests) are durable in git itself; the bus is a projection that can be rebuilt. This is the resolution of the old "the log is a single point of failure" question ([openquestions.md](./openquestions.md), *Resolved*). |
| 82 | |
| 83 | **Exit criteria.** |
| 84 | - A push to classic-laddie produces a `ref-updated` event visible in `valley tail` within seconds. |
| 85 | - Rebuilding the stream from scratch (replay the repo's refs) reproduces the same events — the projection is deterministic. |
| 86 | |
| 87 | **Links.** [README](../README.md) (*Why a log*), [contribute.md §8](./contribute.md). |
| 88 | |
| 89 | --- |
| 90 | |
| 91 | ## Phase 2 — Attestations (verification MVP) |
| 92 | |
| 93 | **Goal.** Replace "wait for CI" with "signed local check" for real day-to-day work. |
| 94 | |
| 95 | **What gets built.** A `nix run .#attest` helper that: runs the repo's canonical `nix flake check` derivations; composes the attestation JSON ([contribute.md §3](./contribute.md) / [verification.md](./verification.md) shape); SSH-signs it with the same key as the commit signature; stores it as `refs/the-valley/attestations/<sha>`; pushes atomically ([contribute.md §7](./contribute.md)). |
| 96 | |
| 97 | **Deferred to [Phase 5](#phase-5--trust-backstop):** the Tessera tlog and witness re-derivation. Phase 2 is *just local signed attestations* — the ergonomics of the protocol, without the trust backstop. This is the right cut: the protocol has to feel good before the security layer is worth building on top of it. |
| 98 | |
| 99 | **The design claim it validates.** The contributor protocol's ergonomics — that a signed local check is a pleasant, fast substitute for a CI gate, produced by native git plus one helper ([contribute.md](./contribute.md)). |
| 100 | |
| 101 | **Exit criteria.** |
| 102 | - Real changes to the-valley land with an attestation ref alongside every commit. |
| 103 | - The push is one atomic native-git command; no wrapper. |
| 104 | - The user prefers this to CI for the pilot repo — the ergonomic claim holds in practice, not just in theory. |
| 105 | |
| 106 | **Links.** [contribute.md](./contribute.md), [verification.md](./verification.md). |
| 107 | |
| 108 | --- |
| 109 | |
| 110 | ## Phase 3 — The integrator |
| 111 | |
| 112 | **Goal.** Stop writing `main` by hand. Route every change through a request-and-react flow, even solo. |
| 113 | |
| 114 | **What gets built.** Two things: |
| 115 | |
| 116 | - **The structural invariant.** The one-line `pre-receive` hook: only the integrator key writes `refs/heads/<protected>`; attestation refs are create-only; everything else is open ([contribute.md](./contribute.md), *What protects the canonical refs*; [integration.md](./integration.md), *The minimal invariant*). |
| 117 | - **The integrator controller.** Pull-based, subscribing to `integration-requested`. Verifies signature + attestation + (for now, self-) trust, does FF/rebase into `main`, emits outcome events ([integration.md](./integration.md), *Mechanism*). Merge-queue semantics fall out for free. |
| 118 | |
| 119 | This is where the user **stops pushing directly to `main`** and goes through the request flow, even as the only contributor. That's the whole point — the flow has to be tolerable at N=1 before it's asked to hold at N>1. |
| 120 | |
| 121 | **The design claim it validates.** The controller pattern and the core integration claim — that a pull-based integrator is a better shape than a `pre-receive` gate ([integration.md](./integration.md)), and that staleness is the right unified failure mode ([integrator-internals.md](./integrator-internals.md)). |
| 122 | |
| 123 | **Exit criteria.** |
| 124 | - Direct pushes to `refs/heads/main` are rejected by the hook; only the integrator key succeeds. |
| 125 | - A change lands via `integration-requested` → `integration-succeeded` with no manual ref write. |
| 126 | - A stale case (rebase would change the tree) surfaces as one `request-stale` event, not a rejection or a retry storm. |
| 127 | |
| 128 | **Links.** [integration.md](./integration.md), [integrator-internals.md](./integrator-internals.md). |
| 129 | |
| 130 | **New open questions.** Integrator self-integration — the integrator is code in a repo; how does *its* changes get integrated? Already tracked in [openquestions.md](./openquestions.md) (*Identity & trust bootstrapping*). Phase 3 is where the chicken-and-egg becomes concrete. |
| 131 | |
| 132 | --- |
| 133 | |
| 134 | ## Phase 4 — Effectful reactions (armstrong-as-controller) |
| 135 | |
| 136 | **Goal.** Prove the causality chain end to end: a commit becomes a build becomes a deploy becomes a notification, all as reactions on the log. |
| 137 | |
| 138 | **What gets built.** armstrong subscribes to `integration-succeeded` → `nix build` the artifact derivation → deploy / notify ([scenarios.md #1](./scenarios.md)). This is the controller-shaped successor to the current Actions-based armstrong — the same tool, inverted from push-based pipeline to reactive subscriber. |
| 139 | |
| 140 | **The design claim it validates.** Reactive controllers replace push-based CI/CD, and the causality chain (commit → build → deploy → notify) is *one queryable history* rather than seven disconnected job UIs ([README](../README.md), *Effectful reactions* and *Why a log*). |
| 141 | |
| 142 | **Exit criteria.** |
| 143 | - An integration into `main` triggers a build and a deploy with no workflow file — only a subscriber. |
| 144 | - The full chain for a given commit is reconstructable from the log alone. |
| 145 | |
| 146 | **Links.** [README](../README.md) (*Effectful reactions*), [scenarios.md #1 and #6](./scenarios.md). |
| 147 | |
| 148 | --- |
| 149 | |
| 150 | ## Phase 5 — Trust backstop |
| 151 | |
| 152 | **Goal.** Make attestations trustworthy under adversarial or multi-party conditions, not just convenient. |
| 153 | |
| 154 | **What gets built.** |
| 155 | |
| 156 | - **Transparency log.** Tessera-backed tlog publication of attestations via tesseract, with inclusion proofs appended as a sidecar ([contribute.md §4](./contribute.md)). |
| 157 | - **Witness re-derivation.** A pure-check re-verifier that re-derives any pure attestation and emits confirm/deny events. |
| 158 | - **Trust controller.** Scores per signer from confirm rates, with revocation ([verification.md](./verification.md), *Reactions on the event*). |
| 159 | |
| 160 | Together these enable the untrusted-contributor and agent-identity scenarios that Phase 2's local-only attestations can't. |
| 161 | |
| 162 | **The design claim it validates.** The security model — roughly SLSA Level 3 for pure-derivation checks, plus non-repudiation from the tlog ([verification.md](./verification.md), *What "unforgeable" actually means*). |
| 163 | |
| 164 | **Exit criteria.** |
| 165 | - Every attestation lands in the tlog with a verifiable inclusion proof. |
| 166 | - A deliberately-wrong pure attestation is caught by the witness and lowers the signer's trust score. |
| 167 | - An untrusted signer's change integrates *only* via the trust flow ([scenarios.md #5](./scenarios.md)), never by default. |
| 168 | |
| 169 | **Links.** [verification.md](./verification.md), [contribute.md](./contribute.md), [scenarios.md #2 and #5](./scenarios.md). |
| 170 | |
| 171 | --- |
| 172 | |
| 173 | ## Phase 6 — Knowledge & feedback |
| 174 | |
| 175 | **Goal.** Unbundle the last two things GitHub does — project knowledge and review — from the vendor UI. |
| 176 | |
| 177 | **What gets built.** |
| 178 | |
| 179 | - **Knowledge graph.** The typed-node markdown graph (`bug` / `principle` / `decision` / `idea` / `thread`) at each repo root ([knowledge.md](./knowledge.md)). |
| 180 | - **Threads.** Derived views over events, scoped to a change or chain ([feedback.md](./feedback.md), *Threads*). PR-as-thread — the "PR" becomes a named query, not a stored object. |
| 181 | - **Priority/attention router.** The routing subsystem that decides who needs to know about which event ([feedback.md](./feedback.md), *The priority/routing layer*). |
| 182 | |
| 183 | **The design claim it validates.** Observability + project-knowledge unbundling — that review is a special case of feedback, and that institutional knowledge belongs in a signed, agent-legible graph rather than scattered across issues, wikis, and heads ([README](../README.md), *Observability & feedback*, *Project knowledge* rows). |
| 184 | |
| 185 | **Exit criteria.** |
| 186 | - A change accrues discussion, an approval, and an outcome as one chronology with no PR object anywhere. |
| 187 | - An agent reads and writes knowledge nodes as structured frontmatter. |
| 188 | - The router surfaces one genuinely high-priority event to a human without a firehose. |
| 189 | |
| 190 | **Links.** [knowledge.md](./knowledge.md), [feedback.md](./feedback.md), [scenarios.md #3 and #5](./scenarios.md). |
| 191 | |
| 192 | **New open questions.** None new here — but note the *priority-layer architecture* question ([openquestions.md](./openquestions.md), *Attention, routing, and threads*) is the hardest new bottleneck the whole design creates, and Phase 6 is where it stops being hypothetical. |
| 193 | |
| 194 | --- |
| 195 | |
| 196 | ## Cross-cutting threads |
| 197 | |
| 198 | Some things aren't a phase; they run through all of them. |
| 199 | |
| 200 | - **CUE event schemas.** Shared across producers and consumers, reused from armstrong. They start minimal in Phase 1 and grow a field or a type each phase. Schema evolution is a standing concern, not a phase — tracked in [openquestions.md](./openquestions.md) (*Storage, retention, and evolution*). |
| 201 | - **The `valley` CLI.** A thin tool that accretes one verb per phase — `valley migrate` (0), `valley tail` (1), `valley attest` or the `nix run .#attest` helper (2), `valley browse` (6). It stays thin on purpose: the contributor protocol is native-git-first ([contribute.md](./contribute.md)), so the CLI is convenience, never the critical path. Anything `valley` does, plain git and `nix` can do. |
| 202 | - **Durability as a standing priority.** Phase 0 makes it explicit, but it never stops mattering. The durable substrate is git objects + attestation refs + the tlog — all replicable, all externally witnessable. The bus is the one replaceable component: lose it and rebuild it from git. Every phase should preserve that property — if a phase makes the bus load-bearing for durable state, that's a design smell to catch. |
| 203 | |
| 204 | ## Open questions |
| 205 | |
| 206 | Two questions are genuinely new to this document and should migrate to [openquestions.md](./openquestions.md) under the noted themes: |
| 207 | |
| 208 | - **Hetzner backup mechanism** (*Storage, retention, and evolution*). git-native mirror (a), ZFS send (b), or restic/borg (c) for the offsite copy — or a combination. Tradeoffs in [Phase 0](#phase-0--mvp-repos-off-github). *Origin: roadmap.md.* |
| 209 | - **Phase-0 identity is Tailscale-ACL-based** (*Identity & trust bootstrapping*). Thin by design and swappable; the open question is *when* it has to grow and into what — likely driven by [Phase 5](#phase-5--trust-backstop). *Origin: roadmap.md.* |
| 210 | |
| 211 | Everything else this roadmap touches is already tracked in [openquestions.md](./openquestions.md) — integrator self-integration, the priority-layer architecture, attestation expiry vs. cache retention, agent identity, and schema evolution all surface at specific phases above. |