fix: run from directories without a local .cupcake policies folder (#104)#107
Open
punk-dev-robot wants to merge 3 commits into
Open
fix: run from directories without a local .cupcake policies folder (#104)#107punk-dev-robot wants to merge 3 commits into
punk-dev-robot wants to merge 3 commits into
Conversation
added 2 commits
May 29, 2026 10:18
A missing project .cupcake/policies/<harness> dir made eval exit 1, blocking every tool call. The project scan errored on a missing dir while the global scan guards with .exists(); mirror that guard so eval proceeds with global policies. Scanner stays strict. Adds a regression test.
init --global emitted --policy-dir <global config root>, but eval treats it as the project root and mis-resolved it, so local policies were never read (and pre-fix the bogus path exited 1). The global config auto-discovers independently, so global hooks now use the same project-relative path as project hooks. Existing global installs must re-run init --global.
b487aa9 to
7d81ab9
Compare
Engine::new tolerates a missing project .cupcake/policies dir as of the eqtylab#104 fix, initializing with global policies only. The binding smoke test asserted is_err() on a bogus path; that path now yields Ok. Flip the assertion to is_ok() to match the intended post-eqtylab#104 behavior.
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.
Summary
Running a harness from a directory without a local
.cupcake/policies/<harness>folder exited eval with code 1, blocking every tool call (#104). Two related causes:.exists(). Mirror that guard so a missing project dir yields no policies and eval proceeds on global policies. Scanner stays strict (validate/inspect).init --globalemitted--policy-dir <global config root>, but eval treats--policy-diras the project root and mis-resolved it, so local policies were never read (and pre-fix the bogus path exited 1). The global config auto-discovers independently, so global hooks now use the same project-relative path as project hooks ($CLAUDE_PROJECT_DIR/.cupcake, etc.).Regression test added; cli + opencode/scanner/global suites pass.