{"version":3,"file":"index.mjs","names":["path","path","path"],"sources":["../../src/verify/run-compat-check.ts","../../src/engine/manifest-reader.ts","../../src/verify/run-overlay-retry-loop.ts","../../src/compat/staleness.ts","../../src/verify/run-staleness-check.ts","../../src/verify/run-smoke-check.ts"],"sourcesContent":["import { getExtractor } from '../compat/extractor-registry.js';\nimport {\n  diffSnapshots,\n  specDerivedNames,\n  specDerivedFieldPaths,\n  specDerivedMethodPaths,\n  specDerivedEnumValues,\n  filterSurface,\n} from '../compat/differ.js';\nimport { apiSurfaceToSnapshot } from '../compat/ir.js';\nimport type { LanguageId } from '../compat/ir.js';\nimport { getDefaultPolicy, mergePolicy } from '../compat/policy.js';\nimport type { CompatPolicyHints } from '../compat/policy.js';\nimport type { ApiSpec } from '../ir/types.js';\nimport type { ApiSurface } from '../compat/types.js';\nimport type { CompatCheckResult } from './types.js';\n\nexport async function runCompatCheck(\n  baseline: ApiSurface,\n  outputDir: string,\n  lang: string,\n  spec?: ApiSpec,\n  policyOverrides?: Partial<CompatPolicyHints>,\n): Promise<CompatCheckResult> {\n  const extractor = getExtractor(lang);\n  const candidate = await extractor.extract(outputDir);\n\n  let scopedBaseline = baseline;\n  let scopedToSpec = false;\n  let scopedSymbolCount: number | undefined;\n  if (spec) {\n    const allowed = specDerivedNames(spec, extractor.hints);\n    const fieldPaths = specDerivedFieldPaths(spec, extractor.hints);\n    const methodPaths = specDerivedMethodPaths(spec);\n    const enumVals = specDerivedEnumValues(spec);\n    scopedBaseline = filterSurface(baseline, allowed, { fieldPaths, methodPaths, enumValues: enumVals });\n    scopedToSpec = true;\n    scopedSymbolCount =\n      Object.keys(scopedBaseline.interfaces).length +\n      Object.keys(scopedBaseline.classes).length +\n      Object.keys(scopedBaseline.typeAliases).length +\n      Object.keys(scopedBaseline.enums).length;\n  }\n\n  const baseSnap = apiSurfaceToSnapshot(scopedBaseline);\n  const candSnap = apiSurfaceToSnapshot(candidate);\n\n  const langId = lang as LanguageId;\n  const policy = policyOverrides ? mergePolicy(getDefaultPolicy(langId), policyOverrides) : getDefaultPolicy(langId);\n\n  const diff = diffSnapshots(baseSnap, candSnap, policy);\n  const passed = diff.changes.every((c) => c.severity !== 'breaking');\n\n  return { passed, diff, scopedToSpec, scopedSymbolCount };\n}\n","import { readFileSync, existsSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { MANIFEST_FILENAME } from './manifest.js';\n\n/** Minimal shape matching compat/overlay.ts ManifestEntry for cross-layer use. */\ninterface ManifestEntry {\n  operationId: string;\n  sdkResourceProperty: string;\n  sdkMethodName: string;\n  httpMethod: string;\n  path: string;\n  pathParams: string[];\n  bodyFields: string[];\n  queryFields: string[];\n}\n\n/**\n * Read the operations map from `.oagen-manifest.json` in the given directory\n * and convert it to `ManifestEntry[]` for the overlay builder.\n *\n * Returns undefined if the manifest is absent or has no operations field.\n */\nexport function readManifestSync(dir: string): ManifestEntry[] | undefined {\n  const manifestPath = path.join(dir, MANIFEST_FILENAME);\n  if (!existsSync(manifestPath)) return undefined;\n  try {\n    const parsed = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n    const operations = parsed?.operations;\n    if (!operations || typeof operations !== 'object') return undefined;\n    return convertOperationsToManifestEntries(operations);\n  } catch {\n    return undefined;\n  }\n}\n\n/** Convert the operations map from .oagen-manifest.json into ManifestEntry[]. */\nfunction convertOperationsToManifestEntries(operations: Record<string, unknown>): ManifestEntry[] {\n  const entries: ManifestEntry[] = [];\n  for (const [httpKey, value] of Object.entries(operations)) {\n    const spaceIdx = httpKey.indexOf(' ');\n    const httpMethod = httpKey.slice(0, spaceIdx);\n    const httpPath = httpKey.slice(spaceIdx + 1);\n\n    const values = Array.isArray(value) ? value : [value];\n    for (const v of values) {\n      const entry = v as { sdkMethod?: string; service?: string };\n      entries.push({\n        operationId: '',\n        sdkResourceProperty: entry.service ?? '',\n        sdkMethodName: entry.sdkMethod ?? '',\n        httpMethod,\n        path: httpPath,\n        pathParams: [],\n        bodyFields: [],\n        queryFields: [],\n      });\n    }\n  }\n  return entries;\n}\n","import { readdirSync, unlinkSync, statSync, openSync, readSync, closeSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { buildOverlayLookup, patchOverlay, isPatchableChange } from '../compat/overlay.js';\nimport { getExtractor } from '../compat/extractor-registry.js';\nimport type { ApiSurface } from '../compat/types.js';\nimport type { ApiSpec } from '../ir/types.js';\nimport { getEmitter } from '../engine/registry.js';\nimport { generate } from '../engine/orchestrator.js';\nimport { runCompatCheck } from './run-compat-check.js';\nimport type { OverlayRetryResult } from './types.js';\nimport { readManifestSync } from '../engine/manifest-reader.js';\n\n/** Generated file header markers used by various emitters. */\nconst GENERATED_MARKERS = ['Code generated by oagen', 'auto-generated by oagen', 'This file is auto-generated'];\n\n/**\n * Delete oagen-generated source files so the retry loop can regenerate them\n * with overlay-corrected names. Only deletes files that contain an oagen\n * generation marker, preserving hand-written files.\n */\nfunction cleanGeneratedFiles(dir: string): void {\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return;\n  }\n  for (const entry of entries) {\n    const full = path.join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(full);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      cleanGeneratedFiles(full);\n      continue;\n    }\n    // Skip non-source files and manifests\n    if (entry.endsWith('.json') || entry.endsWith('.lock')) continue;\n    // Read only the first 200 bytes to check for generation marker\n    try {\n      const buf = Buffer.alloc(200);\n      const fd = openSync(full, 'r');\n      try {\n        readSync(fd, buf, 0, 200, 0);\n      } finally {\n        closeSync(fd);\n      }\n      const header = buf.toString('utf-8');\n      if (GENERATED_MARKERS.some((m) => header.includes(m))) {\n        unlinkSync(full);\n      }\n    } catch {\n      // ignore read/delete errors\n    }\n  }\n}\n\nexport async function runOverlayRetryLoop(opts: {\n  baseline: ApiSurface;\n  parsedSpec: ApiSpec;\n  outputDir: string;\n  lang: string;\n  maxRetries: number;\n  namespace?: string;\n  onRetry?: (attemptNumber: number, maxRetries: number, patchableCount: number) => void;\n}): Promise<OverlayRetryResult> {\n  const { baseline, parsedSpec, outputDir, lang, maxRetries, namespace, onRetry } = opts;\n\n  const manifest = readManifestSync(outputDir);\n  // Pass language-specific hints so property-to-class matching works correctly\n  // (e.g., Ruby snake_case \"api_keys\" → PascalCase \"ApiKeys\").\n  const extractor = getExtractor(lang);\n  let overlay = buildOverlayLookup(baseline, manifest, parsedSpec, extractor.hints);\n  let prevPreserved = -1;\n  const patchedPerIteration: number[] = [];\n\n  for (let attempt = 0; attempt <= maxRetries; attempt++) {\n    const compatResult = await runCompatCheck(baseline, outputDir, lang, parsedSpec);\n    if (compatResult.passed) {\n      return {\n        status: 'passed',\n        attempts: attempt,\n        patchedPerIteration,\n        compatResult,\n      };\n    }\n\n    if (attempt === maxRetries) {\n      return {\n        status: 'max-retries',\n        attempts: attempt,\n        patchedPerIteration,\n        compatResult,\n      };\n    }\n\n    const patchable = compatResult.diff.changes.filter(isPatchableChange);\n    if (patchable.length === 0) {\n      return {\n        status: 'no-patchable',\n        attempts: attempt,\n        patchedPerIteration,\n        compatResult,\n      };\n    }\n\n    const currentBreaking = compatResult.diff.summary.breaking;\n    // Stall detection: if breaking count hasn't decreased, we're not making progress\n    if (attempt > 0 && currentBreaking >= prevPreserved) {\n      return {\n        status: 'stalled',\n        attempts: attempt,\n        patchedPerIteration,\n        compatResult,\n      };\n    }\n    prevPreserved = currentBreaking;\n    patchedPerIteration.push(patchable.length);\n    onRetry?.(attempt + 1, maxRetries, patchable.length);\n\n    overlay = patchOverlay(overlay, patchable, baseline);\n\n    // Pre-delete generated source files so the writer creates them fresh\n    // with overlay-corrected names. Without this, the AST merger would preserve\n    // old method/class names from the existing files.\n    // Only delete files that look like oagen-generated source files (have the header).\n    cleanGeneratedFiles(outputDir);\n\n    const emitter = getEmitter(lang);\n    await generate(parsedSpec, emitter, {\n      namespace: namespace ?? parsedSpec.name,\n      outputDir,\n      overlayLookup: overlay,\n      apiSurface: baseline,\n    });\n  }\n\n  const compatResult = await runCompatCheck(baseline, outputDir, lang, parsedSpec);\n  return {\n    status: 'max-retries',\n    attempts: maxRetries,\n    patchedPerIteration,\n    compatResult,\n  };\n}\n","import type { ApiSurface, LanguageHints, Violation } from './types.js';\nimport type { ApiSpec } from '../ir/types.js';\nimport { specDerivedNames, specDerivedFieldPaths } from './spec-filter.js';\nimport { diffSpecs } from '../differ/diff.js';\n\n/**\n * Detect symbols that exist in the live SDK surface but are no longer defined\n * in the current OpenAPI spec. These are \"stale\" — they compile and run but\n * represent dead code from a previous spec version.\n *\n * Requires both the old and new spec so we can distinguish hand-written SDK\n * symbols (never in any spec) from genuinely removed spec symbols.\n */\nexport function detectStaleSymbols(\n  liveSurface: ApiSurface,\n  oldSpec: ApiSpec,\n  newSpec: ApiSpec,\n  hints: LanguageHints,\n): Violation[] {\n  const violations: Violation[] = [];\n\n  // Step 1-3: Name-set difference for top-level symbols\n  const oldNames = specDerivedNames(oldSpec, hints);\n  const newNames = specDerivedNames(newSpec, hints);\n\n  const removedNames = new Set<string>();\n  for (const name of oldNames) {\n    if (!newNames.has(name)) removedNames.add(name);\n  }\n\n  for (const name of removedNames) {\n    if (liveSurface.classes[name]) {\n      violations.push({\n        category: 'staleness',\n        severity: 'warning',\n        symbolPath: name,\n        baseline: name,\n        candidate: '(removed from spec)',\n        message: `Class \"${name}\" is no longer defined in the OpenAPI spec`,\n      });\n    }\n    if (liveSurface.interfaces[name]) {\n      violations.push({\n        category: 'staleness',\n        severity: 'warning',\n        symbolPath: name,\n        baseline: name,\n        candidate: '(removed from spec)',\n        message: `Interface \"${name}\" is no longer defined in the OpenAPI spec`,\n      });\n    }\n    if (liveSurface.typeAliases[name]) {\n      violations.push({\n        category: 'staleness',\n        severity: 'warning',\n        symbolPath: name,\n        baseline: name,\n        candidate: '(removed from spec)',\n        message: `Type alias \"${name}\" is no longer defined in the OpenAPI spec`,\n      });\n    }\n    if (liveSurface.enums[name]) {\n      violations.push({\n        category: 'staleness',\n        severity: 'warning',\n        symbolPath: name,\n        baseline: name,\n        candidate: '(removed from spec)',\n        message: `Enum \"${name}\" is no longer defined in the OpenAPI spec`,\n      });\n    }\n  }\n\n  // Step 4-6: Field-level staleness for models that still exist in new spec\n  const oldFieldPaths = specDerivedFieldPaths(oldSpec, hints);\n  const newFieldPaths = specDerivedFieldPaths(newSpec, hints);\n\n  for (const fieldPath of oldFieldPaths) {\n    if (newFieldPaths.has(fieldPath)) continue;\n\n    const [modelName, fieldName] = fieldPath.split('.');\n    // Only flag field-level staleness for models that still exist in the new spec\n    // (fully removed models are already caught above)\n    if (removedNames.has(modelName)) continue;\n\n    const iface = liveSurface.interfaces[modelName];\n    if (iface?.fields[fieldName]) {\n      violations.push({\n        category: 'staleness',\n        severity: 'warning',\n        symbolPath: fieldPath,\n        baseline: fieldName,\n        candidate: '(removed from spec)',\n        message: `Field \"${fieldPath}\" is no longer defined in the OpenAPI spec`,\n      });\n    }\n  }\n\n  // Step 7: Operation-level staleness via diffSpecs\n  const diff = diffSpecs(oldSpec, newSpec);\n  for (const change of diff.changes) {\n    if (change.kind === 'operation-removed') {\n      const cls = liveSurface.classes[change.serviceName];\n      if (cls?.methods[change.operationName]) {\n        violations.push({\n          category: 'staleness',\n          severity: 'warning',\n          symbolPath: `${change.serviceName}.${change.operationName}`,\n          baseline: change.operationName,\n          candidate: '(removed from spec)',\n          message: `Method \"${change.serviceName}.${change.operationName}\" is no longer defined in the OpenAPI spec`,\n        });\n      }\n    }\n  }\n\n  return violations;\n}\n","import { getExtractor } from '../compat/extractor-registry.js';\nimport { detectStaleSymbols } from '../compat/staleness.js';\nimport type { ApiSpec } from '../ir/types.js';\nimport type { ApiSurface } from '../compat/types.js';\nimport type { StalenessCheckResult } from './types.js';\n\nexport function runStalenessCheck(\n  baseline: ApiSurface,\n  oldSpec: ApiSpec,\n  newSpec: ApiSpec,\n  lang: string,\n): StalenessCheckResult {\n  const extractor = getExtractor(lang);\n  const violations = detectStaleSymbols(baseline, oldSpec, newSpec, extractor.hints);\n  return { violations };\n}\n","import { execFileSync } from 'node:child_process';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport * as path from 'node:path';\nimport { CommandError } from '../errors.js';\nimport type { SmokeCheckResult } from './types.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nfunction resolveScript(scriptRelPath: string): { bin: string; script: string } {\n  const distScript = path.resolve(__dirname, '..', '..', 'dist', 'scripts', scriptRelPath.replace(/\\.ts$/, '.mjs'));\n  if (existsSync(distScript)) {\n    return { bin: 'node', script: distScript };\n  }\n  const srcScript = path.resolve(__dirname, '..', '..', 'scripts', scriptRelPath);\n  return { bin: 'npx', script: srcScript };\n}\n\nfunction runPackagedScript(scriptRelPath: string, args: string[]): void {\n  const { bin, script } = resolveScript(scriptRelPath);\n  const fullArgs = bin === 'npx' ? ['tsx', script, ...args] : [script, ...args];\n  execFileSync(bin, fullArgs, { stdio: 'inherit', env: process.env });\n}\n\nexport function runSmokeCheck(opts: {\n  spec?: string;\n  lang: string;\n  output: string;\n  rawResults?: string;\n  smokeConfig?: string;\n  smokeRunner?: string;\n}): SmokeCheckResult {\n  const { spec, lang, output, rawResults, smokeConfig, smokeRunner } = opts;\n\n  let baselinePath = rawResults ?? 'smoke-results-raw.json';\n  let generatedBaseline = false;\n\n  if (!rawResults && !existsSync('smoke-results-raw.json')) {\n    if (!spec) {\n      throw new CommandError(\n        'error: --spec <path> or OPENAPI_SPEC_PATH env var is required when no raw baseline exists',\n        '',\n        1,\n      );\n    }\n\n    try {\n      runPackagedScript('smoke/baseline.ts', ['--spec', spec]);\n    } catch {\n      throw new CommandError('Baseline generation failed', '', 1);\n    }\n    baselinePath = 'smoke-results-spec-baseline.json';\n    generatedBaseline = true;\n  }\n\n  const smokeArgs = ['--lang', lang, '--sdk-path', output, '--raw-results', baselinePath];\n  if (spec) smokeArgs.push('--spec', spec);\n  if (smokeConfig) smokeArgs.push('--smoke-config', smokeConfig);\n\n  try {\n    if (smokeRunner) {\n      const bin = smokeRunner.endsWith('.ts') ? 'npx' : 'node';\n      const fullArgs = bin === 'npx' ? ['tsx', smokeRunner, ...smokeArgs] : [smokeRunner, ...smokeArgs];\n      execFileSync(bin, fullArgs, { stdio: 'inherit', env: process.env });\n    } else {\n      runPackagedScript('smoke/sdk-test.ts', smokeArgs);\n    }\n\n    return { passed: true, baselinePath, generatedBaseline };\n  } catch {\n    if (existsSync('smoke-compile-errors.json')) {\n      return { passed: false, compileErrors: true, baselinePath, generatedBaseline };\n    }\n\n    const findingsCount = existsSync('smoke-diff-findings.json')\n      ? (JSON.parse(readFileSync('smoke-diff-findings.json', 'utf-8')) as unknown[]).length\n      : undefined;\n\n    return { passed: false, findingsCount, baselinePath, generatedBaseline };\n  }\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,eACpB,UACA,WACA,MACA,MACA,iBAC4B;CAC5B,MAAM,YAAY,aAAa,KAAK;CACpC,MAAM,YAAY,MAAM,UAAU,QAAQ,UAAU;CAEpD,IAAI,iBAAiB;CACrB,IAAI,eAAe;CACnB,IAAI;AACJ,KAAI,MAAM;AAKR,mBAAiB,cAAc,UAJf,iBAAiB,MAAM,UAAU,MAAM,EAIL;GAAE,YAHjC,sBAAsB,MAAM,UAAU,MAAM;GAGC,aAF5C,uBAAuB,KAAK;GAE6B,YAD5D,sBAAsB,KAAK;GACuD,CAAC;AACpG,iBAAe;AACf,sBACE,OAAO,KAAK,eAAe,WAAW,CAAC,SACvC,OAAO,KAAK,eAAe,QAAQ,CAAC,SACpC,OAAO,KAAK,eAAe,YAAY,CAAC,SACxC,OAAO,KAAK,eAAe,MAAM,CAAC;;CAGtC,MAAM,WAAW,qBAAqB,eAAe;CACrD,MAAM,WAAW,qBAAqB,UAAU;CAEhD,MAAM,SAAS;CAGf,MAAM,OAAO,cAAc,UAAU,UAFtB,kBAAkB,YAAY,iBAAiB,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,OAAO,CAE5D;AAGtD,QAAO;EAAE,QAFM,KAAK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