vibe.workbench.headless_engine

Headless Interview Engine.

Provides a stateless interview engine for the workbench that can process interview sessions without Flask session state or web UI dependencies.

run_interview_turn

run_interview_turn(config: dict[str, Any], session_state: dict[str, Any], form_data: dict[str, Any] | None = None) -> dict[str, Any]

Run a single turn of the interview engine without Flask session state.

This is the headless version of the interview logic, designed for use in test mode and other stateless contexts.

Parameters:
  • config (dict[str, Any]) –

    Template configuration dictionary

  • session_state (dict[str, Any]) –

    Current session state as a dictionary

  • form_data (dict[str, Any] | None, default: None ) –

    Optional form data to process (user answers)

Returns:
  • dict[str, Any]

    Dictionary containing:

  • dict[str, Any]
    • "relevant_questions": List of question IDs that should be shown
  • dict[str, Any]
    • "all_questions": Complete question definitions
  • dict[str, Any]
    • "validation_errors": Any validation errors
  • dict[str, Any]
    • "session_state": Updated session state
  • dict[str, Any]
    • "completion_status": "incomplete", "preview", or "complete"
  • dict[str, Any]
    • "rendered_result": Rendered result content (if complete/preview)
  • dict[str, Any]
    • "error": Error message if something went wrong

render_questions_for_test_mode

render_questions_for_test_mode(relevant_questions: list[str], all_questions: dict[str, Any], session_state: dict[str, Any]) -> str

Render questions as HTML for test mode display.

Parameters:
  • relevant_questions (list[str]) –

    List of question IDs that should be shown

  • all_questions (dict[str, Any]) –

    Complete question definitions

  • session_state (dict[str, Any]) –

    Current session state

Returns:
  • str

    HTML string containing the rendered questions