diff --git a/.agents/skills/ship/SKILL.md b/.agents/skills/ship/SKILL.md index 342774b7858..442067f291b 100644 --- a/.agents/skills/ship/SKILL.md +++ b/.agents/skills/ship/SKILL.md @@ -47,19 +47,14 @@ When the user runs `/ship`: - Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version). - `(cd packages/db && bunx drizzle-kit generate && git status --porcelain ./migrations)` must print nothing (CI's schema/migration sync step). - `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy. -6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed. +6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases abort ship if any generator or audit fails: their runners (`scripts/generate-all.ts`, `scripts/run-audits.ts`) collect each job's exit code and exit non-zero, so never replace them with a backgrounded loop and a bare `wait`, which swallows child exit codes. - **Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `generate:agent-stream-docs` (derives from the provider model registry), `generate:docs-manifest` (derives from docs page paths), `generate:tool-metadata` (derives from the tool registry), and `skills:sync` (derives from `.agents/skills/**`). They write disjoint outputs (`apps/docs/…/agent.mdx`, `apps/sim/lib/mothership/generated/docs-manifest.ts`, `apps/sim/tools/generated/*`, and `.claude/skills` links), so they parallelize safely, and each is idempotent (a no-op when already in sync): + **Phase A — regenerate the always-in-repo committed artifacts, then let step 7 stage whatever changed.** Run the umbrella generator. It derives its list from package.json (every `generate:` that has a matching `check:`, plus `skills:sync`; see the header of `scripts/generate-all.ts`), so it covers every repo-local generator an ordinary code change can drift (a `models.ts` edit drifts `agent-stream-docs` and the SDK fixture catalog, a tool change drifts `tool-metadata`), runs them in the order their inputs require, and each is idempotent (a no-op when already in sync): ```bash - rm -f /tmp/ship-gen-results - for g in generate:agent-stream-docs generate:docs-manifest generate:tool-metadata skills:sync; do - ( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) & - done - wait - # any non-zero line is a FAILED generator — read /tmp/ship-gen-.log and fix before shipping; - # a silently-failed generate leaves a stale artifact that Phase B / CI then rejects. Keep the - # `exit 1`: it is what makes the block's own status non-zero so a caller actually stops. - if grep -vE '^0 ' /tmp/ship-gen-results; then echo "❌ generator(s) failed — do not ship"; exit 1; fi + # A non-zero exit means a generator FAILED: the summary names it and its output is above. Fix it + # before shipping; a silently-failed generate leaves a stale artifact that Phase B / CI then + # rejects. Keep the `exit 1`: it makes the block's own status non-zero so a caller actually stops. + bun run generate || { echo "❌ generator(s) failed — do not ship"; exit 1; } echo "✅ artifacts regenerated" ``` Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes. diff --git a/apps/sim/lib/workflows/code/real-catalog.test.ts b/apps/sim/lib/workflows/code/real-catalog.test.ts index 0bce94b9eff..0c55fba1485 100644 --- a/apps/sim/lib/workflows/code/real-catalog.test.ts +++ b/apps/sim/lib/workflows/code/real-catalog.test.ts @@ -4,7 +4,7 @@ * workflows against the types generated from the whole registry with the workspace's TypeScript 7 * compiler. */ -import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import path from 'node:path' import { createBlock } from '@sim/testing/factories/block.factory' @@ -32,9 +32,7 @@ import { afterAll, describe, expect, it, vi } from 'vitest' vi.unmock('@/blocks/registry') vi.unmock('@/tools/metadata-outputs') -import { projectBlockCatalog } from '@/lib/workflows/code/catalog/build' import { registryCatalog as catalog } from '@/lib/workflows/code/catalog/registry-catalog.test-helpers' -import { registryTrigger } from '@/lib/workflows/code/catalog/registry-sources' import { generateRegistryCorpus } from '@/lib/workflows/code/corpus' import { createMaterializeHooks } from '@/lib/workflows/code/materialize-hooks' import { @@ -44,7 +42,6 @@ import { } from '@/lib/workflows/code/sdk-typecheck.test-helpers' import { BUILTIN_SKILLS } from '@/lib/workflows/skills/builtin-skills' import { getBlockRegistry } from '@/blocks/registry' -import { SDK_NAMES } from '@/blocks/sdk-names.generated' const registryBlocks = Object.values(getBlockRegistry()) @@ -82,26 +79,6 @@ const COOKBOOK_WORKSPACE: WorkspaceManifest = { } describe('canonicalize and codegen over the real block catalog', () => { - it('keeps the SDK fixture catalog equal to the real projection of its blocks', () => { - const fixturePath = path.join(SDK_ROOT, 'test/fixtures/catalog.json') - const fixture = JSON.parse(readFileSync(fixturePath, 'utf8')) as { blocks: object } - const types = new Set(Object.keys(fixture.blocks)) - const projected = { - ...projectBlockCatalog({ - blocks: registryBlocks.filter((block) => types.has(block.type)), - trigger: registryTrigger, - sdkNames: SDK_NAMES, - }), - hash: 'fixture', - } - const text = `${JSON.stringify(projected, null, 2)}\n` - if (process.env.UPDATE_SDK_FIXTURE_CATALOG === '1') writeFileSync(fixturePath, text) - expect( - JSON.parse(readFileSync(fixturePath, 'utf8')), - 'Regenerate with UPDATE_SDK_FIXTURE_CATALOG=1 bun run test lib/workflows/code/real-catalog.test.ts' - ).toEqual(JSON.parse(text)) - }) - it("never freezes the host's timezone into the catalog as the schedule default", () => { const timezone = catalogBlock(catalog, 'schedule')?.subBlocks.find( (sub) => sub.id === 'timezone' diff --git a/apps/sim/scripts/generate-sdk-fixture-catalog.ts b/apps/sim/scripts/generate-sdk-fixture-catalog.ts new file mode 100644 index 00000000000..f8c64759b75 --- /dev/null +++ b/apps/sim/scripts/generate-sdk-fixture-catalog.ts @@ -0,0 +1,59 @@ +#!/usr/bin/env bun +/** + * Maintains `packages/workflow-sdk/test/fixtures/catalog.json`, the block catalog the SDK and CLI + * tests compile against. + * + * The fixture is not hand-written: it is the real `projectBlockCatalog` projection of a subset of + * registry blocks, so a test over it exercises the shapes production emits. The subset is the set + * of block types already in the fixture; add a block by adding its type key to `blocks` and + * regenerating. The hash is pinned to `'fixture'` so the file changes only when a projected block + * does. + * + * Any change to a projected block, its tools' outputs, its SDK names, or a model list it reads + * drifts this file, which is why `--check` runs in `check:audits` instead of leaving the drift for + * a test shard to find. + * + * Usage: + * bun run apps/sim/scripts/generate-sdk-fixture-catalog.ts # rewrite the fixture + * bun run apps/sim/scripts/generate-sdk-fixture-catalog.ts --check # fail if it is stale + */ +import { readFile, writeFile } from 'node:fs/promises' +import { dirname, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import { projectBlockCatalog } from '@/lib/workflows/code/catalog/build' +import { registryTrigger } from '@/lib/workflows/code/catalog/registry-sources' +import { getBlockRegistry } from '@/blocks/registry' +import { SDK_NAMES } from '@/blocks/sdk-names.generated' + +const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)) +const FIXTURE_PATH = resolve( + SCRIPT_DIR, + '../../../packages/workflow-sdk/test/fixtures/catalog.json' +) +const FIXTURE_LABEL = 'packages/workflow-sdk/test/fixtures/catalog.json' + +const checkOnly = process.argv.includes('--check') +const current = await readFile(FIXTURE_PATH, 'utf8') +const types = new Set(Object.keys((JSON.parse(current) as { blocks: object }).blocks)) + +const blocks = Object.values(getBlockRegistry()).filter((block) => types.has(block.type)) +const projected = { + ...projectBlockCatalog({ blocks, trigger: registryTrigger, sdkNames: SDK_NAMES }), + hash: 'fixture', +} +const text = `${JSON.stringify(projected, null, 2)}\n` + +if (checkOnly) { + if (current !== text) { + console.error( + `${FIXTURE_LABEL} is stale: it no longer matches the registry projection of its ${types.size} blocks. Run \`bun run generate:sdk-fixture-catalog\` and commit the result.` + ) + process.exit(1) + } + console.log(`${FIXTURE_LABEL} matches the registry projection of its ${types.size} blocks.`) +} else if (current === text) { + console.log(`${FIXTURE_LABEL} is already up to date (${types.size} blocks).`) +} else { + await writeFile(FIXTURE_PATH, text) + console.log(`Regenerated ${FIXTURE_LABEL} (${types.size} blocks).`) +} diff --git a/package.json b/package.json index 108cebe674d..1791b665d99 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "check:sealed-columns": "bun run scripts/check-sealed-columns.ts", "check:schema-mock": "bun run scripts/generate-schema-mock.ts --check", "check:audits": "bun run scripts/run-audits.ts", + "generate": "bun run scripts/generate-all.ts", "check:skills": "bun run scripts/sync-skills.ts --check", "check:guidance-refs": "bun run scripts/check-guidance-refs.ts", "check:desktop-bridge": "bun run scripts/check-desktop-bridge-contract.ts --check", @@ -102,6 +103,8 @@ "check:tool-metadata": "bun run scripts/sync-tool-metadata.ts --check", "generate:sdk-names": "bun run apps/sim/scripts/generate-sdk-names.ts", "check:sdk-names": "bun run apps/sim/scripts/generate-sdk-names.ts --check", + "generate:sdk-fixture-catalog": "bun run apps/sim/scripts/generate-sdk-fixture-catalog.ts", + "check:sdk-fixture-catalog": "bun run apps/sim/scripts/generate-sdk-fixture-catalog.ts --check", "check:sdk-names-frozen": "bun run scripts/check-sdk-names-frozen.ts", "generate:deployment-config": "bun run scripts/generate-deployment-config.ts", "check:deployment-config": "bun run scripts/generate-deployment-config.ts --check", diff --git a/packages/workflow-sdk/test/fixtures/catalog.json b/packages/workflow-sdk/test/fixtures/catalog.json index c3d27b9f32f..0376fa970a9 100644 --- a/packages/workflow-sdk/test/fixtures/catalog.json +++ b/packages/workflow-sdk/test/fixtures/catalog.json @@ -120,6 +120,14 @@ "id": "thinkingmachines/inkling-2-small", "label": "thinkingmachines/inkling-2-small" }, + { + "id": "gpt-6.2-astra", + "label": "gpt-6.2-astra" + }, + { + "id": "gpt-6.2-sol", + "label": "gpt-6.2-sol" + }, { "id": "gpt-6.1-terra", "label": "gpt-6.1-terra" @@ -464,6 +472,18 @@ "id": "azure-anthropic/claude-opus-4-1", "label": "azure-anthropic/claude-opus-4-1" }, + { + "id": "gemini-4-neon", + "label": "gemini-4-neon" + }, + { + "id": "gemini-4-hydrogen", + "label": "gemini-4-hydrogen" + }, + { + "id": "gemini-4-carbon", + "label": "gemini-4-carbon" + }, { "id": "gemini-4-argon", "label": "gemini-4-argon" @@ -1217,6 +1237,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -1303,6 +1325,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -1525,6 +1550,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -1611,6 +1638,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -1826,6 +1856,8 @@ "thinkingmachines/inkling-small": true, "thinkingmachines/inkling": true, "thinkingmachines/inkling-2-small": true, + "gpt-6.2-astra": true, + "gpt-6.2-sol": true, "gpt-6.1-terra": true, "gpt-6.1-sol": true, "gpt-6-sol": true, @@ -1912,6 +1944,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": true, + "gemini-4-hydrogen": true, + "gemini-4-carbon": true, "gemini-4-argon": true, "gemini-3.8-flash": true, "gemini-3.7-flash": true, @@ -2128,6 +2163,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -2214,6 +2251,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -2429,6 +2469,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -2515,6 +2557,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -2729,6 +2774,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -2815,6 +2862,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -3031,6 +3081,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -3117,6 +3169,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -3331,6 +3386,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -3417,6 +3474,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -3646,6 +3706,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -3732,6 +3794,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -3912,6 +3977,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -3998,6 +4065,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -4171,6 +4241,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -4257,6 +4329,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -4431,6 +4506,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -4517,6 +4594,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -4691,6 +4771,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -4777,6 +4859,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -4992,6 +5077,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -5078,6 +5165,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -5293,6 +5383,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -5379,6 +5471,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -5636,6 +5731,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": true, + "gpt-6.2-sol": true, "gpt-6.1-terra": true, "gpt-6.1-sol": true, "gpt-6-sol": true, @@ -5722,6 +5819,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -5945,6 +6045,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": true, "gpt-6.1-terra": true, "gpt-6.1-sol": true, "gpt-6-sol": true, @@ -6031,6 +6133,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -6254,6 +6359,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -6340,6 +6447,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": true, + "gemini-4-hydrogen": true, + "gemini-4-carbon": true, "gemini-4-argon": true, "gemini-3.8-flash": true, "gemini-3.7-flash": true, @@ -11682,6 +11792,14 @@ "id": "thinkingmachines/inkling-2-small", "label": "thinkingmachines/inkling-2-small" }, + { + "id": "gpt-6.2-astra", + "label": "gpt-6.2-astra" + }, + { + "id": "gpt-6.2-sol", + "label": "gpt-6.2-sol" + }, { "id": "gpt-6.1-terra", "label": "gpt-6.1-terra" @@ -12026,6 +12144,18 @@ "id": "azure-anthropic/claude-opus-4-1", "label": "azure-anthropic/claude-opus-4-1" }, + { + "id": "gemini-4-neon", + "label": "gemini-4-neon" + }, + { + "id": "gemini-4-hydrogen", + "label": "gemini-4-hydrogen" + }, + { + "id": "gemini-4-carbon", + "label": "gemini-4-carbon" + }, { "id": "gemini-4-argon", "label": "gemini-4-argon" @@ -12776,6 +12906,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -12862,6 +12994,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -13081,6 +13216,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -13167,6 +13304,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -13379,6 +13519,8 @@ "thinkingmachines/inkling-small": true, "thinkingmachines/inkling": true, "thinkingmachines/inkling-2-small": true, + "gpt-6.2-astra": true, + "gpt-6.2-sol": true, "gpt-6.1-terra": true, "gpt-6.1-sol": true, "gpt-6-sol": true, @@ -13465,6 +13607,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": true, + "gemini-4-hydrogen": true, + "gemini-4-carbon": true, "gemini-4-argon": true, "gemini-3.8-flash": true, "gemini-3.7-flash": true, @@ -13678,6 +13823,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -13764,6 +13911,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -13976,6 +14126,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -14062,6 +14214,9 @@ "azure-anthropic/claude-haiku-4-5": true, "azure-anthropic/claude-sonnet-4-5": true, "azure-anthropic/claude-opus-4-1": true, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -14273,6 +14428,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -14359,6 +14516,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -14572,6 +14732,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -14658,6 +14820,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -14869,6 +15034,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -14955,6 +15122,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -15181,6 +15351,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -15267,6 +15439,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -15444,6 +15619,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -15530,6 +15707,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -15700,6 +15880,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -15786,6 +15968,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -15957,6 +16142,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -16043,6 +16230,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, @@ -16214,6 +16404,8 @@ "thinkingmachines/inkling-small": false, "thinkingmachines/inkling": false, "thinkingmachines/inkling-2-small": false, + "gpt-6.2-astra": false, + "gpt-6.2-sol": false, "gpt-6.1-terra": false, "gpt-6.1-sol": false, "gpt-6-sol": false, @@ -16300,6 +16492,9 @@ "azure-anthropic/claude-haiku-4-5": false, "azure-anthropic/claude-sonnet-4-5": false, "azure-anthropic/claude-opus-4-1": false, + "gemini-4-neon": false, + "gemini-4-hydrogen": false, + "gemini-4-carbon": false, "gemini-4-argon": false, "gemini-3.8-flash": false, "gemini-3.7-flash": false, diff --git a/scripts/generate-all.ts b/scripts/generate-all.ts new file mode 100644 index 00000000000..584fc702ea8 --- /dev/null +++ b/scripts/generate-all.ts @@ -0,0 +1,92 @@ +#!/usr/bin/env bun +/** + * Runs every self-contained, repo-local generator, so a contributor (or `/ship`) can bring all + * committed artifacts back in sync with one command: `bun run generate`. + * + * The list is derived from package.json the way `run-audits.ts` derives its audits, so a new + * generator is picked up by default rather than added to a list here. A generator qualifies when + * it has a matching audit: every `generate:` that has a `check:`, plus the older names in + * {@link ALIASED_PAIRS}. That pairing is the repo's convention for "this artifact is a pure + * function of the tree" (`check:audits` runs the check), so it is also what makes a generator safe + * to run unprompted. Name a new generator `generate:` / `check:` and it runs here. + * + * Deliberately not run: the `:generate` / `:check` suffix pairs (`mship*`, `trace-*`, + * `metrics`, `vfs`, `billing-protocol`, `images`, `library:covers`), which need the sibling + * copilot repo, a Helm render, or a per-machine renderer (see `run-audits.ts`); + * `generate:pi-model-catalog` under `apps/sim`, which reads an installed package; and + * `scripts/generate-docs.ts`, whose broad integration-docs rewrite has no `generate:` script. + * + * Generators run one at a time, in package.json order, because they are not independent: some + * read what an earlier one wrote. `generate:cli-docs` reads the operation table + * `generate:cli-api` emits, `generate:docs-manifest` lists the pages `generate:cli-docs` writes, + * and `generate:sdk-fixture-catalog` projects through `generate:tool-metadata` and + * `generate:sdk-names` output. Keep a new pair below the generators it reads. + * + * Exits non-zero when any generator fails; the rest still run so one failure does not hide another. + * + * Usage: + * bun run generate + */ +import path from 'node:path' + +/** Generators whose audit predates the `generate:` / `check:` naming, keyed to that audit. */ +const ALIASED_PAIRS: Record = { + 'skills:sync': 'check:skills', +} + +const ROOT = path.resolve(import.meta.dir, '..') + +interface GeneratorResult { + script: string + ok: boolean + durationMs: number +} + +function generatorScripts(scripts: Record): string[] { + return Object.keys(scripts).filter((name) => { + if (name.startsWith('generate:')) return `check:${name.slice('generate:'.length)}` in scripts + const audit = ALIASED_PAIRS[name] + return audit !== undefined && audit in scripts + }) +} + +/** + * Runs one generator with inherited output. + * + * Spawns the script directly rather than `bun run `, which would start a bun process only + * to have it read package.json and start a second one. + */ +async function runGenerator(script: string, command: string): Promise { + const startedAt = performance.now() + const argv = command.replace(/^bun run /, '').split(/\s+/) + const proc = Bun.spawn([process.execPath, ...argv], { + cwd: ROOT, + stdout: 'inherit', + stderr: 'inherit', + }) + const exitCode = await proc.exited + return { script, ok: exitCode === 0, durationMs: performance.now() - startedAt } +} + +const manifest = await Bun.file(path.join(ROOT, 'package.json')).json() +const commands = manifest.scripts as Record +const generators = generatorScripts(commands) +const results: GeneratorResult[] = [] + +for (const script of generators) { + console.log(`\n▶ ${script}`) + results.push(await runGenerator(script, commands[script])) +} + +console.log(`\n${results.length} generators:`) +for (const result of results) { + console.log(`${result.ok ? '✓' : '✗'} ${result.script} (${Math.round(result.durationMs)}ms)`) +} + +const failures = results.filter((result) => !result.ok) +if (failures.length > 0) { + console.error( + `\n${failures.length} generator(s) failed: ${failures.map((f) => f.script).join(', ')}. Their output is above; fix the cause and rerun \`bun run generate\`.` + ) + process.exit(1) +}