feat(orchestrator): ExitClassifier with KG-boosted agent exit classification#758
Merged
AlexMikhalev merged 3 commits intomainfrom Apr 5, 2026
Merged
Conversation
…ation Implement structured agent exit classification using terraphim-automata Aho-Corasick pattern matching on stderr/stdout. Each agent exit now produces an AgentRunRecord with classified ExitClass, matched patterns, and confidence score. - Add ExitClass enum (12 variants) and ExitClassifier in agent_run_record.rs - Build exit class thesaurus programmatically from KG patterns - Integrate classification into poll_agent_exits() reconciliation loop - Inject exit_class into Quickwit LogDocument.extra for observability - Add heading extraction to MarkdownDirectives (replaces raw file read) - Use markdown_directives::extract_heading_from_path in builder.rs - Add exit class KG thesaurus at docs/src/kg/exit_classes.md - 18 unit tests for classifier, 4 tests for heading extraction Refs #395 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…traction Replace naive line-based heading extraction with AST-based parsing from terraphim-markdown-parser. The parser handles inline code, emphasis, and other markdown within headings correctly. - Include terraphim-markdown-parser in workspace (was excluded) - Add extract_first_heading() to terraphim-markdown-parser using AST - Wire markdown_directives to use AST parser for heading extraction - Add 4 tests for heading extraction in markdown parser crate Refs #395 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Documentation PreviewYour documentation changes have been deployed to: This preview will be available until the PR is closed. |
- cargo fmt: reformat 4 files for edition 2024 style (wiki_sync, store, symbolic_embedding_bench, gitea) - clippy: gate load_restart_counts with #[cfg(not(test))] to match its only call site (was dead code in test builds) - wasm: replace workspace = true with explicit versions in standalone wasm-test/Cargo.toml (standalone workspace cannot inherit) Refs #395 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Documentation PreviewYour documentation changes have been deployed to: This preview will be available until the PR is closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExitClassifierwith KG-boosted Aho-Corasick pattern matching on agent stderr/stdout for structured exit classificationAgentRunRecordwith classifiedExitClass(12 variants), matched patterns, and confidence scorepoll_agent_exits()reconciliation loop with QuickwitLogDocument.extrainjectionterraphim-markdown-parserAST-based heading extraction forMarkdownDirectives(replaces naive line scanning)extract_first_heading()toterraphim-markdown-parserusingmarkdown::to_mdastbuilder.rs:concept_from_path()Test plan
cargo clippy -- -D warningscleancargo test --workspacepassesRefs #395 (Gitea)
Generated with Terraphim AI