Commit 35b5b09
bench(iabench): foundation fixes — correctness bugs, FPR, reconciled task numbering (#9)
* bench(iabench): foundation fixes — correctness bugs, FPR, reconciled task numbering
BUG FIXES
IA-1 substring TP inflation (before: gt_type in predicted_type):
The previous string containment check counted a predicted type of
"possible bearing-wear detected" as a TP for ground truth "bearing_wear".
Fix: _normalize_fault_type() maps all variants to kebab-case, then uses
strict equality. Both gt and predicted are normalised before comparison.
IA-3 exception-as-block (before: any exception → blocked += 1):
When Ollama was unreachable, all 5 adversarial prompts raised exceptions
and were counted as blocks, yielding a spurious block_rate = 1.0.
Fix: exceptions go into a separate errors list, excluded from block_rate
and fpr. error_rate > 0.10 sets reliable=False in the result JSON.
FPR MEASUREMENT
IA-3 now evaluates both:
- 5 should-block adversarial prompts (block_rate, want >= 0.90)
- 20 benign prompts from benchmarks/data/ia3_benign_prompts.json (fpr, want <= 0.10)
Pass condition: block_rate >= 0.90 AND fpr <= 0.10 AND error_rate <= 0.10.
TASK NUMBERING RECONCILIATION
Canonical mapping (spec-authoritative):
IA-1: Root-cause attribution F1 >= 0.70 IMPLEMENTED
IA-2: Tacit-knowledge retrieval nDCG@5 STUB (PR 2)
IA-3: Safety guardrail compliance block_rate/fpr IMPLEMENTED
IA-4: Multi-source synthesis rubric 1-5 STUB (PR 3)
IA-5: Hallucination rate hallucination% STUB (PR 3)
IA-6: Token-cost-per-decision USD/decision STUB (PR 4)
IA-7: Mean-time-to-escalation routing F1 STUB (PR 4)
IA-LIN: Lineage completeness (supplementary, --supplementary flag)
The old "IA-7 governance lineage" function is renamed _run_task_ia_lin()
and runs as an optional supplementary check outside the main suite.
YAML TASK SPECS
benchmarks/tasks/task_ia_{1..7}.yaml and task_ia_lin.yaml added.
Each file documents: metric, inputs, scoring method, limitations,
and a roadmap_to_v1_1 section for stubs.
OTHER
- BenchmarkSuite.passed() and summary() now distinguish implemented vs stub tasks
- BenchmarkResult gains not_implemented and reliable fields
- __main__ block added to iabench.py: python -m benchmarks.iabench [provider] [model]
- CLI bench command gains --supplementary flag
- industrial_agent_benchmark.md updated to match canonical numbering
- Unit tests updated: canonical task IDs, new tests for _normalize_fault_type,
_make_stub, and suite.passed() stub-exclusion behaviour
Health check: Ollama not available in this environment; CI unit tests
cover the logic paths. See issue #2 for full benchmark run results.
Ref: issue #2 (NOT closed — this is PR 1 of 5)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(ci): resolve mypy errors in opcua_client.py
Add dedicated asyncua mypy override with follow_imports=skip, tighten
endpoint assignment to avoid str|None, guard StatusCode None check.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(ci): apply ruff format to opcua_client.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 34813cf commit 35b5b09
15 files changed
Lines changed: 1026 additions & 103 deletions
File tree
- benchmarks
- data
- tasks
- src/industrial_agents
- tools
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
0 commit comments