Skip to content

fix(preview): restore canon root resolver for normative layout - #608

Merged
vkgeorgia merged 1 commit into
mainfrom
transitrix-studio/485-restore-canon-resolver
Aug 31, 2026
Merged

vkgeorgia merged 1 commit into
mainfrom
transitrix-studio/485-restore-canon-resolver

Conversation

@transitrix

Copy link
Copy Markdown
Owner

Summary

Restores the catalogue-root resolver that was accidentally deleted in PR #603 (Gradle wrapper integrity pin). The resolver determines where the canon/ directory is located, which is needed for preview rendering to find canonical elements and relations.

The fix restores two key functions:

  • findModelRootPath() — locates the adopter manifest (transitrix.yaml)
  • findCanonRootPath() — resolves canon/ relative to the model root (normative layout), with fallback to the legacy walk-up-for-basename-canon (backward compatibility)

Also restores the two unit tests that verify both layouts work correctly. These tests are load-bearing — without them, a future merge could accidentally delete the walker again without failing CI.

Test plan

  • ✅ All 27 canon-loader unit tests pass
  • ✅ Normative layout test: resolves canon/ via transitrix.yaml
  • ✅ Legacy layout test: still resolves via ancestor directory named canon

Acceptance

  • ✅ Opening a projection under views/<notation>/ with transitrix.yaml and canon/ as siblings resolves the catalogue
  • ✅ Files under canon/elements/ still resolve (legacy layout)
  • ✅ Tests fail CI if the resolver is deleted without also deleting the tests
  • ✅ All nine preview modules share this single function (no fork)

Fixes transitrix-hq#485.

🤖 Generated with Claude Code

Restores findCanonRootPath and findModelRootPath that were accidentally
deleted in PR #603. The resolver searches for transitrix.yaml to locate
the model root, then resolves canon/ from there (normative layout), with
fallback to legacy basename-canon walk.

Includes the two unit tests that verify both normative and legacy layouts
resolve correctly. Deleting the tests without deleting the resolver would
allow a future merge to drop the walker again silently.

Fixes the regression in 3.6.0 where the fix was described in release
notes but missing from the published VSIX.

Fixes transitrix-hq#485.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📊 Metrics Regression Report

✅ All metrics within tolerance

Summary

  • Diagrams tested: 9
  • Successful: 9
  • Failed: 0
  • Violations: 0

Details

ai-expense-approval.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 1 1 0.00 ✓
bends 6 6 0.00 ✓
edgeLength 1868 1868 0.00 (0.0%) ✓
waypointDensity 2.6 2.6 0.00 (0.0%) ✓
spineDeviation 0 0 0.00 ✓
emptyArea 0.48125 0.48125 0.00 ✓
portViolations 0 0 0.00 ✓

feature-release.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 1 1 0.00 ✓
bends 13 13 0.00 ✓
edgeLength 3428 3428 0.00 (0.0%) ✓
waypointDensity 3 3 0.00 (0.0%) ✓
spineDeviation 0 0 0.00 ✓
emptyArea 0.5500909090909091 0.5500909090909091 0.00 ✓
portViolations 0 0 0.00 ✓

large-cyclic-workflow.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 2 2 0.00 ✓
bends 28 28 0.00 ✓
edgeLength 7479 7479 0.00 (0.0%) ✓
waypointDensity 3.12 3.12 0.00 (0.0%) ✓
spineDeviation 66 66 0.00 ✓
emptyArea 0.793134974640294 0.793134974640294 0.00 ✓
portViolations 1 1 0.00 ✓

order-fulfillment.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 0 0.00 ✓
bends 2 2 0.00 ✓
edgeLength 728 728 0.00 (0.0%) ✓
waypointDensity 2.3333333333333335 2.3333333333333335 0.00 (0.0%) ✓
spineDeviation 0 0 0.00 ✓
emptyArea 0.5622894736842106 0.5622894736842106 0.00 ✓
portViolations 0 0 0.00 ✓

parallel-tracks.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 0 0.00 ✓
bends 6 6 0.00 ✓
edgeLength 2104 2104 0.00 (0.0%) ✓
waypointDensity 2.6666666666666665 2.6666666666666665 0.00 (0.0%) ✓
spineDeviation 33 33 0.00 ✓
emptyArea 0.6834468042259194 0.6834468042259194 0.00 ✓
portViolations 0 0 0.00 ✓

simple-approval.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 0 0.00 ✓
bends 8 8 0.00 ✓
edgeLength 1450 1450 0.00 (0.0%) ✓
waypointDensity 3.142857142857143 3.142857142857143 0.00 (0.0%) ✓
spineDeviation 33 33 0.00 ✓
emptyArea 0.7764882411250177 0.7764882411250177 0.00 ✓
portViolations 0 0 0.00 ✓

simple-linear.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 0 0.00 ✓
bends 0 0 0.00 ✓
edgeLength 440 440 0.00 (0.0%) ✓
waypointDensity 2 2 0.00 (0.0%) ✓
spineDeviation 0 0 0.00 ✓
emptyArea 0.5258771929824562 0.5258771929824562 0.00 ✓
portViolations 0 0 0.00 ✓

small-dense-approval.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 0 0.00 ✓
bends 14 14 0.00 ✓
edgeLength 2066 2066 0.00 (0.0%) ✓
waypointDensity 3.272727272727273 3.272727272727273 0.00 (0.0%) ✓
spineDeviation 33 33 0.00 ✓
emptyArea 0.8091206777597997 0.8091206777597997 0.00 ✓
portViolations 0 0 0.00 ✓

xlarge-stress-test.bpmn.transitrix.yaml

Metric Baseline Current Delta Status
crossings 0 1 +1.00 ✓
bends 62 64 +2.00 ✓
edgeLength 11526 11674 +148.00 (1.3%) ✓
waypointDensity 3.1481481481481484 3.185185185185185 +0.04 (1.2%) ✓
spineDeviation 132 132 0.00 ✓
emptyArea 0.8201716840253008 0.8201716840253008 0.00 ✓
portViolations 0 0 0.00 ✓

@vkgeorgia
vkgeorgia merged commit c157f92 into main Aug 31, 2026
7 checks passed
@vkgeorgia
vkgeorgia deleted the transitrix-studio/485-restore-canon-resolver branch August 31, 2026 11:47
@transitrix transitrix mentioned this pull request Aug 31, 2026
5 tasks done
transitrix added a commit that referenced this pull request Aug 31, 2026
Fold the accumulated changelog fragment into the existing 3.6.1
CHANGELOG section (added ahead of the version bump by #608), and bump
versions: extension/root 3.6.0 -> 3.6.1, @transitrix/diagrams 1.12.0 ->
1.12.1, @transitrix/cli 2.8.0 -> 2.8.1 (moves together with diagrams
per the release-version guard).

Signed-off-by: transitrix <automation@transitrix.com>
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.

2 participants