Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Part of #523.
Shared backend both upgrade pipelines depend on: regenerate a lexicon from its current spec source, validate the result, and diff the generated public API surface against last-known-good so a reviewer sees added / changed / removed resources and properties.
Scope
- A reusable step (CLI or library, e.g.
chant check-lexicon-adjacent) that for a given lexicon runs the existingprepackchain —generate → bundle → validate → build(tsx src/codegen/generate-cli.ts,src/validate-cli.ts) — pluschant lintand the example harness for that lexicon's examples. - API surface snapshot + diff. Extract the generated public surface (resource/property-type names and their prop shapes) into a stable, serializable snapshot; compare a fresh regen against the committed snapshot; classify each change as additive (new resource/optional prop), changed (type/enum/required change), or removed. Emit a human-readable delta + machine-readable JSON, with a rolled-up severity (
additivevsbreaking) so the pipelines can label PRs and drive design: per-lexicon independent versioning & publish (republish one lexicon without a monorepo release) #528's semver. - A committed per-lexicon
surface.snapshot.json(or similar) as the last-known-good baseline the diff runs against and a PR updates.
Supply-chain hardening
- The spec fetch is pinned/verified (digest or known source). Codegen treats the fetched spec strictly as data — it never executes spec-provided input. This tool is the single choke point where untrusted upstream enters an automated pipeline, so the guarantee lives here.
Validation, never auto-fix
- Build/lint/example/test failures on a regen are captured and returned with the diff for the runner to surface as a report/issue. This tool never rewrites examples or masks a failure.
Acceptance criteria
- Given a lexicon, the tool regenerates, validates, and returns
{ ok, changed, severity, delta: { added, changed, removed }, failures }without publishing. - The surface diff distinguishes additive from breaking deterministically and emits a rolled-up severity.
- Runs offline against a pinned/verified, cached spec; no cloud, no network beyond the verified fetch; codegen executes no spec input.
- Reused unchanged by the pinned-bump (feat(codegen): pinned-version spec bump pipeline (k8s, gcp, docker, gitlab) #525) and rolling-drift (feat(codegen): rolling-spec drift pipeline (aws, azure, github) #526) pipelines.
Notes
- Generated code is gitignored, so the baseline for the diff is the committed surface snapshot, not the generated files.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat(codegen): lexicon API surface snapshot and diff tooling (#524) (#…
feat(codegen): pinned-version upgrade detection for k8s, gcp, docker,…
feat(codegen): rolling-spec drift detection for aws, azure, github (#526
feat(codegen): rolling-spec drift detection for aws, azure, github (#526