2121}
2222from app .core .exceptions import CorkedError , EmptyCellarError
2323from app .database .repositories .evaluation import EvaluationRepository
24+ from app .graph .graph_factory import EvaluationMode
2425from app .models .graph import (
2526 ReactFlowGraph ,
2627 TraceEvent ,
2728 ModeResponse ,
28- EvaluationMode ,
2929 Graph3DPayload ,
3030)
3131from app .services .graph_builder import (
32- build_six_hats_topology ,
32+ build_six_sommeliers_topology ,
3333 build_full_techniques_topology ,
3434)
3535from app .services .graph_builder_3d import build_3d_graph
@@ -66,11 +66,11 @@ def _check_ownership(evaluation: dict[str, Any], user, evaluation_id: str) -> No
6666 # Allow access to public demo evaluations without auth
6767 if evaluation_id in PUBLIC_DEMO_EVALUATIONS :
6868 return
69-
69+
7070 # Require auth for non-public evaluations
7171 if user is None :
7272 raise CorkedError ("Authentication required to view this evaluation" )
73-
73+
7474 if evaluation .get ("user_id" ) != user .id :
7575 raise CorkedError (
7676 "Access denied: evaluation belongs to another user" , status_code = 403
@@ -84,14 +84,16 @@ def _determine_mode(evaluation: dict[str, Any]) -> EvaluationMode:
8484 evaluation: The evaluation document.
8585
8686 Returns:
87- EvaluationMode (six_hats or full_techniques).
87+ EvaluationMode (six_sommeliers, grand_tasting, or full_techniques).
8888 """
89- # Check for explicit mode in evaluation data
90- mode = evaluation .get ("mode" )
89+ # Check for explicit evaluation_mode first, then fall back to mode
90+ mode = evaluation .get ("evaluation_mode" ) or evaluation . get ( " mode" )
9191 if mode == EvaluationMode .FULL_TECHNIQUES .value :
9292 return EvaluationMode .FULL_TECHNIQUES
93- # Default to six_hats mode
94- return EvaluationMode .SIX_HATS
93+ if mode == EvaluationMode .GRAND_TASTING .value :
94+ return EvaluationMode .GRAND_TASTING
95+ # Default to six_sommeliers mode
96+ return EvaluationMode .SIX_SOMMELIERS
9597
9698
9799@router .get ("/{evaluation_id}/graph" , response_model = ReactFlowGraph )
@@ -132,8 +134,8 @@ async def get_graph(
132134
133135 if mode == EvaluationMode .FULL_TECHNIQUES :
134136 graph = build_full_techniques_topology ()
135- else :
136- graph = build_six_hats_topology ()
137+ else : # SIX_SOMMELIERS, GRAND_TASTING
138+ graph = build_six_sommeliers_topology ()
137139
138140 logger .info (f"[Graph] Returning { mode .value } graph for { evaluation_id } " )
139141 return graph
@@ -159,8 +161,8 @@ async def get_graph_structure(
159161 mode = _determine_mode (evaluation )
160162 if mode == EvaluationMode .FULL_TECHNIQUES :
161163 graph = build_full_techniques_topology ()
162- else :
163- graph = build_six_hats_topology ()
164+ else : # SIX_SOMMELIERS, GRAND_TASTING
165+ graph = build_six_sommeliers_topology ()
164166
165167 return graph
166168
@@ -185,8 +187,8 @@ async def get_graph_execution(
185187 mode = _determine_mode (evaluation )
186188 if mode == EvaluationMode .FULL_TECHNIQUES :
187189 graph = build_full_techniques_topology ()
188- else :
189- graph = build_six_hats_topology ()
190+ else : # SIX_SOMMELIERS, GRAND_TASTING
191+ graph = build_six_sommeliers_topology ()
190192
191193 methodology_trace = evaluation .get ("methodology_trace" , [])
192194 if methodology_trace :
@@ -268,7 +270,7 @@ async def get_mode(
268270) -> ModeResponse :
269271 """Get current evaluation mode.
270272
271- Returns the evaluation mode (six_hats or full_techniques)
273+ Returns the evaluation mode (six_sommeliers, grand_tasting, or full_techniques)
272274 for the specified evaluation.
273275
274276 Public demo evaluations can be accessed without authentication.
0 commit comments