Skip to main content
Version: v0.0.6

Interface: AstmRecordWarning

A single Tier-2 warning: a stable code, a value-free human-readable message, and positional context. Plain data, accumulated onto AstmMessage.warnings.

Example

import type { AstmRecordWarning } from "@cosyte/astm";
const w: AstmRecordWarning = {
code: "ASTM_RECORD_UNKNOWN_TYPE",
message: "Unknown record type.",
position: { recordIndex: 2, recordType: "Z" },
};

Properties

code

readonly code: WarningCode


expected?

readonly optional expected?: boolean

true when an active vendor AstmProfile expected this deviation and re-badged it as a WARNING_CODES.PROFILE_QUIRK_APPLIED. An expected warning does not escalate to a thrown AstmStrictError in strict mode (the whole point of the profile is that this deviation is known and benign): it is still recorded, so nothing is hidden. Absent on an untolerated warning.


message

readonly message: string

Human-readable detail for logs. Never contains a field value.


position

readonly position: AstmPosition


profile?

readonly optional profile?: string

The name of the AstmProfile that tolerated this warning, when expected.


toleratedCode?

readonly optional toleratedCode?: WarningCode

When code is WARNING_CODES.PROFILE_QUIRK_APPLIED, the original warning code the profile tolerated, so a consumer can still see which deviation was re-badged as expected.