DECLARATIVE-YAML-13: YAML contract and its TypeScript equivalent, identical findings
What it demonstrates
Section titled “What it demonstrates”That a YAML-authored contract compiles to the same Contract as the combinator API, producing identical findings.
Builds on: DECLARATIVE-YAML-12: Run a YAML config from the CLI
How it’s done
Section titled “How it’s done”Commands, code, and output together; comments mark which is which.
# YAMLfrontmatter: strict: true fields: id: { type: string, pattern: '^T-[0-9A-Z]{4}$' } status: { enum: [open/ready, closed/done] }
// TypeScript — same contract, same findingscontract({ frontmatter: z.object({ id: z.string().regex(/^T-[0-9A-Z]{4}$/), status: z.enum(["open/ready", "closed/done"]),}).strict() })Surfaces exercised
Section titled “Surfaces exercised”loadContract vs contract({frontmatter})both yield a Contract whose validate() emits the same frontmatter/* findings