Skip to content

Commit ede0a5d

Browse files
backnotpropclaude
andauthored
implement span writing (#86)
* implement json span writing * comment fix * chore: fmt * Rename DebugCapture → SignalTelemetry, remove dead code - Rename DebugCapture to SignalTelemetry (accurate name for its purpose) - Remove dead fields: signals_configured, errors (written but never read) - Remove add_error() method (only consumer was dead) - Remove ~550 lines of dead formatting/output code from debug.rs - Delete debug/tests.rs (tested dead code) - Update engine/mod.rs to use new type and field names - Remove dead write statements to signals_configured and errors The struct is now a minimal container (~35 lines) that collects signal execution data for telemetry. TelemetryContext handles all actual output (debug files + telemetry JSON). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Extract config.rs and move PolicyUnit to metadata.rs Step 1 of engine/mod.rs refactor (Surgical Plus approach): - Create engine/config.rs with: - find_shell_command() and SHELL_COMMAND static - ProjectPaths struct and impl (~125 lines) - EngineConfig struct and impl (~35 lines) - Move PolicyUnit struct to metadata.rs (enables future routing.rs extraction) - Update mod.rs re-exports for public API compatibility mod.rs reduced from 2506 to 2290 lines (~216 lines extracted) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Apply Executor pattern to global evaluation path, remove legacy code - Add executor.rs module with Executor struct that handles all OS/IO interactions (signal gathering, action execution) - Add execute_global_actions() and gather_global_signals() methods - Update evaluate() to create Executor early for both global and project evaluation paths - Update evaluate_global() to accept Executor parameter - Remove legacy methods from mod.rs: - gather_signals_with_rulebook - execute_signals_from_rulebook - execute_actions_with_rulebook - execute_rule_specific_actions - execute_single_action - Gate route_with_map under #[cfg(feature = "catalog")] - Fix Python test fixtures: move test_basic.rego to policies/claude/ - Update setup_test_policies to copy both policies/ and system/ dirs This eliminates DRY violation and security maintenance risk from duplicate action execution code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove dead code and redundant abstractions - routing_debug.rs: Remove unused CLI inspection methods (inspect_route, list_all_routes) - trace.rs: Remove extract_event_name and extract_tool_name (only used in tests, not production code) - routing.rs: Remove redundant create_all_routing_keys_from_metadata wrapper that just called create_routing_key_from_metadata - Update mod.rs to use create_routing_key_from_metadata directly Note: fixtures/bundle.tar.gz is already gitignored by root .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Track actual preprocessing operations instead of hardcoded list Address reviewer concern: hardcoded preprocessing operations in telemetry did not reflect what was actually applied. Changes: - Add PreprocessResult struct to track which operations were performed - Update preprocess_input to return PreprocessResult - Update helper functions to return bool indicating if they applied changes: - preprocess_claude_bash_command - preprocess_cursor_shell_command - normalize_write_edit_content_fields - resolve_and_attach_symlinks - Update main.rs to use actual operations from PreprocessResult Now telemetry accurately reports only operations that were actually performed based on config and input data, rather than always reporting the same hardcoded list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix telemetry for signals * chore: fix fmt * chore: fix fmt * chore: fix fmt * remove otlp forwarder * remove Unnecessary comments * telemetry docs * better span structure for signal evaluation * simplify init * chore: fmt/clippy * proper builtin routing * use fixture for example * use fixture for example --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ac9a962 commit ede0a5d

54 files changed

Lines changed: 3278 additions & 2764 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cupcake/note.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)