Skip to content

fix(release): give discriminator-mapped variant models an IR scope - #292

Merged
gjtorikian merged 1 commit into
mainfrom
devin/1795462289-radar-evidence-changelog-scope
Nov 23, 2026
Merged

gjtorikian merged 1 commit into
mainfrom
devin/1795462289-radar-evidence-changelog-scope

Conversation

@kevinferri

@kevinferri kevinferri commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The required sdk-validation check fails on the Radar spec syncs (#290, #291) with:

entry "Add SDK API surface" resolved to fallback scope "sdk" (unmapped symbols: NormalizedEmail, BlockedTld, SignUp, SmsSignIn, BotDetection, BruteForceAttack, DomainProtections, ImpossibleTravel, RepeatSignUp, StaleAccount, UnrecognizedDevice, SmsSignInTrigger)

Those are the variant models of RadarDetectionEvidence and the nested RadarDetectionRestrictionDetails / RadarDetectionRepeatSignUpDetails unions. In the IR they appear only in model.discriminator.mapping, never as a field, so buildIndexes's collectModelClosure never reached them from Radar.find and they had no IR owner. Their names don't contain "Radar", so scopeFromName falls back to sdk too.

collectModelClosure now also follows discriminator mapping targets:

for (const variant of Object.values(model.discriminator?.mapping ?? {})) {
  collectModelClosure(variant, out, seen);
}

This fixes the general case (any allOf + oneOf + mapping union reached from an operation) instead of adding Radar-specific name rules for generic names like SignUp.

Verified by replaying the CI scope check locally against #291's spec (oagen diff/parse/resolve + sdk-release-metadata.mjs --strict-scopes, no compat reports): it failed before, and now passes with the entry scoped to radar ("Add radar operations and models"). The new regression test fails without the change. npm test: 174 pass.

Link to Devin session: https://app.devin.ai/sessions/178b0d721a854a99a9840bf30178f437
Open in Devin Desktop: https://app.devin.ai/desktop/session/178b0d721a854a99a9840bf30178f437?variant=devin
Requested by: @kevinferri


🟢 Devin Review found nothing to fix · View findings

Devin Review

Variant models that appear only in a discriminator mapping (the
RadarDetectionEvidence and nested Radar details unions) had no IR
owner, so their changelog entry fell to the sdk fallback and failed
--strict-scopes in sdk-validation.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from kevin.ferri

i want to implement https://linear.app/workos/issue/RDR-954/11-persist-per-control-evidence-on-radar-detections

reed the project brief and description if you need more context.

let's decide how to break the PRs down for this

@kevinferri
kevinferri marked this pull request as ready for review November 23, 2026 20:18
@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

buildIndexes now follows discriminator mappings when finding the models owned by an operation.

  • Mapped union variants now inherit the scope of the operation that reaches them.

Reviews (1) · Last reviewed commit: "Give discriminator-mapped variant models..." · Reviewed by Greptile

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@gjtorikian gjtorikian changed the title Give discriminator-mapped variant models an IR scope fix(release): give discriminator-mapped variant models an IR scope Nov 23, 2026
@gjtorikian
gjtorikian merged commit 007653e into main Nov 23, 2026
11 checks passed
@gjtorikian
gjtorikian deleted the devin/1795462289-radar-evidence-changelog-scope branch November 23, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants