gunk-dev/the-valley

README.md

sourced8fb1811f533main's published tip history
5.3 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| 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| Issues / discussion | Bolted on | Subsumed into feedback; threads can scope to any change, chain, or topic |
30
31## Shape of the system
32
33```
34 bare git (Tailscale) ──┐
35 build outputs ───┤
36 agent runs (klaus) ───┼──► event log ──► subscribers
37 deploy state ───┤ (NATS JS) │
38 external signals ──┘ ├──► nix build (pure reactions)
39 └──► armstrong (effectful reactions)
40```
41
42- **Hosting**: bare git over SSH. Each repo is just a directory. `cgit` or similar for browsing if needed.
43- **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.
44- **Pure reactions**: Nix derivations. Inputs are events (refs, flake locks), outputs are content-addressed artifacts. Replayable from the log.
45- **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.
46- **Schemas**: CUE, already used by armstrong. Shared across event producers and consumers.
47
48## Why a log, not a workflow engine
49
50GitHub Actions, GitLab CI, Jenkins — all push-based pipelines. An event happens, a workflow runs, it exits, the trail is a log file.
51
52A reactive log inverts this:
53
54- **Causality is preserved.** The chain of "commit → build → deploy → notification" is one queryable history, not seven disconnected job UIs.
55- **Reactions are independent.** Adding a new subscriber doesn't touch any other subscriber or any workflow file.
56- **Replay is free.** Want to know what would have happened if a reaction had been different? Replay the log against a new subscriber.
57- **No central workflow file.** Each subscriber owns its own logic and lifecycle.
58
59Prior art: Atomist (defunct, but had this model). Kubernetes controllers. Datomic / event sourcing generally. `git` itself — commits are events, refs are views.
60
61## Open questions
62
631. **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.
642. **Discovery.** Without GitHub-the-social-graph, how do humans find each other's repos? Probably out of scope, but worth naming.
653. **The log is a single point of failure.** Accepted for now. Replication is cheap when it's needed.
664. **Schema evolution.** CUE handles validation, but event schemas will change. Migration story?
67
68## Design notes
69
70Longer thinking on specific subproblems lives in [`design/`](./design):
71
72- [`verification.md`](./design/verification.md) — replacing CI-as-gate with local attestations and async re-verification.
73- [`integration.md`](./design/integration.md) — pull-based integrator controllers in place of branch-protection gates; merge-queue semantics for free.
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.