IStore
Defined in: packages/core/src/types.ts:125
Storage backend interface. All methods are async so implementations can use any backend — SQLite, Supabase, Postgres, or custom.
Error contract
Section titled “Error contract”Implementations MUST wrap any driver-level error thrown by a public
method in a StoreError with package, method, message, and
cause set so callers receive a uniform error shape and the original
stack stays inspectable via error.cause. Validation errors from
arktype (thrown via ValidationError) propagate unwrapped so
bad input is distinguishable from a downstream driver failure.
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: packages/core/src/types.ts:165
Release pooled connections and file handles.
Returns
Section titled “Returns”Promise<void>
getNewPatterns()
Section titled “getNewPatterns()”getNewPatterns(
options?):Promise<object[]>
Defined in: packages/core/src/types.ts:147
Returns tests that newly crossed the flakiness threshold — failures in the current window but none in the prior window of the same length.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<object[]>
getRecentRuns()
Section titled “getRecentRuns()”getRecentRuns(
options):Promise<RecentRun[]>
Defined in: packages/core/src/types.ts:155
Return the most recent runs ordered by startedAt descending. Filters
by options.project the same way getNewPatterns does — pass a
project string to isolate one project’s history, or leave undefined /
null to match rows with NULL project. Used by the HTML report so users
see run history even when there are no newly-flaky patterns.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<RecentRun[]>
insertFailure()
Section titled “insertFailure()”insertFailure(
input):Promise<void>
Defined in: packages/core/src/types.ts:136
Record a single test failure against an existing run.
Parameters
Section titled “Parameters”durationMs?
Section titled “durationMs?”number | null
errorMessage?
Section titled “errorMessage?”string | null
errorStack?
Section titled “errorStack?”string | null
failedAt
Section titled “failedAt”string
failureKind
Section titled “failureKind”"unknown" | "assertion" | "timeout" | "uncaught"
string
testFile
Section titled “testFile”string
testName
Section titled “testName”string
Returns
Section titled “Returns”Promise<void>
insertFailures()
Section titled “insertFailures()”insertFailures(
inputs):Promise<void>
Defined in: packages/core/src/types.ts:142
Insert multiple failures in a single transaction. Falls back to sequential inserts for backends that don’t support transactions. Preferred over calling insertFailure() in a loop for remote stores.
Parameters
Section titled “Parameters”inputs
Section titled “inputs”readonly object[]
Returns
Section titled “Returns”Promise<void>
insertRun()
Section titled “insertRun()”insertRun(
input):Promise<void>
Defined in: packages/core/src/types.ts:132
Record the start of a run — paired with updateRun at completion.
Parameters
Section titled “Parameters”gitDirty?
Section titled “gitDirty?”boolean | null
gitSha?
Section titled “gitSha?”string | null
project?
Section titled “project?”string | null
string
runtimeVersion?
Section titled “runtimeVersion?”string | null
startedAt
Section titled “startedAt”string
testArgs?
Section titled “testArgs?”string | null
Returns
Section titled “Returns”Promise<void>
listFailures()
Section titled “listFailures()”listFailures(
options):Promise<FailureRow[]>
Defined in: packages/core/src/types.ts:163
Raw failure rows used by the HTML report to build kind breakdowns,
hot-file lists, and per-run drill-downs. The primitive every adapter
exposes — grouping and summarising happens in core so the logic lives
in one place. Respects MAX_FAILED_TESTS_PER_RUN by default; set
excludeInfraBlowups: false to disable.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<FailureRow[]>
migrate()
Section titled “migrate()”migrate():
Promise<void>
Defined in: packages/core/src/types.ts:130
Create tables and run any pending schema migrations. Idempotent — safe to call on every startup.
Returns
Section titled “Returns”Promise<void>
updateRun()
Section titled “updateRun()”updateRun(
runId,input):Promise<void>
Defined in: packages/core/src/types.ts:134
Finalize a previously-inserted run with terminal status and counts.
Parameters
Section titled “Parameters”string
durationMs?
Section titled “durationMs?”number
endedAt?
Section titled “endedAt?”string
errorsBetweenTests?
Section titled “errorsBetweenTests?”number
failedTests?
Section titled “failedTests?”number
passedTests?
Section titled “passedTests?”number
status?
Section titled “status?”"pass" | "fail"
totalTests?
Section titled “totalTests?”number
Returns
Section titled “Returns”Promise<void>