Skip to content

feat(bridge): PreToolUse decision file warning (GH-333)#339

Merged
fagemx merged 1 commit intomainfrom
feat/GH-333-pretooluse-warning
Mar 20, 2026
Merged

feat(bridge): PreToolUse decision file warning (GH-333)#339
fagemx merged 1 commit intomainfrom
feat/GH-333-pretooluse-warning

Conversation

@fagemx
Copy link
Owner

@fagemx fagemx commented Mar 20, 2026

Summary

  • Add decision_warning.rs with glob-matching engine that checks whether an edited file is governed by active decisions
  • Integrate into dispatch_pre_tool_use as a fourth additionalContext source, triggered only on Edit tool calls
  • Session-scoped DECISION_CACHE with 120s TTL ensures repeated PreToolUse calls avoid re-querying SQLite (PERF-01 < 100ms)

Boundary Compliance

  • BOUNDARY-01: No DecisionRow import in edda-bridge-claude — only DecisionView
  • BOUNDARY-02: Reads via query_active_with_paths() which uses to_view() internally
  • PERF-01: Timing instrumented via tracing::debug!("decision_warning_ms=...")

Test plan

  • test_no_decisions_returns_none — empty ledger returns None
  • test_no_matching_paths_returns_none — non-matching glob returns None
  • test_matching_glob_returns_warning — matching glob returns formatted warning
  • test_multiple_matches — two matching decisions both appear in warning
  • test_matches_any_path_normalization — backslash paths match forward-slash globs
  • test_format_warning_empty_reason — empty reason omits trailing separator
  • cargo clippy -p edda-bridge-claude --all-targets — zero warnings
  • grep -rn "DecisionRow" crates/edda-bridge-claude/ — 0 code results (only comment)

Closes #333

🤖 Generated with Claude Code

Add decision_warning.rs with glob-matching engine that checks if an
edited file is governed by active decisions. Integrates into
dispatch_pre_tool_use as a fourth additionalContext source (Edit tool
only). Session-scoped cache with 120s TTL meets PERF-01 (<100ms).

Boundary compliance:
- BOUNDARY-01: no DecisionRow import
- BOUNDARY-02: reads via query_active_with_paths (to_view)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fagemx fagemx merged commit b5322d5 into main Mar 20, 2026
4 of 7 checks passed
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.

feat(bridge): PreToolUse decision file warning

1 participant