Visitar URL original
feat: add unified AI prompting and native decision model support by ranadeepsingh · Pull Request #2811 · microsoft/SynapseML · GitHub
Skip to content

feat: add unified AI prompting and native decision model support - #2811

Merged
Rana Singh (ranadeepsingh) merged 8 commits into
microsoft:masterfrom
ranadeepsingh:feat/aiprompt-core-20261105
Nov 12, 2026
Merged

Rana Singh (ranadeepsingh) merged 8 commits into
microsoft:masterfrom
ranadeepsingh:feat/aiprompt-core-20261105

Conversation

@ranadeepsingh

@ranadeepsingh Rana Singh (ranadeepsingh) commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Users currently need different Spark stages and provider-specific handling for text, embeddings and native decision models. This adds AIPrompt, built on the existing OpenAIPrompt interface, so callers can select the API explicitly, pass supported request options and inspect typed results, errors and complete response JSON without adding another inference transport.

AIPrompt routes a Spark DataFrame through five explicit API contracts, with shared controls, distinct outputs and compatibility limits.

Foundry correction: the earlier Azure-host rejection incorrectly prevented valid Decisions calls before HTTP. Foundry supports Decisions for supported gpt-6-luna deployments at /openai/v1/decisions; Microsoft Decision-1 uses the separate SystemOne API. This follow-up corrects the route and Azure API-key authentication, updates the diagram and enables the notebook's Decisions examples. All four inference APIs now have fresh live evidence on this implementation, as detailed below. Availability still depends on the provider, deployment and region.

Compatibility: all five declared API types are supported, but this is not universal provider support or drop-in parity with OpenAIPrompt. Scalar/column parameter bindings, copy and save/load are preserved; explicitly unsupported typed options fail before HTTP. messagesCol is input-only, Responses forwards configured sampling options rather than suppressing them by deployment name, and the default transport does not follow redirects or retain cookies. SystemOne returns a lossless answer map; Decisions returns typed ordered answers. Their direct classes reuse the facade implementation with a locked API selector.

API versions: Chat Completions, Responses and OpenAIDecisions default to v1 without an api-version query. Chat and Responses select their v1 route from a resource root without a redundant version setter. Configured defaults and explicit scalar/per-row overrides remain supported; other strings are forwarded as api-version without a library allowlist. Complete customUrlRoot overrides preserve their bytes and cannot be combined with an explicit version.

Start with the getting-started notebook and usage guide. The Foundry Decisions documentation describes model and region restrictions, including the East US 2 exclusion.

Related Issues/PRs

Implements the native-inference portion of #2759. The umbrella remains open: recoverable Delta results are tracked separately in #2800 and optional #2813. This follow-up supplies live Foundry Decisions evidence relevant to #2760; it does not assert universal provider availability.

All prerequisite fixes are merged: #2806, #2807, #2808, #2809, #2810, #2818, #2819 and #2820. This PR is rebased onto master 36dfb77160ec99ea2bf43c7fae5decaf63ee7396; optional #2813 remains separate and follows this PR. No merge or auto-merge is authorized.

What changes are proposed in this pull request?

  • Add AIPrompt for explicit Chat Completions, Responses, embeddings and native API selection, plus the small AISystemOne and OpenAIDecisions specializations.
  • Reuse existing request/authentication infrastructure while preserving legacy classes and parameter shapes. Forward supported options or reject unsupported ones explicitly.
  • Support scalar and column-driven JSON body extensions, correct output schemas, lossless native observations, usage and distinct failure diagnostics.
  • Preserve native parameter/default behavior through generated Python, copy, save/load and pipelines.
  • Default Chat, Responses and Decisions to v1; preserve explicit version overrides, proxy prefixes, embedding defaults and legacy behavior.
  • Route Azure Decisions resource roots, /openai bases, v1 bases and complete routes correctly. Use api-key for Azure subscription keys and retain Entra bearer authentication and non-Azure Decisions bearer-key behavior.
  • Add the getting-started notebook and usage guide, including runnable Foundry Decisions examples and the corrected provider diagram.

This PR does not add Delta recovery, response-size configuration, old-reader/new-class interoperability, a tool-execution loop or an exactly-once inference guarantee. Spark execution remains lazy and may replay paid requests.

