Skip to content

Releases

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 06:40
24d024c

Added

  • scorer_failure_scored (IEBP012) flags broad exception handlers that turn grader or sandbox failures into fixed results. It checks scorer functions and the package helpers they call. Grader failures are reported as errors and sandbox failures as warnings. The hints recommend letting errors propagate, with Score.unscored(...) reserved for grader replies without a usable verdict (#56).
  • grader_model_under_test (IEBP013) reports an error when scorer code uses get_model() to select the model under evaluation and generate a grading response. It covers omitted model arguments, state.model, and parameters that default to None. Reading model metadata is allowed, and calls with role= remain covered by IEBP002. The rule documentation lists supported forms and limitations (#61).
  • fence_tolerant_json (IECQ008) warns when json.loads, model_validate_json or validate_json parses a model completion generated in the same function without allowing code fences. Models can wrap JSON in fences even when asked for bare JSON or given a response schema. The hint recommends inspect_evals.utils.code.strip_json_fence, and the rule runs only where that helper is available (#92).
  • dockerfile_locking (IEBP007) accepts Git repository ADD instructions pinned to a full commit using #<commit> or --checksum=<commit>. Branches, tags and short hashes are reported as unpinned. The hint for an unpinned git clone now includes these BuildKit alternatives (#99).
  • verdict_parse_anchored (IEBP015) reports errors for verdict substrings and unanchored verdict regexes that can mistake text in a judge's reasoning for its final verdict. Word boundaries and lookarounds still allow matches anywhere in the response and are also flagged. The rule warns on whole-response searches for labelled numbers, which can match quoted text. Output read from state.output is excluded because it belongs to the model under evaluation (#57).

Fixed

  • dockerfile_locking (IEBP007) accepts a git clone followed in the same RUN by a checkout, switch or hard reset to a full commit in the cloned directory. It also accepts git clone --revision=<commit> and git checkout FETCH_HEAD after fetching a full commit. Branches, tags, short hashes and checkouts in a different directory still warn (#99).
  • Ruff pre-commit hooks use the project's locked development dependency, keeping them in sync with tests when Dependabot updates Ruff (#101).

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 02:16
f12a458

IESC001 now applies the mount checks that inspect_ai's Docker sandbox enforces in releases after 0.3.279, so a Compose file the sandbox would refuse fails the lint first. This can fail a package that passed 0.11.0. Any writable host bind mount fails, even an allowlisted one, and so does any volumes_from. Before moving a pin, add :ro to bind mounts the sandbox only reads, or set the x-inspect_docker_sandbox.unsafe_allow_writable_host_mounts opt-out and allowlist it after review. The JSON report schema is unchanged. IETS008 now also accepts the packaged pytest_inspect_evals.metrics helper, and --explain works from a wheel without mdformat.

Changed

  • custom_metric_tests (IETS008) now accepts the packaged epoch helper by default. A test counts when it imports pytest_inspect_evals.metrics or the deprecated tests/utils/metric_epochs.py shim. Before, only metric_epochs counted, so a test written the recommended way was still warned about. helper-module now takes a list as well as one name. A dotted name must appear as consecutive parts of the import path: pytest_inspect_evals.metrics matches from pytest_inspect_evals import metrics but not from inspect_evals.foo import metrics. Before, a dotted name matched by its last part alone.
  • sandbox_privileges (IESC001) now also reports the mounts that inspect_ai's Docker sandbox refuses by default in releases after 0.3.279: writable host bind mounts, read-only binds, configs or secrets in a service that could remount them writable, shared bind propagation, writable submounts, any volumes_from, and named volumes or mount types whose host access cannot be verified. These findings have no allowlist key, because an allowlist entry cannot make inspect_ai accept the mount. Upgrading can fail a package that passed before, including one whose writable bind mount or volumes_from is allowlisted. Fix the mount, usually by adding :ro, or set the top-level x-inspect_docker_sandbox.unsafe_allow_writable_host_mounts: true opt-out. The rule reports the opt-out for review under that key. A non-boolean opt-out value is an error, since inspect_ai refuses it too.

Fixed

  • --explain no longer fails with ModuleNotFoundError: No module named 'mdformat' when the package is installed from a wheel. It ran the rule's page through mdformat, which is only a docs dependency. The page is now printed as written, which renders the same in the terminal; the doc field of --output-format json can differ from docs/rules/<code>.md in whitespace and table rules.

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 04:52
e410d9f

Added

  • readme_task_args (IEFS007) checks the -T name=value arguments in the README's inspect eval and inspect eval-set commands, in fenced code blocks and inline code, with or without uv run and across line continuations. Each task the command names is resolved against the package's @task functions as <namespace>/<task>, a bare <task> or path/to/file.py@task, and every -T name must be a parameter of every resolved task. Inspect drops an argument the task does not take and only logs a warning, so the command runs with the default. Tasks that do not resolve to the package, such as placeholders and other packages' tasks, and tasks that take **kwargs are not checked. A README generator that rewrites a generated parameter list does not read the hand-written examples around it, which is how these drift. Findings are errors (#59).
  • readme_dependency_groups (IEFS008) checks the extras and dependency groups the README's commands install. In a uv command, --extra X must name an extra under [project.optional-dependencies] and --group X a group under [dependency-groups]. In a pip install (also pip3, python -m pip and uv pip) or uv add command, project[X] must name an extra when the project is the repository's own or .. Names are compared in normalised form. The governing pyproject.toml is the repository's, or the evaluation's own <isolated-packages-dir>/<name>/pyproject.toml when it has one, and the message names it. Other projects' extras, placeholders, uv commands with --project, --directory or --package, and commands after a cd in the same code block are not checked. A pyproject.toml that is not valid TOML skips the rule. A name that exists as the other kind gets a hint to switch flags. Findings are errors (#60).
  • metric_epoch_safety (IEBP014) checks custom metrics against the scores Inspect actually hands them. By default the epoch reducer runs before every metric, even at epochs=1: value can be an epoch mean such as 0.667, and answer, explanation and reason are None unless every epoch agrees. The rule reads each @metric function, including the function it returns and helpers nested in it, and each @score_reducer. It reports an error for .as_int(), .as_bool() or int(...) of anything computed from a score value in a metric, but not int(len(...)) or int() of a comparison. It warns on a single-type isinstance(v, int) or isinstance(v, float) applied directly to a score value; (int, float) and the isnan guard are not flagged. It reports an error for reading <x>.score.answer, .explanation or .reason in a metric, and for an attribute or subscript assignment into the scores a metric or reducer was handed. Names are followed in statement order, so rebinding one to a deep copy ends it, and a store into a field that a shallow model_copy() shares with the original is flagged. @metric(scores="unreduced") metrics see raw epoch scores, so only the last check applies to them. The hints recommend converting each value with the function value_to_float() returns, as accuracy() and mean() do, which holds under every reducer except collect. Score.as_float() raises on "C", and a type filter drops samples under mode or max. Nothing is followed into plain helper functions or other files (#58).
  • shared_code_extraction (IECQ006) warns where an evaluation extracts code from a completion with its own fence pattern instead of inspect_evals.utils.code.extract_code_block. It flags a string literal holding a triple-backtick fence, or a regex quantifier for three backticks, passed as the pattern to re.compile, search, findall, finditer, match, fullmatch or sub, or as a tag to extract_from_tags. As the separator to split, replace, find, partition or startswith it counts only with a language label, so a bare fence toggle while reading markdown does not warn. F-strings, + concatenations and names bound to a literal in the same function or at module level count, including a name inside a concatenation. There is one warning per function, and one for a file's module-level patterns. A pattern whose fences are all labelled json is left alone, and so is a bare closing fence beside one in the same function. A (?:json|python)? alternation still warns. Test files and the helper's own module are not read. The rule applies only where the helper is available: a helper package defines extract_code_block (inspect_evals itself), or the root pyproject.toml declares inspect-evals outside dev. Elsewhere it is skipped. The docs say a migration needs a task version bump, and that an evaluation whose upstream benchmark takes a different block should suppress with a reason (#62).
  • ruff_rules_enabled (IECQ007) warns when the ruff configuration governing a package does not enable a rule in a curated set of ruff rules that matter for evaluations. The set starts with PLW1514 (unspecified-encoding); each entry carries its justification on the rule page. The check asks ruff rather than parsing its configuration: it lints a snippet the rule reports as though it were a file in the package, so select prefixes, extend-select, ignore, extend, per-file-ignores, preview and explicit-preview-rules apply as ruff applies them. A preview rule selected by a prefix while preview is off counts as not enabled. A repository with no ruff configuration gets ruff's defaults, which enable none of the set. The message names the configuration file and how many violations ruff would report under the source root with the rule on. The rule uses the ruff package installed alongside the linter, else ruff on PATH, and skips when there is neither; ruff is not a runtime dependency. It also skips, with ruff's reason, when ruff cannot load the configuration, and a failing ruff is tried once per configuration in a run. A repository declines an entry with a reason under [tool.inspect-evals-lint.ruff_rules_enabled] declined, and the finding is then reported as suppressed (#64).
  • custom_metric_tests (IETS008) warns about each custom @metric that no test runs through the real epoch reducer. A test counts when it imports the epoch helper module, metric_epochs by default (tests/utils/metric_epochs.py in inspect_evals and the evaluation template), and names the metric as a whole word, or the name given in @metric(name=...). A hand-written test that runs eval() with epochs= is not counted. A unit test that hands a metric hand-built scores misses the reducer, which turns "C" into 1.0 even at epochs=1 and two passes in three epochs into 0.667. The helper module can be renamed with [tool.inspect-evals-lint.custom_metric_tests] helper-module, which takes a bare or dotted module name. It is a warning, and a presence check only.

Changed

  • A rule can mark a diagnostic as shared when it is about something several packages share, such as a repository-wide configuration file. A run lists an identical shared diagnostic once, under the first package that reports it, and each other package records a skip for the rule naming that package. The mechanism is opt-in: only ruff_rules_enabled uses it, and every other diagnostic stays with its package even when its text matches another package's, so no other results change.
  • The documentation pages that list every rule are built with the documentation site instead of committed: the rule index, the front page, llms.txt, llms-full.txt and rules.json. Every new rule changed them, so any two pull requests that added rules conflicted on them. mkdocs serve rebuilds them when a rule or the README changes. docs/rules/ and the README's configuration table are still generated and committed. docs/CHECKS.md stays as a pointer to the site's rule index, because releases up to 0.10.0 link to it.
  • The CLI's "More info about these checks" link goes to the site's rule index instead of docs/CHECKS.md on GitHub.

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 03 Oct 03:23
7790a8c

New checks for model-controlled input run on the host (IESC002) and for unseeded shuffles (IEBP010, IEBP011), and IEBP003 now also checks FieldSpec-built samples. Each can fail a package that passed 0.9.0. Suppression comments should now give a reason, and suppressed findings count as met. Before moving a pin: JSON reports are now schema_version: 3, because suppressed rules count as passing. A consumer that recomputes or checks scores must accept version 3. The inspect_evals docs dashboard and the inspect-evals-actions register publisher already do.

Added

  • host_code_execution (IESC002) reports model-controlled input that reaches code execution on the host instead of in the sandbox. The sources are tool arguments, model output (.completion, .messages, .tool_calls, .arguments, .output.message, .output.choices, state.output, .generate(...) results, ModelOutput parameters) and sandbox() read_file()/exec() results. The sinks are code execution (exec, eval, compile, __import__, runpy.run_path, runpy.run_module), shell commands, processes with a tainted program (subprocess, asyncio.create_subprocess_exec, os.exec*, os.spawn*, os.posix_spawn, pty.spawn), unsafe deserialisation (pickle, marshal, dill and cloudpickle loads, joblib.load, pandas.read_pickle, numpy.load with allow_pickle, unsafe yaml loads, torch.load without weights_only=True) and a tainted importlib.import_module. inspect_ai.util.subprocess is a shell command when its payload is written as a string and a process when it is a list or tuple literal; any other payload is judged like subprocess.run(cmd). Taint is traced within a file, through one level of same-file calls. A traced flow is an error, allowlisted as path/within/package.py:sink. Every other shell, code or deserialisation sink in host code is a warning, so a reviewer sees each one once. Imports resolve per scope, so importing eval from inspect_ai exempts only eval, and only where the import is in force. Files matched by exclude count as sandbox code and are not read (#12).
  • The exclude documentation now defines host code: every Python file outside its globs.
  • Suppression comments take a reason after --: # inspect-evals-lint: ignore[sample_ids] -- ids are row numbers. suppression_syntax (IECQ005) warns about a comment that suppresses something without one. The suppression still applies, and a warning counts as passing, so no score changes. The reason runs to the end of the line and is never read for other markers. -- followed by another tool's comment, a second --, or an unfilled <reason> placeholder does not count as a reason. The rule's pass message now says every comment has a reason.
  • shuffle_choices_seeded (IEBP010) fails each shuffle_choices= that resolves to True, which shuffles the answer choices without a seed and so changes each sample's option order and target letter between builds. An int is a seed and is accepted. shuffle_seeded (IEBP011) warns on each shuffle= that resolves to true with no seed=, or a seed= that resolves to None, since the order decides which samples --limit picks. It asks for a seed, not for the shuffle to go: a dataset whose records come grouped by category or subject needs a shuffle for a --limit run to span it. A call to inspect_evals' shuffle_and_seed(shuffle) is read as shuffle_choices is, so shuffle: bool | int = 42 passes and = True warns. Both rules also read a dataset's .shuffle() and .shuffle_choices() methods, and skip a call inside an if that the defaults never enter, such as if shuffle: with shuffle=False. A dataset helper passed shuffle_choices=True with a seed= is taken to be seeded, but a known loader is not, since its seed= orders the samples, not the choices. Both read any call passing the argument by keyword, so a task's call to its own dataset helper counts, and shuffle and seed passed positionally to the known loaders. A value is read literally, through the enclosing function's parameter default, or through a module constant the file binds once. A value that can't be resolved, including a parameter the function body reassigns, is not flagged. When the value comes from a parameter default the diagnostic points at the default, and calls reading one default report it once. On inspect_evals main IEBP010 fails 6 sites in lab_bench, sad and truthfulqa. IEBP011 warns at 41 sites in 30 evaluations; 3 of them (mmlu twice, scbench) call a helper that seeds internally (#53).
  • A comment can no longer suppress suppression_syntax findings, which are about the comments themselves. per-file-ignores still can.
  • Every suppression the tool suggests now includes -- <reason>: the CLI's failure summary, the footer on each rule page, the llms.txt intro, and the hints for legacy, malformed and past-header markers.

Changed

  • sample_ids (IEBP003) also checks samples built from a FieldSpec. A FieldSpec(...) without id= fails unless every loader it is passed to as sample_fields= sets auto_id=True. A name passed as sample_fields is resolved by Python's scoping rules, and sample_fields and auto_id passed positionally to Inspect's and inspect_evals' loaders are read. An evaluation whose samples all come from FieldSpec now passes or fails instead of skipping. On inspect_evals main this fails at four sites: air_bench, lingoly and both SimpleQA tasks (#52).
  • Suppressed findings count as met. A suppression is a decision recorded in the repository, and pylint, ruff, mypy, Biome and ESLint all leave suppressed findings out of their counts. In Score, passing is now pass + warn + suppressed. The suppressed count is shown beside the score, e.g. **16/17 checks met** (2 by suppression) in the Markdown headline. A package whose only unmet rules were suppressed now scores 100%, where it scored less on 0.9.0.
  • JSON reports use schema_version: 3, because passing and score add up differently. Fields and statuses are unchanged. A consumer that recomputes or checks the score must count suppressed as passing for version 3, and must be updated before any pin moves to this release. There are two: the register publisher in inspect-evals-actions, and the inspect_evals docs dashboard (docs/_scripts/register-lint.mjs), which checks passing against its parts.
  • The Markdown list's summary line counts the rules it holds by kind, e.g. 1 not met · 1 with warnings · 2 met by suppression. by_suppression(score) is exported for consumers that build their own headline.
  • The package builds with uv_build instead of hatchling, and its version is set once in pyproject.toml; inspect_evals_lint.__version__ reads it from the installed metadata. The wheel holds the same files and metadata as before, apart from __init__.py's version lookup. The sdist now holds only the package source, README.md, LICENSE and pyproject.toml, not the whole repository.

Fixed

  • The console's "Failures by check" and "Warnings by check" tables no longer read messages, hints and locations as Rich markup, which dropped bracketed text such as ignore[<rule>] in a hint.
  • A second marker on the same line, before any reason, is now read. Before, only the first marker on a line took effect.

v0.9.0

Choose a tag to compare

@MattFisher MattFisher released this 30 Sep 03:28
d89fa91

What's Changed

New Contributors

Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@MattFisher MattFisher released this 25 Sep 12:41
e27646e

What's Changed

  • main_file: find @task functions in any module; warn, not fail, on an unconventional name by @MattFisher in #37
  • Treat @agent as a model-resolving component in get_model_location and custom_solver_tests by @MattFisher in #38
  • Tests rules: accept any mockllm/ model and a decorator's registered name= by @MattFisher in #39
  • Skip tests_init under the flat (single-evaluation) test layout by @MattFisher in #40
  • external_dependencies: count transitive core requirements; make the per-eval group a monorepo option by @MattFisher in #41
  • Infer the preset from the source root when nothing names one by @MattFisher in #42
  • Name presets for their layout (multi-eval, single-eval, monorepo); deprecate template and register by @MattFisher in #43
  • Release 0.8.0 by @MattFisher in #44

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@MattFisher MattFisher released this 25 Sep 03:02
f781378

What's Changed

  • feat(rules): duplicate_filter_acknowledged (IEBP008) and known_broken_reported (IEBP009) by @MattFisher in #34
  • Docs site: follow the reader's system light/dark setting by @MattFisher in #33
  • Bump basedpyright from 1.40.0 to 1.40.1 in the python group by @dependabot[bot] in #31
  • Release 0.7.0 by @MattFisher in #35

Full Changelog: v0.6.0...v0.7.0

v0.6.0

Choose a tag to compare

@MattFisher MattFisher released this 23 Sep 07:12
8f8bebc

What's Changed

  • Point each rule at the Inspect documentation for its convention by @MattFisher in #28
  • GitHub output: name the location in every message and write the job summary by @MattFisher in #29
  • Release 0.6.0 by @MattFisher in #30

Full Changelog: v0.5.0...v0.6.0

v0.5.0

Choose a tag to compare

@MattFisher MattFisher released this 23 Sep 02:47
605fdb7

What's Changed

  • Lint by task file, score rules once, render Markdown; prepare 0.5.0 by @MattFisher in #25

Full Changelog: v0.4.3...v0.5.0

v0.4.3

Choose a tag to compare

@MattFisher MattFisher released this 23 Sep 01:44
8dbe77a

What's Changed

Full Changelog: v0.4.2...v0.4.3