> For the complete documentation index, see [llms.txt](https://as-pect.gitbook.io/as-pect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://as-pect.gitbook.io/as-pect/context.md).

# as-pect Context

This context names the project-specific testing and reflection concepts used by `as-pect`. Use these terms consistently when changing modules, interfaces, documentation, or commit messages.

## Language

**Test session**: A full run of one or more AssemblyScript test entries through compilation, wasm instantiation, execution, reporting, and snapshot handling. *Avoid*: Runner service, CLI workflow

**Test session entry plan**: The ordered test entries and include files for a Test session after CLI/config globs are expanded, filtered, sorted, and deduplicated. *Avoid*: Discovered file batch, glob result set

**Test session project path**: The explicit project-root path seam for programmatic Test session runs. It resolves project-relative globs, compiler entry/config/include paths, compiler artifacts, snapshots, and package-resolution anchors from `TestSessionConfig.cwd` instead of ambient `process.cwd()`. *Avoid*: Current directory helper, path utils grab bag

**Test session entry**: The lifecycle for one planned AssemblyScript test entry: compiling with shared compiler IO, optionally writing compiler artifacts, optionally instantiating and executing wasm, flushing reporters, and returning suite facts with snapshot write decisions. *Avoid*: Entry runner, spec file executor

**Compiler IO adapter**: The AssemblyScript compiler-facing file system seam that reads source files, lists source directories, respects absolute compiler paths, caches successful lookups across a Test session, and captures compiler output files in memory. *Avoid*: Filesystem wrapper, compiler cache helper

**Compiler output**: The validated `output.wasm` binary and `output.wat` text artifacts emitted by the AssemblyScript compiler for one Test session entry. *Avoid*: Build result blob, emitted file map

**Test session snapshot plan**: The per-entry snapshot file path, expected snapshot loading, compare/write mode, and write/update decisions for a Test session entry. *Avoid*: Snapshot file helper, snapshot path utility

**Test session stats accumulator**: The aggregate Test session stats seam that folds completed suite facts and snapshot lifecycle stats into the session summary. *Avoid*: Stats helper, counter updater

**Test session WASI resolver**: The CLI/config WASI seam that chooses the effective WASI options for a Test session entry, resolves CLI config paths from the current working directory, and applies the Node `preview1` default without mutating user configuration. *Avoid*: WASI helper, WASI config loader

**CLI shell**: The injectable command-line boundary for `asp` stdout, stderr, logo output, and exit decisions. Tests use this seam instead of monkeypatching global process streams or `process.exit`. *Avoid*: Process wrapper, console shim

**Test suite**: The collected tests and groups for a single AssemblyScript test binary. *Avoid*: Spec bundle, test file model

**Test tree**: The hierarchy of test nodes collected from AssemblyScript `describe`, `it`, and related declarations. *Avoid*: Tree structure, node graph

**Test tree recorder**: The module that records Wasm host callbacks into the Test tree. It creates group and test nodes, preserves parent/child links, allocates stable snapshot namespaces for duplicate names, builds runtime snapshot keys from those namespaces, owns the active target-node scope for host callback facts, and owns declaration-time facts such as hooks, todos, logs, reflected assertion values, and runtime snapshot entries. *Avoid*: Declaration helper, tree builder service

**Test node**: A single group or test in the test tree, including its result facts, logs, todos, and child nodes. *Avoid*: Test component, result object

**Reporter**: An adapter that renders reportable facts from a test suite to stdout, stderr, files, or another output target. *Avoid*: Printer, output service

**Reporter file output**: The shared file-backed reporter seam that builds output paths next to test entries under an explicit project/output root, skips file creation for reports with no executed results, creates Node write streams, and tracks pending stream flushes for reporter `onFlush()` callbacks. *Avoid*: Per-format file plumbing, reporter stream boilerplate

**JUnit XML report**: The file-backed CI interchange report selected with `asp --junit` or emitted directly by `@as-pect/junit-reporter`. It maps Suite report facts to the common JUnit XML `testsuite`, `testcase`, `failure`, `error`, `skipped`, and `system-out` elements without reading Test tree internals. *Avoid*: xUnit dump, CI XML blob

**CTRF JSON report**: The file-backed Common Test Report Format selected with `asp --ctrf` or emitted directly by `@as-pect/ctrf-reporter`. It keeps the CTRF root fields `reportFormat`, `specVersion`, and `results`, maps Suite report pass/fail/todo/skipped facts to CTRF test statuses, and nests as-pect-only facts under `extra.asPect`. *Avoid*: New JSON mode, generic JSON dump

**Legacy JSON report**: The as-pect-specific JSON v1 array output selected with `asp --json` or emitted directly by `@as-pect/json-reporter`. It remains separate from CTRF so existing consumers keep the `group`, `name`, `ran`, `pass`, `negated`, `runtime`, `message`, `actual`, and `expected` object contract. *Avoid*: Standard JSON report, CTRF-compatible JSON

**Coverage setup**: The Test session seam that decides whether coverage is enabled, selects the compiler target, lazily loads the coverage runtime, installs coverage imports, registers compiled modules, and produces the final coverage report string. *Avoid*: Coverage globals, scattered coverage glue

**as-pect CSV v1 contract**: The as-pect-specific CSV reporter column contract for tabular test results. It preserves the `Group`, `Name`, `Ran`, `Negated`, `Pass`, `Runtime`, `Message`, `Actual`, and `Expected` column order and value vocabulary for spreadsheet-style workflows, without treating CSV as a cross-tool test-result standard. *Avoid*: Standard CSV test schema, generic CSV report format

**Reporting lifecycle**: The module that publishes test suite events and final suite report facts to reporters through one seam. It delegates report fact construction instead of walking test nodes itself. *Avoid*: Reporter manager, output lifecycle service

**Suite report factory**: The module that builds suite, group, test, todo, and snapshot report facts from `TestContext` and `TestNode` state before reporter publication. *Avoid*: Reporter event builder, output model factory

**Legacy reporter adapter**: The compatibility seam that translates Report events plus separate legacy report facts to older `onEnter`, `onExit`, and `onFinish` reporter callbacks when a reporter has not implemented the corresponding report callback. *Avoid*: Reporter fallback, callback shim

**Legacy report facts**: Compatibility-only `TestContext` and `TestNode` access passed beside Report events for old reporter callbacks and subclass extension points. These facts must stay out of the public Report event shape. *Avoid*: Event payload internals, reporter context fields

**Suite report**: The stable reportable facts for one completed test suite: counts, groups, tests, todos, warnings, errors, snapshot stats, and snapshot change lines. *Avoid*: Reporter model, result DTO

**Report event**: A reporting lifecycle event that carries only suite report, group report, or test report facts to reporter adapters. Compatibility-only `TestContext` or `TestNode` access belongs in legacy report facts instead of the event object. *Avoid*: Callback payload, event DTO

**Snapshot lifecycle**: The rules for parsing expected snapshots, recording actual snapshots, diffing them, deciding pass/fail, and planning updates. *Avoid*: Snapshot utility, snapshot manager

**Wasm host**: The JavaScript-side interface that exposes `__aspect` imports and runtime facts to AssemblyScript test code. *Avoid*: Runtime bridge, host service

**Class reflection transform**: The AssemblyScript transform module that generates class reflection methods consumed by runtime `Reflect` helpers. *Avoid*: Reflection plugin, transform service

**Class-member plan**: The ordered set of class members that generated class reflection methods use for strict equality and reflected key/value output. *Avoid*: Member list, property collection
