Skip to content

test: add diagnostic schema conformance snapshots#232

Open
bradhallett wants to merge 1 commit into
vercel-labs:mainfrom
bradhallett:test/diagnostic-schema-conformance
Open

test: add diagnostic schema conformance snapshots#232
bradhallett wants to merge 1 commit into
vercel-labs:mainfrom
bradhallett:test/diagnostic-schema-conformance

Conversation

@bradhallett
Copy link
Copy Markdown

Summary

Add conformance snapshot tests for 10 core diagnostic codes. Each test is a minimal .0 source file paired with an .expected.json file that asserts the exact diagnostic output schema.

Diagnostic codes covered

app001, cgen004, err001, imp001, nam003, par100, std002, typ001, typ002, typ009

How it works

  • Each conformance/diagnostics/<code>.0 is a minimal program that triggers that diagnostic
  • Each conformance/diagnostics/<code>.expected.json asserts the diagnostic code, severity, and message pattern
  • conformance/run.mjs is extended with a new diagnostics test type that validates snapshots

Validation

pnpm run conformance

All existing conformance tests continue to pass. New diagnostic snapshots are verified on each run.

Motivation

The diagnostic schema is a core agent-facing contract (see #173). Having snapshot tests for each code makes it easy to catch regressions when diagnostic output format changes across versions.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

@bradhallett is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread conformance/run.mjs Outdated
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

Add conformance snapshot tests for 11 core diagnostic codes. Each test
is a minimal .0 source file paired with an .expected.json that asserts
the exact diagnostic output schema.

Diagnostic codes covered:
app001, bld004, err001, imp001, nam003, par100, std002, typ001, typ002,
typ009, plus a duplicate nam003 (unknown-name fixture).

The title assertion compares the actual compiler diagnostic against the
expected snapshot (not a tautological self-comparison).

Rebased onto latest main after upstream split CGEN004 into BLD004/CGEN004.
@bradhallett bradhallett force-pushed the test/diagnostic-schema-conformance branch from d88b7ac to 767c346 Compare May 23, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant