bc-atlas 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.bca.example.json +40 -0
  2. package/CHANGELOG.md +237 -4
  3. package/README.md +109 -42
  4. package/THIRD_PARTY_NOTICES.md +17 -0
  5. package/package.json +7 -2
  6. package/src/al/compiler.js +349 -0
  7. package/src/al/index.js +184 -0
  8. package/src/al/settings.js +166 -0
  9. package/src/al/toolchain.js +234 -0
  10. package/src/analyzer.js +100 -36
  11. package/src/app/page.js +54 -0
  12. package/src/app/service.js +63 -0
  13. package/src/app/snapshot.js +82 -0
  14. package/src/app/ui/app.css +281 -0
  15. package/src/app/ui/app.js +1023 -0
  16. package/src/app/ui/index.html +53 -0
  17. package/src/app/worker.js +32 -0
  18. package/src/app/workspace.js +362 -0
  19. package/src/architecture.js +19 -5
  20. package/src/automation/pipelines.js +14 -2
  21. package/src/automation/run.js +8 -4
  22. package/src/automation/setup.js +22 -7
  23. package/src/{commands/init.js → automation/starter.js} +0 -27
  24. package/src/automation/vscode.js +12 -13
  25. package/src/blueprint/annotate.js +50 -0
  26. package/src/blueprint/baseline.js +54 -0
  27. package/src/blueprint/components.js +176 -0
  28. package/src/blueprint/evaluate.js +546 -0
  29. package/src/blueprint/extract.js +321 -0
  30. package/src/blueprint/index.js +114 -0
  31. package/src/blueprint/ownership.js +54 -0
  32. package/src/blueprint/propose.js +401 -0
  33. package/src/blueprint/report.js +253 -0
  34. package/src/blueprint/resolutions.js +151 -0
  35. package/src/blueprint/surface.js +212 -0
  36. package/src/call-analysis.js +36 -3
  37. package/src/capabilities.js +203 -142
  38. package/src/cli/help.js +22 -10
  39. package/src/cli.js +22 -23
  40. package/src/commands/blueprint.js +69 -0
  41. package/src/commands/check.js +28 -5
  42. package/src/commands/explore.js +32 -0
  43. package/src/commands/export.js +170 -0
  44. package/src/commands/refactor.js +55 -0
  45. package/src/commands/report.js +3 -11
  46. package/src/docs/al-ui-source.js +3 -2
  47. package/src/docs/export.js +51 -13
  48. package/src/docs/phrases.js +42 -0
  49. package/src/docs/process.js +419 -0
  50. package/src/docs/render/bpmn.js +131 -0
  51. package/src/docs/render/html.js +18 -11
  52. package/src/docs/render/markdown.js +16 -6
  53. package/src/docs/render/process-svg.js +142 -0
  54. package/src/docs/steps.js +28 -3
  55. package/src/docs/task.js +48 -24
  56. package/src/graph/coupling.js +44 -0
  57. package/src/graph/document.js +149 -0
  58. package/src/graph/history.js +286 -0
  59. package/src/graph/html.js +51 -0
  60. package/src/graph/lenses/dependency.js +418 -0
  61. package/src/graph/lenses/index.js +19 -0
  62. package/src/graph/metrics.js +118 -0
  63. package/src/graph/temporal.js +99 -0
  64. package/src/graph/viewer/template.html +76 -0
  65. package/src/graph/viewer/viewer.css +198 -0
  66. package/src/graph/viewer/viewer.js +1470 -0
  67. package/src/health.js +108 -6
  68. package/src/insights.js +1 -1
  69. package/src/mcp.js +110 -2
  70. package/src/output.js +4 -1
  71. package/src/refactor/diff.js +72 -0
  72. package/src/refactor/move.js +288 -0
  73. package/src/refactor/surface.js +107 -0
  74. package/src/resolver.js +7 -4
  75. package/src/sarif.js +65 -0
  76. package/src/svg.js +23 -1
  77. package/src/symbols.js +30 -2
  78. package/src/ui/theme.css +143 -0
  79. package/src/update.js +1 -1
  80. package/src/views.js +27 -4
  81. package/src/workflow.js +5 -1
  82. package/src/commands/architecture.js +0 -79
package/.bca.example.json CHANGED
@@ -63,12 +63,52 @@
63
63
  "message": "Core must not depend on UI"
64
64
  }
65
65
  ],
66
+ "architecture": {
67
+ "components": [
68
+ { "name": "Core", "layer": 0, "match": ["namespace:Contoso.Core"], "exposes": ["type:interface,table", "object:codeunit:Core API"] },
69
+ { "name": "Sales", "layer": 1, "match": ["namespace:Contoso.Sales"], "dependsOn": ["Core"], "maxObjects": 400 },
70
+ { "name": "Integration", "layer": 2, "match": ["app:Contoso Integration"], "dependsOn": ["Sales"] }
71
+ ],
72
+ "allowSameLayer": false,
73
+ "strictLayers": false,
74
+ "maxObjects": 1500,
75
+ "couplingWeights": { "reads": 2, "subscribes": 1 },
76
+ "severity": "error",
77
+ "unassigned": "warning",
78
+ "severities": {
79
+ "internal-access": "warning",
80
+ "unstable-dependency": "off"
81
+ },
82
+ "rules": [
83
+ {
84
+ "name": "owner-writes-its-tables",
85
+ "from": "*",
86
+ "to": "type:table",
87
+ "kinds": ["writes"],
88
+ "across": true,
89
+ "severity": "error",
90
+ "message": "Only the component that owns a table writes to it",
91
+ "resolution": "Call a codeunit of the owning component that writes the record."
92
+ },
93
+ {
94
+ "name": "core-has-no-ui",
95
+ "from": "layer:0",
96
+ "to": "type:page,report",
97
+ "except": ["object:page:Core Setup"]
98
+ }
99
+ ]
100
+ },
66
101
  "check": {
67
102
  "failOn": "error",
68
103
  "cycles": "warning",
69
104
  "maxFanIn": 25,
70
105
  "maxFanOut": 25
71
106
  },
