Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/scripts/assert-pure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ set -euo pipefail
# whose vocabulary dependency includes `anyhow` and `async-trait`.
pure_crates=("tinyhivemind-core" "tinyhivemind-lang")
tool_crates=("tinyhivemind-tools")
# Host and the process harness clients run harnesses as processes (ADR 0035),
# Host and the process harness clients (OpenHuman's and the ACP one) run
# harnesses as processes (ADR 0035),
# and the MCP server serves them hive tools over loopback (ADR 0036), so they may
# hold a runtime, a listener and an HTTP client, but none may link a harness.
host_crates=("tinyhivemind-host" "tinyhivemind-mcp" "tinyhivemind-openhuman-process")
host_crates=("tinyhivemind-host" "tinyhivemind-mcp" "tinyhivemind-openhuman-process" "tinyhivemind-acp")

forbidden_pure='tokio|futures|async-trait|axum|hyper|reqwest|ureq|curl|anyhow|rusqlite|git2|openhuman|tinyagents|tinytools'
# Whole families: `openhuman-embed`, `tinyagents-harness` and so on.
Expand Down
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ is not advisory — do not add an exception to it to land a change.

## Project Structure

This is a Rust 2024 virtual Cargo workspace with eight packages. Core owns all
This is a Rust 2024 virtual Cargo workspace with ten packages. Core owns all
host-neutral behavior; lang is where a hive mind is defined, integrations
included; tools renders native tool definitions and records calls; exec runs a
package's executable tools and hooks; host is the harness-neutral
Expand All @@ -79,6 +79,7 @@ crates/
├── tinyhivemind-mcp/ # hive and package tools served to harness processes over loopback MCP
├── tinyhivemind-openhuman/ # package deployment, seat runners, host integration
├── tinyhivemind-openhuman-process/ # OpenHuman seats as supervised processes
├── tinyhivemind-acp/ # seats on any Agent Client Protocol agent (Claude Code, Codex)
├── tinyhivemind-hives/ # durable cross-hive coordinator
└── tinyhivemind-lang/ # pure hive packages: structure, integrations, edits, lineage
wiki/ # GitHub wiki submodule
Expand All @@ -103,6 +104,9 @@ process. `tinyhivemind-exec` runs those executable tools and hooks
`tinyhivemind-openhuman-process` implements the host's harness port for the
`openhuman` kind over a pinned `openhuman-core` binary (`harnesses.lock`); it
links no harness either.
`tinyhivemind-acp` implements the same port once for every agent that speaks
the Agent Client Protocol over stdio; what differs between agents is an
`Agent` descriptor of data, and it links no harness either.
`tinyhivemind-host` depends on core, hives and lang, and owns what every harness
shares: the hive tools and their dispatch, the send and management policy ports,
turn scope and prompt, package loading, the deployment plan, and supervised
Expand Down
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "3"
# package, each directory named for the package it holds. There is no root
# package: the crate a host links is `crates/tinyhivemind-core`, the same as any
# other member. Keeping the root virtual is what makes that uniform.
members = ["crates/tinyhivemind-core", "crates/tinyhivemind-tools", "crates/tinyhivemind-openhuman", "crates/tinyhivemind-hives", "crates/tinyhivemind-lang", "crates/tinyhivemind-exec", "crates/tinyhivemind-host", "crates/tinyhivemind-mcp", "crates/tinyhivemind-openhuman-process"]
members = ["crates/tinyhivemind-core", "crates/tinyhivemind-tools", "crates/tinyhivemind-openhuman", "crates/tinyhivemind-hives", "crates/tinyhivemind-lang", "crates/tinyhivemind-exec", "crates/tinyhivemind-host", "crates/tinyhivemind-mcp", "crates/tinyhivemind-openhuman-process", "crates/tinyhivemind-acp"]
# `worktrees/` holds `git worktree` checkouts of this same repository; each
# contains a full copy of this manifest. Keep them excluded from Cargo
# workspace discovery.
Expand All @@ -31,6 +31,9 @@ tinyhivemind-exec = { path = "crates/tinyhivemind-exec" }
sha2 = "0.10"
# Harness-neutral tool belt, policies, package plans and process supervision.
tinyhivemind-host = { path = "crates/tinyhivemind-host" }
# Hive tools served to harness processes over loopback MCP. Only tests take
# it: the process runners link no server, and their hive tests start one.
tinyhivemind-mcp = { path = "crates/tinyhivemind-mcp" }
# The HTTP/1.1 server under `tinyhivemind-mcp`, which serves hive tools to
# harness processes over Streamable HTTP on loopback (ADR 0036). hyper 1 is a
# protocol implementation and no framework: no router, no TLS, no HTTP/2, no
Expand Down
47 changes: 47 additions & 0 deletions crates/tinyhivemind-acp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "tinyhivemind-acp"
description = "Hive seats on any Agent Client Protocol agent, each a supervised child process spoken to over stdio."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
readme = "README.md"
publish = false
# This crate links no harness (ADR 0035): it speaks the Agent Client Protocol
# over a supervised child's stdin and stdout, and what differs between agents
# is a descriptor of data. `.github/scripts/assert-pure.sh` asserts that no
# harness enters its graph.

