feat: extract reforge engine into a standalone consumable flake

The forgejo-sandbox / reforge harness, lifted out of the machine config
into a host-agnostic, generic engine anyone can consume with Nix.

Two layers:
- engine (this repo) — nixosModules.reforge stands up the sandbox forge,
  provisions role accounts + tokens, enforces branch protection, and puts
  the reforge-* CLI + forgejo-mcp on PATH. Carries no project specifics.
- run config — per-project manifest/charter/agenda/issues an adopter fills
  in; scaffold one with the `reforge` flake template.

Portability fixes vs the in-config version:
- forgejo-mcp resolved from $REFORGE_MCP_BIN or PATH, never a named host
  (kills the nixosConfigurations.omni hardcode).
- all instance data + paths parameterized via REFORGE_* env, baked into the
  reforge-scripts wrappers from module options (configDir, agentsDir,
  refsDir, org, port, tokenOwner, ...).
- option namespace neutral (reforge.* not omni.packs.*); settings policies
  carry no absolute /etc/nixos paths.
- role briefs + orchestrator playbook genericized: all project specifics
  point at the charter; refs corpus optional.

Validated: nix flake check (eval) + builds of forgejo-mcp, reforge-scripts,
and a module-eval check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-07-18 22:50:49 +02:00
commit df0fd9a9ba
32 changed files with 2698 additions and 0 deletions

View file

@ -0,0 +1,33 @@
# A reforge run
This directory is one reforge run's configuration. Edit the four data files,
wire the module into a NixOS host, and drive the run. See the engine's
`docs/reforge.md` for the full concept and lifecycle.
## The four files you edit
| File | What it is |
|---|---|
| `manifest.txt` | The repo set: pinned bases (`fork`) + placeholders (`original`), and each repo's declared target for the acceptance diff. |
| `charter.md` | The standard every change is judged against. Seeded as `charter/README.md`; reviews cite it. |
| `agenda.md` | What this run must address, in item-id'd groups. |
| `issues.tsv` | The agenda as `repo\|title\|body` rows — filed as issues by `reforge-kickoff`. Keep in sync with `agenda.md`. |
## Wire it up
1. Edit `flake.nix`: set `tokenOwner`, point `reforge.url` at the engine.
2. Add the module to your NixOS host: `imports = [ inputs.myreforge.nixosModules.default ];`
3. `nixos-rebuild switch` — you now have the sandbox forge on
`http://localhost:3030`, provisioned role accounts, and the `reforge-*`
CLI on PATH.
## Drive a run
```bash
reforge-smoke # verify the toolchain + gates after a (re)build
reforge-seed # create repos from the manifest, seed the charter
reforge-kickoff # file the agenda as issues
reforge-role security-lead # one terminal per role …
# or let one agent drive the whole thing:
reforge-orchestrator # then: "Drive Phase A to completion."
```