Skip to content

[bug] _common.sh root search climbs to any ancestor .mpr in a multi-app layout, so ledgers land in the wrong folder #420

Open

Description

@MendixMau

Symptom. In a multi-app layout (apps/<X>/X.mpr), instruments that source project-bin/_common.sh can resolve the project root to an ancestor folder. Look-ledger seen rows then land in another folder's ledger, possibly another project's.

Cause. Tier 2 of the root search only accepts an .mpr at <root>/ or <root>/app/. A multi-app project fails tier 2, and tier 3 walks up from $PWD and takes the first ancestor that holds any .mpr. Repro: a project at /tmp/x/stray/proj with apps/A/A.mpr, and a stray .mpr in /tmp/x/stray: the hook writes to stray/.claude/loop/look/. With the stray removed, it climbs further to any .mpr under /tmp. It never reaches the self-parent fallback.

Fix direction. Stop climbing at the first folder holding .claude/ or bin/_common.sh, and probe apps/*/. Best done with the multi-app model key (state follows the model).

Found while reviewing #414.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions