Repository navigation
fix(exec): relative paths from another folder no longer skip the plan rule - #795
Merged
Merged
Conversation
…after the cd
_XD="${0%/*}" stayed relative (../../bin); after exec.sh's cd to the project root the guard
[ -f "$_XD/_position.sh" ] failed in silence, so 'cd apps/Orders && ../../bin/exec.sh
../../mdlsource/x.mdl' wrote under Interview mode: auto while the same call by absolute path
was refused. A relative MDL script path broke every [ -f "$SCRIPT" ] guard the same way. Both
are made absolute before the cd, only when the caller is not at the project root, so a run from
the root is unchanged. Fixture: test-mode-contract.sh X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXpQSmcGH9hcq6GdHyLxdh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
project-bin/exec.shset_XD="${0%/*}", which stays relative (e.g.../../bin), and then rancd "$PROJECT_ROOT". After the cd, the plan-rule guard[ -f "$_XD/_position.sh" ]silently failed. The whole unattended plan rule was skipped, so a model write before build-ready went ahead.Repro on master: a two-app scaffold with
Interview mode: auto, thencd apps/Orders && bash ../../bin/exec.sh ../../mdlsource/x.mdl. That call is not refused; the same call by absolute path is.The fix: just before the cd, and only when
$PWDis not the project root,_XDand a relative MDL script path are made absolute. The same bug class also broke the later[ -f "$SCRIPT" ]guards (build-plan, Marketplace, restate, scan, look-ledger owe), and those now work too. A run from the project root skips the new block, so its behaviour is unchanged.Evidence
tests/wave2/test-mode-contract.shcase X:The commit is cherry-picked from #789's branch (b2546d8). The #789-only part (an in-app
bin/install) stays in #789.Generated by Claude Code