Repository navigation
fix(config): the resources folder is the one next to the application file - never the working directory (a direct python app.py included) - #45
Merged
Conversation
…file - never the working directory; a direct python app.py anchors on the script it ran
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
…ever the working directory (PR #45 open) - conv-resources-next-to-the-application-file Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
…to the application file on main Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
AppConfigresolvesresources/application.yml(.yaml,.properties) next to the application file:mercury-servepasses the app's folder (load_config(path, app_dir=...)), and the lazy singleton anchors on the script Python ran (main_script_dir(), from__main__.__file__), so a directpython app.pyfinds its folder too. The working directory is never searched.--config <file>still names another file; the companionapp-log-context.yamlfollows the same folder (AppConfig.resources_dir);AppConfig.sourceis the absolute path of the file found; the startup log reportsConfiguration: <path>.python app.py,python -m mercury_composable.cli app.py, and--config). 208 tests, ruff and basedpyright clean. Verified by hand:python examples/llm-helper/llm_helper.pyfrom the repository root now logsConfiguration: .../examples/llm-helper/resources/application.ymland starts asllm-helper.application.ymlcomments and READMEs (the direct-run line), and the CHANGELOG with the upgrade note.Why
During the Bedrock drive a direct
python llm_helper.pyfrom the repository root started with no configuration at all (the default name and port, no health dependency): the CLI's working-directory-first lookup never ran on that path, and the lazy loader probed the working directory. The rule applied here is the maintainer's: the script knows where it sits, so the resources folder is resolved relative to the application file, never by scanning the working directory - the engines' classpath convention, where the configuration travels with the application. A strayresources/in the launch directory can no longer shadow the application's own. Upgrade note: an application that keptresources/in the working directory with its application file elsewhere passes--config, or moves the folder next to the file.The Node twin is the mercury-nodejs PR of the same title (#113, Accenture/mercury-nodejs#113).
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com
🤖 Generated with Claude Code