Repository navigation
Description
Three shipped aws examples fail their own lexicon's post-synth checks at error severity. Found while verifying the resource-count claims in their READMEs by building them (#1312 follow-up).
$ chant build lexicons/aws/examples/lambda-api
error: [dataBucket] S3 bucket "dataBucket" has no bucket policy denying non-TLS
requests — add a Deny statement on aws:SecureTransport = false (aws)
$ chant build lexicons/aws/examples/lambda-s3
error: [appBucket] S3 bucket "appBucket" has no bucket policy denying non-TLS
requests — add a Deny statement on aws:SecureTransport = false (aws)
$ chant build lexicons/aws/examples/shared-alb
error: [apiRepo] ECR repository "apiRepo" does not have ImageTagMutability:
IMMUTABLE — a tag can silently be repointed at different image content (aws)
error: [uiRepo] ECR repository "uiRepo" does not have ImageTagMutability: IMMUTABLE …
The other twelve aws examples build clean.
Why nothing caught it
check-lexicon's tier-1 "Every shipped example builds" check is deliberately scoped to discovery + serialization, not post-synth or lint — its own module doc says so, and that scoping is reasonable for what it was added to catch (#1067, an example with a duplicate export name). So an example can serialize perfectly while failing the checks its own lexicon ships.
There is already a CI step for the neighbouring case:
- name: Lint aws reference composites (EVL regression guard, #916/#952)
# The lexicon's own composites must obey the evaluability rules they teach.
run: npx tsx packages/core/src/cli/main.ts lint lexicons/aws/src/compositesThe same argument applies to examples, arguably more strongly: a composite is a library, an example is something a user copies wholesale. Three of them currently teach a bucket with no TLS-deny policy and a mutable ECR tag — both patterns the lexicon flags as errors when a user writes them.
Options
- Fix the three examples so they satisfy the checks. Note this changes their resource counts (a
BucketPolicyis a resource), so the README counts andexamples.test.tsassertions move with them. - Extend the composites CI step to examples, so a new example cannot land in this state. Wants (1) first, or it fails immediately.
- Both, which is what I would do: fix the three, then gate.
Worth deciding whether the gate is per-lexicon or repo-wide — examples/ at the top level has its own population, and I have not checked those the same way.
Activity
fix(aws): examples pass their own post-synth checks, and CI gates on …
test(examples): a gate that builds and lints every root example, with…
test(examples): a gate that builds and lints every root example, with…