gunk-dev/the-valley

README.md

source7d68f2d207ddmain's published tip history
6.7 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 / tasks | Bolted on, opaque to agents | Git-native structured data, beads-shaped, equally usable by humans and agents |
30| Discussion | Bundled with issues | Subsumed into feedback; threads can scope to any change, chain, issue, 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
53GitHub Actions, GitLab CI, Jenkins — all push-based pipelines. An event happens, a workflow runs, it exits, the trail is a log file.
54
55A 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
62Prior 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
661. **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.
672. **Discovery.** Without GitHub-the-social-graph, how do humans find each other's repos? Probably out of scope, but worth naming.
683. **The log is a single point of failure.** Accepted for now. Replication is cheap when it's needed.
694. **Schema evolution.** CUE handles validation, but event schemas will change. Migration story?
70
71## Design notes
72
73Longer thinking on specific subproblems lives in [`design/`](./design):
74
75- [`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.
76- [`verification.md`](./design/verification.md) — replacing CI-as-gate with local attestations and async re-verification.
77- [`integration.md`](./design/integration.md) — pull-based integrator controllers in place of branch-protection gates; merge-queue semantics for free.
78- [`integrator-internals.md`](./design/integrator-internals.md) — *placeholder.* How the integration automation does its job: queue mechanics, conflict resolution, optional agentic fallback.
79- [`feedback.md`](./design/feedback.md) — reframing review as continuous observability and feedback; threads as derived views; attention routing as a first-class subsystem.
80- [`issues.md`](./design/issues.md) — *placeholder.* A minimal, git-native, human-and-agent-friendly issue tracker; beads-shaped data model without the Dolt dependency.
81- [`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.
82
83## Status
84
85Sketch. Nothing built yet. This document is the design space, not a plan.