gunk-dev/the-valley

roadmap.md

source52a8862e7857main's published tip history
30.0 KiB · Plain text
Contents

Roadmap #

The other design docs describe the design space. This is the plan. It exists to incrementally validate the design — not to commit to it. It sits downstream of the scenario ladder: the ladder says what must become true for a user, and in what order; this document says what gets built to make each rung true, and how each claim gets checked. Where phases and rungs disagree, the rungs win.

The shape of the plan #

The design is a stack of claims: git-as-event-source, signed-local-checks-instead-of-CI, pull-based integration, reactive controllers, transparency-backed trust, a knowledge graph. Each is falsifiable. The roadmap turns each into a phase you can actually run and check.

Four rules govern every phase:

  1. Independently valuable. The phase ships something worth having even if the next phase never happens. Phase 0 is durable self-hosting; you'd want that regardless of whether attestations ever exist.
  2. Independently stoppable. You can stop after any phase and be left with a coherent system, not a half-wired one.
  3. Validates exactly one distinct claim. A phase that validates two claims can't tell you which one broke.
  4. Serves a rung. Every phase names the rung(s) of the ladder it builds toward; a phase no rung demands has no business on this page. One rung may take several phases — each still validates its own claim, and the rung is established at the last of their gates.

Heavy iteration on the later phases is expected, and that's a feature, not a risk. The point of validating Phase 1 before building Phase 3 is that Phase 3 gets designed against a spine that has actually run. This is a living document, re-derived against the ladder as rungs and reality move. It will be wrong in places, and the plan is structured so that being wrong is cheap. The ladder's own discipline applies here too: a phase serving a far rung stays thin until that rung is the top priority.

Sequencing is by validation gate, not calendar date. There are no time estimates here on purpose. Each phase is done when its exit criteria are checkable and checked — "validated when …", not "shipped by …".

Phases at a glance #

PhaseShipsRungValidatesGate
0Repos off GitHub, durably; knowledge v0S1Self-hosting is durable enough to trustVerified restore + a week off GitHub for the pilot
1The event logS2 (1 of 3)git-as-event-source; "a log, not a workflow engine"valley tail shows real ref updates as events
2Signed local attestationsS2 (2 of 3)The contributor protocol's ergonomicsnix run .#attest replaces "wait for CI" for real work
3The integratorS2 establishedPull-based integration; staleness-as-failure-modeYou stop pushing to main directly, even solo
4Agents as first-class authorsS3 establishedThe pipeline holds with no human in itA dispatched change lands unsupervised, attributed in the attestation
5Effectful reactionsS4 establishedReactive controllers replace push-based CI/CDcommit→build→deploy→notify is one queryable history
6Trust backstopS3 hardened; S5 enabledThe security model (~SLSA-3 for purity-claiming checks)An untrusted-signer change lands only via the trust flow
7Feedback & incident memoryS6 establishedReview is feedback; incidents are memoryAn incident files its own node; review happens with no PR object

S7 (strangers) has no phase, deliberately: it is explicitly deferred, maybe never — the trust model should degrade toward it gracefully, not build for it. Requirements need 7 (Demand-shaped work, requirements.md) is likewise phase-less, deliberately: phases serve rungs (rule 4), and need 7 derives from the README's outcome-engine framing rather than a rung — though Phase 4 (dispatch targets an outcome node) and Phase 5 (a landed change closes the outcome it serves) partially serve it.

