Skip to content

Three aws examples fail their own lexicon's post-synth checks #1400

Closed

Description

@lex00

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/composites

The 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

  1. Fix the three examples so they satisfy the checks. Note this changes their resource counts (a BucketPolicy is a resource), so the README counts and examples.test.ts assertions move with them.
  2. Extend the composites CI step to examples, so a new example cannot land in this state. Wants (1) first, or it fails immediately.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:awsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions