> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Changelog

Each entry lists what changed for you in one Doc Detective release. New features come first, then behavior and breaking changes, then notable bug fixes. Releases that only changed internals say so in one line. The newest release comes first, and the oldest entry is version 3.0.0. Major releases lead with their breaking changes and migration steps. To find your installed version, run `npx doc-detective --version`.

Moving to Doc Detective 5? Start with [Upgrade to Doc Detective 5](/docs/ci/upgrade-to-v5).

For commit-level detail, including changes to build and test tooling, see the [GitHub releases](https://github.com/doc-detective/doc-detective/releases) for Doc Detective.

## November 29, 2026

## v5.9.0

### New features

* Each run compares its failures with the newest earlier run in the same `outputDir`. The terminal, Markdown, and HTML reports tag each failure `[new]` or `[already failing]` and list the tests that are now fixed. The results add a `comparison` object and a `failureStatus` on each context. Choose what to compare with in `compareTo` or `--compare-to`. See [Compare with an earlier run](/docs/ci/reporters-and-artifacts#compare-with-an-earlier-run).
* Set `failOn: "new"` or pass `--fail-on new` to fail a run only when a failure is new. When every failure was already failing, the run exits `0`. See [Fail only on new failures](/docs/ci/reporters-and-artifacts#fail-only-on-new-failures).
* An `httpRequest` step's `response.schema` takes a JSON Schema the response body must match. Use it to check the types, formats, and patterns of values that change every run, such as IDs and timestamps. See [Check types, formats, and patterns](/docs/actions/httprequest#check-types-formats-and-patterns).

### Behavior changes

* When `outputDir` holds an earlier run, reports and results include the comparison with no config change. On its own, the comparison doesn't change the exit code. To turn it off, set `compareTo: false` or pass `--no-compare-to`. A fresh CI runner has no earlier run, so cache `outputDir` between jobs or point `compareTo` at a results file you download.
* OpenAPI request and response schema checks enforce `format`, such as `uuid` or `date-time`. Before, Doc Detective ignored `format`, so a step can now fail on a value that passed earlier. See [An OpenAPI schema check fails after an upgrade with a `format` error](/docs/test-docs/http-and-api#an-openapi-schema-check-fails-after-an-upgrade-with-a-format-error).

### Bug fixes

* When an OpenAPI operation has no example, Doc Detective generates examples for `mockResponse` and `useExample`. Those examples now give a field its schema `default` instead of a random value, including a default of `0`, `false`, or `""`.

## November 28, 2026

## v5.8.0

### New features

* The [`checkFile`](/docs/actions/checkfile) action waits for a finished file and can check its text. Set `path` to match files relative to the spec, such as a report a command writes. Set `download` to match a file the browser downloaded. Downloads work in desktop Chrome and Firefox.
* Doc Detective runs Gherkin `.feature` files with no config. Each scenario runs as a test, and each row of a scenario outline's examples runs as its own test. Each step phrase maps to a Doc Detective action. You don't write step definitions. See [Gherkin input format](/docs/test-docs/input-formats/gherkin).
* The `cucumber` reporter writes `cucumber.json`, which Xray, Allure, and other test-management tools import. See [Read the Cucumber report](/docs/ci/reporters-and-artifacts#read-the-cucumber-report).
* A `runOn` entry takes a `matrix` of values, and a test runs once for each combination of the keys its steps reference as `$$matrix.<key>`. List the values inline, or load them from a JSON array file or a sitemap's `<loc>` entries. Use it to run one test against every page of a site or every locale. See [Run once per value with `matrix`](/docs/test-docs/platforms-and-browsers#run-once-per-value-with-matrix).
* `mockRequest` answers in sequence with `responses`, where the last response repeats, and replays recorded responses from a HAR file with `harPath`. See [Answer in sequence](/docs/actions/mockrequest#answer-in-sequence) and [Replay recorded responses](/docs/actions/mockrequest#replay-recorded-responses).
* Screenshot comparison has new controls:
  * `mask` lists elements whose pixels don't count when Doc Detective compares a screenshot with its reference image, such as a clock or an ad. See [Ignore parts that change](/docs/test-docs/screenshot-visual-regression#ignore-parts-that-change).
  * `threshold`, from `0` to `1`, sets how different a pixel's color must be to count as changed. `maxDiffPixels` caps the number of changed pixels alongside `maxVariation`. See [`screenshot`](/docs/actions/screenshot).
  * When any pixels differ, the step writes a diff image and a copy of the previous reference image to the run folder. See [Read what changed](/docs/test-docs/screenshot-visual-regression#read-what-changed).
* Screenshot capture has new options. `fullPage` captures the whole scrollable page. `animations: "disabled"` stops the page's motion for the capture. `stable` waits until the page stops changing. `style` applies CSS only for the capture, such as to hide a chat widget. See [`screenshot`](/docs/actions/screenshot).
* The `--overwrite-screenshots` flag and the `overwriteScreenshots` config key set every screenshot step's `overwrite` for a run, so you can accept a redesign without editing each step. See [Accept a redesign in one run](/docs/test-docs/screenshot-visual-regression#accept-a-redesign-in-one-run).

### Behavior changes

* Screenshot comparison ignores small color differences, such as anti-aliasing, because `threshold` defaults to `0.1`. Before, any color change counted. Measured variation can only go down, so no existing reference image starts warning or gets overwritten. To keep the earlier counts, set `threshold: 0`.
* Every browser screenshot waits up to 2 seconds for the page's web fonts to load. Text then shows in its final font.
* Desktop Chrome and Firefox contexts save downloads to a `downloads` folder for the context in the run folder, without a prompt. See [`checkFile`](/docs/actions/checkfile).

### Bug fixes

* Detection and input formats:
  * An inline `test` statement's `before` and `after` files now run. Before, they validated but did nothing.
  * A DITA `<?doc-detective test ...?>` statement whose YAML starts on the line after the keyword now parses. Before, Doc Detective dropped it, and its steps ran in a test with a generated ID.
  * An inline statement that isn't valid YAML, such as `<!-- test testId: a description: b -->`, now produces a warning that names the fix, and `validate` reports it. Before, Doc Detective dropped it without a message.
  * DITA `<uicontrol>` typing steps find the field by its label. Before, every detected DITA typing step failed or typed into the wrong element.
  * A custom file type's `extensions` can be a single string, such as `"js"`, and `"cjs"` no longer matches `.js` files. A markup definition's `actions` can also be a single string.
  * A `runShell` file type's `$1` placeholder, the file's path, works with Windows paths. Before, the run exited `2` with `Bad escaped character in JSON`, or the command got a broken path.
* Browsers, windows, and tabs:
  * A Chrome context whose page never left the blank start page retries on a fresh session again. v5.7.0 had stopped this retry for Chrome.
  * A `mockRequest` with a glob URL no longer strips the headers from responses it doesn't answer.
  * A tab that a page opens, such as with `target="_blank"`, belongs to the window that opened it, so selectors such as `{"window": 0, "tab": 1}` find it.
  * An app window selector of `{ "index": n }` works like a bare index on Windows and macOS.
  * A string `elementClass` in a screenshot annotation or crop matches as one class name.
* Recording and code:
  * Chrome tab recordings keep the viewport's size while Chrome shows its sharing bar. When the screen is too small to make room for the bar, Doc Detective warns.
  * An automatic recording in a context with no browser, app, or device session reports `SKIPPED` instead of failing the context.
  * `runCode` with `directory` saves its output to the right path. Before, the output went to a doubled folder, and on Windows the step failed.
  * On Windows, a background process with `tty` passes quoted arguments to `cmd.exe` intact.

## November 26, 2026

## v5.7.0

### New features

* The [`mockRequest`](/docs/actions/mockrequest) action answers matching browser requests with a response you define, until the test ends. The request never reaches the server. Use it to show stable data in screenshots or to test how a page handles an error. Filter by URL glob and, optionally, by HTTP method. `mockRequest` works in Chrome. Other browsers skip the step.
* The [`saveState`](/docs/actions/savestate) and [`loadState`](/docs/actions/loadstate) actions save the open site's cookies and `localStorage` to a JSON file and load them in a later test. You then sign in once instead of in every test. The file uses Playwright's `storageState` format. `saveState` doesn't replace an existing file unless you set `overwrite`. The file holds live session cookies and tokens, so keep it out of version control and uploaded CI artifacts. See [Pages behind a sign-in](/docs/test-docs/sign-in).
* The `totp(secret)` expression returns the current one-time code for a base32 secret, the code an authenticator app shows. A test can then sign in to an account that uses two-factor authentication. See [Function operators](/reference/reference/expressions#function-operators) and [Sign in with a one-time code](/docs/ci/secrets#sign-in-with-a-one-time-code).
* A context's browser can set what the page sees about the user's device: `colorScheme`, `locale`, `timezone`, `deviceScaleFactor`, `reducedMotion`, and `clock`. Chrome sets every key, and Firefox sets every key except `timezone` and `clock`. A context that asks for a key its browser can't set reports `SKIPPED`. See [Page emulation](/docs/test-docs/platforms-and-browsers#page-emulation).

### Behavior changes

* Chrome sessions now use a different browser connection, which `mockRequest` and the `timezone` and `clock` settings need. Firefox and Safari sessions are unchanged.

### Bug fixes

* [`saveCookie`](/docs/actions/savecookie) keeps each cookie's `httpOnly` flag, so [`loadCookie`](/docs/actions/loadcookie) restores the cookie as it was saved. Cookie files are readable only by your user account, and a save never leaves a partly written file.

## November 20, 2026

## v5.6.3

### Bug fixes

* Interrupting a run, such as with Ctrl+C, while Doc Detective builds WebDriverAgent for iOS now stops the `xcodebuild` process. Before, the build kept running after Doc Detective exited and left its build lock behind. This covers the first-use build during a test run and `doc-detective install ios`. After an interrupt, Doc Detective starts no more builds and opens no more iOS sessions.

## v5.6.2

### Bug fixes

* Fixed recorded browser contexts that crashed with `WebDriverError: move target out of bounds` after a navigation. Doc Detective now keeps the restored recording cursor inside the new page's viewport.

## v5.6.1

### Bug fixes

* When the Android SDK has a system image but no `emulator` package, Doc Detective installs the emulator on first use. Before, the context was skipped with `"emulator" package must be installed!` and the run exited `2`. This happened in CI when a cache restored only `$ANDROID_HOME/system-images`. The repair installs only the missing SDK tools, so it keeps your default Android Virtual Device (AVD).
* Fixed Android and iOS mobile browser contexts that crashed with `Converting circular structure to JSON` when they recorded at the `debug` log level.
* The first-use WebDriverAgent warning says the build can take several minutes. Before, it said about 10 minutes, which overstated the build time on most machines.

## November 19, 2026

## v5.6.0

### New features

* iOS tests on macOS now build WebDriverAgent on first use. If no cached build matches the current Xcode version and driver, the test builds one before it starts. The build goes into the cache. Previously, only `doc-detective install ios --yes` filled the cache, and otherwise Appium compiled its own copy during the session. The first-use build can take about 10 minutes, and Doc Detective warns in the terminal and the report while it runs. If the build fails, the test still runs and Appium builds WebDriverAgent during the session. To keep the build out of test runs, such as in a CI setup step, run `doc-detective install ios --yes` beforehand. To turn off the first-use build, set the `DOC_DETECTIVE_NO_IOS_AUTOINSTALL` environment variable to `1`. See [WebDriverAgent builds on first use](/docs/test-docs/ios-apps#webdriveragent-builds-on-first-use).

### Bug fixes

* Fixed cases where Doc Detective turned off the WebDriverAgent build or reported it as failed:
  * A slow Xcode version check no longer turns off managed WebDriverAgent builds for the rest of the run.
  * A build that another Doc Detective process finishes while this one waits no longer counts as a failure.
  * When the build succeeds but the cache's `installed.json` record can't be updated, Doc Detective warns about the record instead of reporting a failed build. It shows that warning only when the record update itself fails, not for an earlier problem such as a cache lock it can't take.
* Fixed reports that dropped warnings from earlier attempts when Doc Detective ran a context again after its session died. The report now keeps warnings such as an Android toolchain install or a WebDriverAgent build.

## November 18, 2026

## v5.5.0

### New features

* Doc Detective resolves include directives by default before it looks for tests. A test in a shared snippet runs inside each page that includes it, in reading order. It reads AsciiDoc `include::`, MkDocs snippets, mdBook `{{#include}}`, Fern `<Markdown src>`, MDX snippet imports for Docusaurus, Mintlify, Starlight, and Astro, and reStructuredText `.. include::`. See [Includes](/docs/test-docs/input-formats/includes).
* A `fileTypes` entry accepts `includeStatements`, a list of regular expressions for include syntax that Doc Detective doesn't know. See [Includes](/docs/test-docs/input-formats/includes#add-include-syntax-for-a-custom-format).

### Behavior changes

* A file that another input includes, such as `_setup.md`, no longer runs as its own spec. Its tests run once in each page that includes it, so spec and test counts in results can change. A file listed in `beforeAll` or `afterAll` still runs in that phase. To run a partial alone, pass it as the only `--input`. To read every file on its own as before, set `resolveIncludes` to `false` in your config.
* When a test statement comes from an included file, its `location` in results gains a `file` field with that file's absolute path. Freshness badges and verified dates are written into the included file.
* An included file must be inside the working directory. A missing, outside, or circular include prints a warning on stderr and doesn't change the exit code.

## November 17, 2026

## v5.4.0

### New features

* Doc Detective tests reStructuredText (`.rst`) files with no extra config. Inline statements are RST comments, such as `.. test {...}`, `.. step {...}`, and `.. test end`. With step detection on, links, bold text, images, and code blocks become steps, and nothing inside code, literals, or raw blocks does. `rst` is part of the default `fileTypes` list. See [input formats](/docs/test-docs/input-formats/overview).

### Bug fixes

* Fixed reStructuredText detection of escaped markup, quoted literal blocks, and inline literals that wrap across lines.
* Fixed slow scanning of reStructuredText lines with long runs of whitespace.

## November 16, 2026

## v5.3.1

### Bug fixes

* The official Docker image keeps the browsers it ships with instead of downloading newer ones on each run.
* The iOS driver installs on its own, so a failed iOS driver build no longer stops Appium and the browser drivers from installing.

## v5.3.0

### New features

* Doc Detective replaces outdated cached Chrome, ChromeDriver, Firefox, and geckodriver builds with the latest build and deletes the old one. It checks at most once a day. Before, it only warned until you ran `install browsers --force`. If a check or download fails, Doc Detective warns, keeps the installed build, and waits a day before it tries again. To keep the cached builds, set `DOC_DETECTIVE_SKIP_BROWSER_UPDATE=1`. See [`install`](/reference/reference/cli/install).

## v5.2.1

### Behavior changes

* Doc Detective needs Node.js 24.22.1 or later on the 24 line, or 26.12.1 or later on the 26 line. Node.js 25 isn't supported. Before, Doc Detective accepted Node.js 24.15 or later. The Node.js upgrade hint names both ranges.
* Doc Detective installs Appium 4 and the Appium 4 releases of its browser and device drivers.

## November 15, 2026

## v5.2.0

### New features

* Added the `validate` command, which checks spec files and inline tests without running them, as in `doc-detective validate ./docs`. It exits `0` when every test is valid, `1` when any test is invalid, and `2` for a usage error, a bad config, or no tests found. Pass `--json` for a machine-readable list of each file and its errors. Like every other output, `validate` output masks environment variable values. See the [CLI reference](/reference/reference/cli).

## v5.1.0

### New features

* `find` can locate an element by matching a picture of it on screen, through the new `elementImage` field. Use it for targets with no usable text or selector. Give a file path, or an object with `path` or `base64` and optional `threshold` and `color` values. See [`find`](/docs/actions/find).
* `click`, `type`, `dragAndDrop`, screenshot crops, annotation targets, and `goTo`'s `waitUntil.find` accept `elementImage` too.
* An image match also tries the sizes a reference would have at 175%, 225%, 250%, and 300% display scale.
* A run that uses `elementImage` installs its image matcher on demand, and a failed install stops the run before any test starts.

### Bug fixes

* Fixed cropped screenshots that showed a fixed or sticky header instead of the element. The crop target now scrolls to the center of the viewport.
* Fixed screenshot comparisons that reported drift for identical content when the capture and reference differed slightly in size. Images within 5% of each other's size now compare their common region, so `overwrite: "aboveVariation"` no longer replaces a matching reference.
* Fixed screenshots in Firefox that showed what an `annotate` blur should hide. Screenshots now apply live blurs to the capture itself in every browser. If the page can't report its blurs, the screenshot step fails instead of saving the capture.
* Fixed runs that shared a cache and installed runtime packages at the same time, which could remove each other's packages. Installs into one cache now wait for each other, and a run waits for an install in progress before it loads the packages.
* Fixed relative cache paths, which installed packages where Doc Detective couldn't load them. A relative `--cache-dir`, `DOC_DETECTIVE_CACHE_DIR`, or `cacheDir` now resolves against the working directory.
* A `goTo` whose `waitUntil.find` misses names every criterion it looked for, instead of `Element not found ()`.
* Fixed slow parsing of inline attributes that contain a long run of dots.

## November 14, 2026

## v4.43.1

This is a patch release for the version 4 line, published after v5.0.0. To stay on version 4, pin it, as in `npx doc-detective@4`.

### Behavior changes

* Each version 4 run ends with a notice on stderr that Doc Detective 5 is available. It summarizes what changes, how to keep version 4 exit codes while you triage, and how to upgrade with npm, the GitHub Action, or Docker. The notice links to [Upgrade to Doc Detective 5](/docs/ci/upgrade-to-v5), and it doesn't print when the log level is `silent`.
* In GitHub Actions, the notice also shows on the workflow run page, whichever Action version you use.

## November 13, 2026

## v5.0.0

Doc Detective 5 makes a failed test fail the run, separates results from logs, and checks specs strictly. Before you upgrade, read [Upgrade to Doc Detective 5](/docs/ci/upgrade-to-v5). It lists every breaking change and what to do about each one. To stay on version 4 for now, pin it, as in `npx doc-detective@4`.

To migrate from Doc Detective 4:

1. Move to a supported Node.js version, and set `node-version` explicitly in CI.
2. In GitHub Actions workflows, switch to `doc-detective/github-action@v2`.
3. Run your suite once with `--no-exit-on-fail`, so the job stays green while you read the results.
4. Fix the invalid specs and failures the run reports.
5. Update scripts that read the terminal output, report fields, or results paths.
6. If an AI agent runs your tests, update its tools with `npx doc-detective@5 install agents`.
7. Add `.doc-detective/` to `.gitignore`, and remove `--no-exit-on-fail` to turn the gate on.

### Breaking changes

* **Node.js:** Version 5.0.0 dropped Node.js 22, which version 4 supported, and needed Node.js 24.15 or later. Starting with v5.2.1, Doc Detective needs Node.js 24.22.1 or later on the 24 line. On the 26 line, it needs 26.12.1 or later. That release also stopped supporting Node.js 25, which the v5.0.0 range allowed. Move to a supported Node.js version first, and set `node-version` explicitly in CI, because GitHub-hosted runners default to Node.js 22.
* **Exit codes:** A failed test exits `1`. A run that tests nothing valid exits `2`, including an empty run, a run where every test skipped, and a run with an invalid spec. An interrupted run exits `130` or `143`. Let the exit code decide pass or fail, and pass `--no-exit-on-fail` or set `exitOnFail: false` to keep a job green while you triage.
* **Strict specs:** An invalid spec stops the run before any test runs, instead of being skipped with a warning. Unknown keys on specs, steps, and custom file types make them invalid, and the error suggests the closest valid key. Keys that never did anything, such as `crawl`, `breakpoint`, and an app's `workingDirectory`, are rejected too. Fix or delete each key the error names.
* **Checks that used to pass:** A broken or empty `jq()` query and a condition that's only text, such as an unset `$VARIABLE`, now evaluate to false. Object-shaped `assertions` fail the step. A step with two actions, a duplicate `testId`, and a missing `before` or `after` file make the spec invalid. Run your suite and fix what it reports.
* **Routing handlers:** A routing entry that names an action Doc Detective can't perform at that scope makes the spec invalid. On a step, use `stop: "test"`. To skip a spec's remaining tests, move the handler to the test and use `stop: "spec"`.
* **Step values:** Timeouts that limit how long an operation runs start at `1`, and waits can't be negative. `"browser": "edge"` and the device fields `orientation`, `udid`, and `provider` are rejected. URLs must start with a variable, `http://`, `https://`, or `/`, and request header values must be strings. `"click": true` is invalid, so quote text you want to click, and a `find.click` object takes only `button` and `duration`. Fix each step the error names.
* **Test detection:** Doc Detective parses each file before it detects tests. With step detection on, AsciiDoc and HTML detect steps the way Markdown does, and DITA detects more step types. Markdown code blocks tagged `py` or `js` become `runCode` steps, and capitalized typing instructions such as `Type "kittens"` become `type` steps. Code samples and `json` code blocks no longer produce steps. Compare `--dry-run` output from version 4 and version 5, or set `detectSteps: false` to turn off step detection.
* **Results and logs:** Only results go to stdout. Logs, warnings, hints, and report notices go to stderr without level labels such as `(INFO)`, and the terminal summary has a new format. Read results with `--json`, `--plain`, or `--output` instead of parsing the summary, and redirect with `2>&1` to collect both streams.
* **Report contents:** JUnit test cases are named after test and context IDs, so your CI's test history restarts once. The Markdown and HTML verdicts count tests, and failure and skip messages are reworded. Each step in the results shows its effective object form, so read `goTo.url` instead of `goTo`. Some names changed with no alias, such as `$$stdioMatched` to `$$stdioMatches` and a step's `autoScreenshot` to `autoScreenshotPath`. Update scripts and outputs that read these values.
* **Output paths:** `--output` and `output` always name the JSON results file. Use the new `--output-dir` flag or `outputDir` key for a folder. A run no longer writes `testResults-<timestamp>.json` to the current directory. Read `.doc-detective/runs/<runId>/testResults.json` instead.
* **Screenshots and recordings by default:** `autoScreenshot` and `autoRecord` are on unless you set them to `false`, so every run writes a run folder. To keep version 4's behavior, set both to `false` or pass `--no-auto-screenshot --no-auto-record`. Add `.doc-detective/` to `.gitignore`.
* **Capture locations:** `screenshot: true`, `screenshot: {}`, and `record: true` write to `outputDir` instead of the current folder. Move existing reference images to `outputDir`, or give the step a `path`.
* **Chrome by default:** A context that names no browser runs Chrome first, and a `record` context with no browser runs headless Chrome. To keep a context on Firefox, name `firefox` in its `runOn` entry, and refresh reference images taken in another browser.
* **Masked environment variables:** Logs, reports, results, and saved step output show environment variable values as `***NAME***`. Browser screenshots blur elements that show a secret, and fields that receive a typed secret show dots. List variables that aren't secret in `publicVariables`. See [Keep secrets out of logs, reports, and captures](/docs/ci/secrets).
* **CLI flags:** List flags such as `--reporters` and `--input` take one comma-separated value, given once. `--concurrent-runners` needs a value, invalid flag values exit `2`, and each subcommand accepts only its own flags. Config `reporters` accepts only exact reporter names, and an empty list means no reporters.
* **Removed commands and flags:** The `doc-detective-lsp` and `doc-detective-runner` bins and the `install-agents` alias are gone. Use `doc-detective lsp`, `doc-detective runner`, and `doc-detective install agents`. `install agents` drops `-a` and `-s`, so use `--agent` and `--scope`. `install` drops `--silent`, so use `-q` or `--log-level silent`.
* **Config and environment:** Doc Detective loads `.env` from the current directory, and shell variables win over it. Pass `--no-env-file` to skip it. Flags, the environment, `.env`, the project config, and the user config layer in one precedence order. New installs cache under XDG paths instead of `~/.doc-detective`, though an existing `~/.doc-detective` keeps working. Update CI cache paths, or set `DOC_DETECTIVE_CACHE_DIR`.
* **Environment variable values:** `DOC_DETECTIVE_*` on-or-off variables read `0`, `false`, `no`, and `off` as off. `DOC_DETECTIVE_DEBUG` now adds debug output to a run, so use `doc-detective debug` for the diagnostic dump. The telemetry notice prints once per machine on stderr.
* **Deprecations:** The `runTests` command, `--logLevel`, `--exit-on-fail`, `DOC_DETECTIVE`, `DOC_DETECTIVE_RUNTIME_DEBUG`, and the `beforeAny` config key still work with a warning. Replace them with `run`, `--log-level`, nothing, `DOC_DETECTIVE_CONFIG`, `DOC_DETECTIVE_DEBUG`, and `beforeAll`. Setting both an old and a new name exits `2`.
* **Agent tools:** Agent tools installed for version 4 don't handle the new exit codes and `--output`. When a test fails, they can treat the exit code as a broken runner instead of reading the results. Update them with `npx doc-detective@5 install agents` after you upgrade. Reinstall Gemini CLI and Qwen Code extensions.
* **JavaScript API:** The package exports only `runTests` and `getRunner`. It no longer exports `detectTests`, `detectAndResolveTests`, `resolveTests`, `readFile`, or `resolvePaths`, and the `doc-detective/cli` path is gone. `runTests()` rejects invalid specs and returns an empty report instead of `null` when it finds no tests. Use `doc-detective --dry-run` or `doc-detective-common` in place of the removed exports.
* **GitHub Action:** Use `doc-detective/github-action@v2` to run CLI 5. The `@v1` tag stays on CLI 4. See [Run in CI with the GitHub Action](/docs/ci/github-action).

### New features

* Added the `run` command, which takes files and folders as arguments, as in `doc-detective run ./docs`.
* Added output flags: `--json` prints one JSON document, `--plain` prints one tab-separated line per test context, and `-q` or `--quiet` shows only errors and a one-line verdict. `--no-color` and `NO_COLOR` turn off color, and `--no-input` turns off every prompt.
* Added a user config file, `.env` loading, and file-based credentials through `apiKeyFile`, `apiTokenFile`, and `DOC_DETECTIVE_API_FILE`. See the [CLI reference](/reference/reference/cli).
* Every failed step reports a `resultCode` of `environment`, `drift`, or `assertion`. A browser step that misses its element lists the closest elements in `outputs.nearMatches` and names them in `resultHint`. See [Troubleshoot a failing or flaky test](/docs/troubleshoot/overview).
* The run folder includes a Markdown summary, `testResults.md`, beside the JSON and HTML results. The HTML report shows automatic screenshots and recordings.
* Custom file types can use [selectors](/docs/test-docs/input-formats/selectors) to match parsed nodes, such as links, comments, and bold text, in Markdown, MDX, HTML, DITA, and AsciiDoc. A selector skips code samples, which regex patterns can't.
* `runCode` accepts `py` and `js` as languages.
* Pressing Ctrl+C says the run is stopping and caps cleanup at five seconds. A second Ctrl+C stops at once.
* The Linux Docker image includes Xvfb, so automatic recording can record headless Firefox.
* The language server reads inline statements the way a run does, including ignore blocks and custom file types' statements.

### Bug fixes

* Fixed the HTML report header, which showed a dash for every field. It now shows the run's start time, ID, environment, and duration.
* Fixed detected HTTP requests that ended their headers at a header value with a space, such as `Content-Type: application/json; charset=utf-8`.
* Fixed DITA tests that detected two `goTo` and two `checkLink` steps from one external link.
* A command that can't start, for example because its `workingDirectory` doesn't exist, says so instead of reporting exit code `-2`.

## November 9, 2026

## v4.43.0

### New features

* Config files, specs, and tests accept `publicVariables`, a list of environment variable names. Doc Detective 5 masks environment variable values in output, and `publicVariables` lists the exceptions. Version 4 doesn't mask values, so you can add the key before you upgrade. See [Upgrade to Doc Detective 5](/docs/ci/upgrade-to-v5).

### Behavior changes

* After a local run, Doc Detective now warns on stderr when the run relies on a default that changes in Doc Detective 5:
  * A context that names no browser ran on Firefox. Version 5 uses Chrome first. To stay on Firefox, name `firefox` in the context's `runOn` entry.
  * `autoScreenshot` or `autoRecord` is unset, and a step drove a browser, app, or device. Version 5 saves screenshots and recordings by default. Set the field to `false` or `true` to keep your choice and silence the warning.
  * The run used variables, and `publicVariables` is unset. Version 5 masks environment variable values in output. Setting `publicVariables`, even to an empty list, silences the warning.
* Each warning prints once and links to the upgrade guide. The warnings don't print at the `silent` log level or in the GitHub Action.

## November 8, 2026

## v4.42.1

Maintenance release; no user-facing changes.

## v4.42.0

This release prepares version 4 users for Doc Detective 5 and changes how Doc Detective guards local URLs. See [Upgrade to Doc Detective 5](/docs/ci/upgrade-to-v5).

### New features

* [`checkLink`](/docs/actions/checklink) has a new `timeout` field that sets how long each request attempt waits, in milliseconds. It defaults to `10000`. When an attempt times out, the step fails with a message that names the URL.
* Run reports now record when and where tests ran:
  * The report root has `startedAt` and an `environment` object with the platform, architecture, and Doc Detective, Node.js, and OS versions.
  * Each context has `startedAt` and, when a browser ran, the browser version and the driver's name and version.
  * Each step has `startedAt`.
* You can now set the pseudo-terminal size for background commands. `background.tty` on [`runShell`](/docs/actions/runshell) and [`runCode`](/docs/actions/runcode), and `tty` on a `startSurface` process descriptor, accept an object such as `{"cols": 80, "rows": 24}`. `true` keeps the 120 by 30 terminal.

### Behavior changes

* Doc Detective now warns on stderr when a run relies on something that Doc Detective 5 changes or removes. Examples include CLI flags, `DOC_DETECTIVE` environment variable keys, reporter names, and spec content that version 5 rejects or reads differently. The warnings link to the upgrade guide and don't print at the `silent` log level or in the GitHub Action.
* Self-update now stays within your current major version. When a newer major version is available, Doc Detective prints the upgrade command instead of updating. Update notices go to stderr, so they don't mix with `--dry-run` JSON output.
* Screenshot reference images and OpenAPI `$ref`s on `localhost`, Docker networks, and private networks now load by default. Previously, they required `DOC_DETECTIVE_ALLOW_LOCAL_URLS=true`.
  * Doc Detective now refuses a hop from a public address to a private one. Examples include a redirect to a private address and a `$ref` in a publicly hosted OpenAPI description. After it reads a public description, it also refuses local file `$ref`s.
  * Set `DOC_DETECTIVE_ALLOW_LOCAL_URLS=1` to turn the guard off, or `DOC_DETECTIVE_BLOCK_LOCAL_URLS=1` to refuse every private address. If you set both, Doc Detective exits with code `2`.
  * Requests that steps make, such as `goTo` and `httpRequest`, aren't affected.
* Heretto uploads now start only when an integration sets `uploadOnChange` to `true`. Previously, a config that skipped validation uploaded changed screenshots by default. See [Heretto](/docs/test-docs/heretto).
* A boolean click, such as `{"click": true}`, now fails with a hint. Previously, Doc Detective clicked an element whose text was `true`. To click that text, quote it: `"click": "true"`.

### Bug fixes

* `find.click: false` now finds the element without clicking it. Previously, Doc Detective converted `false` to the text `"false"` and clicked. `wait: true` is no longer read as `1` either.
* [`httpRequest`](/docs/actions/httprequest) accepts a single integer for `statusCodes`, like `checkLink`.
* `$schema` now accepts any URL on specs, tests, steps, contexts, and config files, so you can point your editor at a versioned or local schema. Previously, other URLs failed validation. See [Standalone tests](/docs/test-docs/standalone).
* `environment.arch` now accepts every architecture Node.js reports, such as `arm` and `ia32`.
* Remote files whose URLs have a query string, such as presigned YAML URLs, now parse by the extension in the URL path.
* OpenAPI descriptions that are missing, empty, or invalid now fail with one message that names the cause. A spurious `Failed to parse JSON` warning on remote `.json` descriptions no longer appears.
* `checkLink` network errors no longer include a URL's query string, fragment, or credentials.
* When you load Doc Detective with `require("doc-detective")`, writing verification results back to your files now works, and lazy dependency installs no longer fail with `ENOENT`.

## November 5, 2026

## v4.41.6

### Bug fixes

* Hints printed after a run now link to live documentation pages. Previously, many links led to the docs home page or to pages that no longer exist.

## October 31, 2026

## v4.41.5

Maintenance release; no user-facing changes.

## October 30, 2026

## v4.41.4

This is the first version published to npm after v4.38.1. It includes the changes listed for v4.38.2 through v4.41.3, which were tagged but not published.

## v4.41.3

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Bug fixes

* Fixed the Doc Detective logo in the HTML report, which showed a diagonal slash instead of a rounded corner.

## v4.41.2

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Behavior changes

* A screenshot and its reference image can differ in size because the environment rendered the browser differently. Doc Detective now resizes the window to match the reference. It then captures again, compares, and restores the window when the step ends. See [screenshot visual regression](/docs/test-docs/screenshot-visual-regression).
  * If you set a `viewport` or `window` that no longer matches the reference, Doc Detective leaves it alone, so an intentional change isn't reverted.
  * Doc Detective doesn't retake crops, app captures, screenshots with `overwrite: "true"`, or screenshots taken while a recording runs.
* Desktop browser sessions without a size now get a 1200x800 viewport.

### Bug fixes

* The `size` field on a [`startSurface`](/docs/actions/startsurface) browser descriptor now takes effect. A `size` with no positive dimension counts as unset.

## October 23, 2026

## v4.41.1

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

Maintenance release; no user-facing changes.

## v4.41.0

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### New features

* Doc Detective can now write "last verified" dates back into your documentation source files when tests pass. See [Last verified on](/docs/test-docs/last-verified-on).
  * Opt in with a `verified-by` entry that sets `tool: doc-detective` and a `check` naming a test or spec ID. Put it in front matter to date the page, or in an inline `meta` statement to date one procedure. On a pass, Doc Detective fills in the entry's `version` and `passed` date, and sets `last-verified` once every entry has passed.
  * Doc Detective never changes other tools' entries, and writes nothing when a test fails, warns, or skips.
  * Add `"badge": true` to an inline `test` statement to keep a "Last verified" badge on the line above the test. No test ID is required.
* Use the `verification.write` config field, or the `--verification` CLI flag, to choose what a run writes back. See [verification options](/reference/schemas/verification-options).
  * `"existing"`, the default, fills only what pages already declare.
  * `true` also adds entries for passing pages and tests, and writes generated test IDs into their `test` statements so the IDs stay stable.
  * `false` writes nothing, including badges.
* Write-back supports Markdown, MDX, AsciiDoc, HTML, and DITA. Doc Detective warns when it can't write a statement, such as some AsciiDoc forms.

## October 17, 2026

## v4.40.6

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Bug fixes

* `doc-detective install android` now retries after a temporary `sdkmanager` failure. Previously, the process could exit with code `0` during the retry wait, without retrying.
* `find` with `all: true` is faster when many elements match.

## October 16, 2026

## v4.40.5

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Behavior changes

* Runs start faster. Doc Detective skips browser detection for runs that don't use a browser, and loads some packages only when it needs them.

### Bug fixes

* A telemetry opt-out set through the `DOC_DETECTIVE` environment variable is now honored. Previously, Doc Detective still sent the telemetry event. See [telemetry](/support/support/legal/telemetry).
* An API key set only through the `DOC_DETECTIVE` environment variable now sends the run to the orchestration API.
* A telemetry failure no longer fails a run or loses its results.

## v4.40.4

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Behavior changes

* Doc Detective no longer prints every detected spec as JSON at the default log level. Set the log level to `debug` to see it, or use `--dry-run` to get the resolved test plan as JSON.

### Bug fixes

* String shorthand [`find`](/docs/actions/find) and [`click`](/docs/actions/click) steps now return as soon as the element appears. Previously, each step waited about 5 seconds even when the element was already on the page.
* Regular expression matches in `find` are much faster on pages with many elements.
* Shorthand `find` with text that contains a double quote now works when matching an element ID or test ID.
* JavaScript [`runCode`](/docs/actions/runcode) steps and, on Windows, shell steps start faster.

## v4.40.3

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Bug fixes

* Doc Detective now launches the browser build that `installed.json` records. Previously, an old build left in the cache could launch instead, and Firefox contexts could fall back to Chrome.
* A context that never runs [`goTo`](/docs/actions/goto), such as one with only process steps, is no longer retried because the browser stayed on its blank starting page. Previously, the retry could hide the real failure.

## October 15, 2026

## v4.40.2

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

### Behavior changes

* iOS tests start faster:
  * With version 12 or later of the XCUITest driver on an iOS 17 or later simulator, Doc Detective launches the prebuilt WebDriverAgent from `doc-detective install ios` directly, without `xcodebuild`.
  * Doc Detective opens the Simulator window before the first session, so the driver no longer reboots the simulator.
  * Sequential iOS contexts in a run share one Appium server.
* iOS sessions no longer capture the simulator's crash and system logs, which Doc Detective doesn't read. To turn capture back on for an app surface, set `"appium:skipLogCapture": false` in its `driverOptions`.
* When Doc Detective retries a session start that timed out, it now logs a warning with the error.

_Showing the 20 most recent of 97 entries. Append `/llms.txt` to the changelog URL for the complete index._