diff --git a/pkgs/mcpx/internal/e2e/effect_test.go b/pkgs/mcpx/internal/e2e/effect_test.go index 35d8f0f4fa..bf2f318ba8 100644 --- a/pkgs/mcpx/internal/e2e/effect_test.go +++ b/pkgs/mcpx/internal/e2e/effect_test.go @@ -7,6 +7,7 @@ import ( "io" "net" "net/http" + "net/http/httptest" "net/url" "os" "os/exec" @@ -14,6 +15,7 @@ import ( "sort" "strconv" "strings" + "sync" "testing" "time" @@ -102,6 +104,15 @@ var implementedEffectProbes = map[string]string{ "protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment", "protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment", "events.history": "TestEventsHistoryBoundsTheReplay", + "model.provider": "TestModelProviderSelectsTheBackendFromTheEnvironment", + "model.baseURL": "TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment", + "model.default": "TestModelDefaultNamesTheModelFromTheEnvironment", + "model.apiKeyEnv": "TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment", + "model.budget": "TestModelBudgetCapsAHooksTokensFromTheEnvironment", + "prompt.maxTokens": "TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment", + "model.providers": "TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment", + "model.profiles": "TestModelProfilesResolvesANamedChainFromTheEnvironment", + "model.timeout": "TestModelTimeoutBoundsAGenerationFromTheEnvironment", "session.releaseTimeout": "TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment", "daemon.idleExit": "TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment", "daemon.port": "TestDaemonPortBindsTheChosenPortFromTheEnvironment", @@ -288,6 +299,15 @@ var effectProbeFuncs = map[string]func(*testing.T){ "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment, "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment, "TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay, + "TestModelProviderSelectsTheBackendFromTheEnvironment": TestModelProviderSelectsTheBackendFromTheEnvironment, + "TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment": TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment, + "TestModelDefaultNamesTheModelFromTheEnvironment": TestModelDefaultNamesTheModelFromTheEnvironment, + "TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment": TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment, + "TestModelBudgetCapsAHooksTokensFromTheEnvironment": TestModelBudgetCapsAHooksTokensFromTheEnvironment, + "TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment": TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment, + "TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment": TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment, + "TestModelProfilesResolvesANamedChainFromTheEnvironment": TestModelProfilesResolvesANamedChainFromTheEnvironment, + "TestModelTimeoutBoundsAGenerationFromTheEnvironment": TestModelTimeoutBoundsAGenerationFromTheEnvironment, "TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment": TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment, "TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment": TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment, "TestDaemonPortBindsTheChosenPortFromTheEnvironment": TestDaemonPortBindsTheChosenPortFromTheEnvironment, @@ -3893,6 +3913,202 @@ func TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment(t *test } } +// fakeModel is an OpenAI-compatible chat endpoint that records what it +// was sent and answers with advice naming itself, after delay. +type fakeModel struct { + URL string + tag string + mu sync.Mutex + reqs []fakeModelRequest +} + +type fakeModelRequest struct { + Auth string + Model string `json:"model"` + MaxTokens int `json:"max_tokens"` +} + +func newFakeModel(t *testing.T, tag string, delay time.Duration) *fakeModel { + t.Helper() + m := &fakeModel{tag: tag} + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var req fakeModelRequest + _ = json.NewDecoder(r.Body).Decode(&req) + req.Auth = r.Header.Get("Authorization") + m.mu.Lock() + m.reqs = append(m.reqs, req) + m.mu.Unlock() + select { + case <-r.Context().Done(): + return + case <-time.After(delay): + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"id":"probe","model":"fake-model","choices":[{"index":0,`+ + `"message":{"role":"assistant","content":"advice from `+tag+`"},"finish_reason":"stop"}]}`) + })) + t.Cleanup(srv.Close) + m.URL = srv.URL + return m +} + +// last is the most recent request the endpoint saw; the zero value if none. +func (m *fakeModel) last() fakeModelRequest { + m.mu.Lock() + defer m.mu.Unlock() + if len(m.reqs) == 0 { + return fakeModelRequest{} + } + return m.reqs[len(m.reqs)-1] +} + +// promptHookFrame runs a one-line script under a config whose one +// script hook is an onSuccess prompt, with hooks allowed to run and env +// on top, and returns that hook's frame from `exec --json`. +func promptHookFrame(t *testing.T, env ...string) map[string]any { + t.Helper() + e := newEnv(t, `{"mcpServers":{"demo":{"command":"FAKE"}},`+ + `"script":{"hooks":[{"phase":"onSuccess","prompt":"review the run"}]}}`) + e.setenv(append([]string{"MCPX_HOOKS_AUTONOMY=run", "FAKE_MODEL_KEY=probe-key"}, env...)...) + out := e.run("--json", "exec", `console.log("x")`) + var doc struct { + Hooks []map[string]any `json:"hooks"` + } + if err := json.Unmarshal([]byte(out), &doc); err != nil || len(doc.Hooks) != 1 { + t.Fatalf("exec --json should report one hook frame (%v):\n%s", err, out) + } + return doc.Hooks[0] +} + +// modelAt is the environment that points the prompt hook at m through +// model.provider, model.baseURL and model.default. +func modelAt(m *fakeModel) []string { + return []string{"MCPX_MODEL_PROVIDER=openai", "MCPX_MODEL_BASE_URL=" + m.URL, + "MCPX_MODEL_DEFAULT=openai/fake-model"} +} + +// TestModelProviderSelectsTheBackendFromTheEnvironment is the effect +// probe for model.provider. At the default (none) a prompt hook reports +// that no provider is configured and nothing is called; with +// model.provider=openai the hook's advice comes from the endpoint. +func TestModelProviderSelectsTheBackendFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + if f := promptHookFrame(t, "MCPX_MODEL_BASE_URL="+a.URL, "MCPX_MODEL_DEFAULT=openai/fake-model"); !strings.Contains(fmt.Sprint(f["error"]), "no model provider is configured") { + t.Fatalf("oracle: with model.provider at its default the hook should have no provider: %v", f) + } + if f := promptHookFrame(t, modelAt(a)...); f["advice"] != "advice from A" { + t.Fatalf("with model.provider=openai the hook should be advised by the endpoint: %v", f) + } +} + +// TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment is the +// effect probe for model.baseURL: the same hook is answered by whichever +// endpoint model.baseURL names. +func TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment(t *testing.T) { + a, b := newFakeModel(t, "A", 0), newFakeModel(t, "B", 0) + if f := promptHookFrame(t, modelAt(a)...); f["advice"] != "advice from A" { + t.Fatalf("oracle: model.baseURL at A should be answered by A: %v", f) + } + if f := promptHookFrame(t, append(modelAt(a), "MCPX_MODEL_BASE_URL="+b.URL)...); f["advice"] != "advice from B" { + t.Fatalf("model.baseURL at B should be answered by B: %v", f) + } +} + +// TestModelDefaultNamesTheModelFromTheEnvironment is the effect probe for +// model.default. With no default and no model on the hook, the provider +// has no model to ask for; with model.default=openai/fake-model the +// request names fake-model. +func TestModelDefaultNamesTheModelFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + if f := promptHookFrame(t, "MCPX_MODEL_PROVIDER=openai", "MCPX_MODEL_BASE_URL="+a.URL); !strings.Contains(fmt.Sprint(f["error"]), "no model named") { + t.Fatalf("oracle: with no model.default the hook should have no model to ask for: %v", f) + } + if promptHookFrame(t, modelAt(a)...); a.last().Model != "fake-model" { + t.Fatalf("with model.default=openai/fake-model the request should name fake-model: %+v", a.last()) + } +} + +// TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment is the effect +// probe for model.apiKeyEnv. mcpx reads no key variable unless one is +// named, so by default the request carries no Authorization; naming +// FAKE_MODEL_KEY sends its value as the bearer token. +func TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + if promptHookFrame(t, modelAt(a)...); a.last().Auth != "" { + t.Fatalf("oracle: with no model.apiKeyEnv the request should carry no key: %q", a.last().Auth) + } + if promptHookFrame(t, append(modelAt(a), "MCPX_MODEL_API_KEY_ENV=FAKE_MODEL_KEY")...); a.last().Auth != "Bearer probe-key" { + t.Fatalf("with model.apiKeyEnv=FAKE_MODEL_KEY the request should carry its value: %q", a.last().Auth) + } +} + +// TestModelBudgetCapsAHooksTokensFromTheEnvironment is the effect probe +// for model.budget: a hook asks for the default token cap, and for no +// more than model.budget=7 when it is set. +func TestModelBudgetCapsAHooksTokensFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + promptHookFrame(t, modelAt(a)...) + if def := a.last().MaxTokens; def <= 7 { + t.Fatalf("oracle: the default cap should be well above 7 tokens, got %d", def) + } + if promptHookFrame(t, append(modelAt(a), "MCPX_MODEL_BUDGET=7")...); a.last().MaxTokens != 7 { + t.Fatalf("with model.budget=7 the request should ask for 7 tokens: %+v", a.last()) + } +} + +// TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment is the effect +// probe for prompt.maxTokens: the request's max_tokens follows it. +func TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + promptHookFrame(t, modelAt(a)...) + if def := a.last().MaxTokens; def == 11 || def == 0 { + t.Fatalf("oracle: the default cap should be set and not 11, got %d", def) + } + if promptHookFrame(t, append(modelAt(a), "MCPX_PROMPT_MAX_TOKENS=11")...); a.last().MaxTokens != 11 { + t.Fatalf("with prompt.maxTokens=11 the request should ask for 11 tokens: %+v", a.last()) + } +} + +// TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment is the +// effect probe for model.providers: with model.baseURL at A, a +// per-provider entry giving openai the base URL of B routes the hook to B. +func TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment(t *testing.T) { + a, b := newFakeModel(t, "A", 0), newFakeModel(t, "B", 0) + if f := promptHookFrame(t, modelAt(a)...); f["advice"] != "advice from A" { + t.Fatalf("oracle: without model.providers the hook should go to A: %v", f) + } + if f := promptHookFrame(t, append(modelAt(a), `MCPX_MODEL_PROVIDERS={"openai":{"baseURL":"`+b.URL+`"}}`)...); f["advice"] != "advice from B" { + t.Fatalf("with model.providers giving openai B's URL the hook should go to B: %v", f) + } +} + +// TestModelProfilesResolvesANamedChainFromTheEnvironment is the effect +// probe for model.profiles: with model.default naming a profile whose +// chain is openai/other-model, the request names other-model. +func TestModelProfilesResolvesANamedChainFromTheEnvironment(t *testing.T) { + a := newFakeModel(t, "A", 0) + if promptHookFrame(t, modelAt(a)...); a.last().Model != "fake-model" { + t.Fatalf("oracle: without a profile the request should name fake-model: %+v", a.last()) + } + if promptHookFrame(t, append(modelAt(a), `MCPX_MODEL_PROFILES={"quick":{"models":["openai/other-model"]}}`, + "MCPX_MODEL_DEFAULT=quick")...); a.last().Model != "other-model" { + t.Fatalf("with model.default naming profile quick the request should name other-model: %+v", a.last()) + } +} + +// TestModelTimeoutBoundsAGenerationFromTheEnvironment is the effect probe +// for model.timeout: an endpoint that takes 700ms still advises the hook +// under the default bound, and is cut off at model.timeout=100ms. +func TestModelTimeoutBoundsAGenerationFromTheEnvironment(t *testing.T) { + slow := newFakeModel(t, "slow", 700*time.Millisecond) + if f := promptHookFrame(t, modelAt(slow)...); f["advice"] != "advice from slow" { + t.Fatalf("oracle: under the default model.timeout a 700ms endpoint should answer: %v", f) + } + if f := promptHookFrame(t, append(modelAt(slow), "MCPX_MODEL_TIMEOUT=100ms")...); !strings.Contains(fmt.Sprint(f["error"]), "deadline exceeded") { + t.Fatalf("with model.timeout=100ms the 700ms endpoint should be cut off: %v", f) + } +} + // TestDaemonAddressIsReachableFromTheEnvironment is the effect probe // for daemon.address (#8468 chain 1). The exemption it replaced said // a bind address is a network identity the harness cannot vary diff --git a/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt b/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt index 011d8f3e74..c4dcc7e0da 100644 --- a/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt +++ b/pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt @@ -61,16 +61,7 @@ setting embeddings.backend no integration-test exercise yet; burn-down #8471 (se setting embeddings.model no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting embeddings.url no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting embeddings.wasmPath no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.apiKeyEnv no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.baseURL no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.budget no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.default no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.profiles no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.provider no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.providers no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting model.timeout no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting prompt.catalogBudget no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test -setting prompt.maxTokens no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting prompt.runTimeout no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting prompt.sample no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test setting prompt.sampleTimeout no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test diff --git a/pkgs/mcpx/internal/settings/effect.go b/pkgs/mcpx/internal/settings/effect.go index 89a7a76930..c0b4f6d549 100644 --- a/pkgs/mcpx/internal/settings/effect.go +++ b/pkgs/mcpx/internal/settings/effect.go @@ -101,6 +101,15 @@ var EffectProbes = map[string]string{ "protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment", "protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment", "events.history": "TestEventsHistoryBoundsTheReplay", + "model.provider": "TestModelProviderSelectsTheBackendFromTheEnvironment", + "model.baseURL": "TestModelBaseURLPointsTheProviderAtAnEndpointFromTheEnvironment", + "model.default": "TestModelDefaultNamesTheModelFromTheEnvironment", + "model.apiKeyEnv": "TestModelAPIKeyEnvNamesTheKeyVariableFromTheEnvironment", + "model.budget": "TestModelBudgetCapsAHooksTokensFromTheEnvironment", + "prompt.maxTokens": "TestPromptMaxTokensSetsAHooksTokenCapFromTheEnvironment", + "model.providers": "TestModelProvidersRoutesAProviderToItsEndpointFromTheEnvironment", + "model.profiles": "TestModelProfilesResolvesANamedChainFromTheEnvironment", + "model.timeout": "TestModelTimeoutBoundsAGenerationFromTheEnvironment", "session.releaseTimeout": "TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment", "daemon.idleExit": "TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment", "daemon.port": "TestDaemonPortBindsTheChosenPortFromTheEnvironment", @@ -244,16 +253,7 @@ var EffectExemptions = map[string]string{ "prompt.sample": "prompt/sampling behaviour: its effect needs a sampling provider or several candidate actions; no fixture provides one", "prompt.catalogBudget": "prompt/sampling behaviour: its effect needs a sampling provider or several candidate actions; no fixture provides one", "prompt.sampleTimeout": "prompt/sampling behaviour: its effect needs a sampling provider or several candidate actions; no fixture provides one", - "model.apiKeyEnv": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.baseURL": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.budget": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.default": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.profiles": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.provider": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.providers": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "model.timeout": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", "sampling.answerLocally": "model layer is covered by internal/model and daemon unit tests; no settings-driven e2e with/without probe exists yet", - "prompt.maxTokens": "prompt/sampling behaviour: its effect needs a sampling provider or several candidate actions; no fixture provides one", "prompt.runTimeout": "prompt/sampling behaviour: its effect needs a sampling provider or several candidate actions; no fixture provides one", "http.streamBufferInit": "HTTP server bound (body limits, timeouts, buffers): its effect needs oversized bodies, idle connections, or time passage a single run does not produce", "http.idleConns": "HTTP server bound (body limits, timeouts, buffers): its effect needs oversized bodies, idle connections, or time passage a single run does not produce", @@ -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 = 61 // Shrunk 2026-11-18 (#8473 chain 58): session.releaseTimeout gained an end-of-run release probe. Earlier shrunk 2026-11-18 (#8473 chain 57): daemon.idleExit gained an idle-daemon probe. Earlier shrunk 2026-11-18 (#8473 chain 56): daemon.port gained a bound-port probe. Earlier shrunk 2026-11-18 (#8473 chain 55): daemon.saveInterval gained a lease-table save probe. Earlier shrunk 2026-11-18 (#8473 chain 54): autostart.pollInterval gained a readiness-poll probe. Earlier shrunk 2026-11-18 (#8473 chain 53): daemon.leaseTTL gained a silent-caller probe. Earlier shrunk 2026-11-18 (#8473 chain 52): elicit.disambiguate and elicit.disambiguateDefault gained probes. Earlier shrunk 2026-11-18 (#8473 chain 51): elicit.ttl and elicit.maxAge gained probes, once upstream questions took their deadline from the broker. Earlier shrunk 2026-11-18 (#8473 chain 50): elicit.pendingLimit gained a probe, once `mcpx elicit list` honoured it. Earlier shrunk 2026-11-18 (#8473 chain 49): elicit.askTimeout gained a held-confirmation probe. Earlier shrunk 2026-11-18 (#8473 chain 48): artifacts.idleTtl and artifacts.maxAge gained touch-on-read probes. Earlier shrunk 2026-11-18 (#8473 chain 47): artifacts.ttl, artifacts.gcInterval, pool.min and autostart.idleExit gained probes. Earlier shrunk 2026-11-18 (#8473 chain 46): daemon.warm, pool.idleTimeout, daemon.reapInterval and daemon.endpoint gained probes. Earlier shrunk 2026-11-18 (#8473 chain 45): upstream.probeTimeout gained a probe, and upstream.eraCache and upstream.protocol were mapped to the era test, whose subtests run each with and without. Earlier shrunk 2026-11-18 (#8473 chain 44): prompt.autonomy, hooks.autonomy and repair.autonomy gained probes. Earlier shrunk 2026-11-18 (#8473 chain 43): policy.write, elicit.confirmDestructive and autonomy.max gained probes. Earlier shrunk 2026-11-18 (#8473 chain 42): daemon.inline, autostart.bin, autostart.args, autostart.logTail and daemon.watchConfig gained probes. Earlier shrunk 2026-11-18 (#8473 chain 41): daemon.inlineStartTimeout and daemon.probeTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 40): daemon.warmTimeout, autostart.connectTimeout and autostart.pingTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 39): pool.callTimeout, pool.startTimeout and daemon.refreshTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 38): doctor.timeout and registry.timeout gained probes that set a bound no request can meet. Earlier shrunk 2026-11-18 (#8473 chain 37): completion.maxValues gained a probe once the fake server could answer completions. Earlier shrunk 2026-11-18 (#8473 chain 36): catalog.instructions gained a probe once the fake server could serve instructions. Earlier shrunk 2026-11-18 (#8473 chain 35): the five plumbing source and launcher switches gained probes. Earlier shrunk 2026-11-18 (#8473 chain 34): artifacts.chunkBytes, script.launcher and paths.placeholders gained probes. Earlier shrunk 2026-11-18 (#8473 chain 33): artifacts.interceptImages and plumbing.indexOnQuery gained probes. Earlier shrunk 2026-11-18 (#8473 chain 32): plumbing.validatePaths and script.language gained probes. Earlier shrunk 2026-11-18 (#8473 chain 31): logging.trace and exec.where gained probes. Earlier shrunk 2026-11-18 (#8473 chain 30): paths.adapters and paths.apis gained declaration-file probes. Earlier shrunk 2026-11-18 (#8473 chain 29): script.runtime, runtimeOrder, permissions, profiles and runtimes gained node-backed probes. Earlier shrunk 2026-11-18 (#8473 chain 28): script.before, onSuccess, onError and suffix gained a run-phase probe. Earlier shrunk 2026-11-18 (#8473 chain 27): hooks, hooks.timeout, daemon.ui and daemon.uiDir gained probes. Earlier shrunk 2026-11-18 (#8473 chain 26): logging.level, format, source, dir, include, maxLines, maxBytes and keep gained durable-log probes. Earlier shrunk 2026-11-18 (#8473 chain 25): artifacts.enabled, maxBytes, quota, delivery, inlineMaxBytes and dir gained script-artifact probes. Earlier shrunk 2026-11-18 (#8473 chain 24): preset and serve.mode gained probes. Earlier shrunk 2026-11-18 (#8473 chain 23): presets gained a --preset probe. Earlier shrunk 2026-11-18 (#8473 chain 22): catalog.budget and catalog.bias gained `mcpx catalog` probes. Earlier shrunk 2026-11-18 (#8473 chain 21): catalog.pinnedTools and retention.maxTools gained reactive-session probes. Earlier shrunk 2026-11-18 (#8473 chain 20): diagnose.history and diagnose.preflight gained schema-churn probes. Earlier shrunk 2026-11-18 (#8473 chain 19): events.history gained a trimmed-replay probe. Earlier shrunk 2026-11-18 (#8473 chain 18): protoTasks.maxTTL, maxPerRequestor and perMinute gained task-store probes. Earlier shrunk 2026-11-18 (#8473 chain 17): tasks.ttl and tasks.resultWait gained /v1 task probes. Earlier shrunk 2026-11-18 (#8473 chain 16): recipes.minScore, matchMargin and limit gained recipe probes. Earlier shrunk 2026-11-18 (#8473 chain 15): logstore.queryLimit gained a /v1/log probe. Earlier shrunk 2026-11-18 (#8473 chain 14): completion.perMinute and completion.serverPerMinute gained 429 probes. Earlier shrunk 2026-11-18 (#8473 chain 13): mcp.pageSize and mcp.passthrough gained tools/list probes. Earlier shrunk 2026-11-18 (#8473 chain 12): exec.timeout (now read by local runs), exec.maxOutputBytes and exec.output gained probes. Earlier shrunk 2026-11-18 (#8473 chain 11): spec.first and spec.lenient mapped to their existing revision-policy probes, spec.precedence gained one. Earlier shrunk 2026-11-18 (#8473 chain 10): protoMessages.taskAfter and protoTasks.pollInterval gained task probes. Earlier shrunk 2026-11-18 (#8473 chain 9): protoMessages.listMaxAge and readMaxAge gained cache-hint probes. Earlier shrunk 2026-11-18 (#8473 chain 8): proto.native gained an asked-client probe. Earlier shrunk 2026-11-18 (#8473 chain 7): proto.mcpPath and proto.serveMCP gained mount probes. Earlier shrunk 2026-11-18 (#8473 chain 6): proto.sessionIdle gained a reaped-session probe. Earlier shrunk 2026-11-18 (#8473 chain 5): proto.stateTTL gained a late-resume probe. Earlier shrunk 2026-11-18 (#8473 chain 4): proto.askTimeout gained a held-request probe. Earlier shrunk 2026-11-18 (#8473 chain 3): proto.askTTL gained a /v1/ask deadline probe. Earlier shrunk 2026-11-18 (#8473 chain 2): proto.askRounds gained a two-round MCP e2e probe. Earlier 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. +const EffectExemptionPin = 52 // Shrunk 2026-11-18 (#8473 chain 59): model.provider, baseURL, default, apiKeyEnv, budget, providers, profiles, timeout and prompt.maxTokens gained prompt-hook probes against a fake model endpoint. Earlier shrunk 2026-11-18 (#8473 chain 58): session.releaseTimeout gained an end-of-run release probe. Earlier shrunk 2026-11-18 (#8473 chain 57): daemon.idleExit gained an idle-daemon probe. Earlier shrunk 2026-11-18 (#8473 chain 56): daemon.port gained a bound-port probe. Earlier shrunk 2026-11-18 (#8473 chain 55): daemon.saveInterval gained a lease-table save probe. Earlier shrunk 2026-11-18 (#8473 chain 54): autostart.pollInterval gained a readiness-poll probe. Earlier shrunk 2026-11-18 (#8473 chain 53): daemon.leaseTTL gained a silent-caller probe. Earlier shrunk 2026-11-18 (#8473 chain 52): elicit.disambiguate and elicit.disambiguateDefault gained probes. Earlier shrunk 2026-11-18 (#8473 chain 51): elicit.ttl and elicit.maxAge gained probes, once upstream questions took their deadline from the broker. Earlier shrunk 2026-11-18 (#8473 chain 50): elicit.pendingLimit gained a probe, once `mcpx elicit list` honoured it. Earlier shrunk 2026-11-18 (#8473 chain 49): elicit.askTimeout gained a held-confirmation probe. Earlier shrunk 2026-11-18 (#8473 chain 48): artifacts.idleTtl and artifacts.maxAge gained touch-on-read probes. Earlier shrunk 2026-11-18 (#8473 chain 47): artifacts.ttl, artifacts.gcInterval, pool.min and autostart.idleExit gained probes. Earlier shrunk 2026-11-18 (#8473 chain 46): daemon.warm, pool.idleTimeout, daemon.reapInterval and daemon.endpoint gained probes. Earlier shrunk 2026-11-18 (#8473 chain 45): upstream.probeTimeout gained a probe, and upstream.eraCache and upstream.protocol were mapped to the era test, whose subtests run each with and without. Earlier shrunk 2026-11-18 (#8473 chain 44): prompt.autonomy, hooks.autonomy and repair.autonomy gained probes. Earlier shrunk 2026-11-18 (#8473 chain 43): policy.write, elicit.confirmDestructive and autonomy.max gained probes. Earlier shrunk 2026-11-18 (#8473 chain 42): daemon.inline, autostart.bin, autostart.args, autostart.logTail and daemon.watchConfig gained probes. Earlier shrunk 2026-11-18 (#8473 chain 41): daemon.inlineStartTimeout and daemon.probeTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 40): daemon.warmTimeout, autostart.connectTimeout and autostart.pingTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 39): pool.callTimeout, pool.startTimeout and daemon.refreshTimeout gained probes. Earlier shrunk 2026-11-18 (#8473 chain 38): doctor.timeout and registry.timeout gained probes that set a bound no request can meet. Earlier shrunk 2026-11-18 (#8473 chain 37): completion.maxValues gained a probe once the fake server could answer completions. Earlier shrunk 2026-11-18 (#8473 chain 36): catalog.instructions gained a probe once the fake server could serve instructions. Earlier shrunk 2026-11-18 (#8473 chain 35): the five plumbing source and launcher switches gained probes. Earlier shrunk 2026-11-18 (#8473 chain 34): artifacts.chunkBytes, script.launcher and paths.placeholders gained probes. Earlier shrunk 2026-11-18 (#8473 chain 33): artifacts.interceptImages and plumbing.indexOnQuery gained probes. Earlier shrunk 2026-11-18 (#8473 chain 32): plumbing.validatePaths and script.language gained probes. Earlier shrunk 2026-11-18 (#8473 chain 31): logging.trace and exec.where gained probes. Earlier shrunk 2026-11-18 (#8473 chain 30): paths.adapters and paths.apis gained declaration-file probes. Earlier shrunk 2026-11-18 (#8473 chain 29): script.runtime, runtimeOrder, permissions, profiles and runtimes gained node-backed probes. Earlier shrunk 2026-11-18 (#8473 chain 28): script.before, onSuccess, onError and suffix gained a run-phase probe. Earlier shrunk 2026-11-18 (#8473 chain 27): hooks, hooks.timeout, daemon.ui and daemon.uiDir gained probes. Earlier shrunk 2026-11-18 (#8473 chain 26): logging.level, format, source, dir, include, maxLines, maxBytes and keep gained durable-log probes. Earlier shrunk 2026-11-18 (#8473 chain 25): artifacts.enabled, maxBytes, quota, delivery, inlineMaxBytes and dir gained script-artifact probes. Earlier shrunk 2026-11-18 (#8473 chain 24): preset and serve.mode gained probes. Earlier shrunk 2026-11-18 (#8473 chain 23): presets gained a --preset probe. Earlier shrunk 2026-11-18 (#8473 chain 22): catalog.budget and catalog.bias gained `mcpx catalog` probes. Earlier shrunk 2026-11-18 (#8473 chain 21): catalog.pinnedTools and retention.maxTools gained reactive-session probes. Earlier shrunk 2026-11-18 (#8473 chain 20): diagnose.history and diagnose.preflight gained schema-churn probes. Earlier shrunk 2026-11-18 (#8473 chain 19): events.history gained a trimmed-replay probe. Earlier shrunk 2026-11-18 (#8473 chain 18): protoTasks.maxTTL, maxPerRequestor and perMinute gained task-store probes. Earlier shrunk 2026-11-18 (#8473 chain 17): tasks.ttl and tasks.resultWait gained /v1 task probes. Earlier shrunk 2026-11-18 (#8473 chain 16): recipes.minScore, matchMargin and limit gained recipe probes. Earlier shrunk 2026-11-18 (#8473 chain 15): logstore.queryLimit gained a /v1/log probe. Earlier shrunk 2026-11-18 (#8473 chain 14): completion.perMinute and completion.serverPerMinute gained 429 probes. Earlier shrunk 2026-11-18 (#8473 chain 13): mcp.pageSize and mcp.passthrough gained tools/list probes. Earlier shrunk 2026-11-18 (#8473 chain 12): exec.timeout (now read by local runs), exec.maxOutputBytes and exec.output gained probes. Earlier shrunk 2026-11-18 (#8473 chain 11): spec.first and spec.lenient mapped to their existing revision-policy probes, spec.precedence gained one. Earlier shrunk 2026-11-18 (#8473 chain 10): protoMessages.taskAfter and protoTasks.pollInterval gained task probes. Earlier shrunk 2026-11-18 (#8473 chain 9): protoMessages.listMaxAge and readMaxAge gained cache-hint probes. Earlier shrunk 2026-11-18 (#8473 chain 8): proto.native gained an asked-client probe. Earlier shrunk 2026-11-18 (#8473 chain 7): proto.mcpPath and proto.serveMCP gained mount probes. Earlier shrunk 2026-11-18 (#8473 chain 6): proto.sessionIdle gained a reaped-session probe. Earlier shrunk 2026-11-18 (#8473 chain 5): proto.stateTTL gained a late-resume probe. Earlier shrunk 2026-11-18 (#8473 chain 4): proto.askTimeout gained a held-request probe. Earlier shrunk 2026-11-18 (#8473 chain 3): proto.askTTL gained a /v1/ask deadline probe. Earlier shrunk 2026-11-18 (#8473 chain 2): proto.askRounds gained a two-round MCP e2e probe. Earlier 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,