# BR-TOOL-08

When the arguments contain lists or nested objects, then each text they contain is restored, and the other values (numbers, booleans) stay intact.

Defined in [Let a tool act on the real values](https://docs.piighost.dev/en/domain/processes/let-a-tool-act/#br-tool-08).

## Where the rule lives

- [`map_strings()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/_deidentify.py#L38)
- [`_deidentify.py:25`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/_deidentify.py#L25)

## Direct tests

No test calls this code directly.

## Indirect tests

- [`tests/integrations/test_deidentify_stream.py::test_invented_token_is_dropped`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify_stream.py#L73)
- [`tests/integrations/test_deidentify_stream.py::test_invented_token_raises`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify_stream.py#L80)
- [`tests/integrations/test_deidentify_stream.py::test_literal_text_streams_through`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify_stream.py#L59)
- [`tests/integrations/test_deidentify_stream.py::test_token_split_across_chunks_is_restored`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify_stream.py#L51)
- [`tests/integrations/test_deidentify_stream.py::test_trailing_incomplete_token_is_flushed`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify_stream.py#L66)
- [`tests/integrations/test_deidentify.py::TestAnonymize::test_replaces_pii_with_a_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify.py#L46)
- [`tests/integrations/test_deidentify.py::TestDeanonymize::test_round_trips_a_message`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify.py#L53)
- [`tests/integrations/test_deidentify.py::TestInventedStrategy::test_drop_removes_an_invented_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify.py#L66)
- [`tests/integrations/test_deidentify.py::TestInventedStrategy::test_keep_leaves_an_invented_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify.py#L61)
- [`tests/integrations/test_deidentify.py::TestInventedStrategy::test_raise_refuses_an_invented_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/test_deidentify.py#L71)

## Used by

- [`TextDeidentifier.__init__()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/_deidentify.py#L68)
- [`handle_hook()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/claude_code/hooks.py#L136)
- [`TextDeidentifier.anonymize_value()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/_deidentify.py#L150)
- [`TextDeidentifier.deanonymize_value()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/_deidentify.py#L140)

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