Skip to content

Make BizTalk grouping deterministic and conversions testable offline - #49

Open
Shreyansh Gupta (code-scannner) wants to merge 10 commits into
mainfrom
guptashreyan/migration-pilot-feedback
Open

Shreyansh Gupta (code-scannner) wants to merge 10 commits into
mainfrom
guptashreyan/migration-pilot-feedback

Conversation

@code-scannner

Copy link
Copy Markdown
Collaborator

Addresses feedback from a BizTalk pilot customer. On a real estate the agent:

  • took about 10 minutes to detect 42 logical groups, and the count changed between runs;
  • produced groups whose contents were hard to understand, and analyses that included other flows' ports;
  • stopped at Service Bus provisioning when the user had no Azure access;
  • left no tests and no link from generated files back to source artifacts.

The pilot team also wanted maps in Azure Functions, a receiver → processor → sender topology, requirements.md output, and their own skills.

Changes

Feedback Change
Group detection is slow and returns a different number of groups each run BizTalk groups are computed in code (FlowGroupDetector) in seconds and are the same for the same source. Orchestrations linked by Call/Start Orchestration form one flow. Maps, message schemas, pipelines, ports and projects join the flows that reference them. New setting discovery.groupingMode (auto/deterministic/copilot); Copilot grouping now starts from the same proposal.
Very large groups once shared canonical-schema/common projects were added Artifacts used by several flows (shared schemas, binding files, common code) are marked shared and listed in each flow, instead of forcing flows to merge. Removed the contradictory "one group per receive location" instruction. Call and map matching is now exact.
Analysis of one flow included another flow's ports Binding ports are assigned to flows through orchestration bindings, subscription filters and messaging-only routes. Analysis only sees its own flow's ports.
Missing referenced projects were found only during analysis Unresolved .btproj project references are reported when groups are detected (notification, Home banner, inventory). After a rescan, the extension offers to re-detect groups. Flows that keep their ID keep their progress.
Hard to see what each group contains Home cards show entry → orchestrations → exits, the flow ID, and an artifact list with shared artifacts marked. Added a filter box, a Re-detect Groups action, and Export Inventory (Markdown).
Conversion stopped when Service Bus could not be provisioned New setting azure.provisioningMode = offline: no Azure sign-in. Generates Bicep under infra/ and tests locally with Azurite, the Service Bus emulator and mocks.
No end-to-end tests delivered New automated-test-generation skill and a required generate-tests task. It produces Logic Apps Standard workflow unit tests with mocked connectors, map regression tests (the XSLT is the reference output) and schema tests, all runnable with dotnet test.
No way to tell which generated file belongs to which source artifact Task artifactIds are validated: names are resolved, unknown IDs are rejected, and uncovered artifacts are reported. Task cards list their sources, and each generated project gets a TRACEABILITY.md.
Maps in Azure Functions; receiver → processor → sender New map-strategy and workflow-topology planning choices, carried into the conversion tasks.
The same planning questions for every flow New setting planning.defaultChoices, plus an Apply to All Flows option after answering a question.
Their build process starts from requirements.md Export requirements.md from the Planning view.
Better results with the team's own targeted skills Teams can add .github/skills/<skill>/CUSTOM.md overrides and an optional customer-standards skill. Provisioned skills a user edited are backed up instead of overwritten.
Analyze/Plan/Create slow even for one-artifact groups New migration_lookupMapping tool returns only the matching rows of the 109 KB mapping skill. Small flows without custom code skip decompilation.

Also fixes the BizTalk parsers: map tree references (<SrcTree><Reference Location>), project references in project IR, and send-port maps.

Validation

  • npm test: 112 unit and 2 integration tests pass (main: 70 + 2). Each commit passes on its own.
  • npm run lint is clean and npm run build succeeds.
  • Grouping verified on the BizTalk sample fixture and on a synthetic app with shared canonical schemas, one binding file for several flows, messaging-only routes and a missing project.
  • Home page rendered with a mocked host and checked in a browser. Skill overlays and backups checked in a temporary workspace.

Notes

  • auto grouping is deterministic for BizTalk. MuleSoft and TIBCO keep Copilot grouping, now starting from the deterministic proposal.
  • Skill and agent versions are bumped so existing workspaces receive the updated files.
  • The built-in Service Bus connector has not yet been tested against the emulator on a real flow. If it cannot connect, the skills fall back to mocked unit tests.
  • Merging the Create and Execute Home steps is handled separately in Combine conversion task creation and execution into one Convert step #46.

Shreyansh Gupta and others added 7 commits November 27, 2026 13:10
Discovery grouping was decided by Copilot, which took minutes, returned different
groups on each run, and merged flows into very large groups once shared canonical-schema and
common-code projects were added (every cross-group schema or binding edge was rejected).

- Add FlowGroupDetector: orchestrations joined only by Call/Start Orchestration form a
  flow; maps, message schemas, pipelines, ports and projects attach to the flows that
  reference them; artifacts used by several flows (canonical schemas, binding files)
  are marked shared instead of merging flows. Same inventory -> same groups and IDs.
- Attribute binding ports per flow (orchestration bindings, subscription filters,
  messaging-only routes) and scope shared binding files to each flow's ports when the
  analyser reads a group.
- Report referenced projects missing from the source folder; offer to re-detect groups
  after a rescan changes the inventory, keeping progress of flows whose ID is unchanged.
- Add discovery.groupingMode (auto/deterministic/copilot) and a Re-detect Logical
  Groups command; Copilot grouping now starts from the deterministic proposal.
- Remove the contradictory "one group per receive location" instruction, allow shared
  artifacts in the store tool's independence check, and match call targets exactly.
- Read map tree references, project references and send-port maps in the parsers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Users could not tell which functionality sat in which of dozens of groups.

- Flow cards show the entry receive location, orchestrations and send ports, the
  flow ID, and an expandable artifact list with shared artifacts marked.
- Add a filter box (flow, orchestration, port, schema or map name), a shared-artifact
  count, a missing-projects banner, and how the groups were formed.
- Add Re-detect Groups and Export Inventory actions; the inventory is a Markdown map
  of every group with its ports, artifacts, shared and ungrouped artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the logicAppsMigrationAgent.planning.defaultChoices setting (question ID to option ID). Planning applies a configured default to a matching non-hosting question when there is no explicit answer, no reconsideration, and no per-flow user answer, recording it with source 'configuration'. Configuration-sourced answers are re-resolved when the default changes or is removed. Hosting still comes from deploymentModel and its behavior is unchanged.

After a user answers a non-hosting question, offer 'Apply to All Flows' without blocking planning; accepting saves the answer to the workspace defaults.

Add configuredDefaultOption and PLANNING_QUESTION_IDS with unit tests. Skills define the map-strategy and workflow-topology questions with stable IDs, exclude configured answers from the question budget, and add planning rules for Azure Functions-hosted maps and receiver, processor, and sender workflows for BizTalk, MuleSoft, and TIBCO. Document the setting and choices in the README.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a Markdown export of the finalized migration plan so it can feed skill-based build pipelines that work from a requirements.md. A pure renderer emits decisions, brief, Mermaid architecture and per-workflow diagrams, mapping, disposition, component, gap, and pattern tables, effort, and acceptance criteria derived only from plan content. The Planning view gains an "Export requirements.md" button backed by the new logicAppsMigrationAgent.exportPlanMarkdown command.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Conversion stalled when Service Bus could not be provisioned, left no re-runnable
tests behind, and gave no way to tell which generated file implements which source
artifact.

- Add azure.provisioningMode (provision/offline). Offline conversions never sign in to
  Azure: they generate Bicep under infra/ and test with Azurite, the Service Bus
  emulator and mocked unit tests. Skills now treat Service Bus as emulator-capable.
- Add the automated-test-generation skill and a required generate-tests task: Logic
  Apps Standard workflow unit tests with mocked connectors, map regression tests (the
  converted XSLT stays the oracle when maps move to functions) and schema tests, run
  with dotnet test; the task is rejected without test files and dotnet test results.
- Require task artifactIds for traceability: names resolve to IDs, unknown references
  are rejected, uncovered flow artifacts are reported; task cards list their sources
  and TRACEABILITY.md in the generated project maps artifacts to tasks and files.
- Plan map-function and receiver/processor/sender tasks from the planning choices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pilot users found that their own targeted skills worked better, and that even one-artifact
flows took long because every stage loaded large skills.