[dependencies]
# The harness port, seat runner, verification and process supervision, whose
# JSON lines pipes carry the protocol.
tinyhivemind-host.workspace = true
# The coordinator's turn request and outcome.
tinyhivemind-hives.workspace = true
# The lowered seat and the harness kinds.
tinyhivemind-lang.workspace = true
# Protocol messages, read tolerantly: the usage fields agents send are still
# unstable in the protocol's own schema crate, so this crate does not take it.
serde_json.workspace = true
# The crate's error type.
thiserror.workspace = true
# The reader task, channels and deadlines.
tokio = { workspace = true, features = ["time", "sync", "macros", "rt"] }

[dev-dependencies]
# The hive tests: a real coordinator and hive tool server.
tinyhivemind-mcp.workspace = true
# The edit test's workspace for the host's edit tool.
tinyhivemind-exec.workspace = true
# The mixed hive test runs an OpenHuman seat beside the ACP ones.
tinyhivemind-openhuman-process = { path = "../tinyhivemind-openhuman-process" }
# Fallible tests over several error types.
anyhow.workspace = true
# Async tests and the scripted model's listener.
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "net", "io-util", "time", "sync", "process"] }
# Seat directories.
tempfile.workspace = true

[lints]
workspace = true
19 changes: 19 additions & 0 deletions crates/tinyhivemind-acp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# tinyhivemind-acp

Hive seats on any [Agent Client Protocol](https://agentclientprotocol.com)
agent, each a supervised child process spoken to over stdio. One client for
every agent: what differs between them is an `Agent` descriptor of data.
Claude Code and Codex are the two measured; see
[the ACP harness runs](../../docs/experiments/2026-11-26-acp-harnesses.md).
It links no agent ([ADR 0035](../../docs/adr/0035-a-harness-is-a-process.md)).

An agent's own tools stay off, as [the harness spec](../../docs/specs/harnesses.md)
requires for every kind. A seat that edits files does it through the host's
executable tools, which run in the seat's workspace under the host's access
gate; the live tests show all three harnesses editing that way and a
read-only seat refused.

| Path | Purpose |
| --- | --- |
| [`src/`](src/README.md) | The crate |
| [`tests/`](tests/README.md) | Live hive tests on the pinned agents |
12 changes: 12 additions & 0 deletions crates/tinyhivemind-acp/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Source

| Path | Purpose |
| --- | --- |
| `lib.rs` | Crate overview and public surface |
| [`agent/`](agent/README.md) | `Agent` descriptors, their templates, and the Codex model catalog |
| [`capability/`](capability/README.md) | The one model route a seat may take on an agent |
| [`connection/`](connection/README.md) | JSON-RPC over the supervised process's JSON lines |
| [`protocol/`](protocol/README.md) | The ACP messages a seat needs, built and read as JSON |
| [`seat/`](seat/README.md) | One seat: process, session, turns, cancel and stop |
| [`harness/`](harness/README.md) | `AcpHarness`, the host's harness port, and `Options` |
| [`error/`](error/README.md) | `Error` and how the port sees it |
8 changes: 8 additions & 0 deletions crates/tinyhivemind-acp/src/agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Agent

What differs between ACP agents, as data, with `{name}` templates filled per seat in one pass (a value is never expanded again), TOML-escaped in a `.toml` file. `write_codex_catalog` fails with a typed `CatalogError`.

| File | Purpose |
| --- | --- |
| `mod.rs` | `Agent`, `Agent::claude_code`, `Agent::codex`, `write_codex_catalog`, template values |
| `test.rs` | Templates, TOML escaping, the two descriptors and each catalog failure |
Loading
Loading