107
+ "al": {
108
+ "compiler": "auto",
109
+ "analyzers": ["CodeCop", "UICop"],
110
+ "callGraph": true
111
+ },
72
112
  "report": {
73
113
  "outputDir": "docs/atlas",
74
114
  "views": [
package/CHANGELOG.md CHANGED
@@ -4,7 +4,243 @@ All notable changes to BC Atlas will be documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project
5
5
  follows [Semantic Versioning](https://semver.org/).
6
6
 
7
- ## Unreleased
7
+ ## 0.8.0 - 2026-10-29
8
+
9
+ ### Added
10
+
11
+ - Coupling weights: every dependency weighs what it takes to cut it
12
+ (`writes` 5, `extends` 4, `relates`/`implements` 3, calls and reads 2,
13
+ subscribers 1, permission grants 0.1; repeats count logarithmically;
14
+ `architecture.couplingWeights` changes them). The proposal orders
15
+ components, merges small groups, and finds objects that belong elsewhere
16
+ by coupling; PageRank and communities use it too.
17
+ - `--group-by coupling`: components from namespaces that are tightly coupled
18
+ to each other (Louvain communities on the coupling).
19
+ - Every architecture gets a score: cohesion per component, the share of the
20
+ coupling inside components, and modularity, to compare groupings.
21
+ - Dependency explorer: in open space, what drifts together follows the
22
+ color (apps, components, communities, types, build layers), groups are
23
+ spread apart, and tightly coupled objects sit closer together.
24
+ - Dependency explorer: the new default layout **Open space** lets the graph
25
+ float freely in a large space, like the large-graph example of
26
+ 3d-force-graph: small nodes, hairline links, apps or components that only
27
+ drift together, and the camera frames the connected objects once the layout
28
+ has settled. The filters start collapsed (☰ or `F`) so the graph has the
29
+ whole window.
30
+ - Tools to split a monolith into apps (see the new guide
31
+ [Split a monolith into apps](./docs/modularization.md) and the example
32
+ `examples/monolith`):
33
+ - **Data ownership:** for every table that other components use, who
34
+ owns, writes, reads, relates to, and extends it; `bca check` reports
35
+ tables other components write (`foreign-table-write`).
36
+ - **Extraction plans:** `bca architecture --extract <component>` (and the
37
+ MCP tool `bc_atlas_extraction_plan`, and the Architecture page) lists what
38
+ moves, the blockers with their work items (including app cycles), the new
39
+ app's `app.json` with a stable ID, dependencies, and `idRanges`, the tables
40
+ whose data moves with `ObsoleteState = PendingMove`/`MovedTo`/`MovedFrom`,
41
+ and the steps in order.
42
+ - **Public surface:** per component, the objects other components use (its
43
+ de facto API) and the objects that could be `Access = Internal`
44
+ (`could-be-internal`). `bca refactor surface` (and MCP
45
+ `bc_atlas_refactor_surface`) sets `Access = Internal` on them and writes
46
+ the API to `exposes`. `bca architecture --update-surface` records the
47
+ surface in `.bca-surface.json`; `bca check` then reports changes that
48
+ break its users, like AppSourceCop for internal boundaries
49
+ (`public-surface-change`: removed or internal objects, changed procedure
50
+ signatures, removed events, fields, and enum values).
51
+ - **`bca refactor move`:** moves an AL object to another component: its
52
+ file, or the object cut out of a shared file, goes to the component's
53
+ folder, its namespace becomes the component's, and referencing files get
54
+ the `using` they need. Dry run by default; also the MCP tool
55
+ `bc_atlas_refactor_move`. Work items that are moves carry the command.
56
+ - VS Code: the extension and its engine are bundled with esbuild; the
57
+ `.vsix` holds about 50 instead of 1,200 files, and CI tests the packaged
58
+ extension.
59
+ - More architecture rules in `bca check`, `bca architecture`, and the
60
+ Architecture page:
61
+ - **Public objects:** a component may use only public objects of another
62
+ one: `internal-access` for objects with `Access = Internal` (no other app
63
+ can see them) or outside the component's new `exposes` selectors.
64
+ - **Strict layers:** `strictLayers` lets a component use only the layer
65
+ directly below it (`layer-skip-dependency`).
66
+ - **Rules of your own:** `architecture.rules` forbids dependencies by
67
+ selectors, now also `component:` and `layer:`, with relation `kinds`
68
+ (e.g. only `writes`), `except`, `across`, and a message and resolution
69
+ (`dependency-rule`). Its violations are baselined like the others.
70
+ - **Checks of the architecture:** empty components, unused selectors, unused
71
+ or layer-contradicting `dependsOn` entries, declared cycles, components
72
+ above `maxObjects`, and dependencies on less stable components. Checks of
73
+ the configuration point at the component in `.bca.json`.
74
+ - **Severities:** `architecture.severities` sets the severity of each rule
75
+ or turns it off.
76
+ - New strategies `use-public-api`, `go-through-layer`, and `follow-rule`;
77
+ the report counts violations by rule.
78
+ - VS Code: the BC Atlas panel takes its design from the editor's color theme
79
+ (background, text, borders, accent, selection, status colors, and fonts),
80
+ for any theme including high contrast; the 3D explorer and the Docs page
81
+ inside the panel follow too. Exported pages keep the BC Atlas design.
82
+ - VS Code: the BC Atlas side bar is the panel's navigation and marks the page
83
+ it shows; the panel no longer repeats the pages in a navigation of its own.
84
+ - Microsoft's AL toolchain replaces BC Atlas's own analysis where it knows
85
+ better. With the AL Language extension or the AL Development Tools
86
+ installed (`al.compiler: auto`, the default), BC Atlas compiles a copy of the
87
+ workspace in dependency order and:
88
+ - resolves calls with the compiler's call graph (`al graph`): overloads,
89
+ variables, interfaces, and built-in methods, which no longer show up as
90
+ unresolved calls;
91
+ - reports compiler errors and warnings and CodeCop, UICop, AppSourceCop, and
92
+ PerTenantExtensionCop findings in `bca check`, with exact ranges and help
93
+ links; compiler syntax errors replace tree-sitter parse errors.
94
+
95
+ Results are cached by file content; nothing is written into the repository.
96
+ `--compiler auto|off|<path>`, `BCA_AL_COMPILER`, and the `al` section of
97
+ `.bca.json` choose the compiler; `--analyzers CodeCop,UICop` picks analyzers.
98
+ - `bca check --compiler-log <file|folder>` imports AL compiler error logs from
99
+ any build (alc `/errorlog`, `al workspace compile --errorlogdirectory`,
100
+ AL-Go, BcContainerHelper) without a compiler on the machine.
101
+ - `bca check --format sarif`: SARIF 2.1.0 with BC Atlas and AL findings for
102
+ GitHub code scanning and Azure DevOps.
103
+ - AL settings like the AL Language extension reads them: `al.packageCachePath`
104
+ (string or list) for symbols, `al.codeAnalyzers` with
105
+ `al.enableCodeAnalysis`, `al.ruleSetPath`, and `al.assemblyProbingPaths`
106
+ from `.vscode/settings.json` and `.code-workspace` files, whose `folders`
107
+ also define the projects. The same symbol package in several caches loads
108
+ once.
109
+ - VS Code: the extension uses the AL Language extension's compiler and the
110
+ editor's `al.*` settings, compiles in the background after each change, and
111
+ analyzes again after **AL: Download Symbols**, a new `.app`, or changed AL
112
+ settings. Settings `bcAtlas.alCompiler` and `bcAtlas.alAnalyzers`. Compiler
113
+ findings in the Problems panel are left to the AL Language extension.
114
+ - Generated GitHub Actions workflows and Azure Pipelines, and the BC Atlas
115
+ GitHub Action (`al-compiler` input), install the AL Development Tools.
116
+ - BC Atlas for VS Code (`vscode/`, `SchulzOli.bc-atlas`): everything BC Atlas
117
+ does, in the editor, with the engine inside. A panel with one look and feel
118
+ for all of it: an overview, health findings, the architecture (layers, work
119
+ items, components; adopt a proposal or accept violations with one click),
120
+ the 3D dependency explorer, diagrams for every view with zoom and pan, a
121
+ searchable object list with one page per object (dependencies, members,
122
+ violations; open the source at its line), and the UI-test documentation.
123
+ Findings in the Problems panel, CodeLens above AL objects, a status bar
124
+ item, a side bar, commands for export, documentation, setup, and tasks,
125
+ and the BC Atlas MCP server for agents in VS Code. The engine analyzes in
126
+ a background process and the panel refreshes when AL files change.
127
+ `bca setup --editor vscode` recommends the extension.
128
+ - `bca export`: one command for every file output. `--view app` (default)
129
+ writes the BC Atlas pages as one offline HTML file to share or publish from CI;
130
+ `report`, `explorer`, `catalog`, and the ten diagram views write what the
131
+ former commands wrote; `--watch` writes again on every change.
132
+ - The Git timeline can step by merged pull request (`--history-by prs`:
133
+ GitHub, Azure DevOps, GitLab, and squash merges, with the number of commits
134
+ each brought) or by release tag (`--history-by releases`, plus unreleased
135
+ commits); `--last n` keeps the most recent steps. The Dependencies page in
136
+ VS Code has the same choice.
137
+ - Explorer: a Spacing slider (50 % to 500 %) gives crowded graphs room:
138
+ longer links, longest between large nodes, stronger repulsion, and more
139
+ distance between clusters and floors.
140
+ - One design system (`src/ui/theme.css`) for the VS Code panel, the explorer, and the
141
+ HTML documentation, with light and dark themes.
142
+
143
+ - `bca architecture`: clean architecture for AL apps. Define components
144
+ (namespace, folder, app, module, type, or object selectors), layers, and
145
+ allowed dependencies in `.bca.json`, or let BC Atlas propose them from
146
+ today's dependencies (`--propose`, weighted feedback arc set and layering).
147
+ Every dependency that points outward, sideways, or undeclared becomes a work
148
+ item with a resolution strategy in AL terms: declare the dependency, move an
149
+ extension, subscriber, permissions, or navigation, move a related field into
150
+ a table extension, move an object, or invert the dependency with an
151
+ interface or event. Reports instability, abstractness, and distance per
152
+ component and which components can become apps of their own; text,
153
+ Markdown with a Mermaid diagram, and JSON.
154
+ - `--write` saves the architecture to `.bca.json`; `--update-baseline`
155
+ accepts today's violations. `bca check` fails on new violations, reports
156
+ fixed ones so the baseline only shrinks, and warns about component cycles.
157
+ - The dependency explorer shows the architecture: a Components level, violating edges
158
+ in red with their resolution, an Architecture panel with the largest work
159
+ items, violations per commit on the timeline, and architecture layers as a
160
+ layout. The MCP server offers `bc_atlas_architecture`.
161
+
162
+ - Dependency explorer (`bca export --view explorer`, and the Dependencies
163
+ page in VS Code): an interactive 3D dependency explorer in one
164
+ self-contained, offline HTML file. Dependencies inside one app are kept apart from
165
+ dependencies across apps, which are checked against `app.json`: `declared`,
166
+ `implicit` (Microsoft apps), `undeclared`, and `unresolved`. Switch between
167
+ an object level and an app level; filter by app, dependency class, object
168
+ type, and relation kind; search, isolate neighborhoods, and inspect the
169
+ evidence behind every edge.
170
+ - `--history` replays Git history as a fourth dimension: one frame per commit
171
+ that changed AL files or `app.json`, with added, changed, and removed
172
+ objects highlighted. Without Git, the timeline replays the build order.
173
+ - `--format json` writes the `bc-atlas.graph` document: a temporal graph with
174
+ presence spans, PageRank, Louvain communities, build layers, and cycles,
175
+ built with graphology. The MCP server offers it as `bc_atlas_explore`.
176
+ - `examples/multi-app`, a three-app workspace, and its explorer example.
177
+ - Nested `app.json` files are modules of the enclosing app, as in BCApps'
178
+ System Application and Base Application. The explorer adds a module level,
179
+ checks module dependencies against the module manifests, and marks
180
+ dependencies between modules of one app as `cross-module`.
181
+ - Platform system objects (`Integer`, `Date`, `Field`, `AllObjWithCaption`,
182
+ `Company`, ...) and `System "..."` permissions count as implicit
183
+ dependencies instead of unresolved ones.
184
+ - `--paths` analyzes and replays only some folders of a large
185
+ repository. Large explorer files embed their graph gzip-compressed and start
186
+ on the module level.
187
+
188
+ - `bca docs generate` draws every scenario as a flow of its clicks in BPMN
189
+ notation ("At a glance"): user tasks, milestones for `[THEN]` between
190
+ `[WHEN]` phases, loop markers for repeated blocks, and wrapping rows for long
191
+ flows.
192
+ - Every use case gets a process diagram with one lane per permission set, the
193
+ scenarios in `[NEXT]`/`[REQUIRES]` order, and an exclusive gateway where
194
+ `[ALTERNATIVE]` paths branch. In HTML, each scenario links to its guide.
195
+ - `--export bpmn`: `use-case-<feature>.bpmn`, a BPMN 2.0 file with diagram
196
+ layout and colors for Camunda Modeler, bpmn.io, and Signavio. Each scenario
197
+ is a collapsed sub-process; double-click it to see its clicks as user tasks.
198
+
199
+ ### Changed
200
+
201
+ - `internal-access` is on by default: a configured architecture can report
202
+ new violations where a component uses an `Access = Internal` object of
203
+ another one. Accept them with `bca architecture --update-baseline`, or set
204
+ `"severities": { "internal-access": "off" }` when components are layers of
205
+ one app that never split.
206
+ - The *Publish VS Code extension* workflow signs in to the Marketplace with
207
+ Microsoft Entra ID (GitHub OIDC, `vsce --azure-credential`) instead of the
208
+ `VSCE_PAT` token, because Azure DevOps retires global personal access
209
+ tokens on December 1, 2026. It needs the secrets `AZURE_CLIENT_ID` and
210
+ `AZURE_TENANT_ID` and checks access to the publisher before publishing.
211
+ - A new BC Atlas icon and logo (an "A" drawn as a dependency graph with an
212
+ orbit), used by the extension, its activity bar, and the panel. The
213
+ extension has a Marketplace listing with screenshots, a banner, and a social
214
+ preview image; sources and the render script are in `vscode/marketing/`.
215
+ - Fewer commands: 8 instead of 15. `bca report`, `bca graph`, `bca watch`,
216
+ `bca inspect`, and `bca codegraph` are now `bca export --view report`,
217
+ `--view <view>`, `--watch`, `--format json`, and `--view catalog`; `-o`
218
+ replaces `--output-dir`. `bca init` is part of `bca setup`, and
219
+ `bca capabilities` is `bca help --format json`. `bca <app-root>` is no
220
+ longer a shortcut; the interactive views are in the VS Code extension. See
221
+ the table in the CLI reference.
222
+ - The journey diagram shows each scenario with its permission set and number
223
+ of steps. `[NEXT]` and `[REQUIRES]` between the same scenarios are one
224
+ arrow in flow direction; `[ALTERNATIVE]` and `[RELATED]` are dashed lines.
225
+
226
+ ### Fixed
227
+
228
+ - The warehouse example declares `using BCA.Example.UI;` for the page its
229
+ permission set grants; the AL compiler reported it as missing.
230
+ - The 3D explorer inside the panel follows a dark theme: it now asks for the
231
+ theme once its graph is unpacked, instead of missing the message sent while
232
+ it was still loading.
233
+ - Namespace-qualified references such as
234
+ `Record Microsoft.Sales.Document."Sales Header"`,
235
+ `TableData Microsoft.Sales.Document."Sales Line" = R`, and
236
+ `Database::Microsoft.Sales.Document."Sales Header"` resolve to their object
237
+ instead of an unresolved object named `Microsoft`.
238
+ - The call view no longer slows down quadratically on large apps: resolving
239
+ calls in the Base Application takes about 2.5 instead of 70 seconds.
240
+
241
+ - Steps on quoted fields and actions, such as
242
+ `SalesOrder."Sell-to Customer No.".SetValue(...)`, are no longer dropped from
243
+ generated documentation.
8
244
 
9
245
  ## 0.7.0 - 2026-10-04
10
246
 
@@ -43,9 +279,6 @@ follows [Semantic Versioning](https://semver.org/).
43
279
  setup.
44
280
  - With a `package.json` that declares `bc-atlas`, generated pipelines and VS
45
281
  Code tasks use that version (`npm ci`, `npx --no-install bca`).
46
-
47
- ### Added
48
-
49
282
  - `bca docs generate` presents scenarios in the structure of an OASIS DITA 1.3
50
283
  task topic (prerequisites, steps, step results, result, related links).
51
284
  The AL tags are unchanged.
package/README.md CHANGED
@@ -5,13 +5,17 @@
5
5
  [![Node.js 22+](https://img.shields.io/badge/Node.js-22%2B-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
6
6
  [![Docs](https://img.shields.io/badge/docs-schulzoli.github.io%2FBC--Atlas-0b62d6)](https://schulzoli.github.io/BC-Atlas/)
7
7
 
8
+ ![BC Atlas: see your architecture, find what stands in its way, and keep it clean, right in VS Code](./vscode/marketing/social-preview.jpg)
9
+
8
10
  **Understand, guard, and document Microsoft Dynamics 365 Business Central AL
9
11
  projects - straight from source.**
10
12
 
11
13
  BC Atlas (`bca`) parses AL with
12
14
  [`tree-sitter-al`](https://github.com/SShadowS/tree-sitter-al), resolves
13
15
  objects, calls, events, data access, and permissions into an architecture
14
- model, and turns it into diagrams, health checks, reports, and documentation.
16
+ model, and shows it in one app: overview, health, a target architecture with
17
+ the work to reach it, a 3D dependency explorer, diagrams, one page per object,
18
+ and documentation from UI tests. The same results are files for Git and CI.
15
19
  Parser and renderer are WebAssembly: Node.js is the only requirement.
16
20
 
17
21
  **Documentation: [schulzoli.github.io/BC-Atlas](https://schulzoli.github.io/BC-Atlas/)**
@@ -19,29 +23,29 @@ Parser and renderer are WebAssembly: Node.js is the only requirement.
19
23
  ```sh
20
24
  npm install --global bc-atlas
21
25
  cd path/to/al-project
22
- bca setup # features, Husky hooks, VS Code tasks, pipeline, schedule (or: bca setup agent)
23
- bca report # docs/atlas/README.md: overview, diagrams, health
24
- bca check # architecture gate for CI
25
- bca update # new version? see what changed and update everything in one step
26
+ bca setup # .bca.json, Husky hooks, VS Code tasks, pipeline, schedule (or: bca setup agent)
27
+ bca check # architecture gate for CI
28
+ bca export --view report # docs/atlas/README.md: overview, diagrams, health
29
+ bca update # new version? see what changed and update everything in one step
26
30
  ```
27
31
 
32
+ In VS Code, install the **BC Atlas** extension and open an AL project:
33
+
34
+ ![BC Atlas in VS Code: an object page in the BC Atlas panel next to its AL source with CodeLens and a Problems entry](./docs/generated/images/vscode.png)
35
+
28
36
  ## Features at a glance
29
37
 
30
38
  | Area | Command | What you get |
31
39
  | --- | --- | --- |
32
- | **Get started** | `bca setup` | Guided setup in the terminal or through your AI agent (Claude Code, Copilot, Cursor): features, Husky or Git hooks, GitHub Actions or Azure Pipelines, cron schedule, and sync. |
33
- | | `bca init` | A starter `.bca.json`: title, excluded test folders, source links for your Git host. |
34
- | | `bca report` | One Markdown page with an at-a-glance table, six architecture diagrams, and the health summary. [Example](./examples/report/README.md) |
35
- | **Visualize** | `bca graph` | D2, SVG, PNG, PDF, or JSON for ten focused views (below). |
36
- | | `bca watch` | The same diagram, rebuilt on every AL change. |
37
- | **Analyze** | `bca check` | Health findings - cycles, forbidden dependencies, hot spots, diagnostics - with a CI exit code. |
38
- | | `bca inspect` | The resolved architecture model as JSON for scripts. |
39
- | **Document** | `bca codegraph` | One linked Markdown page per AL object. |
40
- | | `bca docs` | User guides and test cases from AL UI tests (`[SCENARIO]`, `[GIVEN]`, `[WHEN]`, `[THEN]`) as Markdown, HTML, DITA 1.3, or Azure DevOps CSV, with real captions and translations. [Example](./examples/docs/index.md) |
40
+ | **In VS Code** | BC Atlas extension | Everything below in the editor: a panel with overview, health, architecture, 3D dependencies, diagrams, objects, and docs; findings in the Problems panel; CodeLens above AL objects; the MCP server for agents. [Guide](./docs/vscode.md) |
41
+ | **Get started** | `bca setup` | Guided setup in the terminal or through your AI agent (Claude Code, Copilot, Cursor): a starter `.bca.json`, features, Husky or Git hooks, GitHub Actions or Azure Pipelines, cron schedule, and sync. |
42
+ | **Analyze** | `bca check` | Health findings - cycles, forbidden dependencies, architecture violations, hot spots, diagnostics, and AL compiler and CodeCop/UICop/AppSourceCop findings - with a CI exit code, also as SARIF for code scanning. |
43
+ | | `bca architecture` | Find a target architecture (components, layers), list every dependency that blocks it with how to resolve it, and enforce it with a shrinking baseline. [Guide](./docs/clean-architecture.md) |
44
+ | **Export** | `bca export` | Everything the extension shows, as files: the BC Atlas pages as one offline HTML file to share (default), the Markdown report ([example](./examples/report/README.md)), the 3D explorer, one Markdown page per object, any of ten diagram views as D2, SVG, PNG, PDF, or JSON, with `--watch`. |
45
+ | | `bca docs` | User guides and test cases from AL UI tests (`[SCENARIO]`, `[GIVEN]`, `[WHEN]`, `[THEN]`) as Markdown, HTML, DITA 1.3, or Azure DevOps CSV, with real captions and translations, a flow diagram per scenario, and BPMN 2.0 processes per use case. [Example](./examples/docs/index.md) |
41
46
  | **Integrate** | `bca run` | One entry point for Git hooks, schedules, and pipelines; verifies, stages, or publishes generated files. Also available as a [GitHub Action](./docs/automation-and-ci.md#github-actions). |
42
47
  | | `bca update` | "BC Atlas 0.8.0 is available": release notes, one-step update, and regenerated hooks, tasks, and pipelines. Dependabot pull requests on request. |
43
- | | `bca capabilities` | A versioned JSON contract of every command for tools and agents. |
44
- | | `bca mcp` | A Model Context Protocol server for AI agents. |
48
+ | | `bca mcp` | A Model Context Protocol server for AI agents; `bca help --format json` is the versioned command contract. |
45
49
 
46
50
  Run `bca` for the same overview in your terminal and `bca help <command>` for
47
51
  options and examples.
@@ -50,16 +54,52 @@ options and examples.
50
54
 
51
55
  | View | Answers | Example |
52
56
  | --- | --- | --- |
53
- | `project` | What does the app contain? | `bca graph --view project -o project.svg` |
54
- | `module` | How do namespaces or folders depend on each other? | `bca graph --view module -o modules.svg` |
55
- | `object` | What surrounds one object? | `bca graph --view object --object codeunit:50100 -o object.svg` |
56
- | `data` | Which code reads and writes which tables? | `bca graph --view data -o data.svg` |
57
- | `call` | Which procedures call each other? | `bca graph --view call --root-procedure Post --call-direction both -o calls.svg` |
58
- | `boundary` | What crosses a namespace, folder, app, or object boundary? | `bca graph --view boundary --scope namespace:Contoso.Sales -o boundary.svg` |
59
- | `contracts` | Which types implement an interface? | `bca graph --view contracts -o contracts.svg` |
60
- | `events` | Which subscribers react to which publishers? | `bca graph --view events --focus OnPosted -o events.svg` |
61
- | `ui` | How do pages, actions, and source tables connect? | `bca graph --view ui --focus "Sales Order" -o ui.svg` |
62
- | `workflow` | What happens after an action or entry point? | `bca graph --view workflow --entry action:Release -o flow.svg` |
57
+ | `project` | What does the app contain? | `bca export --view project -o project.svg` |
58
+ | `module` | How do namespaces or folders depend on each other? | `bca export --view module -o modules.svg` |
59
+ | `object` | What surrounds one object? | `bca export --view object --object codeunit:50100 -o object.svg` |
60
+ | `data` | Which code reads and writes which tables? | `bca export --view data -o data.svg` |
61
+ | `call` | Which procedures call each other? | `bca export --view call --root-procedure Post --call-direction both -o calls.svg` |
62
+ | `boundary` | What crosses a namespace, folder, app, or object boundary? | `bca export --view boundary --scope namespace:Contoso.Sales -o boundary.svg` |
63
+ | `contracts` | Which types implement an interface? | `bca export --view contracts -o contracts.svg` |
64
+ | `events` | Which subscribers react to which publishers? | `bca export --view events --focus OnPosted -o events.svg` |
65
+ | `ui` | How do pages, actions, and source tables connect? | `bca export --view ui --focus "Sales Order" -o ui.svg` |
66
+ | `workflow` | What happens after an action or entry point? | `bca export --view workflow --entry action:Release -o flow.svg` |
67
+
68
+ In VS Code, the Diagrams page of the BC Atlas panel renders every view with zoom and pan.
69
+
70
+ ### Clean architecture
71
+
72
+ `bca architecture` finds a target architecture for an app or workspace
73
+ (components in layers, dependencies pointing inward), lists every dependency
74
+ that stands in the way as a work item with a concrete resolution (declare it,
75
+ move an extension or subscriber, move a field into a table extension, invert
76
+ it with an interface), and shows which components can become apps of their
77
+ own. Save it to `.bca.json`, accept today's violations in a baseline, and
78
+ `bca check` keeps the architecture from eroding: new violations fail CI,
79
+ fixed ones shrink the baseline. In VS Code, the Architecture page shows the
80
+ layers and work items and adopts a proposal with one click.
81
+
82
+ ```sh
83
+ bca architecture ./app --propose --format markdown -o architecture.md
84
+ bca architecture ./app --propose --write --update-baseline
85
+ bca check ./app
86
+ ```
87
+
88
+ ### Interactive dependency explorer
89
+
90
+ The Dependencies page in VS Code, also written by `bca export --view explorer` as
91
+ one offline HTML file, shows a 3D graph of every AL object and app. Dependencies inside one app stay gray; dependencies across apps are
92
+ checked against `app.json` and colored as declared, implicit (Microsoft),
93
+ undeclared, or unresolved. Filter by app, class, type, or relation kind,
94
+ switch to the app level, and press play: with `--history` the timeline replays
95
+ how objects and dependencies were added, changed, and removed commit by
96
+ commit.
97
+
98
+ ```sh
99
+ bca export ./workspace --view explorer --history -o dependencies.html
100
+ ```
101
+
102
+ ![Dependency explorer with three apps, an undeclared cross-app dependency, and the commit timeline](./docs/generated/images/explorer-view.png)
63
103
 
64
104
  ### Screenshots
65
105
 
@@ -83,8 +123,14 @@ Generated from the checked-in [warehouse example](./examples/README.md).
83
123
  - permission sets: table-data `RIMD` rights, execute rights, and composed sets
84
124
  across dependent apps;
85
125
  - pages, parts, actions, and navigation;
86
- - `app.json` metadata, `.alpackages` symbols, multi-app workspaces, cycles,
87
- hubs, orphans, and unresolved references.
126
+ - `app.json` metadata, `.alpackages` symbols and `al.packageCachePath`,
127
+ `.code-workspace` multi-root workspaces, cycles, hubs, orphans, and
128
+ unresolved references.
129
+
130
+ With Microsoft's AL toolchain installed (the AL Language extension or the AL
131
+ Development Tools), the AL compiler resolves every call and reports compiler
132
+ and code-analyzer findings; BC Atlas's own analysis is the fallback. See
133
+ [AL toolchain](./docs/al-toolchain.md).
88
134
 
89
135
  Relationship colors are consistent across views, and labels and dash patterns
90
136
  ensure that color is never the only signal. Every edge keeps its evidence
@@ -128,7 +174,8 @@ optionally as Dependabot pull requests. See [Guided setup](./docs/setup.md).
128
174
  Read the docs at **[schulzoli.github.io/BC-Atlas](https://schulzoli.github.io/BC-Atlas/)**, with
129
175
  search, or browse them here, starting with the [table of contents](./docs/_TOC_.md):
130
176
 
131
- - [Getting started](./docs/getting-started.md) and [guided setup](./docs/setup.md), including [staying up to date](./docs/setup.md#staying-up-to-date)
177
+ - [Getting started](./docs/getting-started.md), [BC Atlas for VS Code](./docs/vscode.md), and [guided setup](./docs/setup.md), including [staying up to date](./docs/setup.md#staying-up-to-date)
178
+ - [AL toolchain: compiler, analyzers, AL settings](./docs/al-toolchain.md)
132
179
  - [Automation: hooks, schedules, and pipelines](./docs/automation-and-ci.md)
133
180
  - [Architecture reports](./docs/reports.md) and [health checks](./docs/health-checks.md)
134
181
  - [Architecture diagrams and views](./docs/architecture-diagrams.md)
@@ -141,8 +188,8 @@ search, or browse them here, starting with the [table of contents](./docs/_TOC_.
141
188
  ## AI agents and tools
142
189
 
143
190
  ```sh
144
- bca capabilities # versioned JSON contract: argv templates, options, enums, exit codes
145
- bca mcp # MCP stdio server (also installed as bca-mcp)
191
+ bca help --format json # versioned JSON contract: argv templates, options, enums, exit codes
192
+ bca mcp # MCP stdio server (also installed as bca-mcp)
146
193
  ```
147
194
 
148
195
  Agents should read the contract first, pass arguments as arrays, parse stdout
@@ -155,26 +202,33 @@ and update-check tools. `bca setup agent --agent claude|copilot|cursor` adds a
155
202
  ## How it works
156
203
 
157
204
  ```text
158
- *.al + app.json + .alpackages
205
+ *.al + app.json + .alpackages + AL settings
159
206
  -> tree-sitter AL syntax tree
160
207
  -> objects, members, relations (analyzer)
208
+ -> AL compiler: calls and diagnostics (src/al, when the toolchain is installed)
161
209
  -> resolved model with evidence (resolver, call analysis, semantics)
162
210
  -> view projection and insights (views, workflow, health)
163
- -> D2 / SVG / JSON / Markdown (renderers)
211
+ -> D2 / SVG / JSON / Markdown / HTML (renderers)
212
+ -> the pages: one workspace, in VS Code (vscode/) or exported as one file
164
213
  ```
165
214
 
166
215
  Parsing, resolution, projection, and rendering are separate stages, so new
167
- views and outputs do not touch the parser. Every command is defined once in
216
+ views and outputs do not touch the parser. The VS Code extension, `bca check`,
217
+ `bca architecture`, and `bca export` read the same analysis, so they always
218
+ agree; `src/ui/theme.css` gives the pages, the explorer, and the HTML
219
+ documentation one look. Every command is defined once in
168
220
  `src/capabilities.js`; help, argument validation, the JSON contract, and the
169
221
  generated reference derive from it.
170
222
 
171
223
  ### Current limits
172
224
 
173
- BC Atlas is an architecture extractor, not the AL compiler. References resolve
174
- by object type, ID, name, namespace, app preference, and declared dependencies,
175
- including `.alpackages` symbols. Dynamic calls, interface dispatch, and unusual
176
- subscriber forms stay syntactic or unresolved when the source does not identify
177
- a target. Conditional compilation is represented as parsed, not evaluated.
225
+ Object references resolve by object type, ID, name, namespace, app
226
+ preference, and declared dependencies, including symbol packages. Calls are
227
+ exact when the AL compiler is available; without it they resolve by name and
228
+ number of arguments, and dynamic calls and unusual subscriber forms stay
229
+ syntactic or unresolved when the source does not identify a target. Without
230
+ the compiler, conditional compilation is represented as parsed, not
231
+ evaluated.
178
232
 
179
233
  ## Development
180
234
 
@@ -196,7 +250,7 @@ Container:
196
250
 
197
251
  ```sh
198
252
  docker build -t bc-atlas .
199
- docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/workspace" bc-atlas report /workspace/app --output-dir /workspace/docs/atlas
253
+ docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/workspace" bc-atlas export /workspace/app --view report -o /workspace/docs/atlas
200
254
  ```
201
255
 
202
256
  The AL grammar is pinned in `vendor/tree-sitter-al.wasm`; update it with
@@ -211,8 +265,21 @@ enter that exact version in the workflow form. The workflow rejects mismatched
211
265
  or already published versions, runs all checks, and publishes with the selected
212
266
  dist-tag. It then tags the commit as `v<version>`, so
213
267
  `uses: SchulzOli/BC-Atlas@v<version>` resolves, and creates a GitHub release
214
- with the version's `CHANGELOG.md` section. It requires an `NPM_TOKEN`
215
- repository secret.
268
+ with the version's `CHANGELOG.md` section. npm authenticates through
269
+ [trusted publishing](https://docs.npmjs.com/trusted-publishers): the package's
270
+ trusted publisher on npmjs.com is this repository's `publish-npm.yml`
271
+ workflow, so no npm token is stored in GitHub.
272
+
273
+
274
+ The VS Code extension in `vscode/` is published by the `Publish VS Code
275
+ extension` workflow: set `version` in `vscode/package.json`, then run the
276
+ workflow with that version. It tests and packages the extension with the
277
+ current engine and publishes it to the Visual Studio Marketplace as the
278
+ publisher `SchulzOli`, signed in with Microsoft Entra ID through GitHub's OIDC
279
+ token (no Marketplace token is stored; see the
280
+ [launch checklist](https://github.com/SchulzOli/BC-Atlas/blob/main/vscode/marketing/README.md#launch-checklist)), and, with
281
+ the secret `OVSX_PAT`, to Open VSX. Every CI run uploads the `.vsix` as the
282
+ `bc-atlas-vsix` artifact.
216
283
 
217
284
  ## Contributing and support
218
285
 
@@ -21,3 +21,20 @@ License 2.0. Source: <https://github.com/terrastruct/d2>
21
21
  The official D2 WebAssembly package is redistributed as an npm dependency for
22
22
  SVG rendering. The CLI can optionally invoke a separately installed D2
23
23
  executable for PNG and PDF output.
24
+
25
+ ## 3d-force-graph and three.js
26
+
27
+ 3d-force-graph: Copyright Vasco Asturiano. three.js: Copyright three.js
28
+ authors. Both licensed under the MIT License. Sources:
29
+ <https://github.com/vasturiano/3d-force-graph>, <https://github.com/mrdoob/three.js>
30
+
31
+ The 3d-force-graph browser bundle, which includes three.js, is embedded in the
32
+ explorer HTML files written by `bca export` and shown by the VS Code extension.
33
+
34
+ ## graphology
35
+
36
+ Copyright Guillaume Plique (Yomguithereal). Licensed under the MIT License.
37
+ Source: <https://github.com/graphology/graphology>
38
+
39
+ `graphology`, `graphology-metrics`, and `graphology-communities-louvain` build
40
+ the graph model of the dependency explorer and compute its metrics.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-atlas",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "BC Atlas maps Microsoft Dynamics 365 Business Central AL projects: architecture diagrams, health checks, reports, and documentation generated from source.",
5
5
  "homepage": "https://github.com/SchulzOli/BC-Atlas#readme",
6
6
  "bugs": {
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "start": "node ./src/cli.js",
29
- "test": "node --test",
29
+ "test": "node --import ./test/setup.js --test",
30
30
  "check": "node ./scripts/check-syntax.js && npm run docs:check",
31
31
  "docs": "node ./scripts/generate-docs.js",
32
32
  "docs:check": "node ./scripts/generate-docs.js --check",
@@ -61,12 +61,17 @@
61
61
  "dependencies": {
62
62
  "@modelcontextprotocol/server": "^2.3.0",
63
63
  "@terrastruct/d2": "^0.1.33",
64
+ "3d-force-graph": "^1.80.0",
64
65
  "fflate": "^0.8.3",
66
+ "graphology": "^0.26.0",
67
+ "graphology-communities-louvain": "^2.0.2",
68
+ "graphology-metrics": "^2.4.1",
65
69
  "web-tree-sitter": "^0.27.0",
66
70
  "zod": "^4.6.5"
67
71
  },
68
72
  "devDependencies": {
69
73
  "@modelcontextprotocol/client": "^2.3.0",
74
+ "bpmn-moddle": "^10.3.1",
70
75
  "vitepress": "2.0.0-alpha.20"
71
76
  }
72
77
  }