Expand description
Exception Collector — 全项目组异常收集系统。
自动捕获 panic、error 日志和 Result::Err,根据用户是否参与「共建计划」
走两条上报路径:
- 共建用户(已安装
ghCLI):LLM 语义去重 → 自动创建 GitHub Issue - 普通用户(无
gh):本地签名去重 → 批量上传自研收集平台
§集成方式
每个组件在启动入口调用 install() 注册 panic hook 和 tracing layer:
ⓘ
use exception_collector::{CollectorConfig, install};
let config = CollectorConfig::from_file("repo-map.toml")?;
install(config, "component-name".into());Structs§
- Aggregated
Exception - 缓冲区内按签名聚合的异常。
- Classification
Result - The LLM’s decision for a single exception record.
- Collector
Config - 收集器配置。
- Custom
Platform Reporter - Reports exceptions by sending a
POSTrequest to a custom platform endpoint. - Dedup
Engine - Local signature deduplication engine.
- Exception
Batch - 上报批次。
- Exception
Buffer - In-memory and
SQLite-backed buffer for exception aggregation. - Exception
Record - 单条异常记录。
- Existing
Issue Data - Data about an existing open GitHub issue (for dedup comparison).
- GitHub
Reporter - Reports exceptions by calling the
ghCLI. - LlmClassifier
- Classifies exception batches using an LLM channel.
- Pipeline
Runner - Orchestrates the exception reporting pipeline.
- Retry
Policy - 指数退避重试策略。
Enums§
- Batch
Status - 批次上报状态。
- Classification
Action - Action determined by LLM classification.
- Collector
Error - 收集器错误类型。
- Exception
Kind - 异常来源类型。
- Report
Result - 上报结果。
- Report
Target - 上报目标。
Traits§
- Exception
Reporter - 异常上报器 trait。
- LlmChannel
- Abstract LLM channel for classification requests.
Functions§
- collect_
result_ err - Manually capture a
Result::Errinto the buffer. - collect_
unreported - Scan all
*.dbfiles under the shared exceptions directory and return any unreported exception records across all components. - compute_
signature - Compute a SHA256 deduplication signature for an exception record.
- exceptions_
dir - Resolve the shared exceptions directory.
- with_
retry - 对异步操作执行指数退避重试。
Type Aliases§
- Collector
Result - 收集器结果类型别名。