feat(check_config): report a config file that exists but is not in use - #414
Open
PYDuquesnoy wants to merge 1 commit into
Open
PYDuquesnoy wants to merge 1 commit into
PYDuquesnoy wants to merge 1 commit into
Conversation
#410 first half. Registered with IRIS_HOST/IRIS_WEB_PORT and a .iris-agentic-dev.toml in the project folder, check_config reported connection_source: explicit_flag, config_file: null and a config_watch_path pointing straight at that file. Three true fields and nothing joining them. The file is invisible rather than merely outranked: apply_workspace_config_with_path short-circuits BEFORE the file is read and returns None for the path, so the connection never learns it exists. The warning therefore comes from the watcher's path plus a filesystem read, not from the connection. And the half that bites: an EDIT to that same ignored file IS adopted on the next tool call, because check_reload calls the raw load_workspace_config, which takes no `explicit` argument and cannot honour the short-circuit. So whether a session reaches the flag's instance or the file's depends on whether the file was touched after startup. This is the complement of an existing warning. check_config already covers config_file.is_none() && !is_explicit (fallback discovery); that is one half of a partition on is_explicit and only that half had a message. Which precedence the fork should adopt is still open, and this does not decide it — the message describes the asymmetry without declaring either side correct, asserted by the_warning_does_not_pick_a_precedence. The branch condition is extracted as ignored_config_path() so the WIRING is testable and not only the message; the_existence_check_is_not_inert runs the same call with the file absent, created and removed again, because without the negative halves it would pass against an implementation that reports a file which is not there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N7fLbq3ftb82ub45QCpsPB
2 tasks
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.
Addresses the first checkbox of #410. It deliberately does not decide the precedence — that is
the second checkbox and it is yours.
What was reported
Registered at user scope with
IRIS_HOST/IRIS_WEB_PORT, with a.iris-agentic-dev.tomlin theproject folder, a fresh session reports:
Three true fields, and nothing joining them.
The file is invisible, not merely outranked
apply_workspace_config_with_pathshort-circuits before the file is read:It returns
Nonefor the path, so the connection never learns the file exists — which is whyconfig_fileis null rather than naming the file it declined. The warning therefore has to be builtfrom the watcher's path plus a filesystem read, not from anything on the connection.
The half that actually bites
An edit to that same ignored file is adopted on the next tool call, because
check_reloadcalls the raw
load_workspace_configdirectly and that loader takes noexplicitargument, so itcannot honour the short-circuit. Whether a session reaches the flag's instance or the file's therefore
depends on whether the file happened to be touched after startup — which is what made the reporter
switch to
--mcp-config --strict-mcp-configto get determinism.The message says both halves. A warning that only said "your file is being ignored" would leave the
reader concluding the file is inert and editing it freely, which is the trap.
It is the complement of a warning that already exists
check_configalready warns forconfig_file.is_none() && !is_explicit— fallback discovery. That isone half of a partition on
is_explicit, and only that half had a message. So this is the same shapeas #409 and #408: a guard on one sibling and not its twin.
the_two_warnings_are_not_interchangeableasserts the two messages cannot be confused, andthe_warning_does_not_claim_the_file_is_absentasserts this one never borrows the other's diagnosis —the file is sitting right there.
The precedence is left open, on purpose
Honouring the escape hatch on reload would be one line, and it would break the other documented
behaviour:
check_config's own description promises hot-reload as an operator feature, and the serveris normally registered with
IRIS_HOST, which isexplicit_flag. So the two documented behaviourscontradict each other whenever both a flag and a file are present, and picking a winner is a contract
call.
the_warning_does_not_pick_a_precedenceasserts the message describes the asymmetry withoutdeclaring either side correct — a message that implied one would document a contract nobody chose.
The wiring is tested, not just the string
The branch condition is extracted as
ignored_config_path(config_file, source_is_explicit, watch_path), so the three reasons to stay silent are unit-testable rather than living inline in anasync handler: the file IS the source; the source is not explicit (that is the other branch's case);
nothing exists at the watched path (then the watcher is waiting, and claiming a file is ignored would
be a fabrication).
the_existence_check_is_not_inertruns the same call three times, differing only in whether the fileis on disk — absent →
None, created →Some, removed →None. Without the negative halves it wouldpass against an implementation that reports a file which is not there, which is the mirror image of
the defect. The check is
is_file(), notexists(), becauseexists()is true for a directory.Verification
--checkrc=0, this file 13/13,cargo clippy --workspace --all-targets -- -D warningsrc=0,
cargo build --workspacerc=0cargo test --workspacewith the IRIS env unset rc=0 — 1855 passed, 0 failed, 69 ignored across66 binaries (66
test result:lines, so the total is measured and not an empty grep)restored byte-identical (sha checked), post-restore baseline green
Two mutants are worth naming because they cover the ways this could be wrong rather than absent:
reporting without checking the file exists (killed by
the_existence_check_is_not_inert), and themessage implying the flag is the correct one to rely on (killed by
the_warning_does_not_pick_a_precedence).🤖 Generated with Claude Code
https://claude.ai/code/session_01N7fLbq3ftb82ub45QCpsPB