Skip to content

Implement command categorization, telemetry, and modularize distillation#76

Merged
fajarhide merged 14 commits intomainfrom
fix/0.5.7-rc1
May 5, 2026
Merged

Implement command categorization, telemetry, and modularize distillation#76
fajarhide merged 14 commits intomainfrom
fix/0.5.7-rc1

Conversation

@fajarhide
Copy link
Copy Markdown
Owner

@fajarhide fajarhide commented May 5, 2026

PR Auto Describe

Summary

This release introduces lightweight anti‑hallucination guards, a fast local dependency graph, and richer context warnings for file reads and mutating commands. New distillers for ReadFile and grep output provide structured summaries and factual guards. The cursor integration is refactored into idempotent helper functions. Doctor, stats, and hooks are enhanced to report new telemetry, adaptive compression thresholds, and hot‑file warnings. Three new agent tools (omni_context, omni_explain_savings, omni_find_noise) expose graph and compression insights. The store now records passthrough events, unhandled tools, and runs a one‑time migration. Utility command_family normalizes commands for adaptive compression and stats.

Key Changes

  • Added anti‑hallucination guards and dependency‑aware ReadFile distillation.
  • Implemented lightweight dependency graph building (graph/indexer.rs).
  • New omni_context tool to show import/imported‑by stats and hot‑file hit count.
  • Added omni_explain_savings and omni_find_noise tools for compression insight.
  • Refactored Cursor integration with helper functions (initialize_mcp_config, install_mcp_server, etc.).
  • Doctor now warns on missing MCP, runs inline filter tests, repairs legacy learned.toml, and suggests omni init.
  • Stats formatting updated (widths, command family, adaptive thresholds).
  • Hook pipeline now resolves agent ID via OMNI_AGENT_ID/OMNI_CMD, records retrieve events, and emits hot‑file context.
  • post_tool now uses graph context for many‑dependent files and adds compression‑recovery warnings.
  • pre_tool detects mutating commands, warns on hot files, and hints at context availability.
  • Store telemetry: passthrough_events, unhandled_tools, schema_migrations with cursor‑to‑vscode backfill.
  • command_family helper normalizes common command families.
  • Session domain inference now prefers directory prefixes, falls back to basenames, and handles edge cases.

Detailed Breakdown

  • changelog & README: Documented new lightweight anti‑hallucination, dependency graph, structured ReadFile+Grep, and contextual warnings.
  • distillers/readfile.rs: Distill by language, include imports, public API, risk markers, and guard for many dependents.
  • distillers/search.rs: Summarize grep results by file, prioritize error/secret lines, guard for omitted files.
  • graph/indexer.rs: Walks up to 5k files, extracts imports per language, resolves relative/crate paths, builds imports and imported_by maps with dedupe.
  • agents/cursor.rs: Extracted MCP path logic, idempotent install/remove, validation helper has_valid_omni_server. Added tests.
  • cli/doctor.rs: Added idle distill warning, optional repair of learned.toml, inline filter tests, hot‑file warning, and new omni_context tool.
  • cli/stats.rs: Adjusted column widths, expanded command‑family depth, increased per‑command limit, simplified output format.
  • hooks/pipe.rs: resolve_pipe_agent_id simplified to respect OMNI_AGENT_ID/OMNI_CMD, default to terminal.
  • hooks/post_tool.rs: Uses graph context for ReadFile, invokes distill_readfile_with_context; Grep uses distill_grep; added compression‑recovery and noise warnings.
  • hooks/pre_tool.rs: Detects mutating commands, warns if hot file accessed >2 times, provides context hint for target file, and generic hot‑file warning for mutating commands.
  • lib.rs / main.rs: exposed graph module.
  • mcp/server.rs: Added omni_context, omni_explain_savings, omni_find_noise tools; record retrieve events; telemetry; backfill migration.
  • pipeline/toml_filter.rs: Legacy learned.toml repair now injects default match_command = "^$" to avoid skip warnings.
  • session/learn.rs: Safe fallback for match_command when none provided.
  • session/tracker.rs: Improved infer_domain to prefer directory prefixes, fallback to basename without extension.
  • store/sqlite.rs: Added passthrough_events, unhandled_tools, schema_migrations; migration to rename vscode agent to cursor.
  • util/command_family.rs: Normalizes common command families for compression thresholds.
  • tests: Added numerous unit tests for cursor helpers, graph extraction, command family, and domain inference.

Notes

  • All new guards are non‑blocking: they emit warnings but never block execution.
  • Migration runs idempotently; older builds will be updated automatically.

Breaking Changes

None. All APIs remain backward compatible; new environment variables (OMNI_AGENT_ID, OMNI_CMD) are optional.

Last updated: 2026-05-05 17:15:38

fajarhide added 14 commits May 4, 2026 11:54
… telemetry for passthrough and retrieval events.
…just compression thresholds for higher retrieval rates
… for file dependencies and mutating commands
…prioritize directory paths and handle basename fallback
@fajarhide fajarhide merged commit 612b1c3 into main May 5, 2026
4 checks passed
@fajarhide fajarhide deleted the fix/0.5.7-rc1 branch May 5, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant