| 1 | # the-valley |
| 2 | |
| 3 | > "Whatever." |
| 4 | |
| 5 | A space to rethink developer workflow and source management from scratch. |
| 6 | |
| 7 | This is not a project to "move off GitHub." That framing is too narrow. The question is: **what would source management look like if designed today**, with AI agents as first-class authors, Nix as a substrate, and no assumption that a single platform should own hosting, identity, CI, artifacts, review, and automation? |
| 8 | |
| 9 | ## Constraints |
| 10 | |
| 11 | - **Open source.** |
| 12 | - **Minimal.** Prefer composing small tools over building a platform. |
| 13 | - **Nix-native.** Builds, verification, and artifacts are derivations. |
| 14 | - **Decentralized where possible.** Accept centralization only where ordering or coordination genuinely require it, and be explicit about it. |
| 15 | |
| 16 | ## What GitHub does, broken out |
| 17 | |
| 18 | GitHub bundles seven things. Most of them it does poorly enough that unbundling looks attractive: |
| 19 | |
| 20 | | Concern | Current state | Direction | |
| 21 | | ------------------- | ------------------------------ | ------------------------------------------------------ | |
| 22 | | Hosting | Works fine, lock-in is the cost | Bare git over SSH on a Tailscale-reachable box | |
| 23 | | Identity / access | Works fine | Tailscale ACLs + SSH keys | |
| 24 | | Verification | Slow, YAML-shaped | `nix flake check` triggered by events | |
| 25 | | Artifacts | Opaque, ephemeral | Nix derivations, content-addressed, pushed to a cache | |
| 26 | | Automation | Actions: push-based, brittle | Reactive controllers subscribing to an event log | |
| 27 | | Integration / merge | Branch protection in vendor UI | Pull-based integrator controllers reacting to integration-requested events | |
| 28 | | Observability & feedback | PR-shaped, conflates four concerns | Continuous feedback as events; threads as derived views; priority/routing as a first-class subsystem | |
| 29 | | Project knowledge | Scattered: issues, wikis, docs, scratch files, agent histories, heads | Unified typed-node graph in markdown — bugs, principles, decisions, ideas, threads — equally navigable by humans and agents | |
| 30 | | Discussion | Bundled with issues | Threads are themselves nodes in the knowledge graph; scope to any change, chain, node, or topic | |
| 31 | |
| 32 | ## Shape of the system |
| 33 | |
| 34 | ``` |
| 35 | bare git (Tailscale) ──┐ ┌──► nix build (pure reactions) |
| 36 | build outputs ───┤ │ |
| 37 | agent runs (klaus) ───┼──► event bus ──► subscribers ──► armstrong (effectful reactions) |
| 38 | deploy state ───┤ (NATS JS) │ |
| 39 | external signals ──┘ └──► integrator (per-repo integration) |
| 40 | |
| 41 | attestations published to a Tessera-backed transparency log on every push |
| 42 | ``` |
| 43 | |
| 44 | - **Hosting**: bare git over SSH. Each repo is just a directory. `cgit` or similar for browsing if needed. |
| 45 | - **Bus**: NATS JetStream. Single binary, persistent streams, runs on the same Tailscale box. Carries cross-system events — events whose source isn't a single repo (deploys, metrics, agent runs) and projections of per-repo git events (ref updates, attestations, integration requests) for cross-cutting subscribers. Replicate later if needed. |
| 46 | - **Transparency log**: Tessera-backed tlog. Every published attestation lands here with an inclusion proof. Independently witnessable; gives non-repudiation and external auditability without depending on any one host. |
| 47 | - **Pure reactions**: Nix derivations. Inputs are events (refs, flake locks), outputs are content-addressed artifacts. Replayable from the log. |
| 48 | - **Effectful reactions**: [armstrong](https://github.com/gunk-dev/armstrong) as a Go controller. Subscribes to events and emits side-effects: deploys, notifications, agent dispatches, integrator dispatches. The controller-shaped successor to the current Actions-based armstrong. |
| 49 | - **Schemas**: CUE, already used by armstrong. Shared across event producers and consumers. |
| 50 | |
| 51 | ## Why a log, not a workflow engine |
| 52 | |
| 53 | GitHub Actions, GitLab CI, Jenkins — all push-based pipelines. An event happens, a workflow runs, it exits, the trail is a log file. |
| 54 | |
| 55 | A reactive log inverts this: |
| 56 | |
| 57 | - **Causality is preserved.** The chain of "commit → build → deploy → notification" is one queryable history, not seven disconnected job UIs. |
| 58 | - **Reactions are independent.** Adding a new subscriber doesn't touch any other subscriber or any workflow file. |
| 59 | - **Replay is free.** Want to know what would have happened if a reaction had been different? Replay the log against a new subscriber. |
| 60 | - **No central workflow file.** Each subscriber owns its own logic and lifecycle. |
| 61 | |
| 62 | Prior art: Atomist (defunct, but had this model). Kubernetes controllers. Datomic / event sourcing generally. `git` itself — commits are events, refs are views. |
| 63 | |
| 64 | ## Open questions |
| 65 | |
| 66 | Consolidated across the design docs in [`design/openquestions.md`](./design/openquestions.md). Themes: identity & trust bootstrapping, policy & configuration, cross-repo coordination, attention/routing/threads, storage/retention/evolution, knowledge graph specifics, verification specifics, workflow patterns, discovery. |
| 67 | |
| 68 | ## Roadmap |
| 69 | |
| 70 | [`design/roadmap.md`](./design/roadmap.md) is the plan-of-record: an MVP-first, incremental sequence that validates the design one claim at a time. Each phase is independently valuable, independently stoppable, and validates exactly one thing — sequenced by validation gate, not by date. Phase 0 is durable self-hosting (repos off GitHub); everything else is built against it. Heavy iteration on the later phases is expected and is a feature. |
| 71 | |
| 72 | ## Design notes |
| 73 | |
| 74 | Longer thinking on specific subproblems lives in [`design/`](./design): |
| 75 | |
| 76 | - [`contribute.md`](./design/contribute.md) — the tight contributor protocol: signed commit, local hermetic checks, signed attestation, tlog publication, atomic push of branch + attestation + integration request. |
| 77 | - [`verification.md`](./design/verification.md) — replacing CI-as-gate with local attestations and async re-verification. |
| 78 | - [`integration.md`](./design/integration.md) — pull-based integrator controllers in place of branch-protection gates; merge-queue semantics for free. |
| 79 | - [`integrator-internals.md`](./design/integrator-internals.md) — the integrator's loop: attestation-invariance under trivial rebase, staleness as the unified failure mode, policy as a derived query over active principles, strict FIFO per protected ref, crash recovery. |
| 80 | - [`feedback.md`](./design/feedback.md) — reframing review as continuous observability and feedback; threads as derived views; attention routing as a first-class subsystem. |
| 81 | - [`knowledge.md`](./design/knowledge.md) — typed-node graph in markdown for everything that isn't code or user docs: bugs, principles, decisions, ideas, threads. Frontmatter is the structured layer; body is freeform. Composes with attestations, integration, and threads. |
| 82 | - [`scenarios.md`](./design/scenarios.md) — end-to-end walk-throughs (solo dev, agent change, post-deploy regression, untrusted contributor, cross-repo, scheduled task) and what each tests or stresses. |
| 83 | - [`openquestions.md`](./design/openquestions.md) — consolidated open questions across all docs, grouped by theme with origin pointers. |
| 84 | - [`roadmap.md`](./design/roadmap.md) — the incremental validation plan: MVP-first phases, each gated on checkable exit criteria, each validating one design claim. |
| 85 | |
| 86 | ## Status |
| 87 | |
| 88 | Sketch. Nothing built yet. This document is the design space; the plan-of-record for building it — incremental, MVP-first, validation-gated — is [`design/roadmap.md`](./design/roadmap.md). |