Skip to content

fix(config): merge user and project configs over BEC_CONFIG_PATH - #37

Merged
yannelli merged 1 commit into
mainfrom
fix/config-path-merge-order
Oct 8, 2026
Merged

yannelli merged 1 commit into
mainfrom
fix/config-path-merge-order

Conversation

@yannelli

@yannelli yannelli commented Oct 8, 2026

Copy link
Copy Markdown
Owner

BEC_CONFIG_PATH replaced the project file. When the variable was set, the hooks skipped .claude/concise.json in the project. The hooks now read the BEC_CONFIG_PATH file first. The user file merges over it, and the project file merges over both, so the project file wins a conflict.

The hooks resolve a relative BEC_CONFIG_PATH against the cwd. When the BEC_CONFIG_PATH file is also the user or project file, it loads once, in the user or project place. The check compares real paths, so a symlink counts as the same file.

The settings tools and the console list the BEC_CONFIG_PATH file as layer env-config before the user layers. The active flags and the layer order follow the merge order. --layer project writes the real project file, and creates .claude/concise.json when no project file exists. The project-override layer id is gone.

The playground passes its config snapshot through BEC_CONFIG_PATH. With the new order, a project file would merge over the snapshot and change the preview. The playground now sets a new variable, BEC_CONFIG_PATH_ONLY=1, which skips the user file and the project file. environment.md lists it.

configuration.md and environment.md describe the new order. INDEX.md has the new dates.

I ran the checks on Node 24.19.0 with NODE_V8_COVERAGE set. node scripts/check.mjs passed. node --test test/*.test.mjs passed 201 of 201 tests. The plugin suite passed 1907 of 1907 checks with HOME, USERPROFILE, and XDG_CONFIG_HOME unset.

node scripts/coverage.mjs reports 99.93% (6131 of 6135 lines) on my machine. The 4 missed lines are lines 29 to 32 of hooks/lib/patterns/ai/outline-conclusion.mjs, which this PR does not change. The same 4 lines are missed on my machine for origin/main, where CI reports 100%. All new lines ran.

BEC_CONFIG_PATH replaced the project file, so a project
.claude/concise.json was skipped when the variable was set. The hooks
now read the BEC_CONFIG_PATH file first. The user file merges over it,
and the project file merges over both, so the project file wins a
conflict. A relative path resolves against the cwd. When the
BEC_CONFIG_PATH file is also the user or project file, it loads once.

The settings tools and the console list the BEC_CONFIG_PATH file as
layer env-config, before the user layers. The project layer is always
the real project file.

The playground sets the new BEC_CONFIG_PATH_ONLY variable. A project
file cannot change a preview.
@yannelli
yannelli merged commit 16ef15b into main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant