gunk-dev/the-valley

roadmap.md

source214e1789a9cdmain's published tip history
32.4 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 in the attestation |
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 convention is checked, not enforced — `nix flake check` runs the knowledge
103lint, and nothing stops a broken graph from landing until there's an integrator. Instantiated at
104[.the-valley/](../.the-valley/README.md). The graph grows one increment per rung from here — agents
105write it ([Phase 4](#phase-4--agents-as-first-class-authors)), it becomes observable
106([Phase 5](#phase-5--effectful-reactions-armstrong-as-controller)), incidents file into it
107([Phase 7](#phase-7--feedback--incident-memory)) — so no later phase "builds the knowledge graph".
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 | Integrated = 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: integrated
125work is in at least two independent places within minutes, one offsite — the guarantee attaches to
126integrated work, not to in-flight branches
127([dcr-24d62f7](../.the-valley/decisions/dcr-24d62f7-publication-mirror-not-review-queue.md));
128restore from the offsite copy within a day — and no copy counts until a restore from it has been
129_performed and verified_.
130
131**Migration strategy: mirror-first, then cut over.** Mirrors are declared config, not a manual
132dual-push: the host declaration's per-project `mirrors` field replicates main and the tags out to
133each mirror URL on every push to the primary — deletions propagated, best-effort, a dead mirror
134never rejects the primary push. A mirror publishes what has been integrated, so topic branches
135awaiting review stay on the primary. GitHub stays declared as one such mirror while confidence
136builds; the canonical `origin` flips per-repo once it's earned. The same field is the
137public-exposure mechanism later — migration dual-push and publishing are one mechanism. Reversible
138at every step; supports iteration.
139
140**Pilot: the-valley itself.** the-valley's own repo is the first off GitHub — dogfooding, low
141stakes, and every later phase is developed against it. Later repos roll out after the pilot proves
142the workflow.
143
144**The design claim it validates.** Self-hosted bare git on the operator's existing infrastructure is
145durable and ergonomic enough to be the canonical home for real work — the premise
146([requirements.md](./requirements.md)) that hosting lock-in is the only thing GitHub does well, and
147it's swappable.
148
149**Exit criteria.** The rung owns them:
150[S1's acceptance checklist](./user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them)
151— canonical origin flipped; every integrated change verifiably in two independent places; one
152restore performed and verified; a week of real human _and_ agent work without GitHub, including an
153agent change landing end to end in direct-push mode; a real issue worked and closed as an in-repo
154node; a repeatable migration-plus-restore runbook.
155
156**Links.** [architecture.md](./architecture.md) (_Hosting_, _Identity / access_ rows),
157[schema/valley.cue](../schema/valley.cue), [examples/host.cue](../examples/host.cue).
158
159**Open questions.** One remains from this phase: Phase-0 identity being Tailscale-ACL-based (thin,
160swappable) — see [Open questions](#open-questions). The replication mechanism was the other and is
161decided above.
162
163---
164
165## Phase 1 — The event log (the spine)
166
167**Rung: [S2](./user-scenarios.md#the-ladder), first of three phases.** No rung demands a bus for its
168own sake; this phase exists because everything S2 needs — attested checks, an integrator — runs on
169events, and the projection claim is worth isolating (rule 3: if it's awkward here, everything
170downstream inherits the problem).
171
172**Goal.** Make git a source of events. Nothing reacts yet — this phase only proves the events are
173real and legible.
174
175**What gets built.** NATS JetStream on the valley host. A `post-receive` hook projecting ref updates
176into bus events: `ref-updated` now, `attestation-published` / `integration-requested` later (per
177[contribute.md](./contribute.md)). A dumb `valley tail` inspector to watch events scroll by. That's
178it. No subscriber acts on anything.
179
180**The design claim it validates.** git-as-event-source — that ref updates project cleanly onto a
181log, and that a log is the right substrate ("a log, not a workflow engine" —
182[architecture.md](./architecture.md)).
183
184**A note on durability.** The bus is the source of truth only for _ephemeral cross-system events_.
185Per-repo events (refs, attestations, integration requests) are durable in git itself; the bus is a
186projection that can be rebuilt. This is the resolution of the old "the log is a single point of
187failure" question ([openquestions.md](./openquestions.md), _Resolved_).
188
189**Exit criteria.**
190
191- A push to the valley host produces a `ref-updated` event visible in `valley tail` within seconds.
192- Rebuilding the stream from scratch (replay the repo's refs) reproduces the same events — the
193 projection is deterministic.
194
195**Validated 2026-07-17**, live on the pilot host: a branch push produced its `ref-updated` on the
196bus within a second, the payload's object id matching the pushed commit; two full replays of the
197pilot repo's refs produced identical event sets. Known limits carried as bug nodes:
198[bd-d853d9c](../.the-valley/bugs/bd-d853d9c-bus-unauthenticated.md) (authorization gates any acting
199consumer or wider listener) and [bd-500adf7](../.the-valley/bugs/bd-500adf7-bus-shares-git-user.md)
200(service user isolation before network reachability).
201
202**Links.** [architecture.md](./architecture.md) (_a log, not a workflow engine_),
203[contribute.md](./contribute.md).
204
205---
206
207## Phase 2 — Attestations (verification MVP)
208
209**Rung: [S2](./user-scenarios.md#the-ladder), second of three.** The rung's hardest demand — checks
210run where the work was written, trustworthy enough to integrate against — enters here as ergonomics;
211the adversarial half of "trustworthy" is [Phase 6](#phase-6--trust-backstop)'s.
212
213**Goal.** Replace "wait for CI" with "signed local check" for real day-to-day work.
214
215**What gets built.** A `nix run .#attest` helper that: runs the repo's canonical checks (Nix
216derivations, in the reference implementation); composes one statement per check
217([contribute.md](./contribute.md) / [verification.md](./verification.md)), recording _what check
218ran, on what tree, with what result_; signs each statement's text as a note with the host's key;
219stores each at a ref keyed by the subject digest and the signer,
220`refs/the-valley/attestations/<tree digest>/<signer key hash>`
221([dcr-0de694f](../.the-valley/decisions/dcr-0de694f-phase2-attestation-shape.md)); pushes atomically
222([contribute.md](./contribute.md)). Purity is a claim tied to a runner kind — the `nix` runner
223claims it strongly — not a property the schema assumes.
224
225Checks-as-derivations is the reference implementation, not the contract. The attestation schema must
226stay implementable by other runner kinds, so a non-Nix runner is an added backend later, never a
227migration.
228
229**Deferred to [Phase 6](#phase-6--trust-backstop):** the Tessera tlog and witness re-derivation.
230Phase 2 is _just local signed attestations_ — the ergonomics of the protocol, without the trust
231backstop. This is the right cut: the protocol has to feel good before the security layer is worth
232building on top of it.
233
234**The design claim it validates.** The contributor protocol's ergonomics — that a signed local check
235is a pleasant, fast substitute for a CI gate, produced by native git plus one helper
236([contribute.md](./contribute.md)).
237
238**Exit criteria.**
239
240- Real changes to the-valley land with an attestation ref alongside every commit.
241- The push is one atomic native-git command; no wrapper.
242- The user prefers this to CI for the pilot repo — the ergonomic claim holds in practice, not just
243 in theory.
244
245**Links.** [contribute.md](./contribute.md), [verification.md](./verification.md).
246
247---
248
249## Phase 3 — The integrator
250
251**Rung: [S2](./user-scenarios.md#the-ladder) — established at this gate.** Push, and seconds later
252it's integrated; the operator never waits for CI, even solo.
253
254**Goal.** Stop writing `main` by hand. Route every change through a request-and-react flow, even
255solo.
256
257**What gets built.** Two things:
258
259- **The structural invariant.** The one-line `pre-receive` hook: only the integrator key writes
260 `refs/heads/<protected>`; attestation refs are create-only; everything else is open
261 ([contribute.md](./contribute.md), _The one invariant_; [architecture.md](./architecture.md), _The
262 one structural git invariant_).
263- **The integrator controller.** Pull-based, subscribing to `integration-requested`. Verifies
264 signature + attestation + (for now, self-) trust, does FF/rebase into `main`, emits outcome events
265 ([architecture.md](./architecture.md), _a pull-based integrator_). Merge-queue semantics fall out
266 for free. The required attestation set is a function of the diff, not of the contributor's claim
267 about it: policy maps path classes to required checks — code takes the full suite, knowledge-only
268 changes (`.the-valley/**`) take the knowledge lint, mixed commits take the max of everything
269 touched. The signature is not policy: it is required of every change by the structural invariant
270 and the integrator, whatever paths the diff touches
271 ([dcr-f41f718](../.the-valley/decisions/dcr-f41f718-declared-verification-policy.md)). That is
272 also what keeps knowledge-node changes cheap through the same protected path: one invariant,
273 proportionate checks.
274
275The integrator is designed around **change objects** — a diff targeting a stream, with identity
276stable across rebases — rather than branches, per the adopted direction in
277[ida-93e4f91](../.the-valley/ideas/ida-93e4f91-changes-not-branches.md).
278
279This is where the user **stops pushing directly to `main`** and goes through the request flow, even
280as the only contributor. That's the whole point — the flow has to be tolerable at N=1 before it's
281asked to hold at N>1.
282
283**The design claim it validates.** The controller pattern and the core integration claim — that a
284pull-based integrator is a better shape than a `pre-receive` gate, and that staleness is the right
285unified failure mode ([architecture.md](./architecture.md)).
286
287**Exit criteria.**
288
289- Direct pushes to `refs/heads/main` are rejected by the hook; only the integrator key succeeds.
290- A change lands via `integration-requested` → `integration-succeeded` with no manual ref write.
291- A stale case (rebase would change the tree) surfaces as one `request-stale` event, not a rejection
292 or a retry storm.
293
294**Links.** [architecture.md](./architecture.md) (_a pull-based integrator_, _The one structural git
295invariant_).
296
297**New open questions.** Integrator self-integration — the integrator is code in a repo; how does
298_its_ changes get integrated? Already tracked in [openquestions.md](./openquestions.md) (_Identity &
299trust bootstrapping_). Phase 3 is where the chicken-and-egg becomes concrete.
300
301---
302
303## Phase 4 — Agents as first-class authors
304
305**Rung: [S3](./user-scenarios.md#the-ladder) — established here; its attribution claim is hardened
306by [Phase 6](#phase-6--trust-backstop).**
307
308**Goal.** An agent's change lands with the same guarantees as the operator's, attributed to the
309agent run that made it, with no human babysitting the pipeline.
310
311This phase cannot begin until [Phase 2](#phase-2--attestations-verification-mvp) and
312[Phase 3](#phase-3--the-integrator) are complete and the event bus is authenticated
313([bd-d853d9c](../.the-valley/bugs/bd-d853d9c-bus-unauthenticated.md), which gates any automated
314consumer acting on an event). Dispatch tooling asks a hosted forge four questions: whether checks
315passed, whether there are conflicts, whether anyone has reviewed, and whether a change can land.
316Checks are answered by attestations, conflicts and review by the integrator, and whether a change
317can land by whatever reacts on the bus. Until all three exist, this phase has nothing to move onto.
318
319**What gets built.** Deliberately thin — the integration flow is unchanged from Phase 3, and that's
320the point:
321
322- **Attribution through provenance.** An agent run holds no key of its own
323 ([ida-a8243d2](../.the-valley/ideas/ida-a8243d2-agent-runs-act-under-delegated-authority.md)). An
324 agent-authored change is attributed inside the host-signed attestation, as part of the provenance
325 that statement carries: the harness, the model, digests of the prompt and of the context, and the
326 delegation chain as recorded
327 ([ida-45178f6](../.the-valley/ideas/ida-45178f6-agent-identity-is-provenance.md)). Attribution
328 lives in the log, not in a platform sidecar; the landed record distinguishes the agent's work from
329 the operator's.
330- **Dispatch against the graph.** klaus dispatch targets an outcome node, not a GitHub issue, and
331 agents read and write knowledge nodes as part of the work — S3's knowledge increment. The
332 convention is already live in [.the-valley/](../.the-valley/README.md); this phase makes it the
333 pipeline's shape instead of a habit.
334
335This phase retires S1's interim mode — agents pushing a branch for the operator to review and merge
336by hand
337([user-scenarios.md § S1](./user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them)).
338Feeling that mode's pain was this phase's motivation, by design.
339
340**The design claim it validates.** The pipeline holds with no human in it: a non-human author lands
341with the same guarantees, and attribution is recorded, not inferred. What this phase deliberately
342does not claim: that attribution can't be forged — attribution rests on the host's signature over
343the statement carrying it, and is only as strong as that key's custody until the tlog lands
344([Phase 6](#phase-6--trust-backstop)). For one operator and their own agents, that is the honest
345cut.
346
347**Exit criteria.**
348
349- A klaus-dispatched change lands via `integration-requested` → `integration-succeeded` with no
350 human action between dispatch and landing.
351- The landed record names the agent run as the change's author, from the provenance recorded in the
352 attestation covering it rather than inferred from commit metadata, and that record is
353 distinguishable from one for a change the operator made.
354- The dispatch's target is an outcome node in the repo, and the work reads and writes knowledge
355 nodes end to end.
356
357**Links.** [architecture.md](./architecture.md) (_Identity / access_ row),
358[scenarios.md #2](./scenarios.md) (klaus-style agent change),
359[user-scenarios.md](./user-scenarios.md).
360
361---
362
363## Phase 5 — Effectful reactions (armstrong-as-controller)
364
365**Rung: [S4](./user-scenarios.md#the-ladder) — established here**, including its knowledge
366increment: knowledge changes become observable events, and a landed change can close the outcome it
367serves.
368
369**Goal.** Prove the causality chain end to end: a commit becomes a build becomes a deploy becomes a
370notification, all as reactions on the log.
371
372**What gets built.** armstrong subscribes to `integration-succeeded` → `nix build` the artifact
373derivation → deploy / notify ([scenarios.md #1](./scenarios.md)). This is the controller-shaped
374successor to the current Actions-based armstrong — the same tool, inverted from push-based pipeline
375to reactive subscriber. Alongside it, the knowledge graph joins the causal record: node changes
376surface on the bus like any ref update, and a landing can flip the outcome node it serves to done —
377the graph stops being write-only.
378
379**The design claim it validates.** Reactive controllers replace push-based CI/CD, and the causality
380chain (commit → build → deploy → notify) is _one queryable history_ rather than seven disconnected
381job UIs ([architecture.md](./architecture.md), _Components_ and _a log, not a workflow engine_).
382
383**Exit criteria.**
384
385- An integration into `main` triggers a build and a deploy with no workflow file — only a
386 subscriber.
387- The full chain for a given commit is reconstructable from the log alone.
388- A landed change closes the outcome node it serves, and that closure is visible in the log like any
389 other event.
390
391**Links.** [architecture.md](./architecture.md) (_Components_),
392[scenarios.md #1 and #6](./scenarios.md).
393
394---
395
396## Phase 6 — Trust backstop
397
398**Rungs: [S3](./user-scenarios.md#the-ladder) hardened, [S5](./user-scenarios.md#the-ladder)
399enabled.** Attribution gains non-repudiation — "can't be waved through or forged" now holds
400adversarially — and trust becomes grantable, bounded, and revocable, which is what lets a second
401human land a change without anything platform-shaped. S5 counts as established when a real
402collaborator lands a real change through this machinery.
403
404**Goal.** Make attestations trustworthy under adversarial or multi-party conditions, not just
405convenient.
406
407**What gets built.**
408
409- **Transparency log.** Tessera-backed tlog publication of attestations via tesseract, with
410 inclusion proofs appended as a sidecar ([contribute.md](./contribute.md)).
411- **Witness re-derivation.** A re-verifier that re-derives any attestation whose runner kind claims
412 purity and emits confirm/deny events.
413- **Trust controller.** Scores per signer from confirm rates, with revocation
414 ([architecture.md](./architecture.md), _attestation with revocation_).
415
416Together these enable the untrusted-contributor and agent-identity scenarios that Phase 2's
417local-only attestations can't.
418
419**The design claim it validates.** The security model — roughly SLSA Level 3 for purity-claiming
420checks, plus non-repudiation from the tlog ([verification.md](./verification.md), _The mechanism
421stack_). Purity is the runner kind's claim, carried in the attestation schema — the `nix` runner is
422the reference implementation of a strong claim, and the model degrades honestly for runners that
423claim less.
424
425**Exit criteria.**
426
427- Every attestation lands in the tlog with a verifiable inclusion proof.
428- A deliberately-wrong purity-claiming attestation is caught by the witness and lowers the signer's
429 trust score.
430- An untrusted signer's change integrates _only_ via the trust flow
431 ([scenarios.md #4](./scenarios.md)), never by default.
432
433**Links.** [verification.md](./verification.md), [contribute.md](./contribute.md),
434[scenarios.md #2 and #4](./scenarios.md).
435
436---
437
438## Phase 7 — Feedback & incident memory
439
440**Rung: [S6](./user-scenarios.md#the-ladder) — established here.** It also completes S4's feedback
441story: who needs to know about which event, without a firehose.
442
443**Goal.** Unbundle review — the last GitHub-shaped interaction — from the vendor UI, and make
444incidents part of the project's durable memory.
445
446**What gets built.**
447
448- **Threads.** Derived views over events, scoped to a change or chain
449 ([architecture.md](./architecture.md), _review is observability + feedback_). PR-as-thread — the
450 "PR" becomes a named query, not a stored object.
451- **Priority/attention router.** The routing subsystem that decides who needs to know about which
452 event ([architecture.md](./architecture.md), same section).
453- **Incident memory.** S6's knowledge increment: an incident files its own node, attributing the
454 regression to the change that caused it — with the attribution carrying its uncertainty honestly,
455 because a confidently wrong answer is worse than none — and linking the revert. The war story
456 becomes a queryable record.
457
458There is no "build the knowledge graph" item here: the graph arrived one increment per rung — plain
459files ([Phase 0](#phase-0--mvp-repos-off-github)), agent-written
460([Phase 4](#phase-4--agents-as-first-class-authors)), observable
461([Phase 5](#phase-5--effectful-reactions-armstrong-as-controller)), incident-filing (here) — exactly
462as the ladder grows it.
463
464**The design claim it validates.** Observability + project-knowledge unbundling — that review is a
465special case of feedback, incidents are a special case of knowledge, and both belong to one history
466rather than scattered across issues, wikis, and heads ([architecture.md](./architecture.md),
467_Observability & feedback_, _Project knowledge_ rows).
468
469**Exit criteria.**
470
471- A change accrues discussion, an approval, and an outcome as one chronology with no PR object
472 anywhere.
473- The router surfaces one genuinely high-priority event to a human without a firehose.
474- A bad deploy — real or gamedayed — ends as an incident node with attribution, stated uncertainty,
475 and a link to the revert.
476
477**Links.** [architecture.md](./architecture.md) (_review is observability + feedback_, _project
478knowledge is a typed-node graph_), [scenarios.md #3 and #4](./scenarios.md).
479
480**New open questions.** None new here — but note the _priority-layer architecture_ question
481([openquestions.md](./openquestions.md), _Attention, routing, and threads_) is the hardest new
482bottleneck the whole design creates, and Phase 7 is where it stops being hypothetical.
483
484---
485
486## Cross-cutting threads
487
488Some things aren't a phase; they run through all of them.
489
490- **CUE schemas.** One schema language across the system. Event schemas are shared across producers
491 and consumers, reused from armstrong — minimal in Phase 1, growing a field or a type each phase.
492 Host config already speaks it ([schema/valley.cue](../schema/valley.cue), shipped in Phase 0);
493 knowledge-node frontmatter and verification policy are candidates to follow. Schema evolution is a
494 standing concern, not a phase — tracked in [openquestions.md](./openquestions.md) (_Storage,
495 retention, and evolution_).
496- **The `valley` CLI.** A thin tool that accretes one verb per phase — `valley migrate` (0),
497 `valley tail` (1), `valley attest` or the `nix run .#attest` helper (2), `valley browse` (7). It
498 stays thin on purpose: the contributor protocol is native-git-first
499 ([contribute.md](./contribute.md)), so the CLI is convenience, never the critical path. Anything
500 `valley` does, plain git and `nix` can do.
501- **Durability as a standing priority.** Phase 0 makes it explicit, but it never stops mattering.
502 The durable substrate is git objects + attestation refs + the tlog — all replicable, all
503 externally witnessable. The bus is the one replaceable component: lose it and rebuild it from git.
504 Every phase should preserve that property — if a phase makes the bus load-bearing for durable
505 state, that's a design smell to catch.
506- **Portability as a standing constraint.** Nix is a backend, not the substrate: portable schemas
507 from day 0, portable implementations on demand. Every schema this plan ships — host config,
508 events, attestations, knowledge nodes — must be implementable without Nix; the NixOS module and
509 checks-as-derivations are reference implementations, never the contract. The review heuristic: a
510 field only Nix can produce is a leak.
511
512## Open questions
513
514This document originally raised two; one is now decided, one remains open:
515
516- **Offsite replication mechanism — decided**
517 ([dcr-d7952bc](../.the-valley/decisions/dcr-d7952bc-phase0-replication-github-transitional.md)).
518 Push-triggered git-native mirroring to an independent live remote (integrated = replicated) —
519 during migration that remote is GitHub, with the dedicated sovereign live remote deferred until
520 GitHub exit — plus periodic encrypted restic-style backup for offsite depth; block-level
521 replication (ZFS send) rejected for now. Details in [Phase 0](#phase-0--mvp-repos-off-github).
522- **Phase-0 identity is Tailscale-ACL-based** (_Identity & trust bootstrapping_). Thin by design and
523 swappable; the open question is _when_ it has to grow and into what — likely driven by
524 [Phase 6](#phase-6--trust-backstop). _Origin: roadmap.md._
525
526Everything else this roadmap touches is already tracked in [openquestions.md](./openquestions.md) —
527integrator self-integration, the priority-layer architecture, attestation expiry vs. cache
528retention, agent identity, and schema evolution all surface at specific phases above.