How is this patch tested?

Published head: c56bc482611a58d4caf6d1f36f8ca4938b58ea0e. Current local qualification used JDK 11 and Spark 3.5.0. The installed-package harness built fresh core/cognitive wheels and JARs, verified all 452 generated Python source/stub files against the wheels, checked artifact hashes and asserted the loaded JVM class origins and Python package paths.

Fresh live qualification, November 12, 2026: four tests passed with zero skips, using existing Sweden Central deployments and synthetic inputs only. There were six valid inference-stage invocations; null-input cases did not require a model call. No deployments or other cloud infrastructure were created.

API Deployment Exercised behavior Result
Chat Completions gpt-4.1-mini AIPrompt, resource-root default v1, template/system prompt, column-driven temperature/token limit, structured JSON, schema, usage and raw response Passed
Responses gpt-4.1-mini Same generative path with default v1, structured output and store=False Passed
Decisions gpt-6-luna Direct OpenAIDecisions and facade; predicate/choice/score answers, runtime schema, usage/raw response, null-input diagnostics and cached pandas conversion Passed
SystemOne Decision-1 Direct AISystemOne and facade; named native questions, lossless answers, schema, usage/raw response, null-input diagnostics and cached pandas conversion Passed

These are real provider calls from local Spark, not a new managed Fabric-runtime test. They do not qualify every model, region, sovereign cloud, parameter combination or performance profile. The live calls used Entra authentication; Azure API-key routing is covered by captured-request regression tests.

Current validation commands and results:

Command/check Result
sbt "set cognitive / Test / fork := false" cognitive/compile cognitive/Test/compile cognitive/scalastyle cognitive/Test/scalastyle "cognitive/testOnly com.microsoft.azure.synapse.ml.services.ai.AIPromptApiVersionSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptEndpointSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptPreflightSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptPersistenceSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptInputSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptSuite com.microsoft.azure.synapse.ml.services.ai.AIPromptFabricSuite com.microsoft.azure.synapse.ml.services.openai.OpenAIDecisionsSuite com.microsoft.azure.synapse.ml.services.openai.OpenAIV1EndpointSuite com.microsoft.azure.synapse.ml.services.ai.AISystemOneSuite" Passed: 215 cases across ten suites, zero skips; compilation and both style gates passed. Covers Azure route/authentication, API versions, complete URL overrides, persistence, legacy behavior and offline Fabric routing. The new Azure regressions first failed on the old rejection.
sbt core/codegen cognitive/codegen core/packageBin cognitive/packageBin "export cognitive/Compile/fullClasspath" Passed; these fresh artifacts were installed and used for the offline and live Python runs. No generated files were manually edited.
python run-foundry169.py (task-local artifact/provenance harness, not a repository command) Passed: 33 installed-package offline cases and four live cases, zero skips. Executes unittest discovery for test_AIPrompt.py and test_AIPromptLive.py; verifies build/source identity, wheel contents and loaded JARs. The exact launcher, artifact hashes and logs are retained with the local evidence.
python -m pytest tools\ci\tests\test_aiprompt_notebook.py -q Passed: six notebook cleanup tests, zero skips.
python -m black --check --config pyproject.toml cognitive\src\test\python\synapsemltest\services\test_AIPromptLive.py Passed with Black 22.3.0.
Notebook JSON/AST and output inspection Passed: all 18 code cells parse and all saved outputs are empty. The full notebook was not rerun for this follow-up.
git diff --cached --check and publication-tree comparison Passed. The qualified build tree is bf71484426e568d7c0a7a097b7e257f693d4bff3; the committed tree is e0faf310fbe6eb4bc7741059f7e44ae6f8e547c1. The only post-qualification differences are the two documentation URLs pointing to the corrected diagram; source and tests are identical.
Diagram publication and inspection Passed: visually checked the corrected labels; the downloaded GitHub image matches the local PNG byte-for-byte. PR, notebook and guide use the same hosted asset.

