Skip to content

Fix AL tool compatibility across BC versions - #852

Open
Sun Haoran (haoranpb) wants to merge 5 commits into
mainfrom
fix/al-tool-net8-runtime
Open

Fix AL tool compatibility across BC versions#852
Sun Haoran (haoranpb) wants to merge 5 commits into
mainfrom
fix/al-tool-net8-runtime

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • select the AL development tools .NET version from each entry's BC platform version
  • use .NET 8 for BC 24-28 and .NET 10 for BC 29+ in both Claude Code and Copilot workflows
  • remove historical Scope = OnPrem table declarations during setup_repo_prebuild and commit that common baseline
  • bump BC-Bench to 0.10.1

Why

Microsoft.Dynamics.BusinessCentral.Development.Tools ships net8.0 and net10.0 payloads. On Windows 2025 runners, an unqualified install selected net10.0 for BC 24 and BC 27 entries even though those platforms require .NET 8. This caused false TimeSpan.FromSeconds overload errors.

After fixing that mismatch, the full run exposed a second, older incompatibility: public AL MCP compilers reject historical Microsoft BaseApp tables containing Scope = OnPrem with AL0850.

setup_repo_prebuild now removes those declarations and commits the result as the baseline. Every agent and evaluator therefore sees the same adjusted source whether AL MCP/LSP is enabled or not, keeping experiments comparable and matching the previously proven approach. The rewrite is limited to table files under each entry's project paths. Current dataset patches neither contain the removed line nor target the rewritten tables, and a test guards that invariant.

Previous attempts and history

Validation

  • uv run pytest tests\test_setup_operations.py tests\test_review_workflows.py tests\test_git_operations.py tests\test_claude_code_agent.py tests\test_copilot_agent.py tests\test_type_exhaustiveness.py -q (55 passed)
  • uv run pre-commit run --all-files
  • verified BC 24/27 select .NET 8 and BC 29 selects .NET 10
  • verified current dataset patches do not depend on the removed scope declarations
  • Simplified prebuild smoke run 33879644151 passed all jobs; BC 24 and BC 27 baselines removed and committed the expected declarations, built/published successfully before and after agent execution, and emitted no AL0850 or AL0196

Force the AL MCP/LSP tool package to use its net8.0 payload so Windows 2025 runners do not select the incompatible net10.0 compiler. Bump the benchmark minor version because this can change agent build results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the BC platform boundary from the container runtime: net8.0 for BC 24 through 28 and net10.0 for BC 29 and newer. Correct the benchmark bump to 0.10.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haoranpb Sun Haoran (haoranpb) changed the title Pin AL development tools to .NET 8 Select AL tool .NET framework by BC version Sep 4, 2026
@haoranpb

Copy link
Copy Markdown
Collaborator Author

Follow-up from evaluation run 33856550710: the framework fix is working. BC 27 jobs install the AL tool with --framework net8.0, and the previous \AL0196\ / \TimeSpan.FromSeconds\ ambiguity is gone. The linked job completed successfully; its evaluator build, publish, and regression test all passed.

One separate agent-side diagnostic remains: \AL0850\ on the historical \TableRelationsBuffer.Table.al\ object's \Scope = OnPrem. This is an explicit restriction in the public AL compiler, reproduces in both AL tool v17 and v18, and cannot be suppressed by a ruleset. It is not a .NET runtime problem. The authoritative BcContainerHelper build accepts that historical Microsoft source and succeeds.

The run's current actual failed matrix job is \microsoftInternal__NAV-227219: Docker failed during container startup with \hcs::System::Start: context deadline exceeded, then could not detach the VHD. That is a separate transient runner/container failure.

Temporarily hide historical Scope = OnPrem table declarations while public AL MCP/LSP runs, then restore the source and original HEAD before patch extraction. Preserve agent edits and keep the evaluator build on the authoritative source.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haoranpb Sun Haoran (haoranpb) changed the title Select AL tool .NET framework by BC version Fix AL tool compatibility across BC versions Sep 4, 2026
@haoranpb

Copy link
Copy Markdown
Collaborator Author

Fresh validation on commit \

Apply historical AL source compatibility to every bug-fix and test-generation Claude/Copilot run, independent of whether AL MCP or LSP is enabled, so benchmark comparisons use the same agent workspace.

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

Copy link
Copy Markdown
Collaborator Author

Comparability follow-up in \8cfbb9e: the source compatibility layer is now enabled for every bug-fix/test-generation Claude and Copilot run, not only AL MCP/LSP experiments. The category registry owns the decision, so tool-enabled and tool-disabled runs see the same agent source; restoration before patch extraction/grading remains unchanged.

Apply the Scope = OnPrem rewrite once during repository prebuild and commit it as the common baseline for every experiment and evaluator. Rename the AL tool output to expose the selected .NET version.

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

Copy link
Copy Markdown
Collaborator Author

Simplified baseline validation passed: run 33879644151 completed successfully on \4f5ae16. BC 24 removed/committed 2 restricted declarations; BC 27 removed/committed 1. Initial and post-agent BcContainerHelper builds published successfully, with no \AL0850\ or \AL0196. Expected benchmark test failures remain result-level outcomes, not infrastructure failures.

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.

1 participant