@@ -162,6 +162,49 @@ async def test_refresh_scan_only_can_be_enabled_from_env_file(
162162 assert (knowledge_root (tmp_path ) / "scan_report.json" ).exists ()
163163
164164
165+ @pytest .mark .asyncio
166+ async def test_generic_host_runner_full_refresh_promotes_generation (
167+ tmp_path : Path ,
168+ monkeypatch ,
169+ commit_workspace ,
170+ ) -> None :
171+ """A successful deterministic git stage must not block promotion."""
172+ runner = tmp_path .parent / f"{ tmp_path .name } -generic-runner"
173+ runner .write_text (
174+ "#!/bin/sh\n "
175+ "cat >/dev/null\n "
176+ "printf '# Generated\\ n\\ nHost runner output.\\ n'\n " ,
177+ encoding = "utf-8" ,
178+ )
179+ runner .chmod (0o755 )
180+
181+ monkeypatch .setenv ("WORKSPACE_PATH" , str (tmp_path ))
182+ monkeypatch .setenv ("OPENAI_API_KEY" , "" )
183+ monkeypatch .setenv ("OPENAI_BASE_URL" , "" )
184+ monkeypatch .setenv ("GOOGLE_API_KEY" , "" )
185+ monkeypatch .setenv ("RB_REFRESH_SCAN_ONLY" , "0" )
186+ monkeypatch .setenv ("RB_HOST_RUNNER" , "generic" )
187+ monkeypatch .setenv ("RB_HOST_COMMAND" , str (runner ))
188+ monkeypatch .setenv ("RB_HOST_OUTPUT_MODE" , "stdout" )
189+
190+ (tmp_path / "main.py" ).write_text ("value = 1\n " , encoding = "utf-8" )
191+ commit_workspace (tmp_path )
192+
193+ from repobrain_engine .config import reset_settings
194+ from repobrain_engine .hub .refresh_pipeline import refresh_pipeline
195+ from repobrain_engine .hub .storage import active_generation_root
196+
197+ reset_settings ()
198+ status = await refresh_pipeline (tmp_path , quick = False )
199+
200+ generation_root = active_generation_root (tmp_path )
201+ assert status .stages ["git_insights" ] == "success"
202+ assert status .overall_status == "success"
203+ assert status .exit_code == 0
204+ assert generation_root is not None
205+ assert (generation_root / "modules" / "_git_insights.md" ).exists ()
206+
207+
165208@pytest .mark .asyncio
166209async def test_ask_pipeline_returns_answer (tmp_path : Path , monkeypatch ) -> None :
167210 """ask_pipeline returns an answer string."""
0 commit comments