Merged
Conversation
Implements config.yaml and src/docproc/config.py with Pydantic models,
${VAR} environment variable substitution via dotenv, path resolution
against project root, validation, and singleton caching.
Closes #3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
config.yaml may contain secrets (API keys), so it should not be tracked. The example file serves as a template for users to copy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add frozen=True to all Pydantic models for immutability - Move _config declaration below Config class (forward reference fix) - Fix singleton cache to only use cache when config_path is None - Add config file existence check before reading - Wrap YAML parse errors and Pydantic validation errors with file context - Handle empty YAML files with clear error message - Move non-empty recipients check into model via Field(min_length=1) - Add field_validator for non-blank API key - Use mock.patch.object in _find_project_root test - Add tests for blank API key, empty YAML, invalid YAML, missing file - Add test for _find_project_root success path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Catch ValidationError specifically instead of broad Exception - Separate file read from YAML parse for distinct I/O error messages - Use tuple instead of list for Recipient.tags and Config.recipients - Add Field(min_length=1) to Recipient.name and Recipient.tags - Add test for get_config() cold-start auto-load path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add min_length=1 to all DeepfellowConfig string fields - Add tags_must_not_contain_blanks validator on Recipient - Raise RuntimeError if load_config called with path when already loaded - Wrap _process_env_vars errors with config file path context Co-Authored-By: Claude Opus 4.6 <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.
Summary
config-example.yamlwith project configuration template (config.yamlis gitignored)src/docproc/config.py— typed Pydantic configuration loader with env var substitution, path resolution, validation, and singleton cachingfrozen=Trueandtuplecollections for deep immutabilityCloses #3
Test plan
uv run ruff check src/ tests/passesuv run ruff format --check src/ tests/passesuv run ty check src/passesuv run pytest— 25 tests pass, 94% coverage (≥80% threshold)🤖 Generated with Claude Code