feat/doctor: parse every env_files entry and report the lines resolveEnv would reject #101

Merged
pti merged 1 commit from feat/doctor-env-file-parse into main 2026-10-19 22:53:55 +02:00
Owner

Closes #72. Since #64 a line without an equals sign or with an empty name fails at tool call time or MCP server start, but wraptool doctor only checked that each env_files entry exists, is readable and has tight permissions. The env file parser is now an exported config.ParseEnvFile with a typed EnvLineError carrying the line number only, resolveEnv calls it and keeps its error text byte for byte, so the server and doctor share one parser. New check tools.env-file-parse, fail severity, runs it over every tools and mcp_servers env_files entry and reports file and line number, never the line content, with a remedy pointing at the Env file format section of docs/configuration.qmd. An unreadable entry is left to tools.env-file-missing. Tests cover the parser directly and the check for tools and mcp_servers subjects, missing files and multiple bad files, and assert the offending text never appears. Design doc check table, implementation plan and docs/doctor.qmd updated, CHANGELOG Added bullet. 🤖 Generated with Claude Code

Closes #72. Since #64 a line without an equals sign or with an empty name fails at tool call time or MCP server start, but wraptool doctor only checked that each env_files entry exists, is readable and has tight permissions. The env file parser is now an exported config.ParseEnvFile with a typed EnvLineError carrying the line number only, resolveEnv calls it and keeps its error text byte for byte, so the server and doctor share one parser. New check tools.env-file-parse, fail severity, runs it over every tools and mcp_servers env_files entry and reports file and line number, never the line content, with a remedy pointing at the Env file format section of docs/configuration.qmd. An unreadable entry is left to tools.env-file-missing. Tests cover the parser directly and the check for tools and mcp_servers subjects, missing files and multiple bad files, and assert the offending text never appears. Design doc check table, implementation plan and docs/doctor.qmd updated, CHANGELOG Added bullet. 🤖 Generated with Claude Code
feat(doctor): parse every env_files entry and report the lines resolveEnv would reject
All checks were successful
Lint / lint (pull_request) Successful in 46s
Lint / sonarqube (pull_request) Has been skipped
2a41d0339c
Since the dotenv-style env file parser landed, a line without '=' or with an
empty name fails at tool call or MCP server start, yet wraptool doctor only
checked that env_files exist and have tight permissions, so a malformed file
passed doctor and failed later.

Extract resolveEnv's per-file loop into the exported config.ParseEnvFile so
the server and doctor share one parser, and have it return a typed
EnvLineError carrying the line number only, never the line content, since env
files hold credentials. resolveEnv wraps it unchanged, so its error text is
byte-identical. The new tools.env-file-parse check reports the file and line
for each rejected entry on tools.* and mcp_servers.*, and skips unreadable
files because tools.env-file-missing owns them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pti merged commit 23d149b053 into main 2026-10-19 22:53:55 +02:00
pti deleted branch feat/doctor-env-file-parse 2026-10-19 22:53:55 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!101
No description provided.