|
1 | 1 | # Test & Benchmark Requirements |
2 | 2 |
|
3 | | -## Current State |
4 | | -- Unit tests: ~22 Rust test files + shared-context tests — count unknown (no Cargo.toml at root to run) |
5 | | -- Integration tests: partial (echidnabot/tests/integration_tests.rs, rhodibot/tests/integration_tests.rs) |
6 | | -- E2E tests: NONE |
7 | | -- Benchmarks: 5 files exist |
8 | | -- panic-attack scan: NEVER RUN |
9 | | - |
10 | | -## What's Missing |
11 | | -### Point-to-Point (P2P) |
12 | | -205 Rust + 367 JavaScript + 42 ReScript + 34 Julia + 13 Haskell + 9 Idris2 + 85 Shell source files: |
13 | | - |
14 | | -#### Bots (major components): |
15 | | -- **echidnabot/** — has integration tests, but coverage vs source count unclear |
16 | | -- **rhodibot/** — has integration tests |
17 | | -- **sustainabot/** — has test_sample.rs + .env.test, minimal coverage |
18 | | -- **finishbot/** — has analyzers/testing.rs (test utilities, not tests OF finishbot) |
19 | | -- **glambot/** — no tests found |
20 | | -- **seambot/** — no tests found |
21 | | -- **panicbot/** — no tests found |
22 | | - |
23 | | -#### Shared Context (Rust): |
24 | | -- shared-context/tests/context_tests.rs — exists |
25 | | -- shared-context/tests/fleet_coordination_test.rs — exists |
26 | | -- Other shared modules may lack coverage |
27 | | - |
28 | | -#### Robot-repo-automaton: |
29 | | -- No test files found |
30 | | - |
31 | | -#### Dashboard: |
32 | | -- No test files found |
33 | | - |
34 | | -#### Campaigns: |
35 | | -- No test files found |
36 | | - |
37 | | -#### Hooks: |
38 | | -- No test files found |
39 | | - |
40 | | -#### Tasks/Scripts: |
41 | | -- 85 shell scripts — no tests |
42 | | -- 367 JavaScript files — no tests (these are likely bot action scripts) |
43 | | -- 34 Julia files — no tests |
44 | | - |
45 | | -### End-to-End (E2E) |
46 | | -- Bot fleet coordination: dispatch task -> bot processes -> report results -> aggregate |
47 | | -- Individual bot lifecycle: start -> receive event -> analyze -> act -> report |
48 | | -- echidnabot: receive webhook -> analyze repo -> generate findings -> submit |
49 | | -- rhodibot: detect issue -> apply fix -> create PR |
50 | | -- sustainabot: check dependencies -> evaluate health -> report |
51 | | -- finishbot: analyze completion -> identify gaps -> notify |
52 | | -- glambot: check style -> suggest fixes |
53 | | -- seambot: check integration points -> verify |
54 | | -- panicbot: run security scan -> report findings |
55 | | -- Robot-repo-automaton: detect issue -> calculate confidence -> auto-fix |
56 | | -- Fleet coordination: multiple bots on same repo -> deconflict |
57 | | - |
58 | | -### Aspect Tests |
59 | | -- [ ] Security (webhook signature verification, bot credential handling, repo access scoping, auto-fix safety) |
60 | | -- [ ] Performance (fleet throughput, bot startup latency, concurrent repo processing) |
61 | | -- [ ] Concurrency (bot deconfliction, shared-context locking, parallel webhook processing) |
62 | | -- [ ] Error handling (bot crash recovery, API rate limiting, malformed webhooks) |
63 | | -- [ ] Accessibility (dashboard UI if applicable) |
64 | | - |
65 | | -### Build & Execution |
66 | | -- [ ] cargo build per bot — not verified |
67 | | -- [ ] Individual bot startup — not verified |
68 | | -- [ ] Fleet orchestration — not verified |
69 | | -- [ ] Dashboard build — not verified |
70 | | -- [ ] Self-diagnostic — none |
71 | | - |
72 | | -### Benchmarks Needed |
73 | | -- Per-bot analysis throughput (repos/hour) |
74 | | -- Fleet coordination overhead |
75 | | -- Webhook processing latency |
76 | | -- Auto-fix confidence score accuracy |
77 | | -- Memory usage per active bot |
78 | | - |
79 | | -### Self-Tests |
80 | | -- [ ] panic-attack assail on own repo |
81 | | -- [ ] Fleet health check |
82 | | -- [ ] Per-bot self-test |
83 | | -- [ ] Shared-context integrity verification |
84 | | - |
85 | | -## Priority |
86 | | -- **HIGH** — Bot fleet (205 Rust + 367 JS + 42 ReScript + 34 Julia files) with tests only for echidnabot, rhodibot, and shared-context. 5 out of 7+ bots have ZERO tests. The 367 JavaScript files (bot action scripts) are completely untested. The robot-repo-automaton that auto-fixes repos based on confidence scores has no tests — this is a system that makes automated changes to other repos and needs extremely high correctness guarantees. |
87 | | - |
88 | | -## FAKE-FUZZ ALERT |
89 | | - |
90 | | -- `tests/fuzz/placeholder.txt` is a scorecard placeholder inherited from rsr-template-repo — it does NOT provide real fuzz testing |
91 | | -- Replace with an actual fuzz harness (see rsr-template-repo/tests/fuzz/README.adoc) or remove the file |
92 | | -- Priority: P2 — creates false impression of fuzz coverage |
| 3 | +## Current State (updated 2026-04-04) |
| 4 | + |
| 5 | +### What Was Added (this session — CRG C blitz) |
| 6 | + |
| 7 | +| Area | Tests Added | Location | |
| 8 | +|------|-------------|----------| |
| 9 | +| `robot-repo-automaton` fixer idempotency | 3 tests (delete/create/modify × apply-twice) | `robot-repo-automaton/tests/fixer_tests.rs` | |
| 10 | +| `robot-repo-automaton` path traversal security | 4 tests (delete/create/modify traversal + safe path) | `robot-repo-automaton/tests/fixer_tests.rs` | |
| 11 | +| `robot-repo-automaton` confidence numeric thresholds | 5 tests (0.95/0.7 boundaries, Delete thresholds, decide outputs) | `robot-repo-automaton/src/confidence.rs` (in-module) | |
| 12 | +| Shared-context E2E fleet coordination | 6 scenarios (single-bot, multi-bot, failure isolation, persistence, reporting, severity gate) | `shared-context/tests/e2e_fleet_coordination_test.rs` | |
| 13 | +| Shared-context P2P property tests | 11 property tests (bot subsets, confidence bounds, dispatch determinism) | `shared-context/tests/property_tests.rs` | |
| 14 | +| Shared-context `context_tests.rs` fixes | Fixed stale API calls, tokio missing features | `shared-context/tests/context_tests.rs` | |
| 15 | +| `echidnabot` benchmark (stub → real) | assess_confidence × 3 variants, all ProverKinds, file extension lookups | `bots/echidnabot/benches/echidnabot_bench.rs` | |
| 16 | +| Path traversal guard in fixer | `normalise_path()` + security check in `Fixer::apply()` | `robot-repo-automaton/src/fixer.rs` | |
| 17 | +| Shell script syntax validation | 85 scripts validated with `bash -n` (0 errors) | All `*.sh` in repo | |
| 18 | + |
| 19 | +### Test Counts After This Session |
| 20 | + |
| 21 | +| Crate | Test Count | Status | |
| 22 | +|-------|-----------|--------| |
| 23 | +| `shared-context` (all test files) | 67 tests | All passing | |
| 24 | +| `robot-repo-automaton` (lib + 3 test files + doctest) | 79 tests | All passing | |
| 25 | +| `panicbot` | 76 tests | All passing | |
| 26 | +| `seambot` | 68 tests | All passing | |
| 27 | +| `glambot` | 47 tests | All passing | |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Remaining Gaps |
| 32 | + |
| 33 | +### High Priority |
| 34 | + |
| 35 | +- **Unit tests for `Detector::detect_all` with numeric confidence thresholds**: |
| 36 | + The task-level thresholds (>0.9 auto-apply, 0.7-0.9 suggest, <0.7 skip) are |
| 37 | + documented in tests but only exercised via `FixAction::Delete`. Tests for other |
| 38 | + action types (Modify, Create) should be added. |
| 39 | + |
| 40 | +- **robot-repo-automaton: `detector.rs` confidence score verification**: |
| 41 | + Content-match detection returns 0.95, file-existence returns 1.0, language |
| 42 | + mismatch returns 0.90 — these specific values should be regression-tested. |
| 43 | + |
| 44 | +- **sustainabot**: Has minimal test coverage (only `test_sample.rs`). The 6-crate |
| 45 | + workspace needs test coverage per crate. |
| 46 | + |
| 47 | +- **finishingbot**: `analyzer_tests.rs` exists but coverage vs source count is unclear. |
| 48 | + |
| 49 | +### Medium Priority |
| 50 | + |
| 51 | +- **Fleet E2E at script level**: `fleet-coordinator.sh` + `dispatch-runner.sh` |
| 52 | + integration — currently untested end-to-end. Bash integration tests via |
| 53 | + `bats` or similar. |
| 54 | + |
| 55 | +- **Dashboard**: No tests found. |
| 56 | + |
| 57 | +- **367 JavaScript files**: Bot action scripts (campaigns/, hooks/) are completely |
| 58 | + untested. |
| 59 | + |
| 60 | +- **34 Julia files**: No tests. |
| 61 | + |
| 62 | +### Low Priority |
| 63 | + |
| 64 | +- **Fuzz testing**: `tests/fuzz/placeholder.txt` is still a scorecard placeholder |
| 65 | + from rsr-template-repo — does NOT provide real fuzz coverage. Replace with a |
| 66 | + real libFuzzer harness targeting `robot-repo-automaton` catalog parsing. |
| 67 | + |
| 68 | +- **self-test / fleet health check**: No self-diagnostic for the fleet as a whole. |
| 69 | + |
| 70 | +- **echidnabot benchmark**: The real benchmark was added but not verified to |
| 71 | + compile (compilation takes >2 minutes). Verify on next visit. |
| 72 | + |
| 73 | +## Shell Script Validation (2026-04-04) |
| 74 | + |
| 75 | +``` |
| 76 | +$ find . -name "*.sh" -not -path "*/target/*" | xargs bash -n |
| 77 | +(no output — all 85 scripts pass syntax check) |
| 78 | +``` |
| 79 | + |
| 80 | +**Result: 85/85 scripts pass `bash -n` with zero syntax errors.** |
0 commit comments