gunk-dev/the-valley

roadmap.md

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