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
readonlycode:WarningCode
expected?
readonlyoptionalexpected?: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
readonlymessage:string
Human-readable detail for logs. Never contains a field value.
position
readonlyposition:AstmPosition
profile?
readonlyoptionalprofile?:string
The name of the AstmProfile that tolerated this warning, when expected.
toleratedCode?
readonlyoptionaltoleratedCode?: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.