How thilak15/deontic works
Deontic statically analyzes AI-agent harness files and MCP configurations, profiles context costs, and offers splitting, synchronization, and session-trace analysis. The main workflow is CLI command dispatch into workspace discovery and analysis, followed by diagnostics or reports; separate commands expose cost, split, sync, trace, and live MCP probing. The README documents these capabilities, while sampled source confirms key orchestration and parsing links. Several command internals and analyzer passes are unsampled, so their detailed connections are omitted.
Main entry points: analyzer/index.ts Analysis Orchestrator · src/index.ts CLI Dispatcher · discovery/index.ts File Discovery · path-splitter.ts Path Splitter
Components 24
CLI and Reporting
- CLI Dispatcher
packages/cli/src/index.ts - Check Command
packages/cli/src/commands/check.ts - Cost Command
packages/cli/src/commands/cost.ts - Split Command
packages/cli/src/commands/split.ts - Sync Command
packages/cli/src/commands/sync.ts - Trace Command
packages/cli/src/commands/trace.ts - MCP Probe Command
packages/cli/src/commands/mcp-probe.ts - Diagnostic Reporters
packages/cli/src/reporters
Workspace Preparation
- Workspace Config
packages/core/src/config/index.ts - File Discovery
packages/core/src/discovery/index.ts - Harness Parser
packages/core/src/parser/index.ts - Profile and Scope
packages/core/src/scope/index.ts
Static Analysis
- Analysis Orchestrator
packages/core/src/analyzer/index.ts - Import Checks
packages/core/src/analyzer/00-imports.ts - Contradiction Solver
packages/core/src/analyzer/01-contradiction.ts - Reference Checks
packages/core/src/analyzer/02-ground-truth.ts - Context Budget
packages/core/src/analyzer/03-bloat-cliff.ts - MCP Schema Analysis
packages/core/src/analyzer/04-mcp-schema.ts - Redundancy Checks
packages/core/src/analyzer/05-redundancy.ts - Trace ROI
packages/core/src/analyzer/06-trace-roi.ts - Directive Ontology
packages/core/src/analyzer/ontology.ts
Refactoring and Insights
- Path Splitter
packages/core/src/autofix/path-splitter.ts - Cross-Tool Sync
packages/core/src/autofix/cross-sync.ts
Other components
- Engineer
Connections 31
- Engineer → CLI Dispatcher: runs command
packages/cli/src/index.ts - CLI Dispatcher → Check Command: dispatches check
packages/cli/src/index.ts - CLI Dispatcher → Cost Command: dispatches cost
packages/cli/src/index.ts - CLI Dispatcher → Split Command: dispatches split
packages/cli/src/index.ts - CLI Dispatcher → Sync Command: dispatches sync
packages/cli/src/index.ts - CLI Dispatcher → Trace Command: dispatches trace
packages/cli/src/index.ts - CLI Dispatcher → MCP Probe Command: dispatches probe
packages/cli/src/index.ts - Check Command → Diagnostic Reporters: formats results
packages/cli/src/commands/check.ts - Analysis Orchestrator → Workspace Config: loads config
packages/core/src/analyzer/index.ts - Analysis Orchestrator → File Discovery: discovers files
packages/core/src/analyzer/index.ts - File Discovery → Profile and Scope: classifies files
packages/core/src/discovery/index.ts - File Discovery → Harness Parser: parses harnesses
packages/core/src/discovery/index.ts - Harness Parser → Profile and Scope: resolves scope
packages/core/src/parser/index.ts - Analysis Orchestrator → Import Checks: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → Contradiction Solver: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → Reference Checks: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → Context Budget: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → MCP Schema Analysis: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → Redundancy Checks: runs pass
packages/core/src/analyzer/index.ts - Analysis Orchestrator → Trace ROI: runs pass
packages/core/src/analyzer/index.ts - Contradiction Solver → Directive Ontology: uses ontology
packages/core/src/analyzer/01-contradiction.ts - Path Splitter → Workspace Config: loads config
packages/core/src/autofix/path-splitter.ts - Path Splitter → File Discovery: discovers files
packages/core/src/autofix/path-splitter.ts - Cross-Tool Sync → Workspace Config
packages/core/src/autofix/cross-sync.ts - Cross-Tool Sync → File Discovery
packages/core/src/autofix/cross-sync.ts - CLI Dispatcher → Analysis Orchestrator: checks workspace
- Cost Command → Context Budget: profiles cost
- Split Command → Path Splitter: requests split
- Sync Command → Cross-Tool Sync: requests sync
- Trace Command → Trace ROI: analyzes sessions
- MCP Probe Command → MCP Schema Analysis: probes servers