-
Notifications
You must be signed in to change notification settings - Fork 0
evaluation
This page covers the offline evaluation harness, golden dataset format, pass thresholds, and regression gate for nClaw semantic retrieval quality.
Three JSONL files live in evaluation/datasets/:
| File | Retrieval type | Minimum fixtures |
|---|---|---|
semantic.jsonl |
Dense vector (pgvector cosine) | 20 |
keyword.jsonl |
BM25 full-text (tsvector GIN) | 20 |
hybrid.jsonl |
RRF fusion (dense + lexical + reranker) | 20 |
Each line is one JSON fixture:
{
"query_id": "hyb-001",
"query": "how to configure nself plugin with authentication JWT token",
"retrieval_type": "hybrid",
"expected_top_k_ids": ["doc-nself-plugin-007", "doc-auth-jwt-003", "doc-nself-config-011"],
"minimum_mrr": 0.75,
"ground_truth_source": "human-annotated",
"tags": ["nself", "plugin", "authentication", "jwt"]
}Field requirements:
-
ground_truth_source: at least 10 fixtures per file must behuman-annotated; remainder may besynthetic -
expected_top_k_ids: the ordered list of relevant document IDs for this query
Validate datasets: npx tsx evaluation/validate-datasets.ts
Defined in evaluation/metrics.ts:
| Metric | Formula | Cutoff |
|---|---|---|
| MRR | 1 / rank_of_first_relevant_doc |
first relevant |
| NDCG@10 |
DCG@10 / IDCG@10 (binary relevance) |
k=10 |
| P@5 | relevant_in_top_5 / 5 |
k=5 |
./evaluation/run_eval.sh \
--dataset evaluation/datasets/hybrid.jsonl \
--model claude-haiku-4-5 \
--top-k 10 \
--output /tmp/eval-report.jsonThe script exits non-zero if any metric is below its threshold.
| Metric | Threshold |
|---|---|
| MRR (hybrid) | ≥ 0.75 |
| NDCG@10 | ≥ 0.70 |
| P@5 | ≥ 0.65 |
| Latency p95 | ≤ 500ms |
| Cost per query | ≤ $0.002 |
The CI workflow (.github/workflows/eval.yml) triggers on changes to nclaw/core/retrieval/ or plugins-pro/paid/nself-ai-mcp/.
LEDGER §A — Baseline-null rule:
- First run:
evaluation/baseline.jsonhasnullmetric values. The harness populates baseline and exits 0. - Subsequent runs: fail if any metric drops more than 5% from the baseline.
Check evaluation/baseline.json to see the current baseline metric values.
npx tsx evaluation/validate-datasets.tsExits non-zero if any fixture is missing required fields, has an invalid retrieval_type, or if a file has fewer than 20 fixtures.
ClawDE · GitHub · MIT License
ClawDE
Getting started
Reference
- Architecture
- Daemon-Reference
- Folder-Structure
- Providers
- Multi-Account
- Security
- Features
- Features/Daemon
- Features/Session-Manager
- Features/Mode-System
- Features/Repo-Intelligence
- Features/Projects
- Features/Remote-Access
- Features/Desktop-App
- Features/Provider-Knowledge
- Features/Coding-Standards
- Roadmap
Branding
Contributing