This read from the yspec object meta data via get_meta.
ys_spec_file(x)
a yspec object
spec <- load_spec_ex()
ys_spec_file(spec)
#> [1] "/private/var/folders/zv/v6tkdhrn1_bb1ndrc0c0j31w0000gp/T/Rtmp7lFAoU/temp_libpath5f2935e7abd0/yspec/spec/spec.yml"