You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP Settings is a frozen dataclass with hand-rolled env parsing while the rest of the library is pydantic #143
Every other configuration-shaped object in osw is pydantic: OswBaseModel and all the *Param classes. Consequences of the outlier:
max_results and max_chars are parsed by a hand-written _int_env helper with its own ValueError to RuntimeError translation, which pydantic does for free.
Nothing validates domain (a bare domain vs a full URL is a real distinction here, see _derive_domain), sparql_endpoint, or state_dir.
The type annotations are enforced by nothing at runtime, and src/osw/mcp is excluded from ty (pyproject.toml), so they are not enforced statically either.
Suggested fix: convert to a pydantic model, ideally BaseSettings-style with env aliases, replacing _first_env and _int_env. Natural point to do it is right after the config module moves to the shared service package in the MCP/CLI refactor, so it is one change instead of two.
Activity
refactor(service): validate Settings with pydantic
fix(service): validate read_only via pydantic instead of truthy set
fix(config): validate domain and state_dir (#195)