Impure `postToolUse` path: [`evaluate_cursor_post_tool_use`] plus per-session hint dedupe persisted under the project's `.tracedecay/` dir.
(event_json: &str)
| 369 | /// Impure `postToolUse` path: [`evaluate_cursor_post_tool_use`] plus |
| 370 | /// per-session hint dedupe persisted under the project's `.tracedecay/` dir. |
| 371 | pub fn cursor_post_tool_use_decision(event_json: &str) -> Option<String> { |
| 372 | let parsed: Value = serde_json::from_str(event_json).ok()?; |
| 373 | let hint = decide_hint(&cursor_tool_hint_input(&parsed))?; |
| 374 | let root = cursor_project_root_candidate_from_parsed_event(&parsed); |
| 375 | let hint_id = mint_hint_id(); |
| 376 | record_hint_analytics( |
| 377 | root.as_deref(), |
| 378 | "hint_candidate", |
| 379 | HintAgent::Cursor, |
| 380 | event_session_id(&parsed).as_deref(), |
| 381 | &hint_id, |
| 382 | &hint, |
| 383 | ); |
| 384 | let hint = deduped_cursor_hint(event_json, &hint_id, hint)?; |
| 385 | Some( |
| 386 | serde_json::json!({ |
| 387 | "additional_context": format_tool_hint(&hint), |
| 388 | }) |
| 389 | .to_string(), |
| 390 | ) |
| 391 | } |
| 392 | |
| 393 | /// Suppresses hints that were already emitted for this session. |
| 394 | /// |