Files
sim/scripts/check-openapi.ts
Waleed b3f459db2e chore(audits): name generated-artifact checks check:<x> so run-audits discovers them (#8882)
* chore(audits): name generated-artifact checks check:<x> so run-audits discovers them

Rename tool-metadata, deployment-config, integration-catalog, docs, agent-stream-docs
and docs-manifest checks to check:<x> (generators to generate:<x>, matching the
existing generate:openapi/check:openapi pairs). run-audits now derives every audit
from the check:* prefix, so the hand-kept EXTRA_AUDITS list is gone, and
check:docs-manifest (local fs only, ~1s) joins check:audits instead of its own CI
step and CLAUDE.md gate line. The <x>:check suffix stays only for checks this job
cannot run (sibling copilot repo, Helm, per-machine covers).

Add module headers to check-monorepo-boundaries, check-realtime-prune-graph and
check-openapi saying what each protects and how to fix a finding.

* docs(ship): regenerate tool metadata in Phase A; drop the actionlint comment with no command
2026-10-09 22:25:43 -07:00

32 lines
1.1 KiB
TypeScript

#!/usr/bin/env bun
/**
* Fails when the published OpenAPI specs drift from the v2 route contracts.
*
* Runs two checks in order and stops at the first failure:
*
* 1. `generate-openapi.ts --check`: every committed spec matches what the generator renders
* from `apps/sim/lib/api/contracts/v2/openapi/`. Fix by running `bun run generate:openapi`
* and committing the result.
* 2. `check-openapi-specs.ts`: spec integrity, v2 conventions, and the contract cross-check.
* Its header lists each rule; fix the contract or its OpenAPI definition, then regenerate.
*
* Run: `bun run check:openapi`
*/
import { spawnSync } from 'node:child_process'
import path from 'node:path'
const ROOT = path.resolve(import.meta.dir, '..')
const CHECKS = [
[process.execPath, 'run', 'scripts/generate-openapi.ts', '--check'],
[process.execPath, 'run', 'scripts/check-openapi-specs.ts'],
] as const
for (const [command, ...args] of CHECKS) {
const result = spawnSync(command, args, {
cwd: ROOT,
stdio: 'inherit',
})
if (result.error) throw result.error
if (result.status !== 0) process.exit(result.status ?? 1)
}