- Merge .github/skills/<skill>/CUSTOM.md into each provisioned skill as an
  authoritative Customer Overrides section, and have agents read an optional
  customer-standards skill first. Provisioned skills carry a content hash: edited
  copies are backed up to SKILL.md.bak (with a warning) instead of being lost.
- Add the migration_lookupMapping tool, which returns only the rows of the
  source-to-logic-apps-mapping skill (109 KB for BizTalk) that mention the given
  components; agents, prompts and skills use it instead of loading the whole skill.
- Add a fast path for small flows without custom code: no decompilation, mapping
  lookups only, one reference-doc search per adapter.
- Bump skill and agent versions so workspaces receive the updated files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review fixes for the deterministic grouping:

- Finishing a flow analysis no longer rebuilds the cached groups without their
  endpoint scopes and shared artifacts; the group lookup reads the disk-backed cache.
- Flows that share a name are all suffixed from their own entry orchestration, so a
  re-detect cannot hand one flow's ID and saved progress to another.
- Link maps to schemas by exact name in the connection graph, so names such as Order
  and PurchaseOrder do not create false cross-group dependencies.
- Copilot re-detection keeps Home usable with the current groups instead of a spinner
  that a stopped agent run would never clear.
- Resolve .btproj project references with Windows separators on every OS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 07:45
CodeQL flagged incomplete escaping in the requirements, traceability and group
inventory exports: cells escaped pipes but not backslashes, so a value ending in a
backslash could still break the table. Escape backslashes before pipes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 upgrade can overwrite customer-edited skills without backup or warning, and the simple-flow logic can skip decompilation of dependencies needed to understand business logic.

2 open issues
What changed in this PR

This PR makes BizTalk discovery more predictable and improves the migration extension’s planning and conversion workflow with offline testing, source traceability, and team customization.

Changes:

  • Adds deterministic grouping, shared-artifact handling, scoped port analysis, and searchable/exportable flow inventories.
  • Adds offline conversion guidance, automated test generation, and source-to-output traceability.
  • Adds reusable planning choices, requirements.md export, customer skill overrides, and targeted mapping lookups.
