gunk-dev/the-valley

roadmap.md

sourceb5ae1571d4bamain's published tip history
30.2 KiB · Rendered
1# Roadmap
2
3The other design docs describe the design space. This is the plan. It exists to **incrementally
4validate the design** — not to commit to it. It sits downstream of the
5[scenario ladder](./user-scenarios.md): the ladder says what must become true for a user, and in
6what order; this document says what gets built to make each rung true, and how each claim gets
7checked. Where phases and rungs disagree, the rungs win.
8
9## The shape of the plan
10
11The design is a stack of claims: git-as-event-source, signed-local-checks-instead-of-CI, pull-based
12integration, reactive controllers, transparency-backed trust, a knowledge graph. Each is
13falsifiable. The roadmap turns each into a phase you can actually run and check.
14
15Four rules govern every phase:
16
171. **Independently valuable.** The phase ships something worth having even if the next phase never
18 happens. Phase 0 is durable self-hosting; you'd want that regardless of whether attestations ever
19 exist.
202. **Independently stoppable.** You can stop after any phase and be left with a coherent system, not
21 a half-wired one.
223. **Validates exactly one distinct claim.** A phase that validates two claims can't tell you
23 _which_ one broke.
244. **Serves a rung.** Every phase names the rung(s) of the [ladder](./user-scenarios.md#the-ladder)
25 it builds toward; a phase no rung demands has no business on this page. One rung may take several
26 phases — each still validates its own claim, and the rung is established at the last of their
27 gates.
28
29Heavy iteration on the later phases is expected, and that's a **feature, not a risk**. The point of
30validating Phase 1 before building Phase 3 is that Phase 3 gets designed against a spine that has
31actually run. This is a living document, re-derived against the ladder as rungs and reality move. It
32will be wrong in places, and the plan is structured so that being wrong is cheap. The ladder's own
33discipline applies here too: a phase serving a far rung stays thin until that rung is the top
34priority.
35
36**Sequencing is by validation gate, not calendar date.** There are no time estimates here on
37purpose. Each phase is done when its exit criteria are checkable and checked — "validated when …",
38not "shipped by …".
39
40## Phases at a glance
41
42| Phase | Ships | Rung | Validates | Gate |
43| ----- | --------------------------------------- | ----------------------- | ------------------------------------------------------- | --------------------------------------------------------------------- |
44| 0 | Repos off GitHub, durably; knowledge v0 | S1 | Self-hosting is durable enough to trust | Verified restore + a week off GitHub for the pilot |
45| 1 | The event log | S2 (1 of 3) | git-as-event-source; "a log, not a workflow engine" | `valley tail` shows real ref updates as events |
46| 2 | Signed local attestations | S2 (2 of 3) | The contributor protocol's ergonomics | `nix run .#attest` replaces "wait for CI" for real work |
47| 3 | The integrator | S2 established | Pull-based integration; staleness-as-failure-mode | You stop pushing to `main` directly, even solo |
48| 4 | Agents as first-class authors | S3 established | The pipeline holds with no human in it | A dispatched change lands unsupervised, attributed to the agent's key |
49| 5 | Effectful reactions | S4 established | Reactive controllers replace push-based CI/CD | commit→build→deploy→notify is one queryable history |
50| 6 | Trust backstop | S3 hardened; S5 enabled | The security model (~SLSA-3 for purity-claiming checks) | An untrusted-signer change lands only via the trust flow |
51| 7 | Feedback & incident memory | S6 established | Review is feedback; incidents are memory | An incident files its own node; review happens with no PR object |
52
53S7 (strangers) has no phase, deliberately: it is
54[explicitly deferred, maybe never](./user-scenarios.md#the-ladder) — the trust model should degrade
55toward it gracefully, not build for it. Requirements need 7 (_Demand-shaped work_,
56[requirements.md](./requirements.md)) is likewise phase-less, deliberately: phases serve rungs (rule
574), and need 7 derives from the README's outcome-engine framing rather than a rung — though Phase 4
58(dispatch targets an outcome node) and Phase 5 (a landed change closes the outcome it serves)
59partially serve it.
60
61The named systems, all pilot instances: **klaus** (agent dispatch, run budget), **armstrong** (the
62Go controller that becomes the effectful-reactions successor), **tesseract**
63([transparency-dev/tesseract](https://github.com/transparency-dev/tesseract), the Tessera-backed
64tlog), **cosmo** (the operator's NixOS infra — the consumer that installs this repo's host module),
65and **classic-laddie** (the pilot host: a box on the operator's tailnet, already running the klaus
66webhook relay; it hosts every server-side phase below first). Hostnames are pilot detail, not
67design: the durable content of this plan is portable, and what any host serves is declared in the
68host schema this repo ships ([schema/valley.cue](../schema/valley.cue)).
69
70---
71
72## Phase 0 — MVP: repos off GitHub
73
74**This is the priority.** Everything downstream is developed against it.
75
76**Rung:
77[S1 — my repos live on my infrastructure and I can never lose them](./user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them).**
78The rung's acceptance checklist is this phase's gate.
79
80**Goal.** Get the crown-jewel git data off GitHub and onto infrastructure you control, durably
81enough that you'd trust it with the only copy — before there's ever only one copy.
82
83**What gets built — and what already is.** Hosting only. Bare git over SSH on a host the operator
84controls (the pilot host: classic-laddie). The first artifacts are shipped: a CUE host schema
85([schema/valley.cue](../schema/valley.cue)) declaring what a valley host serves — projects, each
86with a git store and push mirrors — and a `valley-host` NixOS module ([flake.nix](../flake.nix))
87that installs a host from that declaration; cosmo consumes the module for the pilot host (in
88flight). The schema is the domain model and is deliberately not Nix: the NixOS module is one
89installer consuming it, and any other installer can consume the same file. Identity is Tailscale
90ACLs + SSH keys ([architecture.md](./architecture.md)'s _Hosting_ and _Identity / access_ rows,
91nothing more). **No bus, no attestations, no integrator.** The contributor — one solo dev — pushes
92directly to `main`. `cgit` or similar for browsing if wanted. The integrator and the protected-ref
93invariant arrive in [Phase 3](#phase-3--the-integrator); pushing straight to `main` now is correct,
94not a shortcut.
95
96The Tailscale identity layer is deliberately thin — thin enough to swap later, so it is an
97acceptable v1 choice, not a lock-in. When identity needs to grow (untrusted contributors, agent
98keys), it grows in [Phase 6](#phase-6--trust-backstop).
99
100**Knowledge v0 ships in this phase.** S1's knowledge increment: issues, outcomes, ideas, and
101decisions live with the repo as plain markdown files — a directory convention, not a system. No
102indexer, no events; the schemas are documentation until there's an integrator to enforce them.
103Instantiated at [.the-valley/](../.the-valley/README.md). The graph grows one increment per rung
104from here — agents write it ([Phase 4](#phase-4--agents-as-first-class-authors)), it becomes
105observable ([Phase 5](#phase-5--effectful-reactions-armstrong-as-controller)), incidents file into
106it ([Phase 7](#phase-7--feedback--incident-memory)) — so no later phase "builds the knowledge
107graph".
108
109**Durability is part of the MVP, not an afterthought.** The git data is the crown jewel; losing it
110is the one unrecoverable failure. The target is 3-2-1: primary bare repos on the valley host,
111replicated offsite, with **GitHub retained as a transitional mirror** during migration — three
112copies early on. The mechanism is decided
113([dcr-d7952bc](../.the-valley/decisions/dcr-d7952bc-phase0-replication-github-transitional.md) — it
114was this document's open question): two complementary layers.
115
116| Layer | Mechanism | What it gets you |
117| ---------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
118| Live replication | Push-triggered git-native mirror to an independent live remote | Pushed = replicated: a hot second remote you can `git fetch` from directly; git-native, trivially verifiable |
119| Offsite depth | Periodic encrypted backup of the bare-repo dir (restic-style) to offsite storage | Encrypted, deduplicated point-in-time history, independent of the live remotes |
120
121Block-level replication (ZFS send) was considered and rejected for now: it ties restore to a
122matching filesystem on the far end, and it is not a live git remote. For the pilot, the live second
123remote is GitHub — the transitional mirror — and offsite depth is a Hetzner Storage Box; a dedicated
124sovereign live remote is deferred until GitHub exit. Light RPO/RTO framing, per the rung: pushed
125work is in at least two independent places within minutes, one offsite; restore from the offsite
126copy within a day — and no copy counts until a restore from it has been _performed and verified_.
127
128**Migration strategy: mirror-first, then cut over.** Mirrors are declared config, not a manual
129dual-push: the host declaration's per-project `mirrors` field replicates every push to the primary
130out to each mirror URL — deletions propagated, best-effort, a dead mirror never rejects the primary
131push. GitHub stays declared as one such mirror while confidence builds; the canonical `origin` flips
132per-repo once it's earned. The same field is the public-exposure mechanism later — migration
133dual-push and publishing are one mechanism. Reversible at every step; supports iteration.
134
135**Pilot: the-valley itself.** the-valley's own repo is the first off GitHub — dogfooding, low
136stakes, and every later phase is developed against it. Later repos roll out after the pilot proves
137the workflow.
138
139**The design claim it validates.** Self-hosted bare git on the operator's existing infrastructure is
140durable and ergonomic enough to be the canonical home for real work — the premise
141([requirements.md](./requirements.md)) that hosting lock-in is the only thing GitHub does well, and
142it's swappable.
143
144**Exit criteria.** The rung owns them:
145[S1's acceptance checklist](./user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them)
146— canonical origin flipped; every push verifiably in two independent places; one restore performed
147and verified; a week of real human _and_ agent work without GitHub, including an agent change
148landing end to end in direct-push mode; a real issue worked and closed as an in-repo node; a
149repeatable migration-plus-restore runbook.
150
151**Links.** [architecture.md](./architecture.md) (_Hosting_, _Identity / access_ rows),
152[schema/valley.cue](../schema/valley.cue), [examples/host.cue](../examples/host.cue).
153
154**Open questions.** One remains from this phase: Phase-0 identity being Tailscale-ACL-based (thin,
155swappable) — see [Open questions](#open-questions). The replication mechanism was the other and is
156decided above.
157
158---
159
160## Phase 1 — The event log (the spine)
161
162**Rung: [S2](./user-scenarios.md#the-ladder), first of three phases.** No rung demands a bus for its
163own sake; this phase exists because everything S2 needs — attested checks, an integrator — runs on
164events, and the projection claim is worth isolating (rule 3: if it's awkward here, everything
165downstream inherits the problem).
166
167**Goal.** Make git a source of events. Nothing reacts yet — this phase only proves the events are
168real and legible.
169
170**What gets built.** NATS JetStream on the valley host. A `post-receive` hook projecting ref updates
171into bus events: `ref-updated` now, `attestation-published` / `integration-requested` later (per
172[contribute.md](./contribute.md)). A dumb `valley tail` inspector to watch events scroll by. That's
173it. No subscriber acts on anything.
174
175**The design claim it validates.** git-as-event-source — that ref updates project cleanly onto a
176log, and that a log is the right substrate ("a log, not a workflow engine" —
177[architecture.md](./architecture.md)).
178
179**A note on durability.** The bus is the source of truth only for _ephemeral cross-system events_.
180Per-repo events (refs, attestations, integration requests) are durable in git itself; the bus is a
181projection that can be rebuilt. This is the resolution of the old "the log is a single point of
182failure" question ([openquestions.md](./openquestions.md), _Resolved_).
183
184**Exit criteria.**
185
186- A push to the valley host produces a `ref-updated` event visible in `valley tail` within seconds.
187- Rebuilding the stream from scratch (replay the repo's refs) reproduces the same events — the
188 projection is deterministic.
189
190**Links.** [architecture.md](./architecture.md) (_a log, not a workflow engine_),
191[contribute.md](./contribute.md).
192
193---
194
195## Phase 2 — Attestations (verification MVP)
196
197**Rung: [S2](./user-scenarios.md#the-ladder), second of three.** The rung's hardest demand — checks
198run where the work was written, trustworthy enough to integrate against — enters here as ergonomics;
199the adversarial half of "trustworthy" is [Phase 6](#phase-6--trust-backstop)'s.
200
201**Goal.** Replace "wait for CI" with "signed local check" for real day-to-day work.
202
203**What gets built.** A `nix run .#attest` helper that: runs the repo's canonical checks (Nix
204derivations, in the reference implementation); composes the attestation
205([contribute.md](./contribute.md) / [verification.md](./verification.md)), recording _what check
206ran, on what tree, with what result_; SSH-signs it with the same key as the commit signature; stores
207it as `refs/the-valley/attestations/<sha>`; pushes atomically ([contribute.md](./contribute.md)).
208Purity is a claim tied to a runner kind — the `nix` runner claims it strongly — not a property the
209schema assumes.
210
211Checks-as-derivations is the reference implementation, not the contract. The attestation schema must
212stay implementable by other runner kinds, so a non-Nix runner is an added backend later, never a
213migration.
214
215**Deferred to [Phase 6](#phase-6--trust-backstop):** the Tessera tlog and witness re-derivation.
216Phase 2 is _just local signed attestations_ — the ergonomics of the protocol, without the trust
217backstop. This is the right cut: the protocol has to feel good before the security layer is worth
218building on top of it.
219
220**The design claim it validates.** The contributor protocol's ergonomics — that a signed local check
221is a pleasant, fast substitute for a CI gate, produced by native git plus one helper
222([contribute.md](./contribute.md)).
223
224**Exit criteria.**
225
226- Real changes to the-valley land with an attestation ref alongside every commit.
227- The push is one atomic native-git command; no wrapper.
228- The user prefers this to CI for the pilot repo — the ergonomic claim holds in practice, not just
229 in theory.
230
231**Links.** [contribute.md](./contribute.md), [verification.md](./verification.md).
232
233---
234
235## Phase 3 — The integrator
236
237**Rung: [S2](./user-scenarios.md#the-ladder) — established at this gate.** Push, and seconds later
238it's integrated; the operator never waits for CI, even solo.
239
240**Goal.** Stop writing `main` by hand. Route every change through a request-and-react flow, even
241solo.
242
243**What gets built.** Two things:
244
245- **The structural invariant.** The one-line `pre-receive` hook: only the integrator key writes
246 `refs/heads/<protected>`; attestation refs are create-only; everything else is open
247 ([contribute.md](./contribute.md), _The one invariant_; [architecture.md](./architecture.md), _The
248 one structural git invariant_).
249- **The integrator controller.** Pull-based, subscribing to `integration-requested`. Verifies
250 signature + attestation + (for now, self-) trust, does FF/rebase into `main`, emits outcome events
251 ([architecture.md](./architecture.md), _a pull-based integrator_). Merge-queue semantics fall out
252 for free. The required attestation set is a function of the diff, not of the contributor's claim
253 about it: policy maps path classes to required checks — code takes the full suite, knowledge-only
254 changes (`.the-valley/**`) take signature plus knowledge lint, mixed commits take the max of
255 everything touched. That is also what keeps knowledge-node changes cheap through the same
256 protected path: one invariant, proportionate checks.
257
258The integrator is designed around **change objects** — a diff targeting a stream, with identity
259stable across rebases — rather than branches, per the adopted direction in
260[ida-93e4f91](../.the-valley/ideas/ida-93e4f91-changes-not-branches.md).
261
262This is where the user **stops pushing directly to `main`** and goes through the request flow, even
263as the only contributor. That's the whole point — the flow has to be tolerable at N=1 before it's
264asked to hold at N>1.
265
266**The design claim it validates.** The controller pattern and the core integration claim — that a
267pull-based integrator is a better shape than a `pre-receive` gate, and that staleness is the right
268unified failure mode ([architecture.md](./architecture.md)).
269
270**Exit criteria.**
271
272- Direct pushes to `refs/heads/main` are rejected by the hook; only the integrator key succeeds.
273- A change lands via `integration-requested` → `integration-succeeded` with no manual ref write.
274- A stale case (rebase would change the tree) surfaces as one `request-stale` event, not a rejection
275 or a retry storm.
276
277**Links.** [architecture.md](./architecture.md) (_a pull-based integrator_, _The one structural git
278invariant_).
279
280**New open questions.** Integrator self-integration — the integrator is code in a repo; how does
281_its_ changes get integrated? Already tracked in [openquestions.md](./openquestions.md) (_Identity &
282trust bootstrapping_). Phase 3 is where the chicken-and-egg becomes concrete.
283
284---
285
286## Phase 4 — Agents as first-class authors
287
288**Rung: [S3](./user-scenarios.md#the-ladder) — established here; its attribution claim is hardened
289by [Phase 6](#phase-6--trust-backstop).**
290
291**Goal.** An agent's change lands with the same guarantees as the operator's, attributed to the
292agent that made it, with no human babysitting the pipeline.
293
294**What gets built.** Deliberately thin — the integration flow is unchanged from Phase 3, and that's
295the point:
296
297- **Per-agent identity.** Each agent signs commits and attestations with its own key. Attribution
298 lives in the git objects and the log, not in a platform sidecar; the landed history distinguishes
299 the agent's work from the operator's.
300- **Dispatch against the graph.** klaus dispatch targets an outcome node, not a GitHub issue, and
301 agents read and write knowledge nodes as part of the work — S3's knowledge increment. The
302 convention is already live in [.the-valley/](../.the-valley/README.md); this phase makes it the
303 pipeline's shape instead of a habit.
304
305This phase retires S1's interim mode — agents pushing a branch for the operator to review and merge
306by hand
307([user-scenarios.md § S1](./user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them)).
308Feeling that mode's pain was this phase's motivation, by design.
309
310**The design claim it validates.** The pipeline holds with no human in it: a non-human author lands
311with the same guarantees, and attribution is recorded, not inferred. What this phase deliberately
312does not claim: that attribution can't be forged — signature-based attribution is only as strong as
313key custody until the tlog lands ([Phase 6](#phase-6--trust-backstop)). For one operator and their
314own agents, that is the honest cut.
315
316**Exit criteria.**
317
318- A klaus-dispatched change lands via `integration-requested` → `integration-succeeded` with no
319 human action between dispatch and landing.
320- The landed history attributes the change to the agent's own key, distinguishable from the
321 operator's.
322- The dispatch's target is an outcome node in the repo, and the work reads and writes knowledge
323 nodes end to end.
324
325- A klaus-dispatched change lands via `integration-requested` → `integration-succeeded` with no
326 human action between dispatch and landing.
327- The landed history attributes the change to the agent's own key, distinguishable from the
328 operator's.
329- The dispatch's target is an outcome node in the repo, and the work reads and writes knowledge
330 nodes end to end.
331
332**Links.** [architecture.md](./architecture.md) (_Identity / access_ row),
333[scenarios.md #2](./scenarios.md) (klaus-style agent change),
334[user-scenarios.md](./user-scenarios.md).
335
336---
337
338## Phase 5 — Effectful reactions (armstrong-as-controller)
339
340**Rung: [S4](./user-scenarios.md#the-ladder) — established here**, including its knowledge
341increment: knowledge changes become observable events, and a landed change can close the outcome it
342serves.
343
344**Goal.** Prove the causality chain end to end: a commit becomes a build becomes a deploy becomes a
345notification, all as reactions on the log.
346
347**What gets built.** armstrong subscribes to `integration-succeeded` → `nix build` the artifact
348derivation → deploy / notify ([scenarios.md #1](./scenarios.md)). This is the controller-shaped
349successor to the current Actions-based armstrong — the same tool, inverted from push-based pipeline
350to reactive subscriber. Alongside it, the knowledge graph joins the causal record: node changes
351surface on the bus like any ref update, and a landing can flip the outcome node it serves to done —
352the graph stops being write-only.
353
354**The design claim it validates.** Reactive controllers replace push-based CI/CD, and the causality
355chain (commit → build → deploy → notify) is _one queryable history_ rather than seven disconnected
356job UIs ([architecture.md](./architecture.md), _Components_ and _a log, not a workflow engine_).
357
358**Exit criteria.**
359
360- An integration into `main` triggers a build and a deploy with no workflow file — only a
361 subscriber.
362- The full chain for a given commit is reconstructable from the log alone.
363- A landed change closes the outcome node it serves, and that closure is visible in the log like any
364 other event.
365
366**Links.** [architecture.md](./architecture.md) (_Components_),
367[scenarios.md #1 and #6](./scenarios.md).
368
369---
370
371## Phase 6 — Trust backstop
372
373**Rungs: [S3](./user-scenarios.md#the-ladder) hardened, [S5](./user-scenarios.md#the-ladder)
374enabled.** Attribution gains non-repudiation — "can't be waved through or forged" now holds
375adversarially — and trust becomes grantable, bounded, and revocable, which is what lets a second
376human land a change without anything platform-shaped. S5 counts as established when a real
377collaborator lands a real change through this machinery.
378
379**Goal.** Make attestations trustworthy under adversarial or multi-party conditions, not just
380convenient.
381
382**What gets built.**
383
384- **Transparency log.** Tessera-backed tlog publication of attestations via tesseract, with
385 inclusion proofs appended as a sidecar ([contribute.md](./contribute.md)).
386- **Witness re-derivation.** A re-verifier that re-derives any attestation whose runner kind claims
387 purity and emits confirm/deny events.
388- **Trust controller.** Scores per signer from confirm rates, with revocation
389 ([architecture.md](./architecture.md), _attestation with revocation_).
390
391Together these enable the untrusted-contributor and agent-identity scenarios that Phase 2's
392local-only attestations can't.
393
394**The design claim it validates.** The security model — roughly SLSA Level 3 for purity-claiming
395checks, plus non-repudiation from the tlog ([verification.md](./verification.md), _The mechanism
396stack_). Purity is the runner kind's claim, carried in the attestation schema — the `nix` runner is
397the reference implementation of a strong claim, and the model degrades honestly for runners that
398claim less.
399
400**Exit criteria.**
401
402- Every attestation lands in the tlog with a verifiable inclusion proof.
403- A deliberately-wrong purity-claiming attestation is caught by the witness and lowers the signer's
404 trust score.
405- An untrusted signer's change integrates _only_ via the trust flow
406 ([scenarios.md #4](./scenarios.md)), never by default.
407
408**Links.** [verification.md](./verification.md), [contribute.md](./contribute.md),
409[scenarios.md #2 and #4](./scenarios.md).
410
411---
412
413## Phase 7 — Feedback & incident memory
414
415**Rung: [S6](./user-scenarios.md#the-ladder) — established here.** It also completes S4's feedback
416story: who needs to know about which event, without a firehose.
417
418**Goal.** Unbundle review — the last GitHub-shaped interaction — from the vendor UI, and make
419incidents part of the project's durable memory.
420
421**What gets built.**
422
423- **Threads.** Derived views over events, scoped to a change or chain
424 ([architecture.md](./architecture.md), _review is observability + feedback_). PR-as-thread — the
425 "PR" becomes a named query, not a stored object.
426- **Priority/attention router.** The routing subsystem that decides who needs to know about which
427 event ([architecture.md](./architecture.md), same section).
428- **Incident memory.** S6's knowledge increment: an incident files its own node, attributing the
429 regression to the change that caused it — with the attribution carrying its uncertainty honestly,
430 because a confidently wrong answer is worse than none — and linking the revert. The war story
431 becomes a queryable record.
432
433There is no "build the knowledge graph" item here: the graph arrived one increment per rung — plain
434files ([Phase 0](#phase-0--mvp-repos-off-github)), agent-written
435([Phase 4](#phase-4--agents-as-first-class-authors)), observable
436([Phase 5](#phase-5--effectful-reactions-armstrong-as-controller)), incident-filing (here) — exactly
437as the ladder grows it.
438
439**The design claim it validates.** Observability + project-knowledge unbundling — that review is a
440special case of feedback, incidents are a special case of knowledge, and both belong to one history
441rather than scattered across issues, wikis, and heads ([architecture.md](./architecture.md),
442_Observability & feedback_, _Project knowledge_ rows).
443
444**Exit criteria.**
445
446- A change accrues discussion, an approval, and an outcome as one chronology with no PR object
447 anywhere.
448- The router surfaces one genuinely high-priority event to a human without a firehose.
449- A bad deploy — real or gamedayed — ends as an incident node with attribution, stated uncertainty,
450 and a link to the revert.
451
452**Links.** [architecture.md](./architecture.md) (_review is observability + feedback_, _project
453knowledge is a typed-node graph_), [scenarios.md #3 and #4](./scenarios.md).
454
455**New open questions.** None new here — but note the _priority-layer architecture_ question
456([openquestions.md](./openquestions.md), _Attention, routing, and threads_) is the hardest new
457bottleneck the whole design creates, and Phase 7 is where it stops being hypothetical.
458
459---
460
461## Cross-cutting threads
462
463Some things aren't a phase; they run through all of them.
464
465- **CUE schemas.** One schema language across the system. Event schemas are shared across producers
466 and consumers, reused from armstrong — minimal in Phase 1, growing a field or a type each phase.
467 Host config already speaks it ([schema/valley.cue](../schema/valley.cue), shipped in Phase 0);
468 knowledge-node frontmatter and verification policy are candidates to follow. Schema evolution is a
469 standing concern, not a phase — tracked in [openquestions.md](./openquestions.md) (_Storage,
470 retention, and evolution_).
471- **The `valley` CLI.** A thin tool that accretes one verb per phase — `valley migrate` (0),
472 `valley tail` (1), `valley attest` or the `nix run .#attest` helper (2), `valley browse` (7). It
473 stays thin on purpose: the contributor protocol is native-git-first
474 ([contribute.md](./contribute.md)), so the CLI is convenience, never the critical path. Anything
475 `valley` does, plain git and `nix` can do.
476- **Durability as a standing priority.** Phase 0 makes it explicit, but it never stops mattering.
477 The durable substrate is git objects + attestation refs + the tlog — all replicable, all
478 externally witnessable. The bus is the one replaceable component: lose it and rebuild it from git.
479 Every phase should preserve that property — if a phase makes the bus load-bearing for durable
480 state, that's a design smell to catch.
481- **Portability as a standing constraint.** Nix is a backend, not the substrate: portable schemas
482 from day 0, portable implementations on demand. Every schema this plan ships — host config,
483 events, attestations, knowledge nodes — must be implementable without Nix; the NixOS module and
484 checks-as-derivations are reference implementations, never the contract. The review heuristic: a
485 field only Nix can produce is a leak.
486
487## Open questions
488
489This document originally raised two; one is now decided, one remains open:
490
491- **Offsite replication mechanism — decided**
492 ([dcr-d7952bc](../.the-valley/decisions/dcr-d7952bc-phase0-replication-github-transitional.md)).
493 Push-triggered git-native mirroring to an independent live remote (pushed = replicated) — during
494 migration that remote is GitHub, with the dedicated sovereign live remote deferred until GitHub
495 exit — plus periodic encrypted restic-style backup for offsite depth; block-level replication (ZFS
496 send) rejected for now. Details in [Phase 0](#phase-0--mvp-repos-off-github).
497- **Phase-0 identity is Tailscale-ACL-based** (_Identity & trust bootstrapping_). Thin by design and
498 swappable; the open question is _when_ it has to grow and into what — likely driven by
499 [Phase 6](#phase-6--trust-backstop). _Origin: roadmap.md._
500
501Everything else this roadmap touches is already tracked in [openquestions.md](./openquestions.md) —
502integrator self-integration, the priority-layer architecture, attestation expiry vs. cache
503retention, agent identity, and schema evolution all surface at specific phases above.