Feat/cfg 005 validate config paths#583
Merged
chernistry merged 2 commits intoApr 8, 2026
Merged
Conversation
Add startup validation for file paths referenced in bernstein.yaml: - context_files must exist and be regular files - agent_catalog (if set) must exist and be a directory If any path is missing, the run fails immediately with a clear error: context_files: 'docs/DESIGN.md' does not exist Implementation: - New module: src/bernstein/core/config_path_validation.py - Integration: Called in bootstrap.py after preflight_checks() - Handles both relative and absolute paths consistently - Uses BernsteinError for actionable error messages Test coverage includes valid/invalid paths, absolute paths, directories vs files, and multiple error aggregation. Fixes #303
Address review feedback: - Use handle_cli_error() instead of manual print() + SystemExit - Use ExitCode.CONFIG (3) for config validation failures - Improve error message wording to cover both missing and wrong-type cases
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-code-fast-1 · 131,139 tokens |
|
chernistry
approved these changes
Apr 8, 2026
chernistry
left a comment
Collaborator
There was a problem hiding this comment.
Solid implementation — clean dataclasses, comprehensive tests (27 cases), proper error messaging. Thanks for the contribution! 👍
Contributor
Author
|
Glad i could help :) |
chernistry
added a commit
that referenced
this pull request
Apr 30, 2026
…paths Feat/cfg 005 validate config paths
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
Add startup validation for config-referenced file paths (
context_files,agent_catalog).Why
Fixes #303 - Config paths that don't exist cause mid-run failures. This validates all paths during startup with clear error messages.
How
config_path_validation.pymodule withvalidate_config_paths()andcheck_config_paths()bootstrap.pyafterpreflight_checks(), before orchestration startscontext_files: 'docs/DESIGN.md' does not existSystemExit(1)and actionable BernsteinError on failureChecklist
uv run ruff check src/passesuv run pyright src/passesuv run python scripts/run_tests.py -xpasses (Windows env issue - resource module unavailable)