feat(settings): add OpaqueSettings and load_settings#7
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
|
Port OpaqueSettings, load_settings, strip_to_none_before_validator, and UNHIDE_SENSITIVE_INFO from bridge into foundry-python-core so downstream Foundry components can use shared settings infrastructure without coupling to bridge. - Add pydantic-settings>=2,<3 runtime dependency - Create aignostics_foundry_core/settings.py with the four public names - 14 unit tests with 100% branch coverage - Update AGENTS.md module index with settings entry Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
43d9e25 to
1c9324a
Compare
|
Claude finished @olivermeyer's task in 2m 52s —— View job PR Review Complete ✅Comprehensive code review for PR #7: feat(settings): add OpaqueSettings and load_settings Tasks
✅ Review SummaryExcellent work! This is high-quality, production-ready code that meets all project standards. The settings module is well-designed, thoroughly tested, and properly documented. Code Quality: Excellent ✅Strengths:
Test Quality: Excellent ✅All tests properly marked: Every test has Comprehensive edge case coverage:
Notable test: Code Design: Excellent ✅Defensive programming highlights:
Documentation: Excellent ✅
Conventional Commits: ✅PR title: Commit messages:
Security: ✅
No Issues FoundBlocking issues: None Suggestions: None - this code is ready to merge Recommendation: APPROVE ✅This PR demonstrates excellent engineering practices:
The settings module provides valuable reusable infrastructure for the Foundry ecosystem with user-friendly error messages and proper secret handling. |
`Path` has no `__bool__`, making all instances truthy. The previous
`if not input_value:` guard was therefore never entered for any `Path`,
so `Path("")` silently resolved to the current working directory.
Replace the falsy check with an explicit guard:
if input_value is None or not input_value.parts:
This correctly returns `None` for both `None` and empty/no-parts paths
(e.g. `Path("")` / `Path()`), while resolving all other paths as before.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
In Pydantic v2, `loc` entries can be integers (e.g. for list-typed fields
validated via RootModel). The previous single-expression format
f"{prefix}{error['loc'][0]}".upper()
produced meaningless env-var names like "MY_PREFIX_0" for integer locs.
Add an explicit isinstance guard so integer locs fall back to the model
prefix (e.g. "MY_PREFIX") rather than appending the raw integer.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|



Porting the settings module from Bridge.