gunk-dev/the-valley

README.md

source8d7f770ab82amain's published tip history
5.0 KiB · Rendered
1# the-valley
2
3> "Whatever."
4
5A space to rethink developer workflow and source management from scratch.
6
7This 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
18GitHub 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| Observability & feedback | PR-shaped, conflates four concerns | Continuous feedback as events; threads as derived views; priority/routing as a first-class subsystem |
28| Issues / discussion | Bolted on | Subsumed into feedback; threads can scope to any change, chain, or topic |
29
30## Shape of the system
31
32```
33 bare git (Tailscale) ──┐
34 build outputs ───┤
35 agent runs (klaus) ───┼──► event log ──► subscribers
36 deploy state ───┤ (NATS JS) │
37 external signals ──┘ ├──► nix build (pure reactions)
38 └──► armstrong (effectful reactions)
39```
40
41- **Hosting**: bare git over SSH. Each repo is just a directory. `cgit` or similar for browsing if needed.
42- **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.
43- **Pure reactions**: Nix derivations. Inputs are events (refs, flake locks), outputs are content-addressed artifacts. Replayable from the log.
44- **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.
45- **Schemas**: CUE, already used by armstrong. Shared across event producers and consumers.
46
47## Why a log, not a workflow engine
48
49GitHub Actions, GitLab CI, Jenkins — all push-based pipelines. An event happens, a workflow runs, it exits, the trail is a log file.
50
51A reactive log inverts this:
52
53- **Causality is preserved.** The chain of "commit → build → deploy → notification" is one queryable history, not seven disconnected job UIs.
54- **Reactions are independent.** Adding a new subscriber doesn't touch any other subscriber or any workflow file.
55- **Replay is free.** Want to know what would have happened if a reaction had been different? Replay the log against a new subscriber.
56- **No central workflow file.** Each subscriber owns its own logic and lifecycle.
57
58Prior art: Atomist (defunct, but had this model). Kubernetes controllers. Datomic / event sourcing generally. `git` itself — commits are events, refs are views.
59
60## Open questions
61
621. **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.
632. **Discovery.** Without GitHub-the-social-graph, how do humans find each other's repos? Probably out of scope, but worth naming.
643. **The log is a single point of failure.** Accepted for now. Replication is cheap when it's needed.
654. **Schema evolution.** CUE handles validation, but event schemas will change. Migration story?
66
67## Design notes
68
69Longer thinking on specific subproblems lives in [`design/`](./design):
70
71- [`verification.md`](./design/verification.md) — replacing CI-as-gate with local attestations and async re-verification.
72- [`feedback.md`](./design/feedback.md) — reframing review as continuous observability and feedback; threads as derived views; attention routing as a first-class subsystem.
73
74## Status
75
76Sketch. Nothing built yet. This document is the design space, not a plan.