The named systems, all pilot instances: klaus (agent dispatch, run budget), armstrong (the Go controller that becomes the effectful-reactions successor), tesseract (transparency-dev/tesseract, the Tessera-backed tlog), cosmo (the operator's NixOS infra — the consumer that installs this repo's host module), and classic-laddie (the pilot host: a box on the operator's tailnet, already running the klaus webhook relay; it hosts every server-side phase below first). Hostnames are pilot detail, not design: the durable content of this plan is portable, and what any host serves is declared in the host schema this repo ships (schema/valley.cue).


Phase 0 — MVP: repos off GitHub #

This is the priority. Everything downstream is developed against it.

Rung: S1 — my repos live on my infrastructure and I can never lose them. The rung's acceptance checklist is this phase's gate.

Goal. Get the crown-jewel git data off GitHub and onto infrastructure you control, durably enough that you'd trust it with the only copy — before there's ever only one copy.

What gets built — and what already is. Hosting only. Bare git over SSH on a host the operator controls (the pilot host: classic-laddie). The first artifacts are shipped: a CUE host schema (schema/valley.cue) declaring what a valley host serves — projects, each with a git store and push mirrors — and a valley-host NixOS module (flake.nix) that installs a host from that declaration; cosmo consumes the module for the pilot host (in flight). The schema is the domain model and is deliberately not Nix: the NixOS module is one installer consuming it, and any other installer can consume the same file. Identity is Tailscale ACLs + SSH keys (architecture.md's Hosting and Identity / access rows, nothing more). No bus, no attestations, no integrator. The contributor — one solo dev — pushes directly to main. cgit or similar for browsing if wanted. The integrator and the protected-ref invariant arrive in Phase 3; pushing straight to main now is correct, not a shortcut.

The Tailscale identity layer is deliberately thin — thin enough to swap later, so it is an acceptable v1 choice, not a lock-in. When identity needs to grow (untrusted contributors, agent keys), it grows in Phase 6.

Knowledge v0 ships in this phase. S1's knowledge increment: issues, outcomes, ideas, and decisions live with the repo as plain markdown files — a directory convention, not a system. No indexer, no events; the convention is checked, not enforced — nix flake check runs the knowledge lint, and nothing stops a broken graph from landing until there's an integrator. Instantiated at .the-valley/. The graph grows one increment per rung from here — agents write it (Phase 4), it becomes observable (Phase 5), incidents file into it (Phase 7) — so no later phase "builds the knowledge graph".

Durability is part of the MVP, not an afterthought. The git data is the crown jewel; losing it is the one unrecoverable failure. The target is 3-2-1: primary bare repos on the valley host, replicated offsite, with GitHub retained as a transitional mirror during migration — three copies early on. The mechanism is decided (dcr-d7952bc — it was this document's open question): push-triggered git-native mirroring to an independent live remote, which during migration is GitHub itself, plus periodic encrypted backup to offsite storage for point-in-time depth. The bar this must clear — how fast, in how many places, and what counts as a verified copy — is S1's durability scope decision.

Migration strategy: mirror-first, then cut over. Mirrors are declared config, not a manual dual-push: the host declaration's per-project mirrors field replicates main and the tags out to each mirror URL on every push to the primary and every landing the integrator makes — deletions propagated, best-effort, a dead mirror never rejects the primary push or fails a landing. A mirror publishes what has been integrated, so topic branches awaiting review stay on the primary. GitHub stays declared as one such mirror while confidence builds; the canonical origin flips per-repo once it's earned. The same field is the public-exposure mechanism later — migration dual-push and publishing are one mechanism. Reversible at every step; supports iteration.

Pilot: the-valley itself. the-valley's own repo is the first off GitHub — dogfooding, low stakes, and every later phase is developed against it. Later repos roll out after the pilot proves the workflow.

The design claim it validates. Self-hosted bare git on the operator's existing infrastructure is durable and ergonomic enough to be the canonical home for real work — the premise (requirements.md) that hosting lock-in is the only thing GitHub does well, and it's swappable.

Exit criteria. The rung owns them: this phase is done when every box in S1's acceptance checklist is checked.

Links. architecture.md (Hosting, Identity / access rows), schema/valley.cue, examples/host.cue.

Open questions. One remains from this phase: Phase-0 identity being Tailscale-ACL-based (thin, swappable) — see Open questions. The replication mechanism was the other and is decided above.


Phase 1 — The event log (the spine) #

Rung: S2, first of three phases. No rung demands a bus for its own sake; this phase exists because everything S2 needs — attested checks, an integrator — runs on events, and the projection claim is worth isolating (rule 3: if it's awkward here, everything downstream inherits the problem).

Goal. Make git a source of events. Nothing reacts yet — this phase only proves the events are real and legible.

What gets built. NATS JetStream on the valley host. A post-receive hook projecting ref updates into bus events: ref-updated now, attestation-published / integration-requested later (per contribute.md). A dumb valley tail inspector to watch events scroll by. That's it. No subscriber acts on anything.

The design claim it validates. git-as-event-source — that ref updates project cleanly onto a log, and that a log is the right substrate ("a log, not a workflow engine" — architecture.md).

A note on durability. The bus is a rebuildable projection; only ephemeral cross-system events have it as their source of truth (architecture.md).

Exit criteria.

  • A push to the valley host produces a ref-updated event visible in valley tail within seconds.
  • Rebuilding the stream from scratch (replay the repo's refs) reproduces the same events — the projection is deterministic.

Validated 2026-07-17, live on the pilot host: a branch push produced its ref-updated on the bus within a second, the payload's object id matching the pushed commit; two full replays of the pilot repo's refs produced identical event sets. Known limits carried as bug nodes: bd-d853d9c (authorization gates any acting consumer or wider listener) and bd-500adf7 (service user isolation before network reachability).

Links. architecture.md (a log, not a workflow engine), contribute.md.


Phase 2 — Attestations (verification MVP) #

Rung: S2, second of three. The rung's hardest demand — checks run where the work was written, trustworthy enough to integrate against — enters here as ergonomics; the adversarial half of "trustworthy" is Phase 6's.

Goal. Replace "wait for CI" with "signed local check" for real day-to-day work.

What gets built. A nix run .#attest helper that: runs the repo's canonical checks (Nix derivations, in the reference implementation); composes one statement per check (contribute.md / verification.md), recording what check ran, on what tree, with what result; signs each statement's text as a note with the host's key; stores each at a ref keyed by the subject digest and the signer, refs/the-valley/attestations/<tree digest>/<signer key hash> (dcr-0de694f); pushes atomically (contribute.md). Purity is a claim tied to a runner kind — the nix runner claims it strongly — not a property the schema assumes.

Checks-as-derivations is the reference implementation, not the contract. The attestation schema must stay implementable by other runner kinds, so a non-Nix runner is an added backend later, never a migration.

Deferred to Phase 6: the Tessera tlog and witness re-derivation. Phase 2 is just local signed attestations — the ergonomics of the protocol, without the trust backstop. This is the right cut: the protocol has to feel good before the security layer is worth building on top of it.

The design claim it validates. The contributor protocol's ergonomics — that a signed local check is a pleasant, fast substitute for a CI gate, produced by native git plus one helper (contribute.md).

Exit criteria.

  • Real changes to the-valley land with an attestation ref alongside every commit.
  • The push is one atomic native-git command; no wrapper.
  • The user prefers this to CI for the pilot repo — the ergonomic claim holds in practice, not just in theory.

Links. contribute.md, verification.md.


Phase 3 — The integrator #

Rung: S2 — established at this gate. Push, and seconds later it's integrated; the operator never waits for CI, even solo.

Goal. Stop writing main by hand. Route every change through a request-and-react flow, even solo.

What gets built. Two things:

  • The structural invariant. The pre-receive hook: only a declared writer writes refs/heads/<protected>; attestation refs are create-only; integration requests take the request grant; topic branches are open and every other namespace is closed (contribute.md, The one invariant; architecture.md, The one structural git invariant).
  • The integrator controller. Pull-based, subscribing to integration-requested. Verifies signature + attestation + (for now, self-) trust, does FF/rebase into main, emits outcome events (architecture.md, a pull-based integrator). Merge-queue semantics fall out for free. The required attestation set is derived from the paths the diff actually touches, per the declared verification policy (dcr-f41f718) — which is what keeps knowledge-node changes cheap through the same protected path: one invariant, proportionate checks.

The integrator is designed around change objects — a diff targeting a stream, with identity stable across rebases — rather than branches, per the adopted direction in ida-93e4f91.

This is where the user stops pushing directly to main and goes through the request flow, even as the only contributor. That's the whole point — the flow has to be tolerable at N=1 before it's asked to hold at N>1.

The design claim it validates. The controller pattern and the core integration claim — that a pull-based integrator is a better shape than a pre-receive gate, and that staleness is the right unified failure mode (architecture.md).

Exit criteria.

  • Direct pushes to refs/heads/main are rejected by the hook; only the integrator key succeeds.
  • A change lands via integration-requested → integration-succeeded with no manual ref write.
  • A stale case (rebase would change the tree) surfaces as one request-stale event, not a rejection or a retry storm.

Links. architecture.md (a pull-based integrator, The one structural git invariant).

New open questions. Integrator self-integration — the integrator is code in a repo; how does its changes get integrated? Already tracked in openquestions.md (Identity & trust bootstrapping). Phase 3 is where the chicken-and-egg becomes concrete.


Phase 4 — Agents as first-class authors #

Rung: S3 — established here; its attribution claim is hardened by Phase 6.

Goal. An agent's change lands with the same guarantees as the operator's, attributed to the agent run that made it, with no human babysitting the pipeline.

This phase cannot begin until Phase 2 and Phase 3 are complete and the event bus is authenticated (bd-d853d9c, which gates any automated consumer acting on an event). Dispatch tooling asks a hosted forge four questions: whether checks passed, whether there are conflicts, whether anyone has reviewed, and whether a change can land. Checks are answered by attestations, conflicts and review by the integrator, and whether a change can land by whatever reacts on the bus. Until all three exist, this phase has nothing to move onto.

What gets built. Deliberately thin — the integration flow is unchanged from Phase 3, and that's the point:

  • Attribution through provenance. An agent run holds no key of its own (ida-a8243d2). An agent-authored change is attributed inside the host-signed attestation, as part of the provenance that statement carries: the harness, the model, digests of the prompt and of the context, and the delegation chain as recorded (ida-45178f6). Attribution lives in the log, not in a platform sidecar; the landed record distinguishes the agent's work from the operator's.
  • Dispatch against the graph. klaus dispatch targets an outcome node, not a GitHub issue, and agents read and write knowledge nodes as part of the work — S3's knowledge increment. The convention is already live in .the-valley/; this phase makes it the pipeline's shape instead of a habit.

This phase retires S1's interim mode — agents pushing a branch for the operator to review and merge by hand (user-scenarios.md § S1). Feeling that mode's pain was this phase's motivation, by design.

The design claim it validates. The pipeline holds with no human in it: a non-human author lands with the same guarantees, and attribution is recorded, not inferred. What this phase deliberately does not claim: that attribution can't be forged — attribution rests on the host's signature over the statement carrying it, and is only as strong as that key's custody until the tlog lands (Phase 6). For one operator and their own agents, that is the honest cut.

Exit criteria.

  • A klaus-dispatched change lands via integration-requested → integration-succeeded with no human action between dispatch and landing.
  • The landed record names the agent run as the change's author, from the provenance recorded in the attestation covering it rather than inferred from commit metadata, and that record is distinguishable from one for a change the operator made.
  • The dispatch's target is an outcome node in the repo, and the work reads and writes knowledge nodes end to end.

Links. architecture.md (Identity / access row), user-scenarios.md.


Phase 5 — Effectful reactions (armstrong-as-controller) #

Rung: S4 — established here, including its knowledge increment: knowledge changes become observable events, and a landed change can close the outcome it serves.

Goal. Prove the causality chain end to end: a commit becomes a build becomes a deploy becomes a notification, all as reactions on the log.

What gets built. armstrong subscribes to integration-succeeded → nix build the artifact derivation → deploy / notify. This is the controller-shaped successor to the current Actions-based armstrong — the same tool, inverted from push-based pipeline to reactive subscriber. Alongside it, the knowledge graph joins the causal record: node changes surface on the bus like any ref update, and a landing can flip the outcome node it serves to done — the graph stops being write-only.

The design claim it validates. Reactive controllers replace push-based CI/CD, and the causality chain (commit → build → deploy → notify) is one queryable history rather than seven disconnected job UIs (architecture.md, Components and a log, not a workflow engine).

Exit criteria.

  • An integration into main triggers a build and a deploy with no workflow file — only a subscriber.
  • The full chain for a given commit is reconstructable from the log alone.
  • A landed change closes the outcome node it serves, and that closure is visible in the log like any other event.

Links. architecture.md (Components).


Phase 6 — Trust backstop #

Rungs: S3 hardened, S5 enabled. Attribution gains non-repudiation — "can't be waved through or forged" now holds adversarially — and trust becomes grantable, bounded, and revocable, which is what lets a second human land a change without anything platform-shaped. S5 counts as established when a real collaborator lands a real change through this machinery.

Goal. Make attestations trustworthy under adversarial or multi-party conditions, not just convenient.

What gets built.

  • Transparency log. Tessera-backed tlog publication of attestations via tesseract, with inclusion proofs appended as a sidecar (contribute.md).
  • Witness re-derivation. A re-verifier that re-derives any attestation whose runner kind claims purity and emits confirm/deny events.
  • Trust controller. Scores per signer from confirm rates, with revocation (architecture.md, attestation with revocation).

Together these enable the untrusted-contributor and agent-identity scenarios that Phase 2's local-only attestations can't.

The design claim it validates. The security model — roughly SLSA Level 3 for purity-claiming checks, plus non-repudiation from the tlog (verification.md, The mechanism stack). Purity is the runner kind's claim, carried in the attestation schema — the nix runner is the reference implementation of a strong claim, and the model degrades honestly for runners that claim less.

Exit criteria.

  • Every attestation lands in the tlog with a verifiable inclusion proof.
  • A deliberately-wrong purity-claiming attestation is caught by the witness and lowers the signer's trust score.
  • An untrusted signer's change integrates only via the trust flow, never by default.

Links. verification.md, contribute.md.


Phase 7 — Feedback & incident memory #

Rung: S6 — established here. It also completes S4's feedback story: who needs to know about which event, without a firehose.

Goal. Unbundle review — the last GitHub-shaped interaction — from the vendor UI, and make incidents part of the project's durable memory.

What gets built.

  • Threads. Derived views over events, scoped to a change or chain (architecture.md, review is observability + feedback). PR-as-thread — the "PR" becomes a named query, not a stored object.
  • Priority/attention router. The routing subsystem that decides who needs to know about which event (architecture.md, same section).
  • Incident memory. S6's knowledge increment: an incident files its own node, attributing the regression to the change that caused it — with the attribution carrying its uncertainty honestly, because a confidently wrong answer is worse than none — and linking the revert. The war story becomes a queryable record.

There is no "build the knowledge graph" item here: the graph arrived one increment per rung — plain files (Phase 0), agent-written (Phase 4), observable (Phase 5), incident-filing (here) — exactly as the ladder grows it.

The design claim it validates. Observability + project-knowledge unbundling — that review is a special case of feedback, incidents are a special case of knowledge, and both belong to one history rather than scattered across issues, wikis, and heads (architecture.md, Observability & feedback, Project knowledge rows).

Exit criteria.

  • A change accrues discussion, an approval, and an outcome as one chronology with no PR object anywhere.
  • The router surfaces one genuinely high-priority event to a human without a firehose.
  • A bad deploy — real or gamedayed — ends as an incident node with attribution, stated uncertainty, and a link to the revert.

Links. architecture.md (review is observability + feedback, project knowledge is a typed-node graph).

New open questions. None new here — but note the priority-layer architecture question (openquestions.md, Attention, routing, and threads) is the hardest new bottleneck the whole design creates, and Phase 7 is where it stops being hypothetical.


Cross-cutting threads #

Some things aren't a phase; they run through all of them.

  • CUE schemas. One schema language across the system. Event schemas are shared across producers and consumers, reused from armstrong — minimal in Phase 1, growing a field or a type each phase. Host config already speaks it (schema/valley.cue, shipped in Phase 0); knowledge-node frontmatter and verification policy are candidates to follow. Schema evolution is a standing concern, not a phase — tracked in openquestions.md (Storage, retention, and evolution).
  • The valley CLI. A thin tool that accretes one verb per phase — valley migrate (0), valley tail (1), valley attest or the nix run .#attest helper (2), valley browse (7). It stays thin on purpose: the contributor protocol is native-git-first (contribute.md), so the CLI is convenience, never the critical path. Anything valley does, plain git and nix can do.
  • Durability as a standing priority. Phase 0 makes it explicit, but it never stops mattering. The durable substrate is git objects + attestation refs + the tlog — all replicable, all externally witnessable — while the bus stays a rebuildable projection (architecture.md). Every phase should preserve that property — if a phase makes the bus load-bearing for durable state, that's a design smell to catch.
  • Portability as a standing constraint. Nix is a backend, not the substrate: portable schemas from day 0, portable implementations on demand. Every schema this plan ships — host config, events, attestations, knowledge nodes — must be implementable without Nix; the NixOS module and checks-as-derivations are reference implementations, never the contract. The review heuristic: a field only Nix can produce is a leak.

Open questions #

This document originally raised two; one is now decided, one remains open:

  • Offsite replication mechanism — decided (dcr-d7952bc); see Phase 0.
  • Phase-0 identity is Tailscale-ACL-based (Identity & trust bootstrapping). Thin by design and swappable; the open question is when it has to grow and into what — likely driven by Phase 6. Origin: roadmap.md.

Everything else this roadmap touches is already tracked in openquestions.md — integrator self-integration, the priority-layer architecture, attestation expiry vs. cache retention, agent identity, and schema evolution all surface at specific phases above.