Repository navigation
fix(config): the resources folder is the one next to the application file - never the working directory - #113
Merged
Conversation
…file - never the working directory; a direct node app.mjs anchors on the script it ran
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
…ever the working directory (PR #113 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 (loadConfig(path, appDir)), and the lazy singleton anchors on the script Node ran (mainScriptDir(), fromprocess.argv[1]), so an application that starts the platform itself finds its folder too. The working directory is never searched.--config <file>still names another file; the companionapp-log-context.yamlfollows the same folder (appConfig().resourcesDir);appConfig().sourceis the absolute path of the file found; the startup log reportsConfiguration: <path>.node app.mjs,node dist/src/cli.js app.mjs, and--config). 201 tests, tsc clean. Verified by hand:node dist/src/cli.js examples/llm-helper/llm-helper.mjsfrom the repository root logsConfiguration: .../examples/llm-helper/resources/application.ymland starts asllm-helper.application.ymlcomments and READMEs, and the CHANGELOG with the upgrade note.Why
The Python twin found the gap during the Bedrock drive: a lookup that starts in the working directory makes the configuration an application starts with depend on where it is launched from, and a direct run that never passed through the CLI loaded nothing. The rule applied here is the maintainer's: the command line names the script, so its full path is known and 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 stray
resources/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 Python twin is mercury-python #45 (Accenture/mercury-python#45).
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com
🤖 Generated with Claude Code