check_config reports connection_source: auto_discovered and emits the fallback warning for a connection that was pinned explicitly by IRIS_HOST/IRIS_WEB_PORT. An env-pinned connection and a blind port scan are indistinguishable in its output.
Measured
Same binary (0.18.0), same instance, two environments:
|
connection_source |
fallback_warning |
IRIS_HOST=localhost IRIS_WEB_PORT=43080 … |
auto_discovered |
PRESENT |
no IRIS_* at all |
auto_discovered |
PRESENT |
Byte-identical on both fields. (The namespace differs only because the localhost scan reads IRIS_NAMESPACE for its own probe credentials — not a source distinction.)
Cause
crates/iris-agentic-dev-core/src/tools/mod.rs:4106-4110, at startup:
let (source, file) = if config_path.is_some() {
(ConnectionSource::ConfigFile, config_path)
} else {
(ConnectionSource::AutoDiscovered, None) // env vars land here
};
The decision reads only whether a .iris-agentic-dev.toml was found. ConnectionSource::EnvVars is assigned in exactly one place — ConnectionState::new_disconnected(ConnectionSource::EnvVars) at :4114 — so no live connection can ever report it.
The information is not missing, it is discarded: discovery.rs step 2 sets DiscoverySource::EnvVar on the IrisConnection correctly. The mapping to ConnectionSource never asks.
Why this is worse than a wrong label
check_config's explicit-source test is:
let is_explicit = matches!(conn.source, ConnectionSource::ConfigFile | ConnectionSource::EnvVars);
so the fallback warning fires on an explicitly pinned connection and instructs the operator to pin what is already pinned:
No .iris-agentic-dev.toml config file found. Connection established via fallback discovery (Docker/port scan). Set OBJECTSCRIPT_WORKSPACE or create a .iris-agentic-dev.toml in your project root to pin the target instance.
That warning exists (#21) to flag the one genuinely dangerous case — fallback discovery can silently target the wrong instance. Firing it on every env-registered setup buries the case it was built for. Every workshop VM and every ~/.claude.json registration with an env block is in this state today.
0.18.0 widens it. A connection resolved from VS Code settings is explicit configuration too, and currently gets the same treatment.
This is the report-vs-mechanism split that #169 fixed for the write gate by routing reporting and enforcement through one function. Same shape, different pair.
Fix
Derive ConnectionSource from the connection's own DiscoverySource rather than from config_path alone, and let is_explicit follow it:
DiscoverySource::EnvVar → EnvVars
DiscoverySource::VsCodeSettings → a VsCodeSettings variant, explicit
DiscoverySource::ExplicitFlag → explicit
LocalhostScan / Docker → AutoDiscovered, which is the only case the warning should fire on
A config file still wins, since it is the narrowest statement of intent.
check_configreportsconnection_source: auto_discoveredand emits the fallback warning for a connection that was pinned explicitly byIRIS_HOST/IRIS_WEB_PORT. An env-pinned connection and a blind port scan are indistinguishable in its output.Measured
Same binary (0.18.0), same instance, two environments:
connection_sourcefallback_warningIRIS_HOST=localhost IRIS_WEB_PORT=43080 …auto_discoveredIRIS_*at allauto_discoveredByte-identical on both fields. (The
namespacediffers only because the localhost scan readsIRIS_NAMESPACEfor its own probe credentials — not a source distinction.)Cause
crates/iris-agentic-dev-core/src/tools/mod.rs:4106-4110, at startup:The decision reads only whether a
.iris-agentic-dev.tomlwas found.ConnectionSource::EnvVarsis assigned in exactly one place —ConnectionState::new_disconnected(ConnectionSource::EnvVars)at :4114 — so no live connection can ever report it.The information is not missing, it is discarded:
discovery.rsstep 2 setsDiscoverySource::EnvVaron theIrisConnectioncorrectly. The mapping toConnectionSourcenever asks.Why this is worse than a wrong label
check_config's explicit-source test is:so the fallback warning fires on an explicitly pinned connection and instructs the operator to pin what is already pinned:
That warning exists (#21) to flag the one genuinely dangerous case — fallback discovery can silently target the wrong instance. Firing it on every env-registered setup buries the case it was built for. Every workshop VM and every
~/.claude.jsonregistration with an env block is in this state today.0.18.0 widens it. A connection resolved from VS Code settings is explicit configuration too, and currently gets the same treatment.
This is the report-vs-mechanism split that #169 fixed for the write gate by routing reporting and enforcement through one function. Same shape, different pair.
Fix
Derive
ConnectionSourcefrom the connection's ownDiscoverySourcerather than fromconfig_pathalone, and letis_explicitfollow it:DiscoverySource::EnvVar→EnvVarsDiscoverySource::VsCodeSettings→ aVsCodeSettingsvariant, explicitDiscoverySource::ExplicitFlag→ explicitLocalhostScan/Docker→AutoDiscovered, which is the only case the warning should fire onA config file still wins, since it is the narrowest statement of intent.