gunk-dev/the-valley

README.md

source0c2f74bd1350main's published tip history
5.3 KiB · Rendered
1# the-valley
2
3> 谷神不死,是謂玄牝。玄牝之門,是謂天地根。
4> *The valley spirit never dies. It is called the mysterious female. The gateway of the mysterious female is the root of heaven and earth.*
5> — Tao Te Ching, ch. 6
6
7A space to rethink developer workflow and source management from scratch.
8
9This 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?
10
11## Constraints
12
13- **Open source.**
14- **Minimal.** Prefer composing small tools over building a platform.
15- **Nix-native.** Builds, verification, and artifacts are derivations.
16- **Decentralized where possible.** Accept centralization only where ordering or coordination genuinely require it, and be explicit about it.
17
18## What GitHub does, broken out
19
20GitHub bundles seven things. Most of them it does poorly enough that unbundling looks attractive:
21
22| Concern | Current state | Direction |
23| ------------------- | ------------------------------ | ------------------------------------------------------ |
24| Hosting | Works fine, lock-in is the cost | Bare git over SSH on a Tailscale-reachable box |
25| Identity / access | Works fine | Tailscale ACLs + SSH keys |
26| Verification | Slow, YAML-shaped | `nix flake check` triggered by events |
27| Artifacts | Opaque, ephemeral | Nix derivations, content-addressed, pushed to a cache |
28| Automation | Actions: push-based, brittle | Reactive controllers subscribing to an event log |
29| Observability & feedback | PR-shaped, conflates four concerns | Continuous feedback as events; threads as derived views; priority/routing as a first-class subsystem |
30| Issues / discussion | Bolted on | Subsumed into feedback; threads can scope to any change, chain, or topic |
31
32## Shape of the system
33
34```
35 bare git (Tailscale) ──┐
36 build outputs ───┤
37 agent runs (klaus) ───┼──► event log ──► subscribers
38 deploy state ───┤ (NATS JS) │
39 external signals ──┘ ├──► nix build (pure reactions)
40 └──► armstrong (effectful reactions)
41```
42
43- **Hosting**: bare git over SSH. Each repo is just a directory. `cgit` or similar for browsing if needed.
44- **Bus**: NATS JetStream. Single binary, persistent streams, runs on the same Tailscale box. This is the one piece of unavoidable centralization — append-only ordering needs an authority. Replicate later if the box becomes a constraint.
45- **Pure reactions**: Nix derivations. Inputs are events (refs, flake locks), outputs are content-addressed artifacts. Replayable from the log.
46- **Effectful reactions**: [armstrong](https://github.com/gunk-dev/armstrong) as a Go controller. Subscribes to events and emits side-effects: deploys, notifications, agent dispatches, review-state changes. This is the controller-shaped successor to the current Actions-based armstrong.
47- **Schemas**: CUE, already used by armstrong. Shared across event producers and consumers.
48
49## Why a log, not a workflow engine
50
51GitHub Actions, GitLab CI, Jenkins — all push-based pipelines. An event happens, a workflow runs, it exits, the trail is a log file.
52
53A reactive log inverts this:
54
55- **Causality is preserved.** The chain of "commit → build → deploy → notification" is one queryable history, not seven disconnected job UIs.
56- **Reactions are independent.** Adding a new subscriber doesn't touch any other subscriber or any workflow file.
57- **Replay is free.** Want to know what would have happened if a reaction had been different? Replay the log against a new subscriber.
58- **No central workflow file.** Each subscriber owns its own logic and lifecycle.
59
60Prior art: Atomist (defunct, but had this model). Kubernetes controllers. Datomic / event sourcing generally. `git` itself — commits are events, refs are views.
61
62## Open questions
63
641. **Attention routing.** Once feedback is continuous and event-shaped, the hardest job becomes deciding what reaches a human and when. The priority layer is load-bearing in a way no piece of GitHub is today.
652. **Discovery.** Without GitHub-the-social-graph, how do humans find each other's repos? Probably out of scope, but worth naming.
663. **The log is a single point of failure.** Accepted for now. Replication is cheap when it's needed.
674. **Schema evolution.** CUE handles validation, but event schemas will change. Migration story?
68
69## Design notes
70
71Longer thinking on specific subproblems lives in [`design/`](./design):
72
73- [`verification.md`](./design/verification.md) — replacing CI-as-gate with local attestations and async re-verification.
74- [`feedback.md`](./design/feedback.md) — reframing review as continuous observability and feedback; threads as derived views; attention routing as a first-class subsystem.
75
76## Status
77
78Sketch. Nothing built yet. This document is the design space, not a plan.