You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance command-based content type inference and distillation logic (#56)
<!-- AI-PR-DESCRIPTION-START -->
## PR Auto Describe
## Summary
This PR overhauls Omni's core pipeline and CLI stack, replacing the
legacy content-type classification model with command-aware routing,
cleaning up deprecated code, and streamlining user-facing reporting and
performance.
---
## Key Changes
1. Replaced legacy content-based pipeline routing with command-first
profile resolution
2. Rewrote `omni stats` CLI: removed `--by-type` flag, added `--project`
per-project analytics
3. Deleted unused distillers and deprecated classifier/composer modules
4. Updated hook logic with auto-sibling command detection for pipe mode
---
## Detailed Breakdown
### Core Pipeline Overhaul
- Removed entire `src/pipeline/classifier.rs` legacy content classifier
- Rewrote distiller system: removed `content_type()` from `Distiller`
trait, replaced `get_distiller()` with command-based
`distill_with_command()` in `src/distillers/mod.rs`
- Deleted unused distillers: `infra.rs`, `log.rs`, `tabular.rs`
- Updated all distiller tests to use command strings instead of
ContentType, updated snapshot outputs for docker/kubectl/nginx workflows
- Rewrote `collapse.rs` to use `CollapseMode` enum instead of
ContentType for content-aware collapsing
- Removed `src/pipeline/composer.rs`, moving rewind/learning logic
directly into hook code
### CLI & Stats Updates
- **`src/cli/stats.rs`**: Removed `--by-type` mode, added `--project`
flag for per-project stats, reworked default view to show top commands,
updated JSON output to return command stats instead of content-type data
- Replaced hardcoded $3/1M token cost calculation with config-driven
pricing via new `src/guard/config.rs`
- Renamed all Indonesian-named test functions in `init.rs`,
`session.rs`, `stats.rs` to English
- Deleted old `truncate_commands()` function and associated tests
- Updated bench targets in `benches/pipeline.rs` from `bench_classify`
to `bench_registry_resolve` testing `scorer::score_with_command`
### Hook & Runtime Changes
- Rewrote `src/hooks/pipe.rs` and `src/hooks/post_tool.rs`: removed
classifier calls, added auto-sibling command detection for pipe mode,
updated rewind/route logic and auto-learn triggers
- Added `src/guard/config.rs` for loading user pricing/config settings
- Updated `src/main.rs` to detect pipe commands via env vars, added
background DB cleanup thread
- Added new MCP `omni_search` tool in `src/mcp/server.rs`
- Removed Intelligence Consistency check from `src/cli/doctor.rs`
---
## Notes
- Distiller snapshot outputs have been updated for docker, kubectl, and
nginx workflows to match new command-based distillation logic
---
## Breaking Changes
1. **Public API Break**: Removed `pipeline::classifier::classify`,
`distillers::get_distiller()`, and deprecated `ContentType` enum usage
across core code
2. **CLI Break**: Removed `--by-type` flag from `omni stats`; JSON
output now returns `commands` instead of `content_types`
3. **Distiller Trait Break**: `Distiller` trait no longer includes the
`content_type()` method
4. **Hook Logic Break**: Pipe mode now requires command context, and
pipeline results no longer include ContentType fields
_Last updated: 2026-04-12 04:30:58_
<!-- AI-PR-DESCRIPTION-END -->
0 commit comments