Skip to content

_common.sh: installed and toolkit copies resolve different roots when cwd is inside app/ or apps/<X>/ #489

Closed

Description

@MendixMau

Found in: the independent review of #487 (2026-10-20), which fixes #420.

When the working directory is inside an app folder (app/ or apps/<X>/), the two copies of _common.sh give different project roots:

  • The installed copy (<project>/bin/_common.sh, tier 2) resolves to the project folder.
  • The toolkit copy (tier 3) resolves to the app folder. mxtk_walk_root (_common.sh around line 53) checks for a model before it checks for a project folder, so it stops at the first folder that holds the .mpr.

A script run from the toolkit and the same script installed in the project can therefore write their ledgers (look ledger, metrics ledger, BUILD-LOG) to different roots, and the records split.

Expected: when the walk finds a model in a folder whose parent app/ (or grandparent apps/<X>/) is a project folder, it returns that project folder. Both copies then agree, on single-tree, two-tree and multi-app layouts. Add a fixture case for cwd in app/javasource and in apps/A/ with both copies.

This was already true on master before #487; it is not a regression from that PR.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions