gunk-dev/the-valley

roadmap.md

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