Repository navigation
feat(examples): golden teaching example — L1 synthesis (#216 T2) - #219
Merged
Merged
Conversation
Scaffold the golden teaching example at examples/getting-started/. It teaches chant from the core up in levels, each adding one capability over the same declarations. L1 is the synthesis core — typed resources to spec-native CloudFormation, plus lint and graph, with no executor and no cloud. L1 contents (a Lambda that lists an S3 bucket): - src/main.ts — typed resources, a composite, intrinsics (Sub/Ref/StackName) - src/params.ts — a deploy-time input (CloudFormation Parameter) - src/outputs.ts — a cross-resource reference resolved at synthesis - src/tags.ts — a reused const (static config) README lays out the L1–L5 plan (L2 Ops-local, L3 gate+Temporal, L4 the lifecycle dial, L5 the alert-triage capstone #74) and marks L2+ as follow-ups. Wired into the example harness (describeExample) so L1 lints and builds in CI. Quickstart consolidation decision: local-op-quickstart stays in place — the chant CI regression guard runs `chant run hello` against that path — and is referenced from the golden example as the standalone zero-dependency Op demo, rather than being moved (which would break that CI step). The golden example's own L2 (an Op over L1's declarations) is authored fresh in a later PR. Part of #216. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lex00
added a commit
that referenced
this pull request
Jun 6, 2026
The golden teaching example's lexicon arc is Kubernetes end to end, so every level runs on a laptop (L2 kubectl-applies to local k3d, L5 reaches k8s + temporal). L1 was AWS (#219) — a fine pure-synthesis intro, but AWS does not run locally, so the arc would change lexicon between L1 and L2. Redo L1 on k8s for one coherent arc. L1 (a web Deployment + Service via the WebApp composite): - src/config.ts — static const data (app name, pinned image), reused - src/web.ts — typed resources via WebApp; expands to Deployment + Service + PodDisruptionBudget, with resources and a security context Lint is clean (the harness gate asserts zero warnings); `chant build` still prints non-failing post-synth advisories (imagePullPolicy, readOnlyRootFilesystem), which the README frames as guidance, not failures. Uses the WebApp composite because raw resources trip the core COR001/COR004 style rules — which is why the other raw k8s examples skipLint; the golden example must not skip lint. Updated the harness block to the k8s serializer (Deployment/Service/PDB + managed-by label checks), package scripts (build → k8s.yaml, list instead of the Op-only graph), chant.config to k8s, and the README to the k8s arc. Part of #216. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lex00
added a commit
that referenced
this pull request
Jun 7, 2026
The root examples/examples.test.ts was Bun-era (`import.meta.dir`, undefined under vitest/Node), so vitest's `include` deliberately scoped to packages/** and lexicons/** — meaning the whole file never ran in CI. That included the golden-example L1 `getting-started` block added in #219/#221, the k8s-eks/gke/aks microservice suites, gitlab-cells, ray-kuberay, and the gitlab-aws-alb describeExamples. - Port `import.meta.dir` → `import.meta.dirname` (9 sites). - Add `examples/examples.test.ts` to the vitest include (explicitly, not a wholesale examples/** glob — the fargate docker e2e/volume suites need Docker and aren't CI unit tests). - Quarantine k8s-aks-microservice (`describe.skip`) — it's broken by an Azure lexicon regression (Microsoft.Authorization/roleAssignments no longer generated), tracked in #223. Un-skip when #223 lands. Result: the golden example L1 and 5 other example suites now run in CI (149 passed, aks skipped). This is the real fix behind the golden-example testing, prerequisite to L2 (#216) getting a running test. Part of #216. Refs #223. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #216 T2 — scaffold the golden teaching example at
examples/getting-started/with L1 (the synthesis core).What this is
One example that teaches chant from the core up, in levels, each adding one capability over the same declarations. This PR lands L1 and the structure; L2–L5 are follow-ups.
chant build→ spec-native output,chant lint,chant graph; no executorL1 contents
A Lambda that lists an S3 bucket, declared as typed TypeScript. Each file maps to one concept:
src/main.ts— typed resources, a composite, intrinsics (Sub/Ref/AWS.StackName)src/params.ts— a deploy-time input (CloudFormation Parameter)src/outputs.ts— a cross-resource reference resolved at synthesissrc/tags.ts— a reusedconst(static config)Wired into the example harness via
describeExample, so L1 lints and builds in CI (with a check asserting the CloudFormation output contains the function, the bucket, and theDocsBucketArnoutput).Quickstart consolidation decision (T2 AC)
local-op-quickstartstays in place — thechantCI job's regression guard runschant run helloagainstexamples/local-op-quickstart, so moving it would break that step. The golden example references it as the standalone zero-dependency Op demo. The golden example's own L2 (an Op over L1's declarations) is authored fresh in a later PR rather than by relocating quickstart.Validation
Local: the example builds (
template.json, spec-native CloudFormation) andchant lint srcreports no problems. The full root example suite passes (107 tests), andeslint packages/is clean. The three requiredchantchecks are unaffected by the new example beyond the test job, which now also exercises L1.Part of #216.
🤖 Generated with Claude Code