ai_rfc — reconstruct a specification from a repository's own history
ai_rfc mines a software project's history into an RFC-style specification
whose every claim is gated against the evidence behind it. One repository
holds all of it:
ai_rfc/lifecycle/ — the one door an operator uses: seven verbs
(config, init, run, status, verify, toolchain, doctor) driven
by one recon.yaml, which work out every path the substrate below needs.
The flow is under "Reconstructing a specification".
ai_rfc/ — the deterministic substrate the lifecycle verbs perform:
eight programs for corpus extraction, forge snapshots, timeline clustering,
evidence views, claim manifests, checkpoints and gates, each still reachable
by hand with explicit paths. The substrate makes no model calls, and the only
code here that opens a socket is forge, init's acquisition of the clone
and the snapshot, and toolchain provision; the three subpackages named
separately in this list live under the same directory but are not substrate.
Its design and schema are documented in ai_rfc/README.md.
ai_rfc/server/ — the MCP server and the core both frontends call; the
matching ai-rfc <group> <verb> commands live in ai_rfc/agent/. One core,
two frontends, so an agent cannot overstate what the evidence supports
whichever door it uses. Tool-to-verb table: docs/parity.md.
ai_rfc/experiment/ — the driver and instrument: pristine workspaces,
hermetic claude -p sessions, per-cluster sweeps, audit and metrics. The
only code in the repository that launches an agent. Usage:
ai_rfc/experiment/README.md; design: docs/experiment-protocol.md.
plugins/ai-rfc/ — the Claude Code plugin: four skills, five commands,
.mcp.json. See "Plugin" below.
The decisions the rest of this repository is built on are recorded as ADRs under
docs/adr/: the threat model for the agent under test, and why building a
mechanism is not the same as enforcing it.
Install
pip install -e '.[mcp]' # the substrate, the server and the ai-rfc door
ai-rfc --help # every verb, in workflow order
claude plugin marketplace add /path/to/ai_rfc && claude plugin install ai-rfc
The plugin runs ${AI_RFC_PYTHON} -m ai_rfc.server, so the distribution must
be installed in the interpreter AI_RFC_PYTHON names for the session.
PANTHER consumes this repository as the submodule
panther/plugins/services/testers/ai_rfc; panther build dev installs it and
PANTHER's ai-rfc subcommand forwards everything after ai-rfc to this tool's
own dispatcher, exiting with whatever it returns, so panther ai-rfc and
ai-rfc cannot disagree about a verb, a flag or an exit code.
Reconstructing a specification
One config file and six commands. ai-rfc is the only door an operator needs:
init, run and verify perform the substrate programs a reconstruction
needs, with every path worked out from the config, so the explicit-path forms
documented in ai_rfc/README.md are for driving one stage by hand.
ai-rfc config example > recon.yaml # a starter recon.yaml, every field documented
$EDITOR recon.yaml
ai-rfc doctor # claude, profile, toolchain, forge token, deps, workspace
ai-rfc init --config recon.yaml # networked once: clone at the pin, fetch the forge,
# scaffold the draft, seal the config
ai-rfc run --config recon.yaml # history, timeline, views; then drive sessions, or stop
# at the agent boundary when no sessions: block is set
ai-rfc next --config recon.yaml # the same, one action at a time (needs a sessions: block)
ai-rfc status --config recon.yaml # stage states, the cluster ledger, the pin, config drift
ai-rfc verify --config recon.yaml --strict # every gate the workspace can pass, one exit code
run performs every deterministic stage that is next, and what happens then
depends on the configuration. With a sessions: block it drives the model
sessions itself, through mining and prose to the build gate, bounded by
--until <stage>, --until cluster:<id> or --until ordinal:<n>. Without one
it stops at the agent boundary, printing the ledger and whose turn it is:
mining a cluster's claims needs a model session, and nothing in the substrate
calls one — so a hand-mined workspace stays possible, driven by the plugin's
loop skill or by the experiment instrument below.
next is that same drive, one action at a time: one row of the same state
machine, then the ledger and the exact line to type after it. It takes the
same --until and the same --retry, and it needs a sessions: block —
a row of that table is what it performs, so without one there is nothing it
could do and run is the verb that walks the deterministic stages.