Commit 66edb51
feat(cli): add evaluate subcommand for automata ground-truth evaluation (#818)
* feat(cli): add evaluate subcommand for automata ground-truth evaluation
Wire the existing evaluate() function to a CLI subcommand in terraphim_cli.
Changes:
- Add Evaluate command with --ground-truth and --thesaurus flags
- Add handle_evaluate() function using terraphim_automata::evaluate()
- Add 4 integration tests for evaluate command
- Wire Evaluate match arm in command dispatcher
The core evaluation logic was already implemented in terraphim_automata::evaluation
(~613 lines, 13 unit tests). This adds CLI integration for automation use.
Example usage:
terraphim-cli evaluate --ground-truth gt.json --thesaurus th.json
Part of: Gitea #576
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(clippy): replace sort_by with sort_by_key for Rust 1.95 compatibility
Rust 1.95 promotes clippy::unnecessary_sort_by to hard error under -D warnings.
Convert all sort_by calls to sort_by_key across 3 crates:
- terraphim-markdown-parser: 1 change (descending sort with Reverse)
- terraphim_router: 1 change (descending sort with Reverse)
- terraphim-session-analyzer: 13 changes (ascending + descending)
Line 548 in reporter.rs retains sort_by with #[allow] due to fallible
string parsing in the key function.
Refs #576
* fix(clippy): fix remaining sort_by in session-analyzer main.rs and submodules
Missed in previous commit: session-analyzer has duplicated logic in main.rs
(binary target) and submodules (kg/search, patterns/loader) that also use
sort_by. Convert to sort_by_key where possible, add #[allow] for float
comparisons using partial_cmp.
Refs #576
* fix(clippy): workspace-wide sort_by -> sort_by_key for Rust 1.95 compatibility
Convert all remaining sort_by calls across 40 files to either sort_by_key
or #[allow(clippy::unnecessary_sort_by)] for cases with non-Copy types,
multi-line closures, or partial_cmp on floats.
Covers: terraphim_agent, terraphim_automata, terraphim_orchestrator,
terraphim_service, terraphim_persistence, terraphim_update, terraphim_usage,
terraphim_sessions, terraphim_cli, terraphim_mcp_server, terraphim_types,
terraphim_symphony, terraphim_tinyclaw, terraphim_multi_agent,
terraphim_agent_evolution, terraphim_agent_registry, terraphim_goal_alignment
Refs #576
* fix(clippy): fix Rust 1.95 lints in task_decomposition and rolegraph examples
- Remove unnecessary .into_iter() in extend() call (useless_conversion lint)
- Collapse if guards into match arms (collapsible_match lint)
- Allow explicit_counter_loop in rolegraph examples
Refs #576
* fix(clippy): allow collapsible_match lint in middleware and agent_evolution
Rust 1.95 clippy promotes collapsible_match to hard error under -D warnings.
Add #![allow] at file level for ripgrep.rs, orchestrator_workers.rs,
and parallelization.rs where collapsing the match arms would reduce
readability.
Refs #576
* fix(clippy): allow collapsible_match in goal_alignment/goals.rs Refs #576
* fix(ci): pin Rust toolchain to 1.94.0 to match local dev
dtolnay/rust-toolchain@stable installs latest (1.95.0) which has new
clippy lints (collapsible_match, unnecessary_sort_by, useless_conversion)
not present in 1.94. Pin all ci-pr.yml jobs to 1.94.0 and update
rust-toolchain.toml accordingly.
Refs #576
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent fcb4213 commit 66edb51
33 files changed
Lines changed: 866 additions & 104 deletions
File tree
- .docs
- .github
- workflows
- crates
- terraphim-session-analyzer/src/kg
- terraphim_agent_evolution/src
- workflows
- terraphim_agent_registry/src
- terraphim_agent/src/forgiving
- terraphim_automata/src
- terraphim_cli
- src
- tests
- terraphim_goal_alignment/src
- terraphim_middleware/src/command
- terraphim_multi_agent/src/vm_execution
- terraphim_orchestrator/src
- control_plane
- mode
- terraphim_rolegraph/examples
- terraphim_service/src/score
- terraphim_symphony/src
- orchestrator
- runner
- terraphim_task_decomposition/src
- terraphim_types/src
| 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 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 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 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
0 commit comments