Metadata-Version: 2.5
Name: assay-bittensor
Version: 0.7.3
Summary: Assay your subnet's incentive mechanism — find the gaming vectors before the judges do.
Project-URL: Homepage, https://github.com/yu7dan/assay
Project-URL: Repository, https://github.com/yu7dan/assay
Project-URL: Documentation, https://github.com/yu7dan/assay#readme
Project-URL: Changelog, https://github.com/yu7dan/assay/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/yu7dan/assay/issues
Author: assay contributors
License: MIT
License-File: LICENSE
Keywords: adversarial,bittensor,incentive-mechanism,subnet,testing
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Provides-Extra: chain
Requires-Dist: bittensor<12,>=11; extra == 'chain'
Requires-Dist: python-socks[asyncio]>=2.4; extra == 'chain'
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

<div align="center">

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="assets/logo/assay-mark-dark-256.png">
  <img src="assets/logo/assay-mark-256.png" alt="assay" width="180">
</picture>

# assay

**An assayer melts a sample down and tells you what fraction of it is real gold.<br>
`assay` does that for Bittensor subnets.**

[![PyPI](https://img.shields.io/pypi/v/assay-bittensor?color=blue&label=pypi)](https://pypi.org/project/assay-bittensor/)
[![Python](https://img.shields.io/pypi/pyversions/assay-bittensor)](https://pypi.org/project/assay-bittensor/)
[![Tests](https://img.shields.io/badge/tests-216%20passing-brightgreen)](tests/)
[![Website](https://img.shields.io/badge/website-live-orange)](https://assay-bittensor.vercel.app)
[![CI](https://github.com/yu7dan/assay/actions/workflows/assay.yml/badge.svg)](https://github.com/yu7dan/assay/actions/workflows/assay.yml)
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

**[assay-bittensor.vercel.app](https://assay-bittensor.vercel.app)** — docs, live scan output, and the full evidence trail

**[▶ Watch the 3-minute demo](docs/video/assay-demo.mp4)** — every line of terminal output is real stdout, rendered to film (no screen recording, no stock footage)

[Install](#install) · [Use](#use-it) · [Evidence](#evidence) · [How it works](#how-it-works) · [Roadmap](#roadmap)

</div>

---

## The 15-second version

A Bittensor subnet pays miners according to **rules its owner wrote in code**. Those
rules are easy to write and almost impossible to test — there has been no way to
know they can be gamed short of deploying and watching TAO drain out.

`assay` fixes that. Point it at your scoring logic, and it runs **seven scripted
adversaries** against it:

| adversary | what it does |
|---|---|
| lazy miner | submits whitespace, collects emission anyway |
| weight copier | submits a byte-identical copy of a peer's answer |
| collusion ring | four hotkeys fan out one unit of work |
| Sybil farm | one operator, eight hotkeys, one answer |
| stale replayer | submits last round's valid answer forever |
| noise flood | random bytes at 5 ms latency |
| *(baseline)* | honest miners, to prove the report is not vacuous |

You get a table of what survived, a named defect per failure, and an exit code
that fails CI.

<div align="center">
  <img src="assets/terminal-quality-only.svg" alt="assay run against a competent first-pass mechanism: 5 of 7 scenarios broke it" width="760">
</div>

**That output is the point of the whole project.** The mechanism it is running
against, `quality_only`, is what a competent engineer writes on the first pass:
honest quality scoring, median of three samples, empty submissions rejected. It
handles lazy miners. It is not fooled by noise.

It still loses **5 of 7** — because copying, Sybil farming and replay are not
*quality* problems. They are *identity* and *freshness* problems, and a mechanism
that only measures quality has no defence against them.

## Why now

Bittensor 11 removed the `Axon`/`Dendrite`/`Synapse` networking stack and replaced
it with `btauth/1` signed HTTP requests. The official subnet template was
**archived** and no longer works with current releases. No replacement exists — a
GitHub search for a v11 subnet template returns zero repositories, and
`bittensor-subnet-template` returns 404 on PyPI.

Every subnet in the ecosystem is being rebuilt right now, which means every subnet
owner is rewriting the exact code this tool tests.

## Install

```bash
uvx --from assay-bittensor assay list    # run it without installing anything
pip install assay-bittensor              # or install it
```

`uvx` needs `--from` because the distribution name and the command name differ —
`assay` is taken on PyPI. Same reason `python-dateutil` installs `dateutil`.

For signature verification and live-chain replay, add the extra:

```bash
pip install 'assay-bittensor[chain]'
```

<details>
<summary>Install from a clone instead</summary>

```bash
git clone https://github.com/yu7dan/assay
cd assay
uv venv && source .venv/bin/activate
uv pip install -e '.[chain]'
```
</details>

## Use it

**1. Wrap your reward function.** One method, ten lines:

```bash
assay init assay_my_subnet.py
```

```python
from assay import Batch, Mechanism

class MyMechanism(Mechanism):
    name = "my-subnet"

    def score(self, batch: Batch, evaluate) -> dict[int, float]:
        # evaluate(response) -> noisy quality in [0, 1]
        return {r.uid: evaluate(r) for r in batch.responses}

MECHANISM = MyMechanism()
```

**2. Run the library.**

```bash
assay run assay_my_subnet.py                  # human table
assay run assay_my_subnet.py -f markdown      # paste into your README
assay run assay_my_subnet.py -s sybil_farm    # one scenario
assay run assay_my_subnet.py --netuid 64      # replay a real subnet's distribution
```

**3. Gate your CI.** Exit `0` means every scenario held; `1` means at least one
broke.

```yaml
- run: assay run assay_my_subnet.py -f json -o assay.json
```

Or use the composite action, which also writes the table to the job summary:

```yaml
- id: assay
  uses: yu7dan/assay@main
  with:
    mechanism: ci/assay_adapter.py
    fail-on-regression: "true"
```

A full PR-commenting example lives in
[`examples/workflows/assay-example.yml`](examples/workflows/assay-example.yml).

## The commands

| command | what it answers |
|---|---|
| `assay run` | does my mechanism survive seven adversaries? |
| `assay check` | point it at my repo instead of writing an adapter |
| `assay consensus` | what can a hostile validator do to it? |
| `assay scan` | which subnets look structurally fragile right now? |
| `assay history` | is this subnet's supply base widening or narrowing? |
| `assay rate` | how does supply structure compare across subnets? |
| `assay live` | what does this one real subnet look like? |
| `assay fidelity` | is this tool's model of rewards actually correct? |
| `assay conformance` | does the `btauth/1` wire format match the published vectors? |
| `assay report` | re-render a saved run as markdown or a table |
| `assay init` | scaffold an adapter |

---

# Evidence

Everything below was produced by the tool, on real data, while building it.

## Three tiers of mechanism, one suite

Same scenarios, same seeds, same evaluator noise — the only difference is policy.

| scenario | `naive_flat` | `quality_only` | `hardened` |
|---|---|---|---|
| `honest_baseline` | ✅ 0.000 | ✅ 0.000 | ✅ 0.000 |
| `lazy_miner` | ❌ 0.500 | ✅ 0.000 | ✅ 0.000 |
| `weight_copying` | ❌ 1.000 | ❌ 0.958 | ✅ 0.000 |
| `collusion_ring` | ❌ 6.40× | ❌ 3.20× | ✅ 0.00× |
| `sybil_farm` | ❌ 1.000 | ❌ 0.551 | ✅ 0.067 |
| `stale_replay` | ❌ 1.000 | ❌ 0.996 | ✅ 0.000 |
| `noise_flood` | ❌ 0.500 | ❌ 0.121 | ✅ 0.000 |
| **result** | **6 of 7 broken** | **5 of 7 broken** | **all held** |

<div align="center">
  <img src="assets/terminal-hardened.svg" alt="assay run against the hardened reference mechanism: all scenarios held" width="760">
</div>

The gap between `quality_only` and `hardened` is four checks, not a research
project:

1. **freshness** — a payload seen in a previous round earns nothing
2. **deduplication** — one unit of work is paid once, to the earliest submitter
3. **quality floor** — work below a threshold earns nothing, however fast it arrived
4. **robust sampling** — median of k noisy evaluations instead of one lucky draw

### A real finding, from running this on itself

The first version of `hardened.py` used a quality floor of `0.15`. `noise_flood`
scored **0.053** and failed: with an evaluator noise band of ±0.12, a
0.10-quality garbage miner still cleared a 0.15 floor in roughly 20% of rounds and
collected 5.3% of emission. Raising the floor to `0.30` — clear of the noise band —
took it to 0.000.

That is the argument for this tool in one paragraph. The difference between "my
mechanism is robust" and "my mechanism leaks 5% to garbage" was **one constant**,
and nothing but an adversary would have found it.

## Real subnets, right now

<div align="center">
  <img src="assets/terminal-scan.svg" alt="assay scan output across the largest Bittensor subnets" width="820">
</div>

```bash
assay scan --top 24
```

| measure | result |
|---|---|
| subnets paying validators only, no miner earning | **7 of 24** |
| subnets with fewer than 5 paid miners | **6 of 24** |
| median paid miner count | **3** |
| median `gini*` among paid sets | **0.219** |

Five shapes, all in one sample:

- **7 of 24 pay validators only.** Every neuron with non-zero emission holds a
  validator permit and every miner UID sits at zero incentive. The subnet is still
  emitting — it just has no miner supply this epoch. That is a different condition
  from being inactive, and it needed its own label.
- **6 of 24 have thin supply** — under five miners earn anything at all.
- **netuid 15 (ORO)**: 70 miners are paid, and the top one takes **94.9%** of the
  paid set.
- **netuid 6 (Numinous)**: 163 paid, top-1 only 7.6%, but `gini*` 0.895 — a long
  tail where most earn crumbs.
- **netuids 5 / 13 / 22**: ~97% of registered miners earn, `gini*` under 0.2. These
  are what healthy subnets look like.

> **Two numbers, deliberately kept apart.** `gini*` is concentration among miners
> that actually earned — the signal. `gini_all` is across every registered UID, and
> is nearly identical for every subnet (0.94–0.99) because subnets have hundreds of
> slots and most holders never run a miner. Ranking on `gini_all` produced four
> identical verdicts from four different subnets; that metric had quietly become a
> constant.
>
> A subnet whose commodity comes from two hotkeys has a supply problem **no
> incentive design fixes**, and it is invisible on any dashboard that reports
> emission totals.

**Caveat that travels with this table:** `incentive` is a per-epoch quantity. A
zero means "no reward that epoch", not "permanently unpaid". The scan ranks where
to investigate; it does not accuse anyone.

## Point it at a repository

The barrier to this tool was writing an adapter first. Small work for someone who
already believes their mechanism is worth testing; enormous for someone merely
curious.

```bash
git clone https://github.com/your-org/your-subnet && cd your-subnet
assay check .
```

It scans for the scoring rule, ranks candidates on explainable signals, generates
an adapter that calls the winner, and runs the suite.

**The only real value here is that it refuses to guess.** A scanner that picks
wrong and then reports "seven of seven failed" produces a number that looks like a
finding and is not. So there are three exits, and one of them is a refusal:

| exit | meaning |
|---|---|
| 0 / 1 | the suite ran |
| 2 | no scoring function found in this repository |
| **3** | **found, but could not be reproduced — write an adapter by hand** |

Both repositories tested end at exit 3, for different reasons, and both reasons
are printed:

```
template/validator/reward.py:24 reward()
  → returns a constant regardless of input: reward(query, response) compares two
    arguments, and assay has no query, so the adapter passes the same value twice

rewards/data.py:368 get_data_source_weight()
  → could not import the rule: ModuleNotFoundError: No module named 'torch'
```

Roughly: `check` reproduces a mechanism whose rule is a pure function of measured
quality, and refuses the ones that need a query, a model, or a service. When the
top two candidates score closely it says **ambiguous** rather than picking one.

The ranking is not a guess dressed up in confidence — it was measured against two
real repositories, and the first version got both wrong:

| repository | picked | should have picked |
|---|---|---|
| `desearch-ai/subnet-22` | `format_score() -> str` | `weights_from_shares()`, rank 4 |
| `taoshidev/proprietary-trading-network` | `normalize_scores()` | `combine_scores()` |

Both mistakes are fixed in 0.7.1 (the return annotation gives a formatter away;
payout vocabulary tells the mechanism from a rescaling step) and both are
reproduced as fixtures in `tests/test_check.py`, so the ranking cannot regress
silently. Point `check` at a directory that already holds assay mechanisms and it
says so and runs one, instead of wrapping `score()` in another wrapper.

## Real subnet patterns, not just reference mechanisms

`examples/real/` holds scoring rules reproduced from **actual Bittensor subnets**,
so the question is not "how would a bad mechanism fail" but "how does this one
fail".

**[RaoFoundation's official template](examples/real/README.md)** — the repository the
Bittensor docs point new subnet owners at — fails **3 of 7**:

| scenario | measured | allowed |
|---|---|---|
| `weight_copying` | **1.000** | 0.25 |
| `sybil_farm` | **0.510** | 0.40 |
| `stale_replay` | **1.000** | 0.20 |

A copier scores exactly what the miner it copied scores, because the rule compares
answers rather than identities. Eight sybil hotkeys from one operator capture half
the per-UID reward an honest miner gets. A replayed answer never decays, because
nothing in the rule mentions time.

The template is a minimal starting point and says so. But a subnet owner who ships
it unchanged inherits all three, and two of them cost money.

**[Ranked harmonic](examples/real/README.md)** — the ranking pattern — fails **4 of 7**,
and introduces one of its own: four colluding hotkeys submitting a single answer
**amplify** to 3.28× their fair share, because four copies occupy four ranks.

**[SN22, DEsearch](examples/real/README.md)** — a mechanism that mostly *holds*:
**6 of 7**, and the seventh reported INVALID rather than PASS. It pays in
proportion to verified **volume** per pool (`perc * share_i / sum(shares)`) behind
a binary pass/fail verdict, so replay is void via the ledger's `INSERT OR IGNORE`,
noise and laziness earn nothing because a void upload pays nothing, and eight
sybil hotkeys split one payload's worth instead of multiplying it. What it does
not answer is "correct but worthless output": verification is sampled at 2%, so
the cheapest row to produce is the one nobody checks.

```bash
make real    # all three, side by side
```

## A snapshot answers "what". Only history answers "which way".

`assay scan` tells you sixteen subnets have thin supply today. It cannot tell you
whether netuid 64 paid **18 miners three weeks ago and 11 now** — and that change
is the difference between a subnet having a bad week and a subnet losing its
supply base.

```bash
assay history --record --top 24     # append an observation
assay history --netuid 64           # read the line back
```

```
  assay history · netuid 64  Chutes
  ────────────────────────────────────────────────────────────────────────────
  4 observations over 21.0 days

  paid miners               18 → 11    ↓  -7
  top-1 share             8.7% → 24.1% ↑  +15.4%
  gini* (paid set)       0.240 → 0.440 ↑  +0.200

  paid set turnover      3 kept, 8 new
  ────────────────────────────────────────────────────────────────────────────
  supply base narrowing on both measures
```

Storage is one append-only JSONL file per subnet — no database, no service,
`tail`-able and greppable. **A trend is only reported from three observations
onward**; two points describe a straight line between two points, not a
direction, and the report says so instead of drawing one.

> A widening supply base is not a recommendation to hold anything. A narrowing
> one is not proof of a broken mechanism — the commodity may simply need fewer
> operators now. This is an observation about structure, not a forecast about
> price.

## Rating subnets, and the four times the score was wrong

`assay rate` composes a 0–100 structural score from supply shape. The first
version was a plain weighted average, and running it against sixteen live subnets
produced four indefensible answers:

| subnet | what it looked like | why averaging failed |
|---|---|---|
| **42 · CADmind** | 5 paid miners, `gini*` 0.000 → scored **77.1, "broad supply"** | a sqrt curve against 8 saturated at single digits, so five miners splitting evenly read as a market |
| **2 · DaniLabs** | nobody paid → scored **the same** as 3 paid miners | one ceiling covered 0 and 3 miners alike |
| **18 · Zeus** | top miner 90% → scored **46.4** | three mediocre components averaged the capture away |
| **8 · Vanta** | 18 miners → labelled **"broad supply"** | the grade threshold sat below the supplier ceiling, so the label was reachable |

The fix was not to retune weights. It was to stop letting one catastrophic
dimension average its way out: **supplier count and top-1 share impose hard
ceilings on the composite**, and grade thresholds are aligned with those ceilings
so a label can never describe a set the ceiling forbids.

```
  assay rate · netuid 18  Zeus
  structural   48.7 / 100   concentrated
  one operator supplies most of the commodity

  component                           weight  score  evidence
  Independent suppliers                 32%   0.79  33 miners paid
  Evenness of the paid set              26%   0.10  paid-set gini 0.897
  Largest single supplier               24%   0.04  top miner 89.7% — dominant
  Share of registered miners earning    10%   0.67  20.0% of registered earn
```

The score is never shown alone: every component ships with its weight, sub-score
and evidence, so a reader can disagree with the number on the evidence instead of
trusting it.

> **Structural only.** It scores how a subnet's reward is distributed, not
> whether the commodity is worth anything, and it cannot see the future. It is
> not a price signal and not an investment rating. Structure is not value — a
> subnet can distribute its reward perfectly and produce something nobody wants.

## Validators: the other half

A miner can only misrepresent its own work. A validator misrepresents everyone's.
`assay consensus` runs the mechanism **once per validator**, applies each
validator's behaviour, and combines the results by stake — the same formula
`fidelity` verified against mainnet.

```bash
assay consensus examples/winner_take_all.py
```

What is the mechanism's fault, and what is not:

| scenario | gated? | why |
|---|---|---|
| `weight_concentration` | **yes** | how reward is shaped is entirely the mechanism's own output |
| `validator_outlier` | no | the validator overwrites the result *after* the mechanism runs |
| `validator_capture` | no | majority stake is a stake-distribution problem, not a code problem |

**Two of three are informational and always will be.** A hostile validator does not
ask the mechanism's permission — it runs the code, then submits a different vector.
No scoring rule prevents that, so asserting otherwise would be theatre.

What the numbers still buy you is a price on a stake distribution:

| attacker | emission handed to a zero-work miner |
|---|---|
| one validator holding 1/6 of stake | **0.167** |
| 40% outlier + 20% copier = 60% bloc | **0.600** |

**The cheapest capture is not a bad validator — it is a lazy one.** Consensus is
stake-weighted, so a copier adds no opinion of its own. It lends its stake to
somebody else's judgement. Recruiting one validator that resubmits another's
vector is worth as much as running a validator, and costs nothing. That is why
`copier` is modelled at all: it is the cheapest capture available, and it looks
like participation.

### One scenario I wrote, then deleted

`mechanism_agreement` compared two honest validators' top choices. It ran,
produced numbers, and was worthless — four mechanisms from naive to hardened all
scored identically, because the outcome is governed by the population's quality gap
relative to evaluator noise, not by anything the mechanism does.

A test that cannot tell a broken mechanism from a good one is worse than no test,
because it implies coverage it does not have. Its one mechanism-owned fragment
survives as a measurement:

| mechanism | output drift when evaluator σ goes 0.10 → 0.25 |
|---|---|
| `naive_flat` | 0.000 (ignores the evaluator entirely) |
| `quality_only` (median of 3) | 0.110 |
| `single_sample` (one look) | 0.184 |

Median-of-three roughly halves how much a mechanism's output moves when its
evaluator gets noisier. Real, worth knowing, not strong enough to gate on.

## The model is verified, not assumed

Every verdict above sits downstream of one transformation:

```
incentive[m] = Σ_v (stake_v × weight[v][m]) / Σ_v stake_v
```

`assay fidelity` reconstructs that from live validator weight rows and real stake,
then measures total variation distance from what the chain actually paid.

| measure | result |
|---|---|
| subnets checked (mainnet, 2026-11-28) | 17 |
| within tolerance (TVD ≤ 0.05) | **16 of 17** |
| median TVD | **0.001** |

```bash
assay fidelity --netuid 64
```

### The bug this found

The first version reported **TVD 0.37** on netuid 24, which looked like a topology
difference worth writing up. It was a bug.

The chain stores a weight row for *any* hotkey that submits one, but a row from a
hotkey **without a validator permit** never enters consensus. On netuid 24 one
non-permitted hotkey held 37% of the stake and had submitted a full weight vector;
counting it distorted the reconstruction completely. Filtering to permit-holders
took that subnet from 0.37 to **0.0054**. Eight of the 17 subnets sampled had such
rows — the common case, silently corrupting an innocent-looking number.

## `btauth/1` conformance

The only part of this tool with an objective oracle. The v11 docs publish golden
test vectors with a pinned ed25519 signature, so correctness is not a matter of
opinion — the bytes either match or they don't.

```bash
assay conformance
```

```
PASS  body sha256               341c57448e531310…
PASS  payload layout            227 bytes, no trailing newline
PASS  ed25519 golden signature  byte-for-byte match
PASS  sr25519 roundtrip         sign → verify
PASS  tamper rejection          substituted body rejected
PASS  receiver binding          receiver is part of the signed payload
```

Four of the six checks need the optional `bittensor` dependency. Without it they
report `SKIP` and the summary says **`NOT verified`** — never "all checks held".

---

# How it works

```
                    ┌─────────────────────────────┐
                    │  subnet owner's code        │
                    │  score(batch, evaluate)     │   ~10 line adapter
                    └──────────────┬──────────────┘
                                   │  uid -> weight
   ┌───────────────────────────────▼───────────────────────────────┐
   │                          assay harness                        │
   │                                                               │
   │  population.py      scripted adversaries                      │
   │  scenarios.py       7 scenarios, one-sided assertions         │
   │  mechanism.py       the ABI + NoisyEvaluator                  │
   │  runner.py          rounds, normalisation, per-round series    │
   │  consensus.py       validator behaviours + stake aggregation   │
   │  live.py            metagraph fetch + cache                    │
   │  scan.py            batch profiling across netuids             │
   │  fidelity.py        verifies the model against the chain       │
   │  conformance.py     btauth/1 golden vectors                    │
   │  report.py          table · json · markdown                     │
   └───────────────────────────────┬───────────────────────────────┘
                                   │
                    ┌──────────────▼──────────────┐
                    │  table / JSON / markdown     │
                    │  exit 0 = holds, 1 = broken  │
                    └─────────────────────────────┘
```

**Four design decisions worth naming:**

- **The mechanism never sees ground truth.** It receives responses and a noisy
  `evaluate()`. The harness knows which miners are honest and which are colluding;
  the mechanism does not — exactly as on a real subnet.
- **Assertions are one-sided.** "This attacker must not earn more than X", never
  "you must earn exactly Y". The tool constrains exploitation without dictating a
  design.
- **A baseline guards against vacuous passes.** Every attack assertion is
  satisfiable by a mechanism that pays nobody, so `honest_baseline` runs first and a
  failure there invalidates the entire report.
- **Zero runtime dependencies.** `bittensor` is an optional extra.

## What this does NOT test

A harness that overstates its coverage is worse than none, so:

- **Quality model accuracy.** `evaluate()` is a stand-in. This tests how you
  *aggregate and defend*, not whether your model is good.
- **On-chain stake dynamics.** Weights are modelled, not submitted. Emission,
  bonds, immunity periods and validator permits are out of scope.
- **Real network conditions.** No latency distributions, packet loss, or partial
  failures yet.
- **Mechanism-specific exploits.** The library is generic by design. Your subnet's
  commodity may have a domain-specific attack this does not know about.
- **Adversaries that vary their payload.** A Sybil that submits genuinely distinct
  work per hotkey is indistinguishable from N honest miners — that is not a bug in
  the harness, it is the definition of the problem.

## Status, stated plainly

| | |
|---|---|
| version | **v0.7.2, published on PyPI** |
| tests | 251 passing, Python 3.10–3.13 |
| commands | 12 |
| real users | **none yet** |
| what is proven | the model reproduces on-chain rewards (17 subnets, median TVD 0.001); the conformance vectors match byte-for-byte |
| what is not | that any subnet has been made safer by it |

That last row is the honest one. Everything here is a simulation around a
verified core; the product thesis is that a subnet owner who runs it will find a
real defect before an attacker does. That thesis is untested.

**The second-honest row is the install advice.** 0.4.1 crashed on `assay init`
with `KeyError: 'uid'` and never wrote a file, which is the bug that made a test
suite for the CLI necessary in the first place. Anything from 0.6.0 up works;
0.7.1 is current and adds `assay check`, which finds the scoring rule in a
repository so you do not have to write an adapter to try the tool.

Some mirrors still serve 0.4.1 because they cached it before the release. If
`assay --version` says something older than 0.7.1, pin the version:

```bash
pip install --index-url https://pypi.org/simple "assay-bittensor==0.7.2"
```

Or work from a clone:

```bash
git clone https://github.com/yu7dan/assay && cd assay && uv venv && uv pip install -e .
```

## Roadmap

This is a hackathon entry, and also a product with its own plan. Stated so that
neither is confused for the other.

<table>
<tr><td><b>Now</b></td><td>
Seven adversary scenarios · validator-side consensus modelling · live metagraph
replay · batch scan · <b>history and trend</b> · <b>structural rating</b> ·
verified reward model · <code>btauth/1</code> conformance · CI action · on PyPI.
</td></tr>
<tr><td><b>Next</b></td><td>
A public monthly structural report built from accumulated history, so the data
starts existing before anyone is asked to rely on it. Real validator weight
vectors replayed as adversarial input rather than modelled stake.
</td></tr>
<tr><td><b>Then</b></td><td>
Hosted CI with report history and regression alerts. Mechanism audits as an
engagement, using the same tooling this repository ships.
</td></tr>
<tr><td><b>Positioning</b></td><td>
Developer infrastructure — <b>Track 2</b> of the 2026 Bittensor Global Hackathon.
Not a fund, not a token: a testing tool. The judgement it produces may later be
worth acting on, but the tool has to be trustworthy before that is a real
question.
</td></tr>
</table>

## Documentation

| | |
|---|---|
| [`docs/subnets.md`](docs/subnets.md) | every netuid this tool has read, with real figures and dates |
| [`docs/mechanism.md`](docs/mechanism.md) | how the Bittensor claims are verified, file by file and command by command |
| [`docs/STATUS.md`](docs/STATUS.md) | the evidence collected during development, including what failed |
| [`docs/ROADMAP.md`](docs/ROADMAP.md) | what exists, what does not, and in what order |
| [`CHANGELOG.md`](CHANGELOG.md) | every version, including the bugs each one fixed |
| [`.env.example`](.env.example) | there is nothing to configure — and the file says why |

## Develop

```bash
make install     # editable install + pytest
make test        # 174 tests
make probe       # three reference mechanisms, side by side
make consensus   # validator-side scenarios
make rate        # structural scores across the largest subnets
make track       # record today's observation, read the trend back
make conformance # btauth/1 golden vectors
make all         # what CI runs
```

Regenerate the images in this README from real output:

```bash
python tools/render_terminal_svg.py
```

They are vector text rendered from actual stdout, not screenshots — so they cannot
drift from the code.

## License

MIT.