File Description
src/​views/​planning/​PlanningWebviewPanel.ts Adds the requirements export action.
src/​views/​discovery/​SourceFlowVisualizer.ts Adds richer flow cards, filtering, re-detection, and inventory export.
src/​views/​conversion/​ConversionWebviewPanel.ts Displays each task’s source artifacts.
src/​test/​unit/​skills-lookup.test.ts Tests skill overlays, mapping lookup, and small-flow prompts.
src/​test/​unit/​planning-requirements-markdown.test.ts Tests requirements rendering and acceptance criteria.
src/​test/​unit/​planning-defaults.test.ts Tests configured planning answers.
src/​test/​unit/​flow-group-inventory.test.ts Tests flow summaries, search text, and inventory export.
src/​test/​unit/​flow-group-detector.test.ts Tests deterministic grouping, shared artifacts, and endpoint scoping.
src/​test/​unit/​conversion-traceability.test.ts Tests artifact resolution, traceability, and offline prompts.
src/​stages/​planning/​PlanningDecisionService.ts Applies defaults and offers workspace-wide answer reuse.
src/​stages/​planning/​PlanningDecisions.ts Defines stable question IDs and validates defaults.
src/​stages/​discovery/​FlowGroupInventory.ts Builds flow summaries, search text, and Markdown inventories.
src/​stages/​discovery/​DiscoveryCacheService.ts Preserves progress by flow ID during re-detection.
src/​stages/​conversion/​Traceability.ts Resolves task artifacts and renders traceability matrices.
src/​services/​SkillOverlay.ts Composes customer overrides and detects managed-file edits.
src/​services/​reports/​PlanningRequirementsMarkdown.ts Renders finalized plans as requirements documents.
src/​services/​ReportExporterService.ts Saves Markdown requirements exports.
src/​services/​MappingSkillLookup.ts Searches mapping skills for relevant rows and rules.
src/​services/​LLMFlowGenerator.ts Extends grouping metadata and tightens reference matching.
src/​services/​AgentFileProvisioner.ts Provisions updated skills, overlays, and edit backups.
src/​parsers/​biztalk/​BizTalkProjectParser.ts Normalizes project-reference paths and exposes references in IR.
src/​parsers/​biztalk/​BizTalkMapParser.ts Reads schema references nested inside map trees.
src/​parsers/​biztalk/​BizTalkBindingsParser.ts Includes send-port maps in parsed endpoints.
src/​constants/​UserMessages.ts Adds grouping, planning-default, and backup messages.
src/​constants/​ChatPrompts.ts Adds offline, scoped-analysis, testing, and lookup guidance.
src/​commands/​CommandRegistry.ts Wires grouping, exports, and provisioning settings into commands.
resources/​skills/​workflow-json-generation-rules/​tibco/​SKILL.md Uses targeted mapping lookups for workflow generation.
resources/​skills/​workflow-json-generation-rules/​mulesoft/​SKILL.md Uses targeted mapping lookups for workflow generation.
resources/​skills/​workflow-json-generation-rules/​biztalk/​SKILL.md Uses targeted mapping lookups for workflow generation.
resources/​skills/​runtime-validation-and-testing/​tibco/​SKILL.md Adds emulator, offline, and generated-test guidance.
resources/​skills/​runtime-validation-and-testing/​mulesoft/​SKILL.md Adds emulator, offline, and generated-test guidance.
resources/​skills/​runtime-validation-and-testing/​biztalk/​SKILL.md Adds emulator, offline, and generated-test guidance.
resources/​skills/​planning-decision-guidance/​SKILL.md Defines reusable map-strategy and workflow-topology choices.
resources/​skills/​logic-apps-planning-rules/​tibco/​SKILL.md Adds topology and map-hosting guidance.
resources/​skills/​logic-apps-planning-rules/​mulesoft/​SKILL.md Adds topology and map-hosting guidance.
resources/​skills/​logic-apps-planning-rules/​biztalk/​SKILL.md Adds topology and map-hosting guidance.
resources/​skills/​detect-logical-groups/​tibco/​SKILL.md Starts grouping from proposals and separates shared configuration.
resources/​skills/​detect-logical-groups/​mulesoft/​SKILL.md Starts grouping from proposals and separates shared configuration.
resources/​skills/​detect-logical-groups/​biztalk/​SKILL.md Defines deterministic proposals, shared artifacts, and port scope.
resources/​skills/​conversion-task-plan-rules/​tibco/​SKILL.md Adds infrastructure, map-function, test, and traceability requirements.
resources/​skills/​conversion-task-plan-rules/​mulesoft/​SKILL.md Adds infrastructure, map-function, test, and traceability requirements.
resources/​skills/​conversion-task-plan-rules/​biztalk/​SKILL.md Adds infrastructure, map-function, test, and traceability requirements.
resources/​skills/​cloud-deployment-and-testing/​tibco/​SKILL.md Defines template-only output in offline mode.
resources/​skills/​cloud-deployment-and-testing/​mulesoft/​SKILL.md Defines template-only output in offline mode.
resources/​skills/​cloud-deployment-and-testing/​biztalk/​SKILL.md Defines template-only output in offline mode.
resources/​skills/​automated-test-generation/​SKILL.md Defines reusable workflow, map, and schema tests.
resources/​skills/​analyse-source-design/​tibco/​SKILL.md Directs analysis to targeted mapping lookups.
resources/​skills/​analyse-source-design/​mulesoft/​SKILL.md Directs analysis to targeted mapping lookups.
resources/​skills/​analyse-source-design/​biztalk/​SKILL.md Adds flow-scoped analysis and targeted mapping lookups.
resources/​agents/​migration-planner.md Adds mapping lookup and customer-standard guidance.
resources/​agents/​migration-converter.md Adds testing, traceability, offline, and customization guidance.
resources/​agents/​migration-analyser.md Adds proposal-based grouping and scoped-analysis guidance.
README.md Documents grouping, exports, offline conversion, and customization.
package.json Registers new settings, commands, and mapping-tool schemas.

Review effort: Balanced

continue;
}
// Keep direct edits before updating; teams should move them to CUSTOM.md
if (isEditedManagedSkill(existing)) {
'- `source-to-logic-apps-mapping` — component equivalents, service provider IDs, operation names. Look up components with migration_lookupMapping; read the full skill only when a lookup finds nothing relevant\n';

const FAST_PATH =
'FAST PATH: this flow is small and has no custom code. Do not decompile assemblies, look up components with migration_lookupMapping instead of reading the full `source-to-logic-apps-mapping` skill, and run at most one reference-doc search per adapter or connector.\n';
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.

4 participants