# Data flow — avajs/ava

> Canonical page: https://codevetter.com/unpack/ava/data-flow

# Data flow — avajs/ava

Scanned commit bbfd946322fdeca2b547a691d947fb4e18c0c67f (2026-05-17). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Configuration and CLI input become normalized project-relative selectors and transferable worker options. The parent owns file scheduling and run statistics, while each worker owns test execution and assertion state. Structured state events return through thread messaging or child-process IPC to reporters and exit-code logic. Snapshot and scheduling writes feed touched-file events back into watch mode.
- loadConfig() derives projectDir from package configuration, searches config modules up to the repository boundary, and rejects implicit package/file conflicts; an explicit config discards package configuration. — [lib/load-config.js#L77-L86](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/load-config.js#L77-L86) [lib/load-config.js#L108-L156](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/load-config.js#L108-L156)
- CLI flags overwrite corresponding configured values; file arguments are resolved from cwd, made relative to projectDir, and split into patterns and line selections. — [lib/cli.js#L221-L237](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/cli.js#L221-L237) [lib/cli.js#L397-L405](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/cli.js#L397-L405)
- findTests() expands globs into absolute paths, filters extensions, and excludes underscore-prefixed files; CLI filtering can additionally select existing files outside discovered matches. — [lib/globs.js#L96-L127](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/globs.js#L96-L127) [lib/globs.js#L188-L219](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/globs.js#L188-L219)
- Provider main.compile() receives all discovered tests; non-null provider state is sent to workers, while provider objects and sortTestFiles functions are removed from transferable options. — [lib/api.js#L240-L246](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/api.js#L240-L246) [lib/api.js#L270-L279](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/api.js#L270-L279)
- Worker setup installs provider loaders, loads configured modules sequentially, awaits their default functions with arguments, then imports the test file. — [lib/worker/base.js#L153-L195](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/worker/base.js#L153-L195) [lib/worker/base.js#L207-L228](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/worker/base.js#L207-L228)
- Declaration arguments become metadata-bearing task records; each test gets ContextRef.copy(), whose first access shallow-copies an object value. — [lib/runner.js#L100-L177](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/runner.js#L100-L177) [lib/runner.js#L498-L515](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/runner.js#L498-L515) [lib/context-ref.js#L14-L38](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/context-ref.js#L14-L38)
- Worker Runner events cross the channel into loadFork(), which attaches testFile; RunStatus updates per-file/global counters and emits copied statistics to reporter subscribers. — [lib/worker/base.js#L94-L95](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/worker/base.js#L94-L95) [lib/fork.js#L66-L70](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/fork.js#L66-L70) [lib/run-status.js#L46-L79](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/run-status.js#L46-L79) [lib/run-status.js#L213-L217](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/run-status.js#L213-L217)
- Snapshot assertions map values to title/index entries and Concordance descriptors; saving emits changed/temporary paths, which watch mode records to suppress self-generated reruns. — [lib/test.js#L219-L238](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/test.js#L219-L238) [lib/snapshot-manager.js#L291-L319](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/snapshot-manager.js#L291-L319) [lib/worker/base.js#L102-L107](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/worker/base.js#L102-L107) [lib/watcher.js#L240-L247](https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/watcher.js#L240-L247)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
