@rawsql-ts/test-evidence-core
v0.2.0
Published
Deterministic PreviewJson to DiffJson transformation for rawsql-ts test evidence.
Maintainers
Readme
@rawsql-ts/test-evidence-core
Shared semantic core for test evidence.
Scope
- Pure model and transform functions only
- No filesystem access
- No markdown rendering
Schema Versions
PREVIEW_SCHEMA_VERSION: supported major version forPreviewJsonDIFF_SCHEMA_VERSION: major version emitted forDiffJson
Both are major integers. Unsupported major versions fail with deterministic typed errors.
Compatibility Policy
- Pre-release (
0.x): breaking changes are allowed while boundaries are being finalized - Post-release: breaking schema changes require a major version bump
Deterministic Error Contract
DiffCoreErrorCode:
INVALID_INPUTUNSUPPORTED_SCHEMA_VERSION
Validation failures are deterministic, including stable error shape fields (code, path, schemaVersion, details).
Pure Intermediate Model
buildSpecificationModel(previewJson) returns a pure intermediate model.
- Returns structured data only
- No markdown strings
- No IO
- No side effects
Function Case Contract
Function test cases in PreviewJson.testCaseCatalogs[].cases[] use explicit outcomes:
expected: "success" | "throws" | "errorResult"expected: "throws"requireserror: { name, message, match }- non-throw outcomes require
output - optional metadata:
tags: string[],focus: string
