@@ -57,6 +57,12 @@ def test_surface_aware_command_extraction_never_persists_option_values() -> None
5757 "orch" , ["--project-root=/private/path" , "doctor" ], recognized
5858 ) == "doctor"
5959 assert observation .extract_command ("orch" , ["--help" , "doctor" ], recognized ) == "__no_command__"
60+ assert observation .extract_command (
61+ "orch" , ["--project-root" , "--help" , "doctor" ], recognized
62+ ) == "__no_command__"
63+ assert observation .extract_command (
64+ "orch" , ["--project-root" , "--unknown" , "doctor" ], recognized
65+ ) == "__unknown__"
6066 assert observation .extract_command ("orch" , ["--project" , "/secret" , "doctor" ], recognized ) == "__unknown__"
6167
6268
@@ -148,6 +154,17 @@ def test_database_failure_is_silent_and_does_not_change_dispatch(
148154 assert capsys .readouterr () == ("" , "" )
149155
150156
157+ def test_config_root_resolution_failure_is_silent_and_does_not_change_dispatch (
158+ monkeypatch : pytest .MonkeyPatch , capsys : pytest .CaptureFixture [str ]
159+ ) -> None :
160+ observation = load_observation ()
161+ monkeypatch .setenv ("WORK_BUNDLE_INVOCATION_LOG" , "1" )
162+ monkeypatch .setenv ("WB_CONFIG_ROOT" , "~workbundle-user-that-does-not-exist/usage" )
163+
164+ assert observation .invoke_observed ("wb" , ["doctor" ], {"doctor" }, lambda : 7 ) == 7
165+ assert capsys .readouterr () == ("" , "" )
166+
167+
151168@pytest .mark .parametrize (("filename" , "surface" ), [("wb.py" , "wb" ), ("orch.py" , "orch" )])
152169def test_public_wrappers_observe_once (
153170 enabled : Path , monkeypatch : pytest .MonkeyPatch , filename : str , surface : str
0 commit comments