Skip to content

fix(sdk): eliminate OpenAPI cleanup race during generation #475

Description

@LeXwDeX

Why

The DAG core gate completed its test phases but failed once during SDK generation because the temporary openapi.json file disappeared before cleanup. An immediate rerun and standalone generated-output check passed with no drift. The one-off failure is not a release regression, but it can make mandatory SDK freshness and DAG gates flaky.

What to build

Make OpenAPI generation and temporary-file ownership race-free. Cleanup should be idempotent only after the lifecycle and ownership are understood; it must not hide an earlier generation failure or permit concurrent runs to consume or delete each other’s temporary input.

Reproduction evidence

  • During bun run test:dag-core, SDK generation printed all generated files and then failed while removing openapi.json because the file no longer existed.
  • The full gate rerun passed, standalone bun run check:generated passed, and the worktree remained clean.
  • The failure has only been observed once so far; treat the missing-file race as the hypothesis to prove, not an established root cause.

Acceptance criteria

  • Temporary OpenAPI artifacts have explicit per-run ownership and cannot collide across concurrent or repeated generators.
  • Cleanup succeeds when generation succeeds and does not mask generation or schema failures.
  • Repeated and concurrent SDK generation completes without missing-file failures.
  • bun run check:generated and bun run test:dag-core pass with a clean worktree after completion.
  • A regression test or deterministic stress check demonstrates the previously vulnerable lifecycle.

Blocked by

None - can start immediately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions