diff --git a/pkgs/mcpx/internal/e2e/effect_test.go b/pkgs/mcpx/internal/e2e/effect_test.go index 3ae09b9443..d8f1eada26 100644 --- a/pkgs/mcpx/internal/e2e/effect_test.go +++ b/pkgs/mcpx/internal/e2e/effect_test.go @@ -65,6 +65,7 @@ var implementedEffectProbes = map[string]string{ "stats.top": "TestStatsTopLimitsTheRowsTheStatsAPIReports", "proto.askPoll": "TestAskPollCeilingIsReachableFromTheEnvironment", "daemon.address": "TestDaemonAddressIsReachableFromTheEnvironment", + "daemon.autostart": "TestDaemonAutostartIsReachableFromTheEnvironment", "http.bodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", "http.callBodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", "http.controlBodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", @@ -118,6 +119,7 @@ var effectProbeFuncs = map[string]func(*testing.T){ "TestStatsTopLimitsTheRowsTheStatsAPIReports": TestStatsTopLimitsTheRowsTheStatsAPIReports, "TestAskPollCeilingIsReachableFromTheEnvironment": TestAskPollCeilingIsReachableFromTheEnvironment, "TestDaemonAddressIsReachableFromTheEnvironment": TestDaemonAddressIsReachableFromTheEnvironment, + "TestDaemonAutostartIsReachableFromTheEnvironment": TestDaemonAutostartIsReachableFromTheEnvironment, "TestHTTPBodyLimitsRejectOversizedBodies": TestHTTPBodyLimitsRejectOversizedBodies, "TestHTTPEventStreamSettingsChangeTheStream": TestHTTPEventStreamSettingsChangeTheStream, "TestHTTPReadHeaderTimeoutClosesSlowClients": TestHTTPReadHeaderTimeoutClosesSlowClients, @@ -350,3 +352,38 @@ func TestDaemonAddressIsReachableFromTheEnvironment(t *testing.T) { t.Fatalf("oracle: the widened endpoint answered %d, want 200", resp.StatusCode) } } + +// TestDaemonAutostartIsReachableFromTheEnvironment is the effect probe +// for daemon.autostart (#8468 chain 2). The exemption it replaced said +// daemon lifecycle cannot be varied deterministically; it can: with no +// daemon running, the same command either starts one and leaves its +// socket behind, or refuses and names the disabled rung. +// +// Oracle: the CLI's own no-daemon diagnosis. With autostart off, `ls` +// fails and names "disabled by daemon.autostart" and no socket +// appears; at the default, `ls` succeeds and leaves a socket. +func TestDaemonAutostartIsReachableFromTheEnvironment(t *testing.T) { + socketsIn := func(e *env) []string { + socks, _ := filepath.Glob(filepath.Join(e.dir, "state", "*.sock")) + return socks + } + + off := newEnv(t, oneServer) + off.setenv("MCPX_DAEMON_AUTOSTART=false") + out, err := off.try("ls") + if err == nil { + t.Fatalf("oracle: with daemon.autostart=false and no daemon, ls should fail; got:\n%s", out) + } + if !strings.Contains(out, "disabled by daemon.autostart") { + t.Fatalf("oracle: the refusal should name the disabled autostart rung, got:\n%s", out) + } + if socks := socketsIn(off); len(socks) > 0 { + t.Fatalf("oracle: no daemon socket should appear with autostart off: %v", socks) + } + + on := newEnv(t, oneServer) + on.run("ls") + if socks := socketsIn(on); len(socks) == 0 { + t.Fatalf("oracle: with the default daemon.autostart, ls should start a daemon and leave its socket") + } +} diff --git a/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt b/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt index 65757a2778..cb1d87c857 100644 --- a/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt +++ b/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt @@ -19,7 +19,6 @@ cli reload no integration-test exercise yet; burn-down #8461 (cli daemon group) cli stdio-proxy no integration-test exercise yet; burn-down #8461 (cli daemon group) cli supervise no integration-test exercise yet; burn-down #8461 (cli daemon group) cli upgrade no integration-test exercise yet; burn-down #8461 (cli daemon group) -setting daemon.autostart no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test setting daemon.endpoint no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test setting daemon.idleExit no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test setting daemon.inline no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test diff --git a/pkgs/mcpx/internal/settings/effect.go b/pkgs/mcpx/internal/settings/effect.go index aa42b13b07..5cc71e5199 100644 --- a/pkgs/mcpx/internal/settings/effect.go +++ b/pkgs/mcpx/internal/settings/effect.go @@ -71,6 +71,7 @@ var EffectProbes = map[string]string{ "proxy.timeout": "TestProxyUpstreamTimeoutIsReachableFromTheEnvironment", "proto.askPoll": "TestAskPollCeilingIsReachableFromTheEnvironment", "daemon.address": "TestDaemonAddressIsReachableFromTheEnvironment", + "daemon.autostart": "TestDaemonAutostartIsReachableFromTheEnvironment", "http.bodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", "http.callBodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", "http.controlBodyLimit": "TestHTTPBodyLimitsRejectOversizedBodies", @@ -152,7 +153,6 @@ var EffectExemptions = map[string]string{ "daemon.ui": "daemon lifecycle, binding, or timing: its effect is a bound, an interval, or a network identity the isolated harness cannot vary deterministically", "daemon.uiDir": "daemon lifecycle, binding, or timing: its effect is a bound, an interval, or a network identity the isolated harness cannot vary deterministically", "daemon.inline": "daemon lifecycle, binding, or timing: its effect is a bound, an interval, or a network identity the isolated harness cannot vary deterministically", - "daemon.autostart": "daemon lifecycle, binding, or timing: its effect is a bound, an interval, or a network identity the isolated harness cannot vary deterministically", "daemon.roots": "configured upstream roots only affect an upstream roots/list request; the e2e harness does not yet issue that server request, while daemon hook and mcpclient unit tests cover settings conversion and the response path", "hooks": "hook execution: its effect needs a hook configured for a specific event and an event that fires it; the harness has no per-event hook fixture", "hooks.timeout": "hook execution: its effect needs a hook configured for a specific event and an event that fires it; the harness has no per-event hook fixture", @@ -290,7 +290,7 @@ var EffectExemptions = map[string]string{ // EffectExemptionPin is the ratchet: the exemption count at the time // the guard landed. It may only ever be lowered, and only in the PR // that removes an exemption by adding the probe that replaces it. -const EffectExemptionPin = 194 // Shrunk 2026-11-17: (#8467 settings core-paths burn-down) paths.plugins gained its probe. Earlier shrunk 2026-11-17: (#8469) 14 http.* and transport.* settings gained their probes. Earlier shrunk 2026-11-17: (#8470 burn-down) stats.top gained its probe. Earlier shrunk 2026-11-17 (#8467 settings core-paths burn-down): paths.cache gained its probe. Earlier shrunk 2026-11-17 (#8467 settings core-paths burn-down): paths.scripts gained its probe. Earlier shrunk 2026-11-17 (#8468 chain 1): daemon.address gained its probe. Earlier shrunk 2026-11-17 (#8473 chain 1): proto.askPoll gained its probe. Deliberate +1 (2026-11-14, #1917 remainder shepherd of PR #7818) for script.language: covered by deterministic internal/runner tests (TestEffectiveScriptLanguage, TestExplicitPythonLanguageRunsInlineSnippet); the e2e harness script fixtures are TypeScript-only. Earlier deliberate +3 (2026-11-09, #2716) for proto.elicitationPerMinute, proto.samplingPerMinute and proto.samplingSessionPerMinute: daemon rate limits whose effect needs an over-limit sampling/elicitation flood no e2e fixture drives deterministically; the limiter is covered by internal/mcpclient and internal/daemon ratelimit tests. Earlier deliberate raises: +1 for daemon.roots and +8 for model.*: model settings are covered by internal/model and daemon unit tests; settings-driven e2e probes are not yet present. Deliberate +1 (2026-11-03, #1925 slice 3) for sampling.answerLocally: same model-layer coverage, daemon unit tests in internal/daemon/sampling_local_test.go. Deliberate +1 (2026-11-03, #5242) for plugin.disabledTools: read by the opencode plugin host (JS side); the Go e2e harness does not drive the plugin host, the same basis as every other plugin.* exemption. Deliberate +5 (2026-11-04, #1915 stage 2): import graph, missing, dynamic, cross-project and network policies are covered by deterministic internal/preflight tests, but the e2e harness has no isolated Deno graph fixture yet. Deliberate +2 (2026-11-05, #1911): checker error and unsupported-runtime policies are covered by deterministic internal/preflight stub-runtime tests; the e2e harness has no isolated Deno checker fixture. +const EffectExemptionPin = 193 // Shrunk 2026-11-18 (#8468 chain 2): daemon.autostart gained its probe. Earlier shrunk 2026-11-17: (#8467 settings core-paths burn-down) paths.plugins gained its probe. Earlier shrunk 2026-11-17: (#8469) 14 http.* and transport.* settings gained their probes. Earlier shrunk 2026-11-17: (#8470 burn-down) stats.top gained its probe. Earlier shrunk 2026-11-17 (#8467 settings core-paths burn-down): paths.cache gained its probe. Earlier shrunk 2026-11-17 (#8467 settings core-paths burn-down): paths.scripts gained its probe. Earlier shrunk 2026-11-17 (#8468 chain 1): daemon.address gained its probe. Earlier shrunk 2026-11-17 (#8473 chain 1): proto.askPoll gained its probe. Deliberate +1 (2026-11-14, #1917 remainder shepherd of PR #7818) for script.language: covered by deterministic internal/runner tests (TestEffectiveScriptLanguage, TestExplicitPythonLanguageRunsInlineSnippet); the e2e harness script fixtures are TypeScript-only. Earlier deliberate +3 (2026-11-09, #2716) for proto.elicitationPerMinute, proto.samplingPerMinute and proto.samplingSessionPerMinute: daemon rate limits whose effect needs an over-limit sampling/elicitation flood no e2e fixture drives deterministically; the limiter is covered by internal/mcpclient and internal/daemon ratelimit tests. Earlier deliberate raises: +1 for daemon.roots and +8 for model.*: model settings are covered by internal/model and daemon unit tests; settings-driven e2e probes are not yet present. Deliberate +1 (2026-11-03, #1925 slice 3) for sampling.answerLocally: same model-layer coverage, daemon unit tests in internal/daemon/sampling_local_test.go. Deliberate +1 (2026-11-03, #5242) for plugin.disabledTools: read by the opencode plugin host (JS side); the Go e2e harness does not drive the plugin host, the same basis as every other plugin.* exemption. Deliberate +5 (2026-11-04, #1915 stage 2): import graph, missing, dynamic, cross-project and network policies are covered by deterministic internal/preflight tests, but the e2e harness has no isolated Deno graph fixture yet. Deliberate +2 (2026-11-05, #1911): checker error and unsupported-runtime policies are covered by deterministic internal/preflight stub-runtime tests; the e2e harness has no isolated Deno checker fixture. // CheckEffectCoverage returns one violation per way the probe and // exemption maps fail to cover reg exactly: a setting with neither,