- Fixed CLI
traceand assertion edge cases (including Windows path handling, non-TTY stdout guards inProgressDisplay, and empty/prose JSDoc strings informatTypeString) and exportedAttestFn/Bench/BenchFntypes (#1777, #1782).
Runtime benches now run in a loop compiled for each bench, after a warmup of 500ms (or until.ms if shorter), with as many calls per sample as fit in about 0.2ms. Their times don't compare with earlier versions', so re-record stored runtime baselines.
- Return the result a bench computes, so V8 can't drop its work as unused. attest warns when a bench returns
undefined. until.countanduntil.msbound the samples taken after the warmup. They counted sets of 1000 calls and time from the bench's start.- A bench that returns a Promise is awaited whether or not it is an
asyncfunction. - Sample times are sorted numerically. They were sorted as strings, which misordered times like 9.5 and 10.2 and skewed
.median. - Instantiation counts include evaluating the type a bench (or a test with
attest.instantiations) returns as fully as displaying it would. TypeScript defers members of types like mapped types until something reads them, so a result that was never used went partly uncounted. Benches whose results were already fully evaluated measure the same; re-record the rest. benchErrorOnThresholdExceeded: "types"fails a.types()bench that exceeds its baseline, and"runtime"no longer does. Onlyattest.instantiationscounted as a type bench, so.types()regressions were reported without failing.- An option set with its own
ATTEST_environment variable overrides the configsetup()passes to child processes on every platform. On Windows, which sorts the environment, the inherited config overwrote it. - A failing
.equalsor.isprints values that aren't plain data, like a Type or an object holding one, withprintable. Types and schema nodes print as their expressions, and other class instances inside a plain object or array print as their constructor's name. node:assert's diff walked their entire graphs and could run out of memory instead of failing (#1287). Plain data, including Maps, Sets, Dates and RegExps of it, keeps node:assert's diff. .snap.toFilecreates its snapshot file if it doesn't exist. It threw ENOENT unless the file was already there..completions()under TypeScript 7 includes completions of strings containing punctuation, like a JSON Schema$refpath. TypeScript 7 gives each a filter text of only its last word, which didn't match the prefix, so they were dropped and.completions()returned{}.getChecker()returns the checker attest analyzes with, so a test can branch on output that differs between them.attest traceandattest statscheck projects withcomposite: true. They passed tsc--incremental false, which such a project rejects (TS6379), so since TypeScript 5.6 they skipped type checking and reported 0 instantiations (#1306).@arktype/attest, which published the same package, is no longer published. Install@ark/attest.arktypeis a peer dependency at the version released with@ark/attest, where it was a dependency, so install the two together.
Full changelog: https://github.com/arktypeio/arktype/blob/@ark/attest@0.59.0/ark/attest/CHANGELOG.md