@@ -259,105 +259,39 @@ def verify_prompt_integrity(state: FlowState) -> bool:
259259
260260
261261def synthesize_prompt_with_flow_data (state : FlowState ) -> dict :
262- """Synthesize comprehensive prompt using all collected 3-level flow data.
262+ """Report that prompt synthesis is unavailable.
263+
264+ This function used to load a PromptGenerator from
265+ ``scripts/architecture/03-execution-system/00-prompt-generation/prompt-generation-policy.py``
266+ and build a synthesised prompt from the whole flow. That file was deleted on
267+ 2026-05-04 in 683c23a, so the dynamic import has raised on every run since,
268+ and the ninety lines of flow-data assembly that followed it were unreachable
269+ the entire time. They are removed here rather than left to read as live code.
270+
271+ What replaced them, and why it is not a fallback: the old except-branch
272+ returned ``state[USER_MESSAGE]`` under the key ``synthesized_prompt``, and
273+ flow_trace_converter writes that key to ``current-synthesis.txt`` and reports
274+ "Synthesis: Generated (N chars)". So for three months the trace claimed a
275+ synthesis had been produced while writing out the raw task. Returning empty
276+ lets the consumer's own guard skip the file, which is the honest outcome --
277+ nothing was synthesised, so nothing should be reported as synthesised.
278+
279+ The per-run stderr WARNING is gone with it. It announced a permanent
280+ condition as though it were an incident, on every single run.
263281
264- SYNTHESIS PROCESS:
265- 1. Collect data from all levels
266- 2. Call PromptGenerator.synthesize_with_flow_data()
267- 3. Create comprehensive prompt
268- 4. Return synthesized prompt for actual work
269- """
270- try :
271- import importlib .util
272- import sys
273- from pathlib import Path
282+ Args:
283+ state: Pipeline state (unused; kept for the node signature).
274284
275- # Import PromptGenerator from prompt-generation-policy.py
276- scripts_path = (
277- Path (__file__ ).parent .parent / "scripts" / "architecture" / "03-execution-system" / "00-prompt-generation"
278- )
279- spec = importlib .util .spec_from_file_location (
280- "prompt_generation_policy" , scripts_path / "prompt-generation-policy.py"
281- )
282- pg_module = importlib .util .module_from_spec (spec )
283- spec .loader .exec_module (pg_module )
284-
285- generator = pg_module .PromptGenerator ()
286-
287- # Prepare flow data for synthesis - use ACTUAL pipeline results
288- # Collect validated tasks for TodoList
289- validated_tasks = state .get (StepKeys .TASKS_VALIDATED , [])
290- raw_tasks = state .get (StepKeys .TASKS , {}).get ("tasks" , [])
291- all_tasks = validated_tasks if validated_tasks else raw_tasks
292-
293- # Collect plan phases
294- plan_exec = state .get (StepKeys .PLAN_EXECUTION , {})
295- plan_phases = plan_exec .get ("phases" , []) if isinstance (plan_exec , dict ) else []
296-
297- flow_data = {
298- "level0_preflight" : {
299- "unicode_check" : state .get (StepKeys .UNICODE_CHECK , False ),
300- "encoding_check" : state .get (StepKeys .ENCODING_CHECK , False ),
301- "windows_path_check" : state .get (StepKeys .WINDOWS_PATH_CHECK , False ),
302- },
303- "level1_context_sync" : {
304- "context_percentage" : state .get (StepKeys .CONTEXT_PERCENTAGE , 0 ),
305- "session_chain_loaded" : state .get (StepKeys .SESSION_CHAIN_LOADED , False ),
306- "patterns_detected" : state .get (StepKeys .PATTERNS_DETECTED , []),
307- "project_type" : state .get (StepKeys .DETECTED_FRAMEWORK , "Unknown" ),
308- },
309- "standards" : {
310- "standards_count" : state .get (StepKeys .STANDARDS_COUNT , 0 ),
311- "is_java_project" : state .get (StepKeys .IS_JAVA_PROJECT , False ),
312- "java_standards_loaded" : state .get (StepKeys .JAVA_STANDARDS_LOADED , False ),
313- },
314- "level2_sdlc_pipeline" : {
315- "task_type" : state .get (StepKeys .TASK_TYPE , "General" ),
316- "complexity" : state .get (StepKeys .COMPLEXITY , 5 ),
317- "suggested_model" : state .get (StepKeys .SELECTED_MODEL , "complex_reasoning" ),
318- "plan_mode_suggested" : state .get (StepKeys .PLAN_REQUIRED , False ),
319- "reasoning" : state .get (StepKeys .REASONING , "" ),
320- "tasks" : all_tasks ,
321- "task_count" : len (all_tasks ),
322- "plan_phases" : plan_phases ,
323- "selected_skill" : state .get (StepKeys .SKILL , "" ),
324- "selected_agent" : state .get (StepKeys .AGENT , "" ),
325- "selected_skills" : state .get (StepKeys .SKILLS , []),
326- "selected_agents" : state .get (StepKeys .AGENTS , []),
327- "skill_definition" : state .get (StepKeys .SKILL_DEFINITION , "" ),
328- "agent_definition" : state .get (StepKeys .AGENT_DEFINITION , "" ),
329- },
330- }
331-
332- # SYNTHESIS: Create comprehensive prompt
333- # Priority: user_message > user_message_original > env var CURRENT_USER_MESSAGE
334- import os
335-
336- user_msg = (
337- state .get (StepKeys .USER_MESSAGE )
338- or state .get (StepKeys .USER_MESSAGE_ORIGINAL )
339- or os .environ .get ("CURRENT_USER_MESSAGE" , "" )
340- )
341- synthesis_result = generator .synthesize_with_flow_data (user_msg , flow_data )
342-
343- return {
344- "synthesized_prompt" : synthesis_result .get ("synthesized_prompt" , "" ),
345- "synthesis_metadata" : {
346- "original_message" : synthesis_result .get ("original_message" ),
347- "context_level" : synthesis_result .get ("context_level" ),
348- "data_used" : synthesis_result .get ("data_used" ),
349- },
350- }
351-
352- except Exception as e :
353- import sys
354-
355- print (f"[WARNING] Prompt synthesis failed: { e } " , file = sys .stderr )
356- # Fallback: return original message
357- return {
358- "synthesized_prompt" : state .get (StepKeys .USER_MESSAGE , "" ),
359- "synthesis_metadata" : {"status" : "fallback" },
360- }
285+ Returns:
286+ dict: Empty ``synthesized_prompt`` and metadata naming the cause.
287+ """
288+ return {
289+ "synthesized_prompt" : "" ,
290+ "synthesis_metadata" : {
291+ "status" : "unavailable" ,
292+ "reason" : "prompt-generation-policy.py was removed in 683c23a (2026-05-04)" ,
293+ },
294+ }
361295
362296
363297def output_node (state : FlowState ) -> dict :
0 commit comments