Public monorepo for Bittensor Subnet 118 (SN118), which incentivizes language-neutral agent memory harnesses. Miners submit a Docker build context serving the public harness HTTP contract; platform-operated screeners build and screen submissions; validators run each screened image in an isolated Docker sandbox and score it on DittoBench (tool calling and memory recall), setting weights on chain via Pylon (king-of-the-hill emission when eligible miners exist; 100% owner-associated burn when none qualify).
- Stack: Python
>=3.12,<3.14(uv, Pydantic v2,pytest,ruff,mypy, MIT license), Go scorers & relays (services/dittobench-api,services/model-relay), TypeScript/web Platform dashboard & Backroom (apps/platform,apps/backroom), Terraform/Ansible (infra/). - External library: The reusable Rust/Go harness library lives in
ditto-assistant/ditto-harness.
# Local Python dev (no wallet secrets or chain/API calls)
uv sync
make lint # ruff format --check + ruff check
make typecheck # mypy ditto/
make test # pytest (fast unit suite)Installed via pyproject.toml ([project.scripts]):
ditto verify --path <agent.tar.gz> # offline pre-flight check
ditto --network <finney|test|local> [--chain-endpoint ws://...] upload \
--path <agent.tar.gz> --name <name> --coldkey <coldkey> --hotkey <hotkey> [-y]
ditto status <agent_id>--network locks the API URL and subtensor network together; --chain-endpoint overrides only the chain target. See docs/MINER.md.
cp .env.example .env # set wallet names, hotkey, Pylon token, W&B key (or WANDB_MODE=disabled)
./scripts/validator-compose.sh config --quiet
./scripts/validator-compose.sh up -d --build
./scripts/validator-compose.sh psRuns the validator worker, Pylon, DittoBench scorer, and isolated Docker sandbox from one .env. Inference is ticket-scoped via Platform (validators hold no LLM provider keys). See docs/VALIDATOR.md.
Defined in Makefile:
make lint # ruff format --check + ruff check
make format # ruff format + ruff check --fix
make typecheck # mypy ditto/
make test # uv run pytest
make localstack-up # start local model relay + dittobench-api (STUB=1 for free relay)
make localstack-bench # run local scored/practice bench (see localstack/README.md)
make localstack-smoke # free scored-v12 plumbing smoke against refharness
make localstack-phase1 # scored v12 with Linux broker + TLS
make localstack-down # stop localstack services
make preview-compose # resolve preview plan (see preview/README.md)
make preview-test # pytest ditto/tests/preview -qOwnership and semantic-release component boundaries are defined in release/components.toml:
| Path | Purpose |
|---|---|
ditto/ |
Root Python package: miner_cli/ (ditto CLI), validator/, api_models/ (wire shapes), chain/ (Pylon client), preview/ (ditto-preview), treasury/, tests/ |
miners/ |
Reference starter kits: dittobench-starter-kit/ (production), dittobench-unified-starter-kit/, plus shadow kits (dittobench-coding-starter-kit/, dittobench-generator-starter-kit/, dittobench-router-starter-kit/, cpm-starter-kit/) |
apps/platform/ |
SN118 Platform API, Alembic migrations, durable queue, dashboard, and control plane |
apps/backroom/ |
Public-source SN118 operations console (backroom.dittobench.ai) |
services/ |
dittobench-api/ (Go scorer), screener-orchestrator/, model-relay/, cpm-scorer/, pylon/ |
workers/screener/ |
Provider-neutral screening worker runtime |
packages/ |
Shared contracts: ditto-screening-protocol/, dittobench-coding-contract/, ditto-edge-protocol/ |
research/ |
Deterministic benchmark generators & graders (dittobench-datagen/, dittobench-coding-datagen/, screener-controls/) |
localstack/, preview/ |
Local end-to-end bench stack (localstack/README.md) and preview control harness (preview/README.md) |
infra/ |
SN118 Terraform, Ansible, systemd, and containers (infra/README.md) |
.agents/skills/ |
Repo-owned specialized skills (mirrored under .claude/skills/) |
- docs/MINER.md — prepare, verify, submit, and track an agent
- docs/OWNER-LINKS.md — link rotated miner hotkeys
- docs/VALIDATOR.md — deploy, verify, and upgrade the validator stack
- docs/MONOREPO-RELEASES.md — component release graph & semantic releases
- docs/bounty-guide.md, docs/bounty-claims.md, docs/bounty-operations.md — SN118 build bounties
- docs/UNTRUSTED-EXECUTION-RUNBOOK.md & docs/RUNTIME-ENVELOPE.md
Read AGENTS.md and CLAUDE.md (plus the nearest nested AGENTS.md) before making changes. Critical rules:
- Start every substantial task with the context router:
python3 .agents/skills/ditto-subnet-context/scripts/lookup-context.py "<task>" - Worktree isolation: use
.agents/skills/ditto-subnet-worktree; update cross-component producers, consumers, migrations, andrelease/components.tomlin one monorepo PR stack. - Production control plane: Backroom MCP (
https://backroom.dittobench.ai/mcp) is the sole production control plane — never infer live state from logs or local defaults. - Skills mirror: every skill must exist in both
.agents/skills/<name>and.claude/skills/<name>. - Commit / PR prefixes: conventional commits drive component releases (
python-semantic-release); never usetest:— usechore(tests):for test-only changes. - Wire compatibility: Pydantic wire models must ignore unknown fields (
ConfigDict(extra="ignore"), neverextra="forbid"). - Git Docker contexts: always pin with BuildKit
?ref=refs/heads/<branch>&checksum=<40-sha>, never#<sha>. - Required PR check:
migration-order/merge-resultenforces Alembic migration ordering onmain.