MCPcopy Create free account
hub / github.com/github/gh-aw / findExperimentStatePath

Function findExperimentStatePath

pkg/cli/audit_report_experiments.go:51–62  ·  view source on GitHub ↗

findExperimentStatePath returns the first existing state.json path inside the experiment artifact directory. The file may be flattened to the run root or nested inside the artifact subdirectory.

(logsPath string)

Source from the content-addressed store, hash-verified

49// artifact directory. The file may be flattened to the run root or nested inside the
50// artifact subdirectory.
51func findExperimentStatePath(logsPath string) string {
52 candidates := []string{
53 filepath.Join(logsPath, "state.json"),
54 filepath.Join(logsPath, constants.ExperimentArtifactName, "state.json"),
55 }
56 for _, p := range candidates {
57 if _, err := os.Stat(p); err == nil {
58 return p
59 }
60 }
61 return ""
62}
63
64// extractExperimentData reads state.json from the experiment artifact directory under
65// logsPath and returns a populated ExperimentData or nil when no experiment artifact

Callers 2

extractExperimentDataFunction · 0.85

Calls

no outgoing calls

Tested by 1