Historical evidence, not rerun or substituted for current checks: earlier revisions passed 189 core and 511 offline cognitive cases, with targeted rebase checks for codegen, persistence and attachment cancellation. An earlier packaged notebook run executed 32 examples, including live Chat, Responses, embeddings and Decision-1, but did not execute Decisions. The new Decisions tests above close that live-evidence gap for the tested Foundry deployment; they are not a claim that every notebook example was rerun.

Azure build 245921780 passed all 66 jobs for the older dab28d00fe691cec425d5f61eefdf999fddf25b6 head and its master merge. Earlier fork validation skipped InternalCompat and FabricE2E and reported 12 Component Governance alerts matching the then-current master baseline. Those skips were not counted as passes and the alerts were not claimed as fixed.

Known limits and readiness: Spark may replay paid requests; a plain InterruptedIOException without recognizable timeout evidence deliberately fails the task and can cause retries. Additional-method extraction remains def-based, not arbitrary class-attribute analysis. No further review matrix was started. Current-head remote CI and required maintainer approval remain outstanding; no merge or auto-merge has been performed. Website rendering and the full notebook were not rerun for this follow-up.

  • I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.

Does this PR change any dependencies?

  • No. You can skip this section.
  • Yes. Make sure the dependencies are resolved correctly, and list changes here.

Does this PR add a new feature? If so, have you added samples on website?

  • No. You can skip this section.
  • Yes. Make sure you have added samples following below steps.
  1. Find the corresponding markdown file for your new feature in website/docs/documentation folder.
    Make sure you choose the correct class estimators/transformers and namespace.
  2. Follow the pattern in markdown file and add another section for your new API, including pyspark, scala (and .NET potentially) samples.
  3. Make sure the DocTable points to correct API link.
  4. Navigate to website folder, and run npm start to make sure the website renders correctly.
  5. Don't forget to add <!--pytest-codeblocks:cont--> before each python code blocks to enable auto-tests for python samples.
  6. Make sure the WebsiteSamplesTests job pass in the pipeline.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:53
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Hey Rana Singh (@ranadeepsingh) 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

Spark-internal APIs and cross-runtime persistence contracts require maintainer validation, with final-head runtime qualification, live-provider testing, and prerequisite integration still pending.

No open issues 🎉

What changed in this PR

This PR introduces unified AI prompting on SynapseML’s existing OpenAI infrastructure, covering text generation, embeddings, and native decision models. It addresses the native-inference portion of #2759; Delta recovery remains separate in #2800.

Changes:

  • Add native API parameters, System One and Decisions specializations, request validation, and schema-preserving output support.
  • Extend shared transport, persistence, and Python generation infrastructure for cancellation, explicit defaults, and native JSON values.
  • Add regression tests, opt-in live and managed-runtime checks, benchmark coverage, and documentation navigation.
File Description
website/​sidebars.js Adds unified prompting documentation links.
pipeline.yaml Adds the AI services test package.
core/​src/​test/​scala/​org/​apache/​spark/​TaskContextTestSupport.scala Provides controlled task-cancellation fixtures.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​stages/​VerifyUDFTransformerPersistence.scala Tests reader-session deserialization policy.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​param/​VerifyGlobalParams.scala Tests concurrent global parameters and null preservation.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​nbtest/​SynapseTests.scala Excludes opt-in prompting examples from automatic runs.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​nbtest/​DatabricksUtilitiesSuite.scala Tests notebook exclusions for both cloud runners.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​nbtest/​DatabricksUtilities.scala Excludes the opt-in AIPrompt notebook.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​io/​split1/​VerifyResponseBodyInspection.scala Tests response cleanup after read failures.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​io/​split1/​VerifyFabricRetryAfter.scala Tests bounded retries, authentication refresh, and cancellation.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​core/​serialize/​ValidateComplexParamSerializer.scala Tests assigned-session persistence.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​codegen/​PyCodegenSuite.scala Tests Python method scope and decorator binding.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​codegen/​PyCodegenFixtures.scala Extracts and expands Python-generation fixtures.
core/​src/​main/​scala/​org/​apache/​spark/​sql/​internal/​SQLConfInjections.scala Exposes Spark-configured JSON factories.
core/​src/​main/​scala/​org/​apache/​spark/​ml/​NamespaceInjections.scala Adds parameter-default removal support.
core/​src/​main/​scala/​org/​apache/​spark/​ml/​ExplicitComplexParamsWritable.scala Adds explicit/default-aware persistence and typed readers.
core/​src/​main/​scala/​org/​apache/​spark/​ml/​ComplexParamsSerializer.scala Passes assigned sessions through complex persistence.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​param/​GlobalParams.scala Synchronizes global parameter access.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​io/​http/​HTTPTransformer.scala Adds opt-in cancellable request execution.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​io/​http/​CancellableRequests.scala Implements bounded workers and task-aware cleanup.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​codegen/​Wrappable.scala Supports custom input types and scoped method extraction.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​codegen/​PythonMethodExtractor.scala Extracts Python methods with scope and binding awareness.
core/​src/​main/​python/​synapse/​ml/​core/​schema/​Utils.py Supports importing JVM parameter defaults.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptParserSuite.scala Tests JSON diagnostics and Unicode validation.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptMultimodalRequestSuite.scala Tests attachment-read cancellation propagation.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIDecisionsSuite.scala Adds Decisions serialization and wrapper coverage.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIDecisionsLiveSuite.scala Adds opt-in live Decisions checks.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​NativeQuestionsSuite.scala Tests native questions and multimodal input validation.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AISystemOneSuite.scala Tests native routes, answers, retries, and diagnostics.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AISystemOneLiveSuite.scala Adds opt-in live System One checks.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptTestFixtures.scala Provides mock servers, native payloads, and wrapper fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptTestBase.scala Shares prompting test setup.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptResponseShapeSuite.scala Tests output schemas and partial-response diagnostics.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptPostProcessingSuite.scala Tests lazy CSV and regex postprocessing.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptPersistenceSuite.scala Tests numeric fidelity, defaults, and typed readers.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptMessageSchemaSuite.scala Tests duplicate-field rejection in protocol messages.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptHttpPolicySuite.scala Tests framing-header restrictions and credential selection.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptFabricProbe.scala Checks implicit Fabric routing with synthetic replies.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptCancellationSuite.scala Tests worker cleanup during Spark cancellation.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptBenchmarkSuite.scala Adds an opt-in legacy/native transport benchmark.
cognitive/​src/​test/​python/​synapsemltest/​services/​test_AIPromptLive.py Adds opt-in native PySpark and pandas checks.
cognitive/​src/​test/​python/​synapsemltest/​services/​aiprompt_fabric_e2e.py Adds synthetic managed-runtime qualification.
cognitive/​src/​test/​java/​synapsemltest/​ai/​AIIncompatibleStageProbe.java Detects unintended class initialization during loading.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​ResponseFormatUtils.scala Centralizes chat response-format normalization.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIResponses.scala Shares Responses message encoding through the companion.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptPythonOverrides.scala Generalizes Python overrides for prompting subclasses.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptParsers.scala Adds JSON parse-error diagnostics.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPrompt.scala Adds extension hooks and bounded attachment support.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIDecisions.scala Adds the native Decisions specialization.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIChatCompletion.scala Shares strict message encoding and parameter creation.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIAttachmentUtils.scala Adds bounded reads and cancellation-aware errors.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAI.scala Shares endpoint and Fabric-header helpers.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​HasOpenAIResponseSchema.scala Adds schema-validation and Python-conversion hooks.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​CognitiveServiceBase.scala Retains the selected authentication credential source.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​NativeQuestions.scala Validates native questions and Decisions input.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIValueCodec.scala Preserves schemas and vector-valued map keys.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AISystemOne.scala Adds the native System One specialization.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptPython.scala Adds native Python readers and exact JSON conversion.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIPromptParams.scala Defines native inputs, JSON extensions, and output parameters.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​ai/​AIColumnPlan.scala Plans resolver-aware columns and restores nested row schemas.

Review effort: Balanced

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
Summary
- Apply the pinned Black formatter to the AIPrompt regression suite and its
  Fabric validation helper.

Prompting Intent
- Keep the focused AIPrompt pull request limited to required feature work
  and repairs to its own validation gates.

Linked Sources
- microsoft#2811
- https://github.com/microsoft/SynapseML/actions/runs/42014432464

Rationale
- The Python style gate identified formatting in two new test files.
- The changes preserve both files' Python ASTs, and the repository's
  tracked Python files pass Black 22.3.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:04
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🟡 Changes recommended

The extractor misreads declarations inside skipped triple-quoted docstrings, causing real methods to disappear from stubs and allowing a getModelCol override to bypass alias validation.

1 open issue

Review effort: Balanced

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
## Summary
Keep the existing lexical state current while skipping nested function and
class bodies. Triple-quoted body strings must not create false public accessor
collisions or hide a real accessor defined after the skipped scope.

## Prompting Intent
Resolve the current-head review findings for the independent Python stub
scope fix and integrate the verified repair into the focused AIPrompt work,
without expanding the native feature or optional recovery scope.

## Linked Sources
- microsoft#2805
- microsoft#2810 (review)
- microsoft#2811 (comment)
- microsoft#2759

## Rationale
Advance the existing expression scanner instead of adding another parser.
Four syntax-valid function/class regressions failed before the repair.
All 36 PyCodegenSuite cases, main/test compilation and both style gates pass
in the isolated prerequisite and integrated native-feature worktrees.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
## Summary
Keep the existing lexical state current while skipping nested function and
class bodies. Triple-quoted body strings must not create false public accessor
collisions or hide a real accessor defined after the skipped scope.

## Prompting Intent
Resolve the current-head review findings for the independent Python stub
scope fix and integrate the verified repair into the focused AIPrompt work,
without expanding the native feature or optional recovery scope.

## Linked Sources
- microsoft#2805
- microsoft#2810 (review)
- microsoft#2811 (comment)
- microsoft#2759

## Rationale
Advance the existing expression scanner instead of adding another parser.
Four syntax-valid function/class regressions failed before the repair.
All 36 PyCodegenSuite cases, main/test compilation and both style gates pass
in the isolated prerequisite and integrated native-feature worktrees.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
## Summary
Account for the additional AI test lane in Codecov's expected upload count
and apply the pinned notebook formatter to the new AIPrompt tutorial.

## Prompting Intent
Repair the deterministic checks introduced by the focused AIPrompt change
without changing dependency pins, workflows, release tooling or unrelated
notebooks, and preserve the already-executed tutorial behavior.

## Linked Sources
- microsoft#2759
- microsoft#2811

## Rationale
The authorized AI matrix lane raises expected uploads from 54 to 55.
Keep the existing coverage-count assertion unchanged and fix its configuration.
Black 22.3.0 with Jupyter support changes formatting only: all 18 code-cell
ASTs, metadata and markdown remain identical, outputs stay cleared and
OpenAIDecisions remains commented. The full CI Black command and the targeted
coverage-upload selection test pass locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:28
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

The extractor misreads declaration-like text inside class-body multiline strings, which can omit real methods from generated stubs and leave alias collisions undetected.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Scan ordinary class-body statements to avoid hiding methods in stubs

core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​codegen/​PythonMethodExtractor.scala:106

A class-body multiline string containing def notAHeader( is treated as a declaration because ordinary statements are never scanned, leaving the extractor's expression state open. Subsequent real methods can then disappear from stubs and alias-conflict checks, allowing a getModelCol collision to go undetected. Scan every class-body statement by moving expression.scan(line) outside this condition, and add a regression for a multiline string inside a control block.

1 resolved since last review

Review effort: Balanced

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
## Summary
Track multiline strings and expressions in ordinary class statements so
declaration-like string content cannot hide subsequent methods or bypass
generated service-parameter accessor collision checks.

## Prompting Intent
Keep AIPrompt focused, fix regressions, and publish unrelated fixes separately.
Resolve current-head review findings without expanding the feature scope.

## Linked Sources
- Stub fix: microsoft#2810
- Stub issue: microsoft#2805
- Review: microsoft#2810 (review)
- Duplicate review: microsoft#2811 (review)

## Rationale
Reuse the existing lexical state for all class statements instead of adding
another parsing path. Four public code-generation regressions fail before
the repair and pass afterward, covering direct class statements and control
blocks. All 40 PyCodegenSuite cases, core compile/test compile, and both
Scala style checks pass. Share the existing alias-conflict assertions to
keep the suite within its file-length limit without weakening coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 5, 2026
## Summary
Track multiline strings and expressions in ordinary class statements so
declaration-like string content cannot hide subsequent methods or bypass
generated service-parameter accessor collision checks.

## Prompting Intent
Keep AIPrompt focused, fix regressions, and publish unrelated fixes separately.
Resolve current-head review findings without expanding the feature scope.

## Linked Sources
- Stub fix: microsoft#2810
- Stub issue: microsoft#2805
- Review: microsoft#2810 (review)
- Duplicate review: microsoft#2811 (review)

## Rationale
Reuse the existing lexical state for all class statements instead of adding
another parsing path. Four public code-generation regressions fail before
the repair and pass afterward, covering direct class statements and control
blocks. All 40 PyCodegenSuite cases, core compile/test compile, and both
Scala style checks pass. Share the existing alias-conflict assertions to
keep the suite within its file-length limit without weakening coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:49
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

The supplied diffs cover only part of this 95-file PR, and current-head runtime and compatibility validation for persistence, generated bindings, and Spark-internal integrations remains outstanding.

No open issues 🎉

Review effort: Balanced

Summary:
- Default Chat Completions and Responses requests to the v1 route.
- Preserve explicit and configured version overrides and embedding defaults.
- Cover default routing through copy, save/load and clearing an override.
- Update the usage guide and notebook migration notes.

Prompting Intent:
Keep v1 as the default API version for Chat Completions and Responses,
alongside the existing OpenAIDecisions v1 default.

Linked Sources:
- User request: keep v1 as the default for Chat Completions and Responses.
- microsoft#2811
- microsoft#2759

Rationale:
Use the v1 route without requiring a redundant setter. Change only the
generative fallback so configured scalar and per-row versions, complete
URL overrides, embeddings and legacy OpenAI stages retain their behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:55
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

Spark persistence, HTTP cancellation, and generated-wrapper changes require maintainer assessment and current-head runtime validation, which remains pending and could not be independently reproduced in this environment.

No open issues 🎉

Review effort: Balanced

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

The earlier Foundry restriction was incorrect: supported gpt-6-luna deployments expose Decisions, separately from Decision-1/SystemOne.

The local follow-up passed real Chat Completions, Responses, Decisions and SystemOne tests on existing Sweden Central deployments: four tests, six valid inference-stage invocations, zero skips. The generated Python packages and loaded JARs were verified against source tree bf71484426e568d7c0a7a097b7e257f693d4bff3. The code/documentation follow-up is being published; these results are not a claim that new-head remote CI has passed.

This corrected diagram removes the inaccurate Azure/Foundry limitation.

AIPrompt API contracts with corrected Foundry Decisions support

Foundry exposes Decisions for supported gpt-6-luna deployments, but the
new stages rejected Azure hosts before HTTP and selected bearer-key
authentication for every Decisions endpoint.

Route Azure resource roots through /openai/v1/decisions, retain api-key
authentication for Azure keys, and preserve Entra, proxy, version and
complete-URL behavior. Replace obsolete rejection tests with routing and
authentication regressions. Add opt-in Chat and Responses live tests,
enable the notebook's Foundry Decisions examples, and correct the guide
and shared diagram.

User intent: correct Foundry support and live-test all four inference APIs.
Sources: microsoft#2759, microsoft#2760,
https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/decisions

Validation: 215 Scala cases, 33 installed-package Python cases, six
notebook tests and four real service tests passed with zero skips.
The live tests exercised Chat, Responses, Decisions and SystemOne using
six valid stage invocations on existing Sweden Central deployments.
Compilation, Scala style, Python formatting, codegen and packaging passed.
Loaded JARs and generated Python sources matched the validated build.
No new deployments or dependency changes; no full notebook rerun or
current-head remote CI pass is claimed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Copilot AI balanced review requested due to automatic review settings November 12, 2026 12:00
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

Cross-runtime cancellation and persistence changes rely on Spark-private APIs and require maintainer review plus current-head runtime/CI validation, which the historical results do not establish.

No open issues 🎉

Review effort: Balanced

@ranadeepsingh
Rana Singh (ranadeepsingh) merged commit 33200c2 into microsoft:master Nov 12, 2026
80 checks passed
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 12, 2026
## Summary
- Extract the optional Delta input snapshot, result ledger and explicit
  recovery API from the original combined AIPrompt work.
- Keep ordinary inference lazy, reuse the native value codec, and retain
  ownership, cancellation and interrupted-driver regression coverage.
- Add a separate disabled-by-default recovery notebook and usage guide.

## Prompting Intent
- Keep the native AIPrompt pull request focused and move storage/recovery
  work into a separate explicitly unqualified draft.

## Linked Sources
- microsoft#2759
- microsoft#2800
- microsoft#2811

## Rationale
- Recovery changes storage, ownership and replay behavior and should not
  expand or block review of the focused native API.
- Retain the original recovery implementation and test intent without
  adding response limits or legacy-reader interoperability.
- Compilation and static/style checks are not runtime qualification.
  Ownership races, cancellation, process restart, matching installed
  artifacts, managed runtimes and current-head CI remain required.
- Uncommitted or ambiguous provider calls can still be repeated; this
  feature does not promise exactly-once model execution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 12, 2026
Carry the integrated compatibility fixes into optional recovery, preserve
durable schema/binding checks and maintain process-isolation coverage.

Freeze scope, finish running reviews, address blockers, publish and run
current-head CI instead of starting additional full review matrices.

- microsoft#2813
- microsoft#2811
- microsoft#2818
- microsoft#2819
- microsoft#2820

Keep recovery opt-in and separate from the core feature. Inherit reviewed
runtime fixes without losing the parent-specific task cancellation contract
or changing the documented retry/idempotency limitations.

Source-scoped qualification retains 119 attachment, 189 core and 272 Delta
cases, three explicitly recorded profile cancellations and two installed
Python cases. Current request regressions, compilation and style passed.
Managed restart evidence is retained through byte-equivalent runtime
artifacts, not falsely reported as rerun. Existing review evidence is retained;
additional matrices were superseded by user approval. Fresh CI is required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 12, 2026
## Summary
Update seven stale recovery endpoint expectations after rebasing onto the
merged AIPrompt implementation.

## Prompting Intent
Rebase microsoft#2813 after the core AIPrompt merge and determine
whether optional durable recovery still provides distinct value.

## Linked Sources
- Recovery PR: microsoft#2813
- Merged AIPrompt PR: microsoft#2811
- Recovery requirements: microsoft#2800

## Rationale
Keep the merged routing behavior rather than reintroducing obsolete endpoint
restrictions. Exercise deployment-path Unicode validation with an explicit
dated route, accept Azure Decisions during durable schema preflight, and
retain version rejection only where the embedding contract requires it.
Preserve the checks that schema validation does not create durable storage.
The initial rebased run reproduced seven failed assertions in 31 tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
## Summary
Update recovery preflight expectations for the merged Chat, Responses and
Decisions API-version contract, including scalar and column bindings.

## Prompting Intent
Rebase the recovery PR after AIPrompt merged, retain its distinct durability
value, and correct stale assertions exposed by current-head validation/review.

## Linked Sources
- Recovery PR: microsoft#2813
- Review finding: microsoft#2813 (comment)
- Merged AIPrompt: microsoft#2811

## Rationale
Keep global versions inactive on v1 endpoints while verifying explicit versions
reach HTTP and change the durable fingerprint. Preserve rejection coverage for
System One, embeddings and customUrlRoot. No production routing changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
## Summary
Check completed output items and their structured content instead of fields
that are present only in the raw provider response.

## Prompting Intent
Complete live validation of all five AI APIs through their individual classes
and AIPrompt, and publish fixes needed to make that evidence trustworthy.

## Linked Sources
- microsoft#2834 (comment)
- microsoft#2813
- microsoft#2811

## Rationale
ResponsesModelResponse exposes status on each output item, not top-level
status/store or an item type. Test the shipped schema without widening the
public API merely to expose raw-provider fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
- Extract the optional Delta input snapshot, result ledger and explicit
  recovery API from the original combined AIPrompt work.
- Keep ordinary inference lazy, reuse the native value codec, and retain
  ownership, cancellation and interrupted-driver regression coverage.
- Add a separate disabled-by-default recovery notebook and usage guide.

- Keep the native AIPrompt pull request focused and move storage/recovery
  work into a separate explicitly unqualified draft.

- microsoft#2759
- microsoft#2800
- microsoft#2811

- Recovery changes storage, ownership and replay behavior and should not
  expand or block review of the focused native API.
- Retain the original recovery implementation and test intent without
  adding response limits or legacy-reader interoperability.
- Compilation and static/style checks are not runtime qualification.
  Ownership races, cancellation, process restart, matching installed
  artifacts, managed runtimes and current-head CI remain required.
- Uncommitted or ambiguous provider calls can still be repeated; this
  feature does not promise exactly-once model execution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
Carry the integrated compatibility fixes into optional recovery, preserve
durable schema/binding checks and maintain process-isolation coverage.

Freeze scope, finish running reviews, address blockers, publish and run
current-head CI instead of starting additional full review matrices.

- microsoft#2813
- microsoft#2811
- microsoft#2818
- microsoft#2819
- microsoft#2820

Keep recovery opt-in and separate from the core feature. Inherit reviewed
runtime fixes without losing the parent-specific task cancellation contract
or changing the documented retry/idempotency limitations.

Source-scoped qualification retains 119 attachment, 189 core and 272 Delta
cases, three explicitly recorded profile cancellations and two installed
Python cases. Current request regressions, compilation and style passed.
Managed restart evidence is retained through byte-equivalent runtime
artifacts, not falsely reported as rerun. Existing review evidence is retained;
additional matrices were superseded by user approval. Fresh CI is required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
## Summary
Update seven stale recovery endpoint expectations after rebasing onto the
merged AIPrompt implementation.

## Prompting Intent
Rebase microsoft#2813 after the core AIPrompt merge and determine
whether optional durable recovery still provides distinct value.

## Linked Sources
- Recovery PR: microsoft#2813
- Merged AIPrompt PR: microsoft#2811
- Recovery requirements: microsoft#2800

## Rationale
Keep the merged routing behavior rather than reintroducing obsolete endpoint
restrictions. Exercise deployment-path Unicode validation with an explicit
dated route, accept Azure Decisions during durable schema preflight, and
retain version rejection only where the embedding contract requires it.
Preserve the checks that schema validation does not create durable storage.
The initial rebased run reproduced seven failed assertions in 31 tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
## Summary
Update recovery preflight expectations for the merged Chat, Responses and
Decisions API-version contract, including scalar and column bindings.

## Prompting Intent
Rebase the recovery PR after AIPrompt merged, retain its distinct durability
value, and correct stale assertions exposed by current-head validation/review.

## Linked Sources
- Recovery PR: microsoft#2813
- Review finding: microsoft#2813 (comment)
- Merged AIPrompt: microsoft#2811

## Rationale
Keep global versions inactive on v1 endpoints while verifying explicit versions
reach HTTP and change the durable fingerprint. Preserve rejection coverage for
System One, embeddings and customUrlRoot. No production routing changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Nov 13, 2026
## Summary
Add opt-in standalone Chat Completions and Responses tests and direct/facade
embedding tests to complete the existing native API matrix. Document the
endpoint, deployment, and environment-only authentication requirements.

## Prompting Intent
Determine whether the earlier end-to-end API validation completed and prove
that all five APIs work through their individual classes and AIPrompt.
Publish a focused follow-up for missing coverage or demonstrated defects.

## Linked Sources
- Merged AIPrompt PR: microsoft#2811
- Recovery rebase: microsoft#2813
- Broader Decisions qualification: microsoft#2760

## Rationale
Extend the existing live test suite instead of introducing another harness.
Exercise the public generated wrappers and their JVM stages with synthetic
inputs. Check structured output, schema agreement, vector values and
dimensions, usage, missing-input handling, and cached pandas conversion.
Missing service access remains an explicit skip rather than a passing test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aaff946b-e2e8-48ec-b71c-841a8e04e956
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants