Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Move root notes, images, and the desktop launch script into docs/

justrach1e47309108fa
diff --git a/README.md b/README.md
index 0b11d1c7..45899090 100644
--- a/README.md
+++ b/README.md
@@ -306,7 +306,7 @@ On the 3-task spine (exact-reply + file-ops + fix-fib) graff was **19.9s /
Same model, same endpoint, the older Rust codegraff used **4.3×** the memory
and **~14×** the disk for a dead-heat turn. Method:
-[architecture.md](architecture.md).
+[docs/architecture.md](docs/architecture.md).
</details>
@@ -436,9 +436,9 @@ The repository is organized as follows:
| `src/`, `TUI/` | harness + terminal |
| `apps/` | desktop (Electron) and iOS |
| `graff-evals/` | live, in-house, FrontierHarness |
-| `docs/` | ADRs, images, install, embedding |
+| `docs/` | ADRs, architecture, images, install, embedding |
| `sdk/` | generated TypeScript / Python |
-| `scripts/` | tier-1/2, PTY probes, release |
+| `scripts/` | tier-1/2, PTY probes, release, desktop launch |
Desktop code lives in `apps/native`; evaluation tooling lives in `graff-evals`.
@@ -459,7 +459,7 @@ Docs-only pushes skip it. In-house PR fixtures: `graff-evals/`
Build on Apple Silicon macOS 14+ with Bun, Zig, and Xcode command-line tools:
```sh
-./script/build_and_run.sh
+./scripts/build_and_run.sh
```
The development bundle starts its own local server and uses local development
@@ -492,4 +492,4 @@ licence is perpetual unless they breach it. Commercial permission without
copyleft exists only if **both authors grant it jointly in writing**, and is
revocable.
-<p align="center"><sub>Built in Zig 0.17 dev · <a href="LICENSE">AGPL-3.0 (modified)</a> · <a href="architecture.md">architecture.md</a> · <a href="CHANGELOG.md">CHANGELOG</a> · <a href="uxlog.md">uxlog.md</a></sub></p>
+<p align="center"><sub>Built in Zig 0.17 dev · <a href="LICENSE">AGPL-3.0 (modified)</a> · <a href="docs/architecture.md">architecture</a> · <a href="CHANGELOG.md">CHANGELOG</a> · <a href="docs/uxlog.md">uxlog</a></sub></p>
diff --git a/apps/native/README.md b/apps/native/README.md
index d9b71e5b..3d49fb5f 100644
--- a/apps/native/README.md
+++ b/apps/native/README.md
@@ -300,7 +300,7 @@ than that flag refuses localhost.
so the result is on screen without a click.
The design and what is deliberately left out are in
-`plans/2026-09-03-browser-sidecar.md`. The sidebar footer names the tab's graff
+`docs/proposals/2026-09-03-browser-sidecar.md`. The sidebar footer names the tab's graff
session (`native-…`, the `--resume` target); clicking it copies the
command that continues the same conversation in a terminal.
diff --git a/apps/native/electron/README.md b/apps/native/electron/README.md
index 49279432..e12b3925 100644
--- a/apps/native/electron/README.md
+++ b/apps/native/electron/README.md
@@ -1,6 +1,6 @@
# Electron desktop trial
-Run `./script/build_and_run.sh` from the repository root, or use the Codex Run
+Run `./scripts/build_and_run.sh` from the repository root, or use the Codex Run
action. It builds the production UI with Bun, packages Chromium, Bun, graff,
and the SwiftUI Activity sheet, then opens `zig-out/electron/Codegraff.app`.
Builds currently target Apple Silicon macOS 14+; Liquid Glass uses macOS 26+.
diff --git a/docs/adr/dev-desktop-identity.md b/docs/adr/dev-desktop-identity.md
index e0873319..25976b26 100644
--- a/docs/adr/dev-desktop-identity.md
+++ b/docs/adr/dev-desktop-identity.md
@@ -14,7 +14,7 @@ of opening a development desktop, preventing side-by-side testing.
`zig-out/electron-dev/Codegraff Dev.app`, bundle ID `dev.codegraff.app`.
A bundled development marker selects the name `Codegraff Dev` and a separate
Electron user-data directory before acquiring the single-instance lock.
-`script/build_and_run.sh` builds and launches this variant by default and only
+`scripts/build_and_run.sh` builds and launches this variant by default and only
stops this checkout's previous dev process. The release build remains unchanged.
Development startup does not automatically configure external MCP clients, and
diff --git a/architecture.md b/docs/architecture.md
similarity index 99%
rename from architecture.md
rename to docs/architecture.md
index ab419629..8f68f7ef 100644
--- a/architecture.md
+++ b/docs/architecture.md
@@ -1,8 +1,8 @@
# Architecture
-`simple-harness` is a terminal agentic loop built with Zig 0.17 dev and one
-vendored TUI dependency. It talks to
-two LLM providers, runs tools (including subagents and MCP servers) in
+Codegraff is a coding agent built with Zig 0.17. The terminal pager is
+first-party (`TUI/`); the desktop app is `apps/native`. The harness talks to
+LLM providers, runs tools (including subagents and MCP servers) in
parallel, and compacts its own context. This document explains how the
pieces fit together.
@@ -475,7 +475,7 @@ automatic semantic verification, and fleet-wide behavioral consumption remain
deferred.
The pre-existing append-only `Trajectory` DGM ledger and its record shapes remain
unchanged. See
-[`docs/behavioral-trajectories.md`](docs/behavioral-trajectories.md).
+[`behavioral-trajectories.md`](behavioral-trajectories.md).
## Local learning engine
@@ -519,7 +519,7 @@ appends a new transaction rather than deleting history. `fleet.zig`
marks the verified learned agent as local activation authority so later remote
elite merges cannot replace that name. Full schemas, operational guidance,
privacy implications, and the unimplemented collective-learning design are in
-[`docs/local-learning.md`](docs/local-learning.md).
+[`local-learning.md`](local-learning.md).
## Compaction
diff --git a/TODO.md b/docs/archive/v0.0.193-handoff.md
similarity index 100%
rename from TODO.md
rename to docs/archive/v0.0.193-handoff.md
diff --git a/codegraff.png b/docs/images/codegraff.png
similarity index 100%
rename from codegraff.png
rename to docs/images/codegraff.png
diff --git a/comparison.png b/docs/images/comparison.png
similarity index 100%
rename from comparison.png
rename to docs/images/comparison.png
diff --git a/token-efficient-loop.png b/docs/images/token-efficient-loop.png
similarity index 100%
rename from token-efficient-loop.png
rename to docs/images/token-efficient-loop.png
diff --git a/docs/memory-architecture.md b/docs/memory-architecture.md
index d3fae57b..5bc6cfa3 100644
--- a/docs/memory-architecture.md
+++ b/docs/memory-architecture.md
@@ -4,7 +4,7 @@ A design for pulling memory **into graff's core** as a pluggable, evolvable
layer — rather than leaving it scattered across history/compaction/sessions or
bolted on as an external MCP. Companion to
[hyperagents.md](hyperagents.md) (the DGM/MAP-Elites evolution loop) and
-[architecture.md](../architecture.md) (the harness internals + perf budgets).
+[architecture.md](architecture.md) (the harness internals + perf budgets).
Framing borrowed from **ALMA** (Automated meta-Learning of Memory designs for
Agentic systems, [arXiv:2602.07755](https://arxiv.org/abs/2602.07755)): the
diff --git a/plans/2026-06-15-gui-port-review-handoff.md b/docs/proposals/2026-06-15-gui-port-review-handoff.md
similarity index 100%
rename from plans/2026-06-15-gui-port-review-handoff.md
rename to docs/proposals/2026-06-15-gui-port-review-handoff.md
diff --git a/plans/2026-09-03-browser-sidecar.md b/docs/proposals/2026-09-03-browser-sidecar.md
similarity index 100%
rename from plans/2026-09-03-browser-sidecar.md
rename to docs/proposals/2026-09-03-browser-sidecar.md
diff --git a/Agentic_Operating_System.md b/docs/proposals/Agentic_Operating_System.md
similarity index 100%
rename from Agentic_Operating_System.md
rename to docs/proposals/Agentic_Operating_System.md
diff --git a/graff-dgm.md b/docs/proposals/graff-dgm.md
similarity index 100%
rename from graff-dgm.md
rename to docs/proposals/graff-dgm.md
diff --git a/phase2-escalation.md b/docs/proposals/phase2-escalation.md
similarity index 100%
rename from phase2-escalation.md
rename to docs/proposals/phase2-escalation.md
diff --git a/vision.md b/docs/proposals/vision.md
similarity index 100%
rename from vision.md
rename to docs/proposals/vision.md
diff --git a/uxlog.md b/docs/uxlog.md
similarity index 100%
rename from uxlog.md
rename to docs/uxlog.md
diff --git a/script/build_and_run.sh b/scripts/build_and_run.sh
similarity index 100%
rename from script/build_and_run.sh
rename to scripts/build_and_run.sh
diff --git a/socials/release-post/linkedin.md b/social/release-post/linkedin.md
similarity index 100%
rename from socials/release-post/linkedin.md
rename to social/release-post/linkedin.md
diff --git a/socials/release-post/linkedin2.md b/social/release-post/linkedin2.md
similarity index 100%
rename from socials/release-post/linkedin2.md
rename to social/release-post/linkedin2.md
diff --git a/socials/release-post/live-evals-295.md b/social/release-post/live-evals-295.md
similarity index 100%
rename from socials/release-post/live-evals-295.md
rename to social/release-post/live-evals-295.md
diff --git a/socials/release-post/twitter.md b/social/release-post/twitter.md
similarity index 96%
rename from socials/release-post/twitter.md
rename to social/release-post/twitter.md
index 58f63ec6..1dbce669 100644
--- a/socials/release-post/twitter.md
+++ b/social/release-post/twitter.md
@@ -1,6 +1,6 @@
# graff launch thread (coworker framing)
-A nine-post X thread mirroring the LinkedIn launch: Graff as a continual learning coding coworker. Same story beats as socials/release-post/linkedin2.md, cut for X.
+A nine-post X thread mirroring the LinkedIn launch: Graff as a continual learning coding coworker. Same story beats as social/release-post/linkedin2.md, cut for X.
Every tweet is 280 characters or fewer. Tweet 1 has no link. Tweet copy contains no em dashes or backticks.
@@ -112,7 +112,7 @@ Optional extras if you want denser media: Tweet 5 can use /social/graff-launch-0
## Source verification map
-- Binary and memory methodology: architecture.md and benchmarks/README.md
+- Binary and memory methodology: docs/architecture.md and benchmarks/README.md
- ultracode multi-agent mode: src/mainloop.zig, README.md
- Evolutionary / lineage archive: README.md (An evolutionary harness), src/trace.zig
- Local promotion semantics: src/fleet.zig (promoteAgents) and src/commands_session.zig (/agents promote)
diff --git a/src/agent_eval.zig b/src/agent_eval.zig
index 1b497386..adfbc266 100644
--- a/src/agent_eval.zig
+++ b/src/agent_eval.zig
@@ -259,7 +259,7 @@ pub fn runEval(self: *Agent, note: []const u8) !ExecResult {
}
if (telemetry.g_telem) |t| {
const run_id: []const u8 = &scoring.g_run_id;
- // Genome-send (graff-dgm.md §B): the eval genome is this agent's own
+ // Genome-send (docs/proposals/graff-dgm.md §B): the eval genome is this agent's own
// persona, never spawned via runSub, so its prompt_text never reached
// the worker. A cell only promotes when harness_scores joins to a
// harness_genomes row, so ride the genome text over on a `propose`