Files
neuron-tai/.scratch/alpha-hardening/issues/08-fraud-reputation-model-persistence.md
Dobromir Popov 9abe83b5f4 feat(alpha): complete hardening backlog
Complete the alpha-hardening Ralph task set, including tracker billing/accounting guards, validator fraud-audit primitives, wallet binding proof support, documentation runbooks, and updated tests.

Verification: .venv/bin/python -m compileall -q packages tests; .venv/bin/python -m pytest -q --tb=short (313 passed, 3 skipped, 1 failed: tests/test_mining_cli.py::test_legacy_start_without_port_uses_next_available_port because meshnet-node pid 1263451 is already listening on port 7000).
2026-07-05 21:47:23 +03:00

40 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Status: done
# 08 — FRAUD: Reputation model + persistence
## What to build
Implement graduated reputation per ADR-0018 §6: score derives only from tracker audit outcomes + uptime/latency. Slow build, instant loss, inactivity decay. ×0.8 routing multiplier per strike (not whole penalty — forfeiture stays full pending).
**Scope split:** issue 05 owns **schema + SQLite persistence**; this issue owns **scoring rules** (deltas, decay, strike→multiplier wiring) on top of persisted fields.
**Code refs:**
- `packages/contracts/meshnet_contracts/__init__.py` — extend `RegistryWallet` / persistence from issue 05
- `packages/validator/meshnet_validator/__init__.py``_slash_route` forfeiture path (~125133)
- `packages/tracker/meshnet_tracker/billing.py``forfeit_pending` (~280292)
- Research: `.scratch/alpha-hardening/research-verifiable-inference.md` §6
## Test-first
1. Red: persisted reputation/strike fields from issue 05 are ignored by scoring/routing today.
2. Green: clean audit +0.05 (tunable); failed audit 0.3 and strike; three strikes → ban persisted via issue-05 fields.
3. Inactivity decay after N days without completed jobs.
## Acceptance criteria
- [ ] Uses `reputation_score` and strike/ban fields persisted by issue 05; does not introduce a second schema path
- [ ] Audit pass/fail updates score with documented deltas
- [ ] Strike applies ×0.8 multiplier to routing weight (separate from forfeiture amount)
- [ ] Ban at 3 strikes; probation job count still enforced
- [ ] No peer-to-peer reputation inputs
## ADR links
- [ADR-0018](../../docs/adr/0018-fraud-detection-verification-and-reputation.md) §6
## Blocked by
- `05-a1-a5-persist-strike-ban-reputation.md`
- `07-fraud-commitment-bisection-blame.md` (audit outcomes feed reputation)