Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(ci): wire both honesty gates into pre-push, with baselines and tests
Ruben Lütke284ba8a0c54c
diff --git a/.githooks/pre-push b/.githooks/pre-pushindex 3da4512bdf..0fd9e666b6 100755--- a/.githooks/pre-push+++ b/.githooks/pre-push@@ -110,6 +110,35 @@ if [ -f "$danger_gate" ]; thenfifi+# --- 3c) DEAD CONFIG SWITCH gate (FAIL-CLOSED) ---------------------------------+# Every field on a config model must be read by some shipped code. A switch the+# user can set that nothing reads is a lie told by the settings screen — a whole+# [jarvis_agents] section and both [phase6.safety] flags shipped that way. The+# known backlog is recorded in dead-config-switches-baseline.json, so this only+# fails on a NEW one. Static + stdlib-only (~4 s).+deadcfg_gate="scripts/ci/check_config_switches_wired.py"+if [ -f "$deadcfg_gate" ]; then+ "$PY" "$deadcfg_gate" </dev/null+ if [ "$?" -ne 0 ]; then+ status=1+ deadcfg_hit=1+ fi+fi++# --- 3d) SILENT EXCEPTION gate (FAIL-CLOSED, ratchet) --------------------------+# An except block that neither logs, nor re-raises, nor explains itself makes a+# failure invisible — the largest single source of "it only half works" here.+# Per-file baseline in silent-handlers-baseline.json; fails only when a file+# GAINS one. Static + stdlib-only (~3 s).+silentexc_gate="scripts/ci/check_silent_exception_handlers.py"+if [ -f "$silentexc_gate" ]; then+ "$PY" "$silentexc_gate" </dev/null+ if [ "$?" -ne 0 ]; then+ status=1+ silentexc_hit=1+ fi+fi+# --- 4) CLI DOCGEN drift gate (FAIL-CLOSED) -----------------------------------# docs/jarvis-cli-reference.md is generated from the curated command tree; this# fails the push if a command was added/changed without regenerating it. Static@@ -285,6 +314,18 @@ if [ "$status" -ne 0 ]; thenecho "pre-push BLOCKED: DANGER METADATA gate (destructive route without x-jarvis-dangerous)."echo " Add openapi_extra={\"x-jarvis-dangerous\": True} to the route decorator."fi+ if [ "${deadcfg_hit:-0}" -ne 0 ]; then+ echo "pre-push BLOCKED: DEAD CONFIG SWITCH gate (a new config field nothing reads)."+ echo " The settings screen and jarvis.toml would promise behaviour that does"+ echo " not exist. Wire the field up, or remove it. Triage:"+ echo " python scripts/ci/check_config_switches_wired.py --report"+ fi+ if [ "${silentexc_hit:-0}" -ne 0 ]; then+ echo "pre-push BLOCKED: SILENT EXCEPTION gate (a new except that says nothing)."+ echo " Log it (feature name + what was skipped), re-raise it, or write a"+ echo " comment on the except line saying why silence is right here."+ echo " Then: python scripts/ci/check_silent_exception_handlers.py --update"+ fiif [ "${docgen_hit:-0}" -ne 0 ]; thenecho "pre-push BLOCKED: CLI DOCGEN drift (jarvis-cli-reference.md out of date)."echo " Run: python scripts/ci/gen_cli_reference.py and commit the result."diff --git a/scripts/ci/check_config_switches_wired.py b/scripts/ci/check_config_switches_wired.pyindex a1d7195b6b..86131d9e88 100644--- a/scripts/ci/check_config_switches_wired.py+++ b/scripts/ci/check_config_switches_wired.py@@ -30,6 +30,7 @@ from __future__ import annotationsimport argparseimport ast+import jsonimport reimport sysfrom pathlib import Path@@ -37,10 +38,12 @@ from pathlib import Path_REPO = Path(__file__).resolve().parents[2]_CONFIG = _REPO / "jarvis" / "core" / "config.py"_SELF = Path(__file__).resolve()+_BASELINE = Path(__file__).resolve().parent / "dead-config-switches-baseline.json"#: Fields that are genuinely read through a dynamic path this gate cannot see.#: Every entry names WHY. An entry here is a promise that the switch really-#: works — not a way to silence the gate.+#: works — not a way to silence the gate. Distinct from the baseline file,+#: which is the opposite: switches known to be dead and not yet cleaned up._ALLOWLIST: dict[str, str] = {}#: Directories whose Python counts as a "reader" of a config field.@@ -172,29 +175,75 @@ def unread_fields() -> dict[str, str]:}+def load_baseline() -> set[str]:+ """Field names already known to be dead when the gate was introduced."""+ if not _BASELINE.exists():+ return set()+ return set(json.loads(_BASELINE.read_text(encoding="utf-8"))["fields"])+++def save_baseline(dead: dict[str, str]) -> None:+ payload = {+ "_comment": (+ "Config fields no shipped code reads, recorded when the gate was "+ "introduced so the backlog does not block every push. Generated by "+ "scripts/ci/check_config_switches_wired.py --update. Entries may be "+ "REMOVED freely (that means the switch was wired up or deleted); a "+ "new entry is a gate failure."+ ),+ "count": len(dead),+ "fields": {name: owner for name, owner in sorted(dead.items())},+ }+ _BASELINE.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")++def main() -> int:parser = argparse.ArgumentParser(description="Dead-config-switch gate.")parser.add_argument("--report",action="store_true",- help="list the findings but always exit 0 (for triage, not for CI)",+ help="list every dead switch, baseline included, and exit 0",+ )+ parser.add_argument(+ "--update",+ action="store_true",+ help="record the current findings as the accepted backlog",)args = parser.parse_args()dead = unread_fields()- if not dead:- print(f"OK: all {len(config_fields())} config fields are read by shipped code.")++ if args.report:+ print(f"{len(dead)} dead config switch(es) of {len(config_fields())} fields.\n")+ for name, owner in dead.items():+ print(f" {owner}.{name}")+ return 0++ if args.update:+ save_baseline(dead)+ print(f"Baseline written: {len(dead)} dead switch(es) recorded as backlog.")+ return 0++ baseline = load_baseline()+ fresh = {name: owner for name, owner in dead.items() if name not in baseline}+ cleaned = baseline - set(dead)++ if not fresh:+ msg = f"OK: no new dead config switch ({len(dead)} in the known backlog)."+ if cleaned:+ msg += f" {len(cleaned)} fixed since the baseline - run --update to record it."+ print(msg)return 0- print(f"Dead config switches: {len(dead)} field(s) no code reads.\n")- for name, owner in dead.items():+ print(f"New dead config switch(es): {len(fresh)}\n")+ for name, owner in fresh.items():print(f" {owner}.{name}")print("\nEach one lets a user set something that does nothing. Wire it up, ""remove it, or -- only if it is read through a dynamic path this gate ""cannot see -- add it to _ALLOWLIST with the reason.",)- return 0 if args.report else 1+ return 1if __name__ == "__main__":diff --git a/scripts/ci/check_silent_exception_handlers.py b/scripts/ci/check_silent_exception_handlers.pyindex 8ace809e30..5d80db2e8e 100644--- a/scripts/ci/check_silent_exception_handlers.py+++ b/scripts/ci/check_silent_exception_handlers.py@@ -9,16 +9,22 @@ an embed lane dead for 19 hours. In every case the code caught the error andsaid nothing.The rule is NOT "never swallow". Plenty of handlers are legitimately quiet — an-optional import, a best-effort cleanup on teardown. The rule is that the count-may never GROW. This gate stores a per-file baseline and fails when any file-gains a silent handler, so the existing backlog is grandfathered while new ones-are blocked at the door.+optional import, a capability probe, a best-effort cleanup on teardown. What+separates those from the bug class is that somebody DECIDED it and said so. So+a handler is counted only when it is quiet AND unexplained:++* no ``raise`` and no reporting-shaped call (``log``/``print``/``warn``/...),+* and no comment giving a reason, on the ``except`` line or the first line of+ its body. Lint codes are stripped first — a bare ``# noqa: BLE001`` is an+ escape, not a decision.-A handler counts as silent when its body contains no ``raise`` and no call that-looks like reporting (``log``/``logger``/``print``/``warn``/``emit``/...). When-you must stay quiet, say why in a comment on the ``except`` line and lower the-baseline elsewhere — or better, add the one log line that would have made the-last bug a five-minute fix.+So there are two ways to satisfy this gate, and both are improvements: log the+failure, or write down why silence is right. 589 handlers already carry a+reason; this measures the 1699 that do not.++On top of that the count may never GROW. The gate stores a per-file baseline+and fails when a file gains one, so the backlog is grandfathered while new ones+are blocked at the door.Usage::@@ -38,6 +44,7 @@ from __future__ import annotationsimport argparseimport astimport json+import reimport sysfrom pathlib import Path@@ -108,16 +115,54 @@ def _reports(handler: ast.ExceptHandler) -> bool:return False+#: Minimum length of the prose in a justifying comment, once lint codes are+#: stripped. Long enough that "# noqa: BLE001" alone does not pass, short enough+#: that a real half-sentence does.+_MIN_REASON_CHARS = 12++_COMMENT = re.compile(r"#\s*(.*)$")+_LINT_CODE = re.compile(r"(noqa|type|pragma):?\s*[A-Za-z]+[0-9]*")+++def _justified(lines: list[str], handler: ast.ExceptHandler) -> bool:+ """True when a comment explains WHY this handler stays quiet.++ Plenty of quiet handlers are correct — an optional import, a capability+ probe, a best-effort cleanup on teardown. What separates those from the bug+ class is that somebody decided it, and said so. A bare ``# noqa: BLE001``+ is a lint escape, not a decision, so lint codes are stripped before the+ prose is measured. The reason may sit on the ``except`` line or on the+ first line of its body.+ """+ candidates = [handler.lineno]+ if handler.body:+ candidates.append(handler.body[0].lineno)+ for lineno in candidates:+ if not 0 < lineno <= len(lines):+ continue+ match = _COMMENT.search(lines[lineno - 1])+ if not match:+ continue+ prose = _LINT_CODE.sub("", match.group(1)).strip(" -:—")+ if len(prose) >= _MIN_REASON_CHARS:+ return True+ return False++def silent_handlers(path: Path) -> list[int]:- """Line numbers of the silent ``except`` handlers in ``path``."""+ """Line numbers of ``except`` handlers that are quiet AND unexplained."""+ source = _read(path)try:- tree = ast.parse(_read(path))+ tree = ast.parse(source)except SyntaxError as exc:raise UnparseableSource(f"{path.relative_to(_REPO)} cannot be parsed ({exc}).") from exc+ lines = source.splitlines()return [node.linenofor node in ast.walk(tree)- if isinstance(node, ast.ExceptHandler) and not _reports(node)+ if isinstance(node, ast.ExceptHandler)+ and not _reports(node)+ and not _justified(lines, node)]@@ -217,9 +262,13 @@ def main() -> int:if len(bad) > 20:print(f" ... and {len(bad) - 20} more")print(- "\nLog the error (feature name + what was skipped) or re-raise it. If the "- "silence is genuinely correct, say why on the except line and re-baseline "- "with --update --allow-increase.",+ "\nPick one:\n"+ " * log it - feature name + what was skipped, so the next report is "+ "a five-minute fix rather than an archaeology session;\n"+ " * re-raise - if the caller can actually do something about it;\n"+ " * explain - a comment on the except line saying why silence is "+ "right here (a bare '# noqa' does not count), then re-baseline with "+ "--update.",)return 1diff --git a/scripts/ci/dead-config-switches-baseline.json b/scripts/ci/dead-config-switches-baseline.jsonnew file mode 100644index 0000000000..ac85d75d59--- /dev/null+++ b/scripts/ci/dead-config-switches-baseline.json@@ -0,0 +1,42 @@+{+ "_comment": "Config fields no shipped code reads, recorded when the gate was introduced so the backlog does not block every push. Generated by scripts/ci/check_config_switches_wired.py --update. Entries may be REMOVED freely (that means the switch was wired up or deleted); a new entry is a gate failure.",+ "count": 36,+ "fields": {+ "archival_store": "MemoryConfig",+ "cost_cap_eur": "JarvisAgentHarnessConfig",+ "custom_keyword_file": "WakeWordConfig",+ "default_intent_on_low_confidence": "BrainRouterPolicyConfig",+ "default_rubric": "ReviewConfig",+ "destructive_confirm_enabled": "Phase6SafetyConfig",+ "echo_cancellation": "AudioConfig",+ "escalate_on_uncertainty": "BrainRouterPolicyConfig",+ "gc_after_days": "ReviewConfig",+ "github_auto_push": "JarvisAgentsOutputConfig",+ "github_repo_url": "JarvisAgentsOutputConfig",+ "healthcheck_on_start": "BrainConfig",+ "http_host": "MCPServerConfig",+ "http_port": "MCPServerConfig",+ "injection_scanner_enabled": "Phase6SafetyConfig",+ "jarvis_agents": "JarvisConfig",+ "llm_escalation_enabled": "CompletenessConfig",+ "max_verification_iterations": "JarvisAgentsOutputConfig",+ "metrics_port": "TelemetryConfig",+ "notification": "JarvisAgentHarnessConfig",+ "otel_endpoint": "TelemetryConfig",+ "output_dir": "ReviewConfig",+ "output_dir_mirror_desktop": "JarvisAgentsOutputConfig",+ "periodic_interval_minutes": "SchedulerConfig",+ "prompt_cache_heartbeat_seconds": "BrainPolicyConfig",+ "retention_days_recall": "MemoryConfig",+ "reviewer_model": "ReviewConfig",+ "reviewer_provider": "ReviewConfig",+ "rubrics": "ReviewConfig",+ "startup_chime": "UIConfig",+ "tray_enabled": "UIConfig",+ "use_routing_model_for_intent": "BrainPolicyConfig",+ "voice_auto_switch": "TTSConfig",+ "voice_switch_patterns": "BrainPolicyConfig",+ "voice_when_active": "JarvisAgentNotificationConfig",+ "worker_model": "ReviewConfig"+ }+}diff --git a/scripts/ci/silent-handlers-baseline.json b/scripts/ci/silent-handlers-baseline.jsonindex d6d0b7cee2..e0fe0be913 100644--- a/scripts/ci/silent-handlers-baseline.json+++ b/scripts/ci/silent-handlers-baseline.json@@ -1,55 +1,46 @@{"_comment": "Per-file count of exception handlers that neither log nor re-raise. Generated by scripts/ci/check_silent_exception_handlers.py --update. These numbers may go DOWN freely; an increase is a gate failure.",- "total": 2288,+ "total": 1698,"files": {- "jarvis/__main__.py": 11,+ "jarvis/__main__.py": 10,"jarvis/admin/client.py": 1,- "jarvis/admin/executor.py": 10,+ "jarvis/admin/executor.py": 9,"jarvis/admin/helper.py": 3,"jarvis/admin/ipc.py": 4,"jarvis/admin/launcher.py": 3,"jarvis/admin/transport.py": 6,- "jarvis/admin/unix_socket.py": 8,- "jarvis/agent_accounts.py": 6,+ "jarvis/admin/unix_socket.py": 4,+ "jarvis/agent_accounts.py": 5,"jarvis/agent_cli_probe.py": 1,- "jarvis/agent_config_parity.py": 12,+ "jarvis/agent_config_parity.py": 10,"jarvis/agentic_ide/agent_sessions.py": 16,- "jarvis/agentic_ide/clarify.py": 1,- "jarvis/agentic_ide/code_skeleton.py": 5,- "jarvis/agentic_ide/context.py": 1,+ "jarvis/agentic_ide/code_skeleton.py": 4,"jarvis/agentic_ide/device.py": 1,"jarvis/agentic_ide/drops.py": 4,- "jarvis/agentic_ide/file_index.py": 5,- "jarvis/agentic_ide/fleet_actions.py": 1,+ "jarvis/agentic_ide/file_index.py": 4,"jarvis/agentic_ide/folders.py": 13,- "jarvis/agentic_ide/intent.py": 5,"jarvis/agentic_ide/interrupted.py": 1,- "jarvis/agentic_ide/names.py": 1,"jarvis/agentic_ide/native_picker.py": 2,"jarvis/agentic_ide/prompt_composer.py": 2,- "jarvis/agentic_ide/recap.py": 3,- "jarvis/agentic_ide/recap_engine.py": 3,+ "jarvis/agentic_ide/recap_engine.py": 2,"jarvis/agentic_ide/recents.py": 5,- "jarvis/agentic_ide/resume_store.py": 10,- "jarvis/agentic_ide/session.py": 10,- "jarvis/agentic_ide/work_split.py": 4,- "jarvis/agents/registry.py": 3,- "jarvis/audio/capture.py": 15,- "jarvis/audio/device_init.py": 3,- "jarvis/audio/device_probe.py": 4,+ "jarvis/agentic_ide/resume_store.py": 7,+ "jarvis/agentic_ide/session.py": 3,+ "jarvis/agentic_ide/work_split.py": 3,+ "jarvis/agents/registry.py": 2,+ "jarvis/audio/capture.py": 9,+ "jarvis/audio/device_probe.py": 2,"jarvis/audio/device_select.py": 1,- "jarvis/audio/devices.py": 5,- "jarvis/audio/ducking/controller.py": 4,+ "jarvis/audio/devices.py": 3,"jarvis/audio/gain.py": 1,"jarvis/audio/level_tap.py": 1,"jarvis/audio/mic_level.py": 1,- "jarvis/audio/player.py": 11,- "jarvis/audio/topology.py": 2,+ "jarvis/audio/player.py": 8,"jarvis/audio/vad.py": 4,"jarvis/autostart/windows.py": 1,"jarvis/awareness/context.py": 1,"jarvis/awareness/manager.py": 2,- "jarvis/awareness/probes/filesystem.py": 6,+ "jarvis/awareness/probes/filesystem.py": 5,"jarvis/awareness/probes/git.py": 10,"jarvis/awareness/prompts.py": 1,"jarvis/awareness/story.py": 3,@@ -61,133 +52,115 @@"jarvis/board/profile.py": 10,"jarvis/board/scheduler.py": 3,"jarvis/board/store.py": 6,- "jarvis/board/sync.py": 5,- "jarvis/brain/ack_brain/generator.py": 2,- "jarvis/brain/ack_brain/spawn_announcement.py": 1,- "jarvis/brain/ack_generator.py": 4,+ "jarvis/board/sync.py": 4,+ "jarvis/brain/ack_brain/generator.py": 1,"jarvis/brain/agent_instructions.py": 3,- "jarvis/brain/app_control.py": 8,- "jarvis/brain/assistant_name.py": 1,- "jarvis/brain/cache_heartbeat.py": 3,- "jarvis/brain/drop_context.py": 2,- "jarvis/brain/evidence_gate.py": 2,- "jarvis/brain/factory.py": 2,+ "jarvis/brain/app_control.py": 3,+ "jarvis/brain/cache_heartbeat.py": 2,+ "jarvis/brain/drop_context.py": 1,+ "jarvis/brain/evidence_gate.py": 1,"jarvis/brain/gemini_test_brain.py": 1,"jarvis/brain/healthcheck.py": 3,- "jarvis/brain/identity_card.py": 10,+ "jarvis/brain/identity_card.py": 6,"jarvis/brain/launcher.py": 1,"jarvis/brain/local_action_gate.py": 1,- "jarvis/brain/manager.py": 64,- "jarvis/brain/model_catalog.py": 5,+ "jarvis/brain/manager.py": 31,+ "jarvis/brain/model_catalog.py": 2,"jarvis/brain/persona_loader.py": 3,"jarvis/brain/provider_registry.py": 1,- "jarvis/brain/provider_test.py": 10,- "jarvis/brain/resolver.py": 1,- "jarvis/brain/spawn_gate.py": 3,- "jarvis/brain/streaming.py": 4,- "jarvis/brain/structured_output_parser.py": 3,+ "jarvis/brain/provider_test.py": 9,+ "jarvis/brain/streaming.py": 2,+ "jarvis/brain/structured_output_parser.py": 2,"jarvis/brain/tool_call_recovery.py": 2,"jarvis/brain/tool_gateway.py": 1,- "jarvis/brain/tool_use_loop.py": 3,+ "jarvis/brain/tool_use_loop.py": 2,"jarvis/brain/tools/self_mod_tools.py": 7,- "jarvis/brain/turn_planner.py": 5,+ "jarvis/brain/turn_planner.py": 1,"jarvis/brain/vision_context.py": 1,- "jarvis/browser_voice/route.py": 7,- "jarvis/browser_voice/session.py": 4,+ "jarvis/browser_voice/route.py": 5,+ "jarvis/browser_voice/session.py": 1,"jarvis/channels/discord.py": 3,"jarvis/channels/manager.py": 2,"jarvis/channels/telegram.py": 2,- "jarvis/claude_auth.py": 18,+ "jarvis/claude_auth.py": 14,"jarvis/claude_credentials.py": 2,"jarvis/cli/review_gc.py": 2,- "jarvis/cli_ctl/__main__.py": 1,"jarvis/cli_ctl/client.py": 2,"jarvis/cli_ctl/commands/auth.py": 1,"jarvis/cli_ctl/commands/config.py": 1,"jarvis/cli_ctl/commands/system.py": 1,- "jarvis/cli_ctl/config.py": 2,- "jarvis/cli_ctl/discovery.py": 7,+ "jarvis/cli_ctl/config.py": 1,+ "jarvis/cli_ctl/discovery.py": 5,"jarvis/cli_ctl/doctor.py": 1,"jarvis/cli_ctl/dynamic.py": 1,- "jarvis/cli_ctl/openapi_cache.py": 3,- "jarvis/cli_ctl/render.py": 1,+ "jarvis/cli_ctl/openapi_cache.py": 2,"jarvis/clis/auth.py": 7,"jarvis/clis/catalog/__init__.py": 1,"jarvis/clis/installer.py": 11,"jarvis/clis/prober.py": 6,"jarvis/clis/tool.py": 1,"jarvis/clis/usage_log.py": 1,- "jarvis/codex_auth.py": 8,- "jarvis/commands/registry.py": 3,+ "jarvis/codex_auth.py": 7,"jarvis/contacts/store.py": 2,"jarvis/control/cost.py": 3,"jarvis/control/wiring.py": 1,- "jarvis/core/config.py": 35,+ "jarvis/core/config.py": 22,"jarvis/core/config_writer.py": 2,- "jarvis/core/control_key.py": 10,+ "jarvis/core/control_key.py": 8,"jarvis/core/interactive_terminal.py": 1,- "jarvis/core/keychain_bundle.py": 5,- "jarvis/core/loop_executor.py": 2,- "jarvis/core/loop_watchdog.py": 3,- "jarvis/core/path_augment.py": 3,- "jarvis/core/paths.py": 2,+ "jarvis/core/keychain_bundle.py": 2,+ "jarvis/core/loop_watchdog.py": 1,+ "jarvis/core/path_augment.py": 2,+ "jarvis/core/paths.py": 1,"jarvis/core/process_tree.py": 1,- "jarvis/core/process_utils.py": 1,- "jarvis/core/redact.py": 1,- "jarvis/core/registry.py": 1,"jarvis/core/review/checks.py": 1,- "jarvis/core/review/spawns.py": 3,+ "jarvis/core/review/spawns.py": 2,"jarvis/core/screenshots.py": 2,"jarvis/core/self_mod/schema_introspect.py": 1,"jarvis/core/self_mod/writer.py": 4,- "jarvis/cu/brain_call.py": 5,+ "jarvis/cu/brain_call.py": 4,"jarvis/cu/conventions.py": 3,- "jarvis/cu/engine.py": 13,- "jarvis/cu/geometry.py": 2,+ "jarvis/cu/engine.py": 11,+ "jarvis/cu/geometry.py": 1,"jarvis/cu/indicator/__main__.py": 1,- "jarvis/cu/indicator/capture_guard.py": 2,- "jarvis/cu/indicator/controller.py": 6,+ "jarvis/cu/indicator/capture_guard.py": 1,+ "jarvis/cu/indicator/controller.py": 4,"jarvis/cu/indicator/protocol.py": 2,- "jarvis/cu/indicator/renderer.py": 1,- "jarvis/cu/verify.py": 7,- "jarvis/diagnostics/doctor.py": 5,+ "jarvis/cu/verify.py": 5,+ "jarvis/diagnostics/doctor.py": 4,"jarvis/dictation/_locks.py": 1,"jarvis/dictation/audio.py": 6,- "jarvis/dictation/cleanup.py": 2,- "jarvis/dictation/history.py": 5,- "jarvis/dictation/insert.py": 3,+ "jarvis/dictation/history.py": 4,+ "jarvis/dictation/insert.py": 1,"jarvis/dictation/polish.py": 3,- "jarvis/dictation/polish_client.py": 3,+ "jarvis/dictation/polish_client.py": 2,"jarvis/dictation/segment.py": 2,"jarvis/dictation/stats.py": 8,- "jarvis/docs/loader.py": 6,+ "jarvis/docs/loader.py": 5,"jarvis/docs/registry.py": 3,"jarvis/docs/search.py": 1,"jarvis/friends/status_publisher.py": 1,"jarvis/google_cli/auth_service.py": 4,"jarvis/google_cli/pty_runner.py": 2,"jarvis/google_cli/resolver.py": 1,- "jarvis/hardware/detection.py": 9,+ "jarvis/hardware/detection.py": 8,"jarvis/harness/base.py": 10,- "jarvis/harness/computer_use_context.py": 6,+ "jarvis/harness/computer_use_context.py": 2,"jarvis/harness/computer_use_planner.py": 3,"jarvis/harness/manager.py": 3,"jarvis/harness/native_computer_use.py": 1,- "jarvis/harness/screenshot_only_loop.py": 35,+ "jarvis/harness/screenshot_only_loop.py": 24,"jarvis/harness/screenshot_only_loop_june13.py": 17,- "jarvis/harness/screenshot_only_loop_stable.py": 29,+ "jarvis/harness/screenshot_only_loop_stable.py": 22,"jarvis/marketplace/auth/oauth_dcr.py": 3,"jarvis/marketplace/auth/oauth_device.py": 1,"jarvis/marketplace/auth/oauth_pkce_loopback.py": 3,"jarvis/marketplace/catalog_data.py": 1,- "jarvis/marketplace/connect_helpers.py": 2,+ "jarvis/marketplace/connect_helpers.py": 1,"jarvis/marketplace/plugin_registry.py": 1,- "jarvis/marketplace/plugin_relevance.py": 2,- "jarvis/marketplace/refresh_scheduler.py": 2,- "jarvis/marketplace/token_store.py": 10,+ "jarvis/marketplace/refresh_scheduler.py": 1,"jarvis/mcp/bootstrap.py": 3,"jarvis/mcp/claude_export.py": 2,- "jarvis/mcp/notification_filter.py": 1,"jarvis/mcp/server.py": 3,"jarvis/mcp/state.py": 3,"jarvis/memory/bootstrap_runner.py": 1,@@ -202,16 +175,16 @@"jarvis/memory/wiki/consolidator.py": 8,"jarvis/memory/wiki/contact_mirror.py": 1,"jarvis/memory/wiki/curator.py": 2,- "jarvis/memory/wiki/curator_llm.py": 8,+ "jarvis/memory/wiki/curator_llm.py": 6,"jarvis/memory/wiki/extractor.py": 6,"jarvis/memory/wiki/fts_index.py": 5,"jarvis/memory/wiki/health.py": 3,"jarvis/memory/wiki/index_builder.py": 1,"jarvis/memory/wiki/integration.py": 6,"jarvis/memory/wiki/journal.py": 2,- "jarvis/memory/wiki/lock.py": 6,+ "jarvis/memory/wiki/lock.py": 5,"jarvis/memory/wiki/prompt.py": 2,- "jarvis/memory/wiki/provider_chain.py": 2,+ "jarvis/memory/wiki/provider_chain.py": 1,"jarvis/memory/wiki/recurate.py": 1,"jarvis/memory/wiki/search.py": 1,"jarvis/memory/wiki/self_doc.py": 2,@@ -219,99 +192,87 @@"jarvis/memory/wiki/vault_index.py": 2,"jarvis/memory/wiki/vault_root.py": 1,"jarvis/memory/wiki/voice_bridge.py": 1,- "jarvis/memory/wiki/watcher.py": 4,+ "jarvis/memory/wiki/watcher.py": 3,"jarvis/memory/workspace.py": 2,"jarvis/missions/cleanup.py": 2,"jarvis/missions/critic/reflections.py": 1,- "jarvis/missions/critic/runner.py": 17,+ "jarvis/missions/critic/runner.py": 14,"jarvis/missions/event_bus.py": 3,"jarvis/missions/event_store.py": 1,- "jarvis/missions/init.py": 8,+ "jarvis/missions/init.py": 1,"jarvis/missions/isolation/env.py": 1,"jarvis/missions/isolation/job_object.py": 1,"jarvis/missions/isolation/worktree.py": 4,"jarvis/missions/kontrollierer/decomposer.py": 1,"jarvis/missions/kontrollierer/deliverable.py": 2,"jarvis/missions/kontrollierer/deliverable_paths.py": 1,- "jarvis/missions/kontrollierer/orchestrator.py": 10,+ "jarvis/missions/kontrollierer/orchestrator.py": 9,"jarvis/missions/result_reader.py": 5,"jarvis/missions/safety/destructive_confirm.py": 1,"jarvis/missions/safety/injection_scanner.py": 1,"jarvis/missions/stream_evidence.py": 6,- "jarvis/missions/voice/readback.py": 1,"jarvis/missions/workers/api_agent_tools.py": 10,- "jarvis/missions/workers/api_agent_worker.py": 3,- "jarvis/missions/workers/broker_stdio.py": 1,- "jarvis/missions/workers/capabilities.py": 4,"jarvis/missions/workers/claude_direct_worker.py": 3,- "jarvis/missions/workers/codex_direct_worker.py": 6,+ "jarvis/missions/workers/codex_direct_worker.py": 5,"jarvis/missions/workers/codex_worker.py": 1,"jarvis/missions/workers/gemini_worker.py": 1,- "jarvis/missions/workers/process_utils.py": 2,"jarvis/missions/workers/provider_chain.py": 1,"jarvis/missions/workers/stream_consumer.py": 1,"jarvis/missions/workers/worker_tool_broker.py": 5,- "jarvis/overlay/drop_target.py": 2,+ "jarvis/overlay/drop_target.py": 1,"jarvis/overlay/linux_surface.py": 1,- "jarvis/overlay/system_cursor.py": 5,- "jarvis/overlay/virtual_cursor.py": 2,- "jarvis/platform/input_isolation.py": 1,- "jarvis/platform/macos_ax.py": 3,- "jarvis/platform/monitors.py": 21,+ "jarvis/overlay/system_cursor.py": 4,+ "jarvis/platform/macos_ax.py": 2,+ "jarvis/platform/monitors.py": 4,"jarvis/platform/open_path.py": 2,- "jarvis/platform/permissions.py": 10,- "jarvis/platform/probes.py": 3,- "jarvis/platform/window_capture.py": 1,- "jarvis/platform/window_state.py": 22,+ "jarvis/platform/permissions.py": 2,+ "jarvis/platform/probes.py": 1,+ "jarvis/platform/window_state.py": 20,"jarvis/plugins/brain/_anthropic_base.py": 1,- "jarvis/plugins/brain/_openai_base.py": 2,- "jarvis/plugins/brain/antigravity.py": 3,+ "jarvis/plugins/brain/_openai_base.py": 1,+ "jarvis/plugins/brain/antigravity.py": 2,"jarvis/plugins/brain/claude_cli.py": 2,"jarvis/plugins/brain/codex.py": 4,"jarvis/plugins/brain/gemini.py": 1,- "jarvis/plugins/brain/ollama.py": 1,- "jarvis/plugins/brain/openrouter.py": 2,- "jarvis/plugins/harness/computer_use.py": 7,+ "jarvis/plugins/brain/openrouter.py": 1,+ "jarvis/plugins/harness/computer_use.py": 6,"jarvis/plugins/harness/mcp_remote.py": 3,- "jarvis/plugins/realtime/gemini_live.py": 3,+ "jarvis/plugins/realtime/gemini_live.py": 2,"jarvis/plugins/realtime/openai_realtime.py": 2,- "jarvis/plugins/stt/__init__.py": 6,- "jarvis/plugins/stt/errors.py": 5,+ "jarvis/plugins/stt/__init__.py": 4,+ "jarvis/plugins/stt/errors.py": 2,"jarvis/plugins/stt/groq_api.py": 3,"jarvis/plugins/stt/openai_api.py": 1,- "jarvis/plugins/tool/app_command.py": 3,- "jarvis/plugins/tool/app_resolver.py": 4,- "jarvis/plugins/tool/click.py": 5,+ "jarvis/plugins/tool/app_command.py": 2,+ "jarvis/plugins/tool/app_resolver.py": 3,+ "jarvis/plugins/tool/click.py": 4,"jarvis/plugins/tool/click_element.py": 6,"jarvis/plugins/tool/computer_use_tool.py": 1,"jarvis/plugins/tool/dispatch_to_admin.py": 2,"jarvis/plugins/tool/dispatch_to_harness.py": 5,- "jarvis/plugins/tool/dispatch_with_review.py": 3,+ "jarvis/plugins/tool/dispatch_with_review.py": 1,"jarvis/plugins/tool/drag.py": 5,- "jarvis/plugins/tool/drive_rest.py": 2,- "jarvis/plugins/tool/gmail_rest.py": 3,- "jarvis/plugins/tool/google_calendar_rest.py": 5,+ "jarvis/plugins/tool/drive_rest.py": 1,+ "jarvis/plugins/tool/gmail_rest.py": 2,+ "jarvis/plugins/tool/google_calendar_rest.py": 4,"jarvis/plugins/tool/home_assistant_rest.py": 1,"jarvis/plugins/tool/hotkey.py": 5,- "jarvis/plugins/tool/manage_mcp_server.py": 3,- "jarvis/plugins/tool/move_mouse.py": 5,+ "jarvis/plugins/tool/manage_mcp_server.py": 2,+ "jarvis/plugins/tool/move_mouse.py": 4,"jarvis/plugins/tool/multi_spawn.py": 2,- "jarvis/plugins/tool/open_app.py": 3,- "jarvis/plugins/tool/profile_update.py": 1,- "jarvis/plugins/tool/read_visible_ui_state.py": 3,+ "jarvis/plugins/tool/open_app.py": 2,+ "jarvis/plugins/tool/read_visible_ui_state.py": 2,"jarvis/plugins/tool/remember.py": 1,"jarvis/plugins/tool/reset_orb_position.py": 1,"jarvis/plugins/tool/run_shell.py": 4,- "jarvis/plugins/tool/run_skill.py": 4,- "jarvis/plugins/tool/screen_snapshot.py": 2,+ "jarvis/plugins/tool/run_skill.py": 3,+ "jarvis/plugins/tool/screen_snapshot.py": 1,"jarvis/plugins/tool/scroll.py": 5,- "jarvis/plugins/tool/search_backends.py": 3,- "jarvis/plugins/tool/search_web.py": 5,- "jarvis/plugins/tool/spawn_worker.py": 2,+ "jarvis/plugins/tool/search_web.py": 3,+ "jarvis/plugins/tool/spawn_worker.py": 1,"jarvis/plugins/tool/start_preview_server.py": 1,"jarvis/plugins/tool/switch_window.py": 2,"jarvis/plugins/tool/type_text.py": 7,- "jarvis/plugins/tool/ultrawiki_search.py": 1,"jarvis/plugins/tool/vercel_rest.py": 1,"jarvis/plugins/tool/verify_localhost.py": 2,"jarvis/plugins/tool/verify_via_curl.py": 1,@@ -322,29 +283,24 @@"jarvis/plugins/tool/wiki_recall.py": 1,"jarvis/plugins/tts/__init__.py": 4,"jarvis/plugins/tts/elevenlabs_tts.py": 1,- "jarvis/plugins/tts/fallback_tts.py": 1,"jarvis/plugins/tts/gemini_flash_tts.py": 4,- "jarvis/plugins/wake/vosk_kws_provider.py": 3,- "jarvis/realtime/desktop.py": 8,- "jarvis/realtime/factory.py": 1,- "jarvis/realtime/session.py": 49,- "jarvis/realtime/tools.py": 4,+ "jarvis/realtime/desktop.py": 6,+ "jarvis/realtime/session.py": 21,+ "jarvis/realtime/tools.py": 2,"jarvis/runs/analyzer.py": 1,- "jarvis/runs/runs_ws.py": 4,+ "jarvis/runs/runs_ws.py": 3,"jarvis/safety/approval.py": 1,"jarvis/safety/risk_tier.py": 1,"jarvis/sessions/store.py": 3,"jarvis/setup/dependencies.py": 4,- "jarvis/setup/desktop_integration.py": 2,- "jarvis/setup/macos_app_bundle.py": 9,- "jarvis/setup/macos_launcher_entry.py": 2,+ "jarvis/setup/desktop_integration.py": 1,+ "jarvis/setup/macos_app_bundle.py": 8,+ "jarvis/setup/macos_launcher_entry.py": 1,"jarvis/setup/mcp_selection.py": 2,- "jarvis/setup/model_report.py": 1,- "jarvis/setup/obsidian.py": 5,+ "jarvis/setup/obsidian.py": 4,"jarvis/setup/onboarding_fastpath.py": 1,- "jarvis/setup/prefetch.py": 6,- "jarvis/setup/uninstall.py": 15,- "jarvis/setup/wizard.py": 2,+ "jarvis/setup/uninstall.py": 9,+ "jarvis/setup/wizard.py": 1,"jarvis/skills/authoring/draft_writer.py": 2,"jarvis/skills/authoring/service.py": 1,"jarvis/skills/bootstrap.py": 3,@@ -352,97 +308,90 @@"jarvis/skills/creator_service.py": 2,"jarvis/skills/eval_harness.py": 1,"jarvis/skills/finder.py": 1,- "jarvis/skills/lifecycle.py": 3,+ "jarvis/skills/lifecycle.py": 2,"jarvis/skills/loader.py": 5,- "jarvis/skills/local_search.py": 1,- "jarvis/skills/match_eval.py": 3,+ "jarvis/skills/match_eval.py": 1,"jarvis/skills/prefs.py": 1,"jarvis/skills/prompt_injection.py": 2,"jarvis/skills/quality.py": 3,"jarvis/skills/registry.py": 4,- "jarvis/skills/relevance.py": 4,+ "jarvis/skills/relevance.py": 3,"jarvis/skills/runner.py": 7,"jarvis/skills/trigger_matcher.py": 5,"jarvis/skills/validator.py": 4,- "jarvis/speech/completeness.py": 1,- "jarvis/speech/diagnose.py": 3,- "jarvis/speech/pipeline.py": 87,- "jarvis/speech/rolling_whisper_wake.py": 4,- "jarvis/speech/stt_dictionary.py": 4,+ "jarvis/speech/diagnose.py": 1,+ "jarvis/speech/pipeline.py": 71,+ "jarvis/speech/rolling_whisper_wake.py": 3,+ "jarvis/speech/stt_dictionary.py": 3,"jarvis/speech/tts_eval/__main__.py": 1,- "jarvis/speech/voice_compare.py": 2,- "jarvis/speech/wake_model_fetch.py": 4,+ "jarvis/speech/voice_compare.py": 1,"jarvis/speech/watchdog.py": 1,"jarvis/state/supervisor.py": 1,- "jarvis/tasks/runner.py": 7,+ "jarvis/tasks/runner.py": 5,"jarvis/tasks/scheduler.py": 4,"jarvis/tasks/store.py": 2,"jarvis/telemetry/latency.py": 1,"jarvis/telemetry/latency_log.py": 1,- "jarvis/telephony/audio.py": 2,- "jarvis/telephony/security.py": 2,- "jarvis/telephony/session.py": 7,+ "jarvis/telephony/security.py": 1,+ "jarvis/telephony/session.py": 1,"jarvis/telephony/twiml.py": 2,- "jarvis/terminal/pty_manager.py": 4,+ "jarvis/terminal/pty_manager.py": 3,"jarvis/terminal/shells.py": 1,"jarvis/tools/latency_report.py": 2,- "jarvis/trigger/backends/noop.py": 2,- "jarvis/trigger/backends/pynput.py": 2,- "jarvis/trigger/backends/quartz.py": 2,- "jarvis/trigger/hotkey.py": 5,- "jarvis/ui/desktop_app.py": 70,- "jarvis/ui/icon_utils.py": 4,+ "jarvis/trigger/backends/noop.py": 1,+ "jarvis/trigger/hotkey.py": 2,+ "jarvis/ui/desktop_app.py": 56,+ "jarvis/ui/icon_utils.py": 2,"jarvis/ui/jarvisbar/interaction.py": 3,- "jarvis/ui/jarvisbar/overlay.py": 9,- "jarvis/ui/jarvisbar/qt_overlay.py": 6,+ "jarvis/ui/jarvisbar/overlay.py": 5,+ "jarvis/ui/jarvisbar/qt_overlay.py": 2,"jarvis/ui/jarvisbar/renderer.py": 3,- "jarvis/ui/native_drag.py": 4,- "jarvis/ui/relauncher.py": 14,+ "jarvis/ui/native_drag.py": 3,+ "jarvis/ui/relauncher.py": 11,"jarvis/ui/shell/runtime_check.py": 4,"jarvis/ui/shell/shell.py": 1,- "jarvis/ui/shell/single_instance.py": 11,- "jarvis/ui/tray.py": 5,- "jarvis/ui/web/agentic_ide_routes.py": 11,+ "jarvis/ui/shell/single_instance.py": 10,+ "jarvis/ui/tray.py": 4,+ "jarvis/ui/web/agentic_ide_routes.py": 5,"jarvis/ui/web/board_routes.py": 2,"jarvis/ui/web/claude_routes.py": 1,"jarvis/ui/web/cli_routes.py": 2,- "jarvis/ui/web/diagnostics_routes.py": 3,- "jarvis/ui/web/dictation_routes.py": 3,+ "jarvis/ui/web/diagnostics_routes.py": 1,+ "jarvis/ui/web/dictation_routes.py": 2,"jarvis/ui/web/docs_routes.py": 1,"jarvis/ui/web/fast_bootstrap.py": 7,- "jarvis/ui/web/feedback_routes.py": 2,- "jarvis/ui/web/launcher.py": 23,+ "jarvis/ui/web/feedback_routes.py": 1,+ "jarvis/ui/web/launcher.py": 14,"jarvis/ui/web/marketplace_routes.py": 4,"jarvis/ui/web/mcp_routes.py": 5,"jarvis/ui/web/missions_pty_routes.py": 4,"jarvis/ui/web/missions_ws_routes.py": 11,"jarvis/ui/web/outputs_routes.py": 7,"jarvis/ui/web/profile_routes.py": 8,- "jarvis/ui/web/provider_routes.py": 12,+ "jarvis/ui/web/provider_routes.py": 9,"jarvis/ui/web/review_routes.py": 4,"jarvis/ui/web/schema.py": 1,"jarvis/ui/web/self_mod_routes.py": 1,- "jarvis/ui/web/server.py": 25,- "jarvis/ui/web/settings_routes.py": 16,+ "jarvis/ui/web/server.py": 24,+ "jarvis/ui/web/settings_routes.py": 5,"jarvis/ui/web/setup_report_routes.py": 2,"jarvis/ui/web/setup_routes.py": 1,"jarvis/ui/web/skills_routes.py": 9,"jarvis/ui/web/socials_routes.py": 1,- "jarvis/ui/web/surface_security.py": 21,+ "jarvis/ui/web/surface_security.py": 19,"jarvis/ui/web/tasks_routes.py": 1,- "jarvis/ui/web/telephony_routes.py": 14,- "jarvis/ui/web/tool_model_routes.py": 1,- "jarvis/ui/web/ultrawiki_routes.py": 12,- "jarvis/ui/web/update_routes.py": 16,+ "jarvis/ui/web/telephony_routes.py": 10,+ "jarvis/ui/web/ultrawiki_routes.py": 2,+ "jarvis/ui/web/update_routes.py": 14,"jarvis/ui/web/wiki_routes.py": 6,"jarvis/ui/web/wiki_ws.py": 4,"jarvis/ui/web/workflows_routes.py": 3,- "jarvis/ui/web/workspace_routes.py": 7,+ "jarvis/ui/web/workspace_routes.py": 5,"jarvis/ultrawiki/adapters/_google.py": 6,- "jarvis/ultrawiki/adapters/airtable.py": 2,+ "jarvis/ultrawiki/adapters/airtable.py": 1,"jarvis/ultrawiki/adapters/asana.py": 3,"jarvis/ultrawiki/adapters/clickup.py": 4,- "jarvis/ultrawiki/adapters/discord.py": 8,+ "jarvis/ultrawiki/adapters/discord.py": 7,"jarvis/ultrawiki/adapters/dropbox.py": 3,"jarvis/ultrawiki/adapters/github.py": 3,"jarvis/ultrawiki/adapters/google_drive.py": 2,@@ -450,47 +399,43 @@"jarvis/ultrawiki/adapters/linear.py": 3,"jarvis/ultrawiki/adapters/notion.py": 3,"jarvis/ultrawiki/adapters/slack.py": 7,- "jarvis/ultrawiki/adapters/telegram.py": 6,+ "jarvis/ultrawiki/adapters/telegram.py": 4,"jarvis/ultrawiki/adapters/todoist.py": 3,"jarvis/ultrawiki/connectors/custom_source.py": 8,- "jarvis/ultrawiki/connectors/export_import.py": 27,+ "jarvis/ultrawiki/connectors/export_import.py": 18,"jarvis/ultrawiki/connectors/local_folder.py": 3,"jarvis/ultrawiki/distill.py": 1,- "jarvis/ultrawiki/document_text.py": 1,"jarvis/ultrawiki/embedding_models.py": 2,- "jarvis/ultrawiki/embeddings.py": 2,+ "jarvis/ultrawiki/embeddings.py": 1,"jarvis/ultrawiki/event_store.py": 2,"jarvis/ultrawiki/events.py": 2,- "jarvis/ultrawiki/extract.py": 10,+ "jarvis/ultrawiki/extract.py": 6,"jarvis/ultrawiki/identity.py": 1,"jarvis/ultrawiki/identity_store.py": 6,"jarvis/ultrawiki/media.py": 7,- "jarvis/ultrawiki/media_enrich.py": 2,- "jarvis/ultrawiki/pipeline.py": 15,+ "jarvis/ultrawiki/media_enrich.py": 1,+ "jarvis/ultrawiki/pipeline.py": 6,"jarvis/ultrawiki/progress.py": 1,- "jarvis/ultrawiki/rerank.py": 3,- "jarvis/ultrawiki/search.py": 5,- "jarvis/ultrawiki/service.py": 19,- "jarvis/ultrawiki/store.py": 6,+ "jarvis/ultrawiki/rerank.py": 2,+ "jarvis/ultrawiki/search.py": 3,+ "jarvis/ultrawiki/service.py": 7,+ "jarvis/ultrawiki/store.py": 5,"jarvis/ultrawiki/supabase_link.py": 1,"jarvis/ultrawiki/throughput.py": 2,"jarvis/ultrawiki/vault_export.py": 2,- "jarvis/vision/atspi_tree.py": 19,- "jarvis/vision/ax_tree.py": 6,+ "jarvis/vision/atspi_tree.py": 14,+ "jarvis/vision/ax_tree.py": 4,"jarvis/vision/context_provider.py": 1,- "jarvis/vision/element_at_point.py": 18,+ "jarvis/vision/element_at_point.py": 12,"jarvis/vision/engine.py": 1,- "jarvis/vision/screenshot.py": 1,- "jarvis/vision/set_of_marks.py": 4,- "jarvis/vision/uia_tree.py": 6,- "jarvis/voice/contextual_readback.py": 1,- "jarvis/voice/number_speller.py": 3,+ "jarvis/vision/set_of_marks.py": 3,+ "jarvis/vision/uia_tree.py": 5,+ "jarvis/voice/number_speller.py": 1,"jarvis/voice/self_mod_flow.py": 1,"jarvis/workflows/runner.py": 4,"jarvis/workflows/scheduler.py": 3,- "jarvis/workflows/seed.py": 1,"jarvis/workflows/store.py": 1,- "jarvis/workspace/agents.py": 5,+ "jarvis/workspace/agents.py": 2,"jarvis/workspace/trust.py": 1}}diff --git a/tests/unit/core/test_config_switches_wired.py b/tests/unit/core/test_config_switches_wired.pynew file mode 100644index 0000000000..61244a2d3f--- /dev/null+++ b/tests/unit/core/test_config_switches_wired.py@@ -0,0 +1,72 @@+"""The dead-config-switch gate must hold: no NEW config field that nothing reads.++A switch the user can set but that no code reads is a lie told by the settings+screen and by jarvis.toml. The known backlog is frozen in a baseline file; these+tests protect the mechanism that stops it from growing.+"""+from __future__ import annotations++import ast+import importlib.util+from pathlib import Path++_REPO = Path(__file__).resolve().parents[3]+_GATE = _REPO / "scripts" / "ci" / "check_config_switches_wired.py"+++def _load_gate():+ spec = importlib.util.spec_from_file_location("check_config_switches_wired", _GATE)+ mod = importlib.util.module_from_spec(spec)+ assert spec and spec.loader+ spec.loader.exec_module(mod)+ return mod+++def test_no_new_dead_switch_beyond_the_recorded_backlog():+ gate = _load_gate()+ fresh = sorted(set(gate.unread_fields()) - gate.load_baseline())+ assert fresh == [], (+ "config fields nothing reads, and not in the recorded backlog: "+ f"{fresh}. Wire them up or remove them."+ )+++def test_gate_sees_the_real_config_surface():+ """Guard against the gate silently scanning nothing."""+ gate = _load_gate()+ fields = gate.config_fields()+ assert len(fields) > 300, f"expected the full config surface, found {len(fields)}"+ # Spot-check a field that is unambiguously read by shipped code, so a+ # regression in usage detection shows up here rather than as 400 findings.+ assert "provider" in fields+++def test_bom_files_are_readable_by_the_gate():+ """The largest modules start with a BOM; plain utf-8 makes ast.parse fail.++ This is the bug that made an earlier version of this gate report 24 live+ switches as dead: it skipped exactly manager.py, desktop_app.py and+ server.py, which is where most config reads live.+ """+ gate = _load_gate()+ bom_files = [+ path+ for path in (_REPO / "jarvis").rglob("*.py")+ if "__pycache__" not in path.parts+ and path.read_bytes()[:3] == b"\xef\xbb\xbf"+ ]+ assert bom_files, "expected at least one BOM file to guard against"+ for path in bom_files:+ # Must not raise: the gate reads utf-8-sig, so the BOM is stripped.+ ast.parse(gate._read(path))+++def test_baseline_has_no_stale_entries():+ """Every baselined field still exists; otherwise the backlog is fiction."""+ gate = _load_gate()+ fields = set(gate.config_fields())+ stale = sorted(gate.load_baseline() - fields)+ assert stale == [], (+ f"baseline lists fields that no longer exist: {stale}. "+ "Run: python scripts/ci/check_config_switches_wired.py --update"+ )diff --git a/tests/unit/core/test_silent_exception_handlers.py b/tests/unit/core/test_silent_exception_handlers.pynew file mode 100644index 0000000000..aa169d8843--- /dev/null+++ b/tests/unit/core/test_silent_exception_handlers.py@@ -0,0 +1,110 @@+"""The silent-exception ratchet must hold: no file GAINS an unexplained handler.++An except block that neither logs, nor re-raises, nor says why it stays quiet+makes a failure invisible — the feature just does nothing and nobody can tell.+These tests protect the detection logic and the ratchet itself.+"""+from __future__ import annotations++import importlib.util+import textwrap+from pathlib import Path++_REPO = Path(__file__).resolve().parents[3]+_GATE = _REPO / "scripts" / "ci" / "check_silent_exception_handlers.py"+++def _load_gate():+ spec = importlib.util.spec_from_file_location("check_silent_exception_handlers", _GATE)+ mod = importlib.util.module_from_spec(spec)+ assert spec and spec.loader+ spec.loader.exec_module(mod)+ return mod+++def _count(tmp_path: Path, source: str) -> int:+ path = tmp_path / "sample.py"+ path.write_text(textwrap.dedent(source), encoding="utf-8")+ return len(_load_gate().silent_handlers(path))+++def test_no_file_gained_a_silent_handler():+ gate = _load_gate()+ bad = gate.regressions(gate.scan(), gate.load_baseline())+ assert bad == {}, (+ "files gained an exception handler that says nothing: "+ f"{ {k: v for k, v in list(bad.items())[:10]} }"+ )+++def test_a_bare_swallow_is_counted(tmp_path):+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception:+ pass+ """) == 1+++def test_logging_the_error_is_not_counted(tmp_path):+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception:+ log.warning("dictation: segment dropped")+ """) == 0+++def test_re_raising_is_not_counted(tmp_path):+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception:+ raise+ """) == 0+++def test_a_written_reason_is_not_counted(tmp_path):+ """Explaining the silence is a valid answer — that is the point."""+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception: # a capability probe must never hard-fail+ return None+ """) == 0+++def test_a_bare_lint_escape_is_still_counted(tmp_path):+ """`# noqa: BLE001` alone is an escape, not a decision."""+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception: # noqa: BLE001+ pass+ """) == 1+++def test_reason_on_the_first_body_line_counts(tmp_path):+ assert _count(tmp_path, """+ def f():+ try:+ g()+ except Exception:+ pass # teardown is best-effort; the socket is already gone+ """) == 0+++def test_baseline_covers_the_real_tree():+ """Guard against a baseline that silently drifted to nothing."""+ gate = _load_gate()+ baseline = gate.load_baseline()+ assert baseline, "baseline is empty — the ratchet would allow anything"+ assert sum(baseline.values()) > 500, (+ f"baseline total {sum(baseline.values())} looks impossibly low; "+ "the scan probably broke"+ )