Hive Intelligence

Documentation

/ Reference

hive-author

0.9.0 docs, commit 05e2eb4PyPI packages at 0.9.0docs/reference/hive-author.mdpublic repository on GitHub

Deprecated. hive-author (vf-hive-author) is deprecated and planned for removal in a later release. It remains in the published engine group for existing consumers; new setups should omit it. The only supported write route is the Hive App connector: assistants file drafts, corrections and contributions through it, and reviewers approve them.

Starting hiveauthor emits a DeprecationWarning that says so, and the service otherwise behaves as before. The rest of this page is for existing consumers. The connector keeps the submit_memory_promotion and submit_correction tool names and arguments, but files Hive drafts instead of issues; filing through an assistant names the settings that legacy corrections need.

The write door. Package hiveauthor, CLI hiveauthor.

Its forge credential can open issues and nothing else. It cannot push, merge, or open a pull request.

Narrative version: corrections and memory.

Running

pip install vf-hive-author==<engine version>
hiveauthor

vf-hive-author is published from 0.7.0, so a deployment installs it from the index at the same version as the rest of the engine, the way it installs hive-serve, and runs the console script. Before that a deployment built it from a checkout of this repository, which is the git pin distributing the engine exists to retire, left standing in the one place the fix had not reached. The Dockerfile shipped under tooling/hive-author/deploy/ still does an editable install from the checkout, and stays that way until the deployment switches to the pin.

It serves on HOST:PORT (default 127.0.0.1:8000), exposes /healthz and /metrics, and mounts the MCP app at / - the streamable-HTTP endpoint an MCP client connects to is /mcp, and GET / 404s. It refuses to start unless the forge settings below are complete, because an unset FORGE_REPO builds /repos//issues and 404s every submission while reporting success.

Why it is a separate service

hive-serve is the component exposed to the widest audience, so it holds no credential that can change the corpus and writes no card; its own writes stop at each person's ledger rows, and its retrieval tool profile makes none. Concentrating the corpus write path here is what lets the read path stay keyless.

The consequence is worth stating plainly: there is no path by which an agent, or anyone using one, writes a card directly into the corpus. Every card was merged by a person.

Two tools

Tool Files Labelled
submit_memory_promotion a client-scoped memory card hive-memory
submit_correction a correction against a concept id hive-correction

They are hard-separated: separate builders, separate labels, separate validation. Memory promotion requires a client and refuses without one, because a memory card with no client is either a concept card or a mistake, and both deserve rejection rather than a guess.

What each tool declares. Both tools are labelled the way hive-serve's door labels its tools: a display title and the four MCP annotation hints, which a client uses to label the tool and to decide when to ask before calling. title is also repeated as annotations.title for clients of the 2025-03-26 protocol, which had no top-level title. For both tools readOnlyHint is false and openWorldHint true: each accepted call files an issue on the external forge, visible to anyone who can see the repository. Neither is destructive - the forge only ever gains an issue - and neither is idempotent: there is no dedup, so repeating a call files a duplicate issue. These are hints, not controls: nothing in the hints stops a call from filing.

The round trip

Issue bodies use a ### <section> layout that mirrors the corpus repository's issue forms exactly, so the same hive-gen parsers read a body whether it came from this service or from someone filling in the form by hand. One parser, one format, no drift.

From there an automation opens a pull request, but only after a code owner applies the approval label. The corpus changes when a person merges.

Modules

Module Purpose
submissions.py pure issue-body builders, and the client-required guard on memory promotion
issue_client.py injectable issue client: a protocol, one client per forge kind, and an in-memory fake for tests
mcp_app.py registers the two tools with title and annotation hints, resolves the caller, delegates to submissions
identity.py resolve the owner id from the trusted header, else the default
metrics.py Prometheus registry and per-tool instrumentation
config.py typed settings
server.py wire settings and a client factory, mount under a FastAPI app with /healthz, run

submissions.py is pure and side-effect free, which is what makes the round-trip guarantee testable without a network.

Internals

Module-level detail for the builders, forge clients and MCP surface.

submissions.py

Pure builders, no I/O. They turn arguments into {title, body, labels}.

The body emits ### <label> sections that match the corpus repository's issue forms exactly, so the same workflow parsers accept an issue whichever way it was filed. That symmetry is the whole design: one parser, two front doors.

The two builders are hard-separated and cannot cross. Memory requires a client and labels hive-memory; correction targets a concept id and labels hive-correction.

Those labels must stay in step with .github/ISSUE_TEMPLATE/*.yml in the corpus repository. They said okf-* here until 2026-07-30 while the forms said hive-*, so an issue filed through this service carried a different label from the same issue filed through the form, and any label-based filter or CODEOWNER route saw only half the submissions. Nothing failed; the halves were just invisible to each other.

issue_client.py

A protocol with three implementations: one real client per forge kind, and a fake used in the unit tests. A real one needs only the permission to open issues on one repository.

Injecting the client is what lets tests call the tools with no real forge and no real credential, which matters for a service whose only job is to hold a credential. Tests says what each kind of test runs against.

Two clients exist because of one field. GitHub's issue API takes label names; Forgejo's takes integer IDs and answers a name with 422. FORGE_KIND selects between them and is refused at startup if it is unknown, rather than being inferred from FORGE_API: guessing wrong fails at the moment somebody is waiting on a submission. Everything else about the two APIs is close enough to share.

mcp_app.py, identity.py, server.py

mcp_app exposes exactly two tools, mirroring the two builders. identity resolves the submitter from the trusted gate header so submitted_by provenance is server-derived, never a parameter. server is the entrypoint.

Tests

No real forge and no real credential. Unit tests use the in-memory fake client, or run the real clients with their HTTP calls stubbed; the tool-safety tests run the installed hiveauthor console script over loopback against a mock forge with a dummy token. Use uv run pytest --collect-only -q in tooling/hive-author/ for the current inventory rather than a count written down here.

Configuration

See configuration.

FORGE_API, FORGE_REPO and FORGE_KIND have no default and are validated at startup, along with a credential, which is either FORGE_TOKEN or FORGE_TOKEN_FILE. A plausible-looking default repository would file issues into somebody else's project, which is worse than failing to start.

FORGE_TOKEN_FILE exists because some tokens expire faster than the process lives. A GitHub App installation token lasts an hour while this server runs for days, so it cannot be an environment variable read once at startup. Point FORGE_TOKEN_FILE at a file that something else keeps fresh and the client re-reads it on every submission. Set one or the other (if both are set, FORGE_TOKEN_FILE takes precedence).

Scope the credential to issue creation on the corpus repository. Anything else it can do is blast radius.

Gotchas

Same identity model as hive-serve. The header is trusted, not verified. Without an authenticating proxy in front, anyone who can reach the port can file submissions as anyone.

Compose project name. Both services use a directory called deploy, so without an explicit compose name: they collide on the default project name, and down --remove-orphans in one removes the other's containers. The example compose file sets it. If a stale container lands under the wrong project, remove it by name rather than tearing the project down.