Skip to content

fix(warnings): scope registry diagnostics to the current generation - #400

Merged
yeongseon merged 1 commit into
mainfrom
fix/393-scope-diagnostics
Aug 10, 2026
Merged

fix(warnings): scope registry diagnostics to the current generation#400
yeongseon merged 1 commit into
mainfrom
fix/393-scope-diagnostics

Conversation

@yeongseon

Copy link
Copy Markdown
Owner

Summary

  • Registry diagnostics accumulated on the process-wide singleton and persisted until clear(), so a resolved DUPLICATE_OPERATION collision still surfaced on the next generation.
  • Reset the duplicate-operation channel at the top of generate_openapi_spec (it is fully recomputed on every pass); fixed collisions no longer resurface, real ones are re-added.
  • Add OpenAPIRegistry.clear_diagnostics() / clear_duplicate_operations() helpers; clear() now reuses clear_diagnostics().
  • Discovery/empty channels remain scan-lifetime and are intentionally left untouched — clearing them at generation entry would wipe the current run's scan warnings before collection (scan runs before generation).

Verification

  • make check-all green (coverage ≥95%).
  • New regression test_resolved_collision_not_carried_to_next_generation reproduces the stale DUPLICATE_OPERATION across two generations against the same registry and asserts it is gone.

Design note

Cross-verified the lifetime model with Oracle. The concrete, verifiable staleness bug is generation-scoped (DUPLICATE_OPERATION); the injected --isolate-app registry path uses the same registry if registry is not None else _default_registry resolution, so isolated registries clear their own channel with no cross-contamination.

Closes #393

Registry diagnostics (discovery/empty/duplicate-operation) accumulated on
the process-wide singleton and persisted until clear(), so a resolved
DUPLICATE_OPERATION collision still surfaced on the next generation.

Reset the duplicate-operation channel at the top of generate_openapi_spec
(it is fully recomputed each pass), and add OpenAPIRegistry.clear_diagnostics
/ clear_duplicate_operations helpers (clear() now reuses clear_diagnostics).
Discovery/empty channels remain scan-lifetime and are left untouched so the
current run's scan warnings are not wiped before collection.

Closes #393
@yeongseon
yeongseon merged commit 84c888f into main Aug 10, 2026
16 checks passed
@yeongseon
yeongseon deleted the fix/393-scope-diagnostics branch August 10, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(warnings): scope registry diagnostics to the current scan/generation

2 participants