> This page is for version 0.5.1.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.

# nemo_gym.web.evaluation_collision

Pure collision planning shared by WebArena preparation and scoring.

## Module Contents

### Functions

| Name                                                                                                    | Description                                                          |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [`_add_page_image_snapshot`](#nemo_gym-web-evaluation_collision-_add_page_image_snapshot)               | -                                                                    |
| [`_add_program_html_snapshot`](#nemo_gym-web-evaluation_collision-_add_program_html_snapshot)           | -                                                                    |
| [`_add_snapshot`](#nemo_gym-web-evaluation_collision-_add_snapshot)                                     | -                                                                    |
| [`_is_fixed_url`](#nemo_gym-web-evaluation_collision-_is_fixed_url)                                     | -                                                                    |
| [`_literal_arg`](#nemo_gym-web-evaluation_collision-_literal_arg)                                       | -                                                                    |
| [`_plan_helper_call`](#nemo_gym-web-evaluation_collision-_plan_helper_call)                             | -                                                                    |
| [`_program_html_collision_key`](#nemo_gym-web-evaluation_collision-_program_html_collision_key)         | -                                                                    |
| [`_supports_page_image_snapshot`](#nemo_gym-web-evaluation_collision-_supports_page_image_snapshot)     | -                                                                    |
| [`_supports_program_html_snapshot`](#nemo_gym-web-evaluation_collision-_supports_program_html_snapshot) | -                                                                    |
| [`build_collision_plan`](#nemo_gym-web-evaluation_collision-build_collision_plan)                       | Derive snapshot adapters from a task's evaluator config.             |
| [`build_collision_plans`](#nemo_gym-web-evaluation_collision-build_collision_plans)                     | Build collision plans using the selected benchmark tasks as context. |
| [`extract_helper_calls`](#nemo_gym-web-evaluation_collision-extract_helper_calls)                       | Return helper calls from a `func:` expression without evaluating it. |
| [`has_collision_mitigation`](#nemo_gym-web-evaluation_collision-has_collision_mitigation)               | -                                                                    |
| [`snapshot_target_key`](#nemo_gym-web-evaluation_collision-snapshot_target_key)                         | -                                                                    |

### Data

[`HIGH_RISK_HELPERS`](#nemo_gym-web-evaluation_collision-HIGH_RISK_HELPERS)

[`REVIEW_HELPERS`](#nemo_gym-web-evaluation_collision-REVIEW_HELPERS)

### API

```python
nemo_gym.web.evaluation_collision._add_page_image_snapshot(
    plan: dict[str, typing.Any],
    query: dict[str, typing.Any]
) -> None
```

```python
nemo_gym.web.evaluation_collision._add_program_html_snapshot(
    plan: dict[str, typing.Any],
    target: dict[str, typing.Any]
) -> None
```

```python
nemo_gym.web.evaluation_collision._add_snapshot(
    plan: dict[str, typing.Any],
    adapter: str,
    params: typing.Any = {}
) -> None
```

```python
nemo_gym.web.evaluation_collision._is_fixed_url(
    value: typing.Any
) -> bool
```

```python
nemo_gym.web.evaluation_collision._literal_arg(
    node: ast.AST
) -> typing.Any
```

```python
nemo_gym.web.evaluation_collision._plan_helper_call(
    plan: dict[str, typing.Any],
    call: dict[str, typing.Any]
) -> None
```

```python
nemo_gym.web.evaluation_collision._program_html_collision_key(
    target: dict[str, typing.Any]
) -> str | None
```

```python
nemo_gym.web.evaluation_collision._supports_page_image_snapshot(
    query: dict[str, typing.Any]
) -> bool
```

```python
nemo_gym.web.evaluation_collision._supports_program_html_snapshot(
    target: dict[str, typing.Any]
) -> bool
```

```python
nemo_gym.web.evaluation_collision.build_collision_plan(
    task_config: dict[str, typing.Any],
    program_html_collision_keys: set[str] | None = None
) -> dict[str, typing.Any]
```

Derive snapshot adapters from a task's evaluator config.

```python
nemo_gym.web.evaluation_collision.build_collision_plans(
    task_configs: list[dict[str, typing.Any]]
) -> list[dict[str, typing.Any]]
```

Build collision plans using the selected benchmark tasks as context.

Fixed-URL program_html snapshots are only enabled when more than one task in
the selected set checks the same mutable target. Most targets use the URL as
their collision key; GitLab raw/blob file targets share a key by repo and
branch because commits to different files on the same branch can conflict.
This avoids snapshot overhead and false negatives for unique mutation tasks
while keeping protection for genuinely shared mutable surfaces.

```python
nemo_gym.web.evaluation_collision.extract_helper_calls(
    expr: typing.Any
) -> list[dict[str, typing.Any]]
```

Return helper calls from a `func:` expression without evaluating it.

```python
nemo_gym.web.evaluation_collision.has_collision_mitigation(
    plan: dict[str, typing.Any] | None
) -> bool
```

```python
nemo_gym.web.evaluation_collision.snapshot_target_key(
    target: dict[str, typing.Any]
) -> str
```

```python
nemo_gym.web.evaluation_collision.HIGH_RISK_HELPERS = {'shopping_get_latest_order_url', 'shopping_get_sku_latest_review_author', 'shop...
```

```python
nemo_gym.web.evaluation_collision.REVIEW_HELPERS = {'shopping_get_sku_latest_review_author', 'shopping_get_sku_latest_review_rating...
```