`docs/_source/merkle-agi-v8-consensus.rst` (834 lines, RST sister to the v7-W substrate paper at the same path). Closes Phase 1b of ticket #000012 — the loop-closing consensus protocol that turns single-validator Proof-of-Upgrade into Darwinian selection across an open validator set. 11 parts: Part 1 Introduction & motivation — gap table from v7 § 13.4, concrete backdoor-attack scenario, paper IS/IS-NOT scope. Part 2 Substrate definition — SQD A1/A2/A3 inheritance, consensus_events row schema, consensus_policy_hash sibling (never enters cache_key). Part 3 Validator state machine — bonding/active/challenged/ slashed/unbonding with full transition graph + invariants. Part 4 Acceptance protocol — proposer submission, layered fitness floor (canonical + lab-declared ceiling), audit-replay procedure, 2/3-stake quorum + GRANDPA- style finalization, liveness floor. Part 5 Challenge protocol — counter-evidence shape, adjudication, challenger reward, frivolous-challenge bond. Part 6 Stake mechanics — bond/unbond/challenge window recommendations, offense-class slashing schedule, reward distribution, optional stake cap + sqrt-weighting. Part 7 Fork choice rule — GRANDPA-style finality, pre-finality constraints, liveness recovery. Part 8 Mesh wire format extension — three new message kinds, BLS-or-concat aggregate signatures, bandwidth profile. Part 9 BFT analysis — safety, liveness, Sybil resistance, bootstrap honesty, re-staking attacks. Part 10 Worked example — 7-validator deployment, one upgrade cycle with successful challenge against one fraudulent validator. Part 11 Out of scope — implementation, calibration, cross-chain anchoring, fixture selection, bootstrap-set membership, cross-instance slashing accumulator, branch-set persistence. Closure §: open questions tracked separately (initial validator set composition, threshold-key ceremony, ZK-replay, policy-hash transition mechanics). Ticket #000012 status updated; Phase 1c (branch-set persistence) remains proposed-not-opened. Implementation follow-up tickets that cite this paper land later — one per validator-state-machine, mesh-wire-format extension, audit-replay harness, slashing accountant. |
||
|---|---|---|
| .. | ||
| _ext | ||
| _static | ||
| api | ||
| bench.rst | ||
| concepts.rst | ||
| conf.py | ||
| cookbook.rst | ||
| diagrams | ||
| index.rst | ||
| license.rst | ||
| Makefile | ||
| merkle-agi-v7w-spatial-temporal.rst | ||
| merkle-agi-v8-consensus.rst | ||
| pi-star.rst | ||
| quickstart.rst | ||
| README.md | ||
| requirements.txt | ||
| v8-fork-score.rst | ||
Arborist API Reference (Sphinx)
This directory contains Sphinx configuration to generate API documentation from docstrings.
Build
cd docs/_source
make html # Generate HTML (output: _build/html/)
make text # Generate text (output: _build/text/)
make clean # Remove build artifacts
Or directly:
sphinx-build -b html . _build/html
View
After building, open _build/html/index.html in a browser.
Structure
conf.py— Sphinx configurationindex.rst— Main table of contentsapi/— Module documentation (one .rst per module category)substrate.rst— Core data structures (merkle, document, wikitext)storage.rst— SQLite schema (store, ingest, evict)retrieval.rst— FTS5 search (search, sources, concepts)qa.rst— Q&A pipeline (runner, query, verify, evidence, etc.)distill.rst— Distillation (surface→core)mesh.rst— Federation (gossip-based sync)cli.rst— Command-line interface
What it replaces
This generated documentation replaces docs/modules.md (1200+ lines of static API reference). The docstrings in code are the source of truth; Sphinx extracts them automatically.
Adding new modules
- Add a docstring to the module (module-level docstring at the top of
module.py) - Add an
.rstfile inapi/that includes the module withautomoduledirective - Reference it in
index.rst - Rebuild with
make html
Theme
Uses furo theme (modern, responsive, search-enabled).
Autodoc directives
The .rst files use Sphinx automodule to extract:
- Module docstrings
- Class docstrings + members
- Function signatures + docstrings
- Source code links (
:viewcode:extension)
See Sphinx autodoc docs.