def build_prompt_for_actions(start_statement, timeline, constraints, role):
    prompt = f"""
You are an expert {role} advisor in a software project.

Given the starting decision statement:
"""{start_statement}"""

And the following timeline of relevant prior decisions (summarized):

{chr(10).join(['- ' + t['statement'] for t in timeline])}

Current known constraints and policies:

{chr(10).join(['- ' + c for c in constraints])}

Provide a **structured** list of next recommended actions, including:

- Type (e.g. experiment, research, escalate)
- Description
- Assignee (role or team)
- Confidence (0.0 - 1.0)

Respond ONLY in JSON format as a list of objects with those fields. Do not include any additional commentary.

Example:
[
  {{"type": "experiment", "desc": "Run compatibility test with lib X", "assignee": "engineers", "confidence": 0.75}},
  {{"type": "escalate", "desc": "Review licensing risk", "assignee": "legal", "confidence": 0.9}}
]

Begin now.
"""
    return prompt


def llm_call(model_name: str, prompt: str, max_tokens=400) -> list:
    # Wrap your favorite LLM call here, e.g. OpenAI, Ollama, Claude
    # Return parsed JSON list or empty list on failure

    raw_response = call_llm_api(model_name, prompt, max_tokens=max_tokens)

    try:
        parsed = json.loads(raw_response)
        return parsed
    except Exception:
        # Log parse failure, return empty
        return []
