chore(specs): vendor the spec repos we own, add AGENTS.md - #408
Open
Mkassabov wants to merge 1 commit into
Open
Conversation
Two changes that belong together: the contributor guide says where specs
live, so the specs should live somewhere worth documenting.
## AGENTS.md
Guidance for agents working here. The load-bearing section is "never edit
generated files" — nearly everything under `packages/*/src/services/` is
compiler output, committed so consumers don't have to run codegen, and an
edit there is silently reverted by the next `bun run generate`. It maps
each kind of change to the thing that actually produces it (patch, spec,
SdkSpec, core emitter), walks through adding a new SDK, and documents the
`noCheck: true` trap: a plain `tsc -b` and all editor IntelliSense only
EMIT, so only `bun run typecheck:ci` proves a type change works.
## Vendored specs
The eight `alchemy-run/distilled-spec-*` repositories exist only to hold a
spec and a script that refetches it. Splitting them out bought nothing —
a spec bump and the SDK regeneration it forces are one change, and
submodules made that two commits in two repos.
Seven are folded in here:
packages/<pkg>/specs/distilled-spec-<pkg>/specs/openapi.json
-> packages/<pkg>/specs/openapi.json
packages/<pkg>/specs/distilled-spec-<pkg>/.meta/fetch-specs.ts
-> packages/<pkg>/scripts/fetch-specs.ts
Each `specs:fetch` script drops `git submodule update …` for
`bun scripts/fetch-specs.ts`, and the fetch scripts now resolve their
output through `import.meta.dir` rather than a cwd-relative `../specs` —
they used to run only from inside `.meta/`.
`.github/workflows/update-specs.yml` replaces the seven per-repo cron
jobs. Unlike them it does NOT push to main: a spec change moves generated
SDKs, so it opens a PR and goes through the typecheck gate. One upstream
being down warns rather than failing the run.
gcp stays a submodule — its 519 discovery documents are 120 MB, and
vendoring that would put it in every clone and every CI checkout forever.
The other ten submodules are upstream repositories we don't own (AWS,
Azure, Stripe, kubernetes, …) and stay as they are.
Verified by running `scripts/convert.ts` for all seven: every one reads
its spec from the new path, and `.generated-specs` comes out byte-identical
to what the submodules produced.
Contributor
|
Install the packages built from this commit: @distilled.cloud/core bun add @distilled.cloud/core@https://pkg.distilled.cloud/core/40c0fd0@distilled.cloud/aws bun add @distilled.cloud/aws@https://pkg.distilled.cloud/aws/40c0fd0@distilled.cloud/axiom bun add @distilled.cloud/axiom@https://pkg.distilled.cloud/axiom/40c0fd0@distilled.cloud/azure bun add @distilled.cloud/azure@https://pkg.distilled.cloud/azure/40c0fd0@distilled.cloud/cloudflare bun add @distilled.cloud/cloudflare@https://pkg.distilled.cloud/cloudflare/40c0fd0@distilled.cloud/coinbase bun add @distilled.cloud/coinbase@https://pkg.distilled.cloud/coinbase/40c0fd0@distilled.cloud/expo-eas bun add @distilled.cloud/expo-eas@https://pkg.distilled.cloud/expo-eas/40c0fd0@distilled.cloud/fly-io bun add @distilled.cloud/fly-io@https://pkg.distilled.cloud/fly-io/40c0fd0@distilled.cloud/gcp bun add @distilled.cloud/gcp@https://pkg.distilled.cloud/gcp/40c0fd0@distilled.cloud/kubernetes bun add @distilled.cloud/kubernetes@https://pkg.distilled.cloud/kubernetes/40c0fd0@distilled.cloud/mongodb-atlas bun add @distilled.cloud/mongodb-atlas@https://pkg.distilled.cloud/mongodb-atlas/40c0fd0@distilled.cloud/neon bun add @distilled.cloud/neon@https://pkg.distilled.cloud/neon/40c0fd0@distilled.cloud/planetscale bun add @distilled.cloud/planetscale@https://pkg.distilled.cloud/planetscale/40c0fd0@distilled.cloud/posthog bun add @distilled.cloud/posthog@https://pkg.distilled.cloud/posthog/40c0fd0@distilled.cloud/prisma-postgres bun add @distilled.cloud/prisma-postgres@https://pkg.distilled.cloud/prisma-postgres/40c0fd0@distilled.cloud/stripe bun add @distilled.cloud/stripe@https://pkg.distilled.cloud/stripe/40c0fd0@distilled.cloud/supabase bun add @distilled.cloud/supabase@https://pkg.distilled.cloud/supabase/40c0fd0@distilled.cloud/turso bun add @distilled.cloud/turso@https://pkg.distilled.cloud/turso/40c0fd0@distilled.cloud/typesense bun add @distilled.cloud/typesense@https://pkg.distilled.cloud/typesense/40c0fd0@distilled.cloud/workos bun add @distilled.cloud/workos@https://pkg.distilled.cloud/workos/40c0fd0 |
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.
Two changes that belong together: the contributor guide says where specs live, so the specs should live somewhere worth documenting.
AGENTS.md
The load-bearing section is never edit generated files. Nearly everything under
packages/*/src/services/is compiler output — committed so consumers don't run codegen, not because it's source — and an edit there is silently reverted by the nextbun run generate. It maps each kind of change to the thing that actually produces it:packages/<pkg>/patches/**packages/core/src/codegen/**SdkSpecpackages/<pkg>/specs/**Plus: how to add a new SDK, when to use a manual spec, and the
noCheck: truetrap — a plaintsc -band all editor IntelliSense only emit, so onlybun run typecheck:ciproves a type change works.Vendored specs
The eight
alchemy-run/distilled-spec-*repos exist only to hold one spec and a script that refetches it. Splitting them out bought nothing: a spec bump and the SDK regeneration it forces are one change, and submodules made that two commits across two repos.Seven are folded in:
specs:fetchdropsgit submodule update …forbun scripts/fetch-specs.ts. The fetch scripts now resolve output viaimport.meta.dirinstead of a cwd-relative../specs— they previously only worked when run from inside.meta/, so this would have broken silently otherwise..github/workflows/update-specs.ymlreplaces the seven per-repo cron jobs. Unlike them it does not push to main: a spec change moves generated SDKs, so it opens a PR through the typecheck gate. One upstream being down warns instead of failing the run.What stays a submodule
Verification
Ran
scripts/convert.tsfor all seven packages: each reads its spec from the new path, and.generated-specscomes out byte-identical to what the submodules produced — so this is a pure move, with no spec drift smuggled in.Two things surfaced while testing, neither addressed here:
fly-io/machines/forbidden-errors.patch.jsonandposthog/app-metrics-errors.patch.json— both targeting response codes their upstream has since moved. Pre-existing, unrelated to this change.