# Tessera dashboard: Planted bugs

G6 plants small bugs (mutants) in each accepted task's reference solution and runs the feature tests against each one. A mutant is caught when the tests fail on it.

**35 of 36 mutants caught** (97.2%).

## task_001: Aliases for choice values

11 of 11 caught (threshold 0.7).

| Mutant | Operator | File | Before | After | Result | Return code |
| --- | --- | --- | --- | --- | --- | --- |
| M01_is_not_none_flip | is_not_none_flip | src/click/types.py | `if aliases is not None and not isinstance(aliases, cabc.Mapping):` | `if aliases is None and not isinstance(aliases, cabc.Mapping):` | caught | 1 |
| M02_raise_remove | raise_remove | src/click/types.py | `raise TypeError("aliases must be a mapping")` | `pass` | caught | 1 |
| M03_is_not_none_flip | is_not_none_flip | src/click/types.py | `items = tuple(aliases.items()) if aliases is not None else ()` | `items = tuple(aliases.items()) if aliases is None else ()` | caught | 1 |
| M04_raise_remove | raise_remove | src/click/types.py | `raise TypeError("alias keys must be strings")` | `pass` | caught | 1 |
| M05_eq_to_neq | eq_to_neq | src/click/types.py | `if choice == target:` | `if choice != target:` | caught | 1 |
| M06_raise_remove | raise_remove | src/click/types.py | `raise ValueError("alias target is not a choice")` | `pass` | caught | 1 |
| M07_eq_to_neq | eq_to_neq | src/click/types.py | `normalized_aliases[normalized] == target` | `normalized_aliases[normalized] != target` | caught | 1 |
| M08_raise_remove | raise_remove | src/click/types.py | `raise ValueError("normalized alias collision")` | `pass` | caught | 1 |
| M09_eq_to_neq | eq_to_neq | src/click/types.py | `if canonical_key == normalized and not (choice == target):` | `if canonical_key != normalized and not (choice == target):` | caught | 1 |
| M10_raise_remove | raise_remove | src/click/types.py | `raise ValueError("normalized alias collision")` | `pass` | caught | 1 |
| M11_return_val_none | return_val_none | src/click/types.py | `return normalized_aliases[normed_value]` | `return None` | caught | 1 |

## task_002: Limit invalid custom-type prompt attempts

4 of 4 caught (threshold 0.7).

| Mutant | Operator | File | Before | After | Result | Return code |
| --- | --- | --- | --- | --- | --- | --- |
| M01_is_not_none_flip | is_not_none_flip | src/click/termui.py | `if max_invalid_attempts is not None and max_invalid_attempts <= 0:` | `if max_invalid_attempts is None and max_invalid_attempts <= 0:` | caught | 1 |
| M02_raise_remove | raise_remove | src/click/termui.py | `raise ValueError("max_invalid_attempts must be greater than 0")` | `pass` | caught | 1 |
| M03_is_not_none_flip | is_not_none_flip | src/click/termui.py | `if max_invalid_attempts is not None and invalid_attempts >= max_invalid_attempts:` | `if max_invalid_attempts is None and invalid_attempts >= max_invalid_attempts:` | caught | 1 |
| M04_raise_remove | raise_remove | src/click/termui.py | `raise Abort() from None` | `pass` | caught | 1 |

## task_003: Mutually exclusive command-line options

11 of 12 caught (threshold 0.7).

| Mutant | Operator | File | Before | After | Result | Return code |
| --- | --- | --- | --- | --- | --- | --- |
| M01_is_none_flip | is_none_flip | src/click/core.py | `if groups is None:` | `if groups is not None:` | caught | 1 |
| M02_eq_to_neq | eq_to_neq | src/click/core.py | `isinstance(param, Option) and param.name == name` | `isinstance(param, Option) and param.name != name` | caught | 1 |
| M03_neq_to_eq | neq_to_eq | src/click/core.py | `) != 1:` | `) == 1:` | caught | 1 |
| M04_raise_remove | raise_remove | src/click/core.py | `raise ValueError(` | `pass` | caught | 2 |
| M05_return_val_none | return_val_none | src/click/core.py | `return original_parse_args(ctx, args)` | `return None` | caught | 1 |
| M06_raise_remove | raise_remove | src/click/core.py | `raise UsageError(` | `pass` | caught | 2 |
| M07_return_val_none | return_val_none | src/click/core.py | `return original_invoke(ctx)` | `return None` | caught | 1 |
| M08_raise_remove | raise_remove | src/click/decorators.py | `raise TypeError("Exclusive option names must be strings.")` | `pass` | caught | 1 |
| M09_neq_to_eq | neq_to_eq | src/click/decorators.py | `if len(names) < 2 or any(not name for name in names) or len(set(names)) != len(names):` | `if len(names) < 2 or any(not name for name in names) or len(set(names)) == len(names):` | caught | 1 |
| M10_raise_remove | raise_remove | src/click/decorators.py | `raise ValueError(` | `pass` | caught | 2 |
| M11_return_val_none | return_val_none | src/click/decorators.py | `return f` | `return None` | caught | 1 |
| M12_return_val_none | return_val_none | src/click/decorators.py | `return decorator` | `return None` | survived | 0 |

## task_007: Context-scoped idempotent help text

3 of 3 caught (threshold 0.7).

| Mutant | Operator | File | Before | After | Result | Return code |
| --- | --- | --- | --- | --- | --- | --- |
| M01_is_not_none_flip | is_not_none_flip | src/click/formatting.py | `if record is not None and key in record[1]:` | `if record is None and key in record[1]:` | caught | 1 |
| M02_is_none_flip | is_none_flip | src/click/formatting.py | `if record is None:` | `if record is not None:` | caught | 1 |
| M03_return_val_none | return_val_none | src/click/globals.py | `return tuple(_local.__dict__.get("stack", ()))` | `return None` | caught | 1 |

## task_009: Identify chained commands in type validation errors

6 of 6 caught (threshold 0.7).

| Mutant | Operator | File | Before | After | Result | Return code |
| --- | --- | --- | --- | --- | --- | --- |
| M01_is_none_flip | is_none_flip | src/click/exceptions.py | `if self.param_hint is None and self.param is None:` | `if self.param_hint is not None and self.param is None:` | caught | 1 |
| M02_is_not_none_flip | is_not_none_flip | src/click/exceptions.py | `if self._type_validation_error and self.ctx is not None:` | `if self._type_validation_error and self.ctx is None:` | caught | 1 |
| M03_is_not_none_flip | is_not_none_flip | src/click/exceptions.py | `if parent is not None:` | `if parent is None:` | caught | 1 |
| M04_return_val_none | return_val_none | src/click/exceptions.py | `return f"{self.ctx.command_path}: {message}"` | `return None` | caught | 1 |
| M05_return_val_none | return_val_none | src/click/exceptions.py | `return message` | `return None` | caught | 1 |
| M06_raise_remove | raise_remove | src/click/types.py | `raise error` | `pass` | caught | 1 |

_The evidence does not record line numbers or which test caught each mutant._
