# BR-CONV-03

When a call names no conversation, then it is refused, before anything is sent to the model.

Defined in [Follow a conversation and restore the reply](https://docs.piighost.dev/en/domain/processes/follow-a-conversation/#br-conv-03).

## Where the rule lives

- [`_thread_id()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/langchain/middleware.py#L47)
- [`_rewrite_tool_output()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/claude_code/hooks.py#L92)

## Direct tests

- [`tests/integrations/langchain/test_middleware.py::TestThreadId::test_a_missing_id_raises`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L176)
- [`tests/integrations/langchain/test_middleware.py::TestThreadId::test_reads_the_configured_thread_id`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L158)
- [`tests/integrations/langchain/test_middleware.py::TestThreadId::test_the_shared_thread_is_named_explicitly`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L183)

## Indirect tests

- [`tests/integrations/langchain/test_middleware_e2e.py::test_second_model_call_never_sees_clear_tool_args`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware_e2e.py#L74)
- [`tests/integrations/langchain/test_middleware_stream.py::test_middleware_deanonymize_stream_restores_split_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware_stream.py#L33)
- [`tests/integrations/langchain/test_middleware.py::TestFactoryContract::test_a_pipeline_without_a_recognizer_is_refused`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L639)
- [`tests/integrations/langchain/test_middleware.py::TestFactoryContract::test_reads_the_recognizer_from_the_pipeline`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L610)
- [`tests/integrations/test_claude_code_hooks.py::test_an_event_without_a_session_id_is_refused`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L92)
- [`tests/integrations/test_claude_code_hooks.py::test_missing_field_is_a_no_op`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L100)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_anonymizes_grep_matching_lines`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L173)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_anonymizes_read_content_leaves_path`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L107)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_anonymizes_string_output`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L42)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_edit_anonymizes_text_leaves_metadata`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L127)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_leaves_grep_file_names_untouched`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L191)
- [`tests/integrations/test_claude_code_hooks.py::test_post_tool_use_unknown_tool_is_passthrough`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L229)
- [`tests/integrations/test_claude_code_hooks.py::test_pre_tool_use_deanonymizes_tool_input`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L59)
- [`tests/integrations/test_claude_code_hooks.py::test_unknown_event_is_a_no_op`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L85)
- [`tests/integrations/test_claude_code_hooks.py::test_user_prompt_submit_records_the_prompt_without_a_mutation`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_claude_code_hooks.py#L25)

## Used by

- [`PIIAnonymizationMiddleware.aafter_model()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/langchain/middleware.py#L186)
- [`PIIAnonymizationMiddleware.abefore_model()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/langchain/middleware.py#L153)
- [`PIIAnonymizationMiddleware.awrap_tool_call()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/langchain/middleware.py#L220)
- [`handle_hook()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/claude_code/hooks.py#L136)
- [`withhold_tool_output()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/claude_code/hooks.py#L111)

Read from the code graph graphify builds, at the places the domain documentation gives.
