Define canonical session workspace paths
This commit is contained in:
@@ -14,28 +14,27 @@ const sha256HexLength = 64
|
||||
|
||||
// SessionPaths contains canonical local paths for one session work directory.
|
||||
type SessionPaths struct {
|
||||
WorkspaceRoot string
|
||||
CampaignID string
|
||||
SessionID string
|
||||
Root string
|
||||
InputsDir string
|
||||
AudioDir string
|
||||
TranscriptsDir string
|
||||
TranscriptsRawDir string
|
||||
TranscriptsTrimmedDir string
|
||||
ArtifactsDir string
|
||||
ReportsDir string
|
||||
ConfigDir string
|
||||
LogsDir string
|
||||
CurrentDir string
|
||||
RunsDir string
|
||||
PreviousDir string
|
||||
CacheDir string
|
||||
PreviousManifestPath string
|
||||
PreviousArtifactsDir string
|
||||
ManifestPath string
|
||||
LockPath string
|
||||
RestoreMarkerPath string
|
||||
WorkspaceRoot string
|
||||
CampaignID string
|
||||
SessionID string
|
||||
Root string
|
||||
InputsDir string
|
||||
AudioDir string
|
||||
TranscriptsDir string
|
||||
TranscriptsRawDir string
|
||||
ArtifactsDir string
|
||||
ReportsDir string
|
||||
ConfigDir string
|
||||
LogsDir string
|
||||
DebugDir string
|
||||
ReferencesDir string
|
||||
RunsDir string
|
||||
PreviousDir string
|
||||
PreviousManifestPath string
|
||||
PreviousArtifactsDir string
|
||||
ManifestPath string
|
||||
LockPath string
|
||||
RestoreMarkerPath string
|
||||
}
|
||||
|
||||
// SessionValidationPolishDir identifies the temporary destination-probe namespace.
|
||||
@@ -66,7 +65,7 @@ func SessionRunsDirForCampaign(rootDir, campaign, sessionID string) string {
|
||||
|
||||
// SessionPreviousDirForCampaign returns the canonical previous-session state directory.
|
||||
func SessionPreviousDirForCampaign(rootDir, campaign, sessionID string) string {
|
||||
return filepath.Join(SessionWorkDirForCampaign(rootDir, campaign, sessionID), config.PathPreviousDirSegment)
|
||||
return filepath.Join(SessionWorkDirForCampaign(rootDir, campaign, sessionID), config.PathInputsDirSegment, config.PathPreviousDirSegment)
|
||||
}
|
||||
|
||||
// SessionPreviousManifestPathForCampaign returns the canonical previous-session manifest cache path.
|
||||
@@ -101,6 +100,24 @@ func SessionRunStageDirForCampaign(rootDir, campaign, sessionID, runID, stageNam
|
||||
return filepath.Join(SessionRunRootForCampaign(rootDir, campaign, sessionID, runID), stageName)
|
||||
}
|
||||
|
||||
// SessionRunLogsDir and SessionRunDebugDir locate diagnostics for an attempt.
|
||||
func SessionRunLogsDir(paths SessionPaths, runID, stageName string) string {
|
||||
return filepath.Join(paths.RunsDir, runID, stageName, "logs")
|
||||
}
|
||||
|
||||
func SessionRunDebugDir(paths SessionPaths, runID, stageName string) string {
|
||||
return filepath.Join(paths.RunsDir, runID, stageName, "debug")
|
||||
}
|
||||
|
||||
// SessionLatestLogsPath and SessionLatestDebugPath locate managed navigation views.
|
||||
func SessionLatestLogsPath(paths SessionPaths, stageName string) string {
|
||||
return filepath.Join(paths.LogsDir, stageName)
|
||||
}
|
||||
|
||||
func SessionLatestDebugPath(paths SessionPaths, stageName string) string {
|
||||
return filepath.Join(paths.DebugDir, stageName)
|
||||
}
|
||||
|
||||
// SessionRunExtractDirForCampaign returns the invocation-local extraction directory.
|
||||
func SessionRunExtractDirForCampaign(rootDir, campaign, sessionID, runID string) string {
|
||||
return SessionRunStageDirForCampaign(rootDir, campaign, sessionID, runID, "extract")
|
||||
@@ -124,7 +141,7 @@ func SessionRunNotariusOutputRootForCampaign(rootDir, campaign, sessionID, runID
|
||||
// SessionNotariusReferenceCacheDir returns the stable cache root for verified
|
||||
// reference snapshots supplied to Notarius.
|
||||
func SessionNotariusReferenceCacheDir(paths SessionPaths) string {
|
||||
return filepath.Join(paths.CacheDir, "notarius", "references")
|
||||
return paths.ReferencesDir
|
||||
}
|
||||
|
||||
// SessionNotariusReferenceSnapshotPath returns the content-addressed path for
|
||||
@@ -280,27 +297,26 @@ func buildSessionPaths(workspaceRoot, campaign, sessionID string) SessionPaths {
|
||||
|
||||
func buildSessionPathsFromRoot(workspaceRoot, campaign, sessionID, root string) SessionPaths {
|
||||
return SessionPaths{
|
||||
WorkspaceRoot: workspaceRoot,
|
||||
CampaignID: campaign,
|
||||
SessionID: sessionID,
|
||||
Root: root,
|
||||
InputsDir: filepath.Join(root, config.PathInputsDirSegment),
|
||||
AudioDir: filepath.Join(root, config.PathAudioDirSegment),
|
||||
TranscriptsDir: filepath.Join(root, config.PathTranscriptsSegment),
|
||||
TranscriptsRawDir: filepath.Join(root, filepath.FromSlash(config.PathTranscriptsRaw)),
|
||||
TranscriptsTrimmedDir: filepath.Join(root, filepath.FromSlash(config.PathTranscriptsTrimmed)),
|
||||
ArtifactsDir: filepath.Join(root, config.PathArtifactsDirSegment),
|
||||
ReportsDir: filepath.Join(root, config.PathReportsDirSegment),
|
||||
ConfigDir: filepath.Join(root, config.PathConfigDirSegment),
|
||||
LogsDir: filepath.Join(root, config.PathLogsDirSegment),
|
||||
CurrentDir: filepath.Join(root, config.PathCurrentDirSegment),
|
||||
RunsDir: filepath.Join(root, config.PathRunsDirSegment),
|
||||
PreviousDir: filepath.Join(root, config.PathPreviousDirSegment),
|
||||
CacheDir: filepath.Join(root, config.PathCacheDirSegment),
|
||||
PreviousManifestPath: filepath.Join(root, config.PathPreviousDirSegment, config.PathManifestFile),
|
||||
PreviousArtifactsDir: filepath.Join(root, config.PathPreviousDirSegment, config.PathArtifactsDirSegment),
|
||||
ManifestPath: filepath.Join(root, config.PathManifestFile),
|
||||
LockPath: filepath.Join(root, config.PathLockFile),
|
||||
RestoreMarkerPath: filepath.Join(root, ".restore-incomplete.json"),
|
||||
WorkspaceRoot: workspaceRoot,
|
||||
CampaignID: campaign,
|
||||
SessionID: sessionID,
|
||||
Root: root,
|
||||
InputsDir: filepath.Join(root, config.PathInputsDirSegment),
|
||||
AudioDir: filepath.Join(root, config.PathAudioDirSegment),
|
||||
TranscriptsDir: filepath.Join(root, config.PathTranscriptsSegment),
|
||||
TranscriptsRawDir: filepath.Join(root, filepath.FromSlash(config.PathTranscriptsRaw)),
|
||||
ArtifactsDir: filepath.Join(root, config.PathArtifactsDirSegment),
|
||||
ReportsDir: filepath.Join(root, config.PathReportsDirSegment),
|
||||
ConfigDir: filepath.Join(root, config.PathConfigDirSegment),
|
||||
LogsDir: filepath.Join(root, config.PathLogsDirSegment),
|
||||
DebugDir: filepath.Join(root, "debug"),
|
||||
ReferencesDir: filepath.Join(root, config.PathInputsDirSegment, "references"),
|
||||
RunsDir: filepath.Join(root, config.PathRunsDirSegment),
|
||||
PreviousDir: filepath.Join(root, config.PathInputsDirSegment, config.PathPreviousDirSegment),
|
||||
PreviousManifestPath: filepath.Join(root, config.PathInputsDirSegment, config.PathPreviousDirSegment, config.PathManifestFile),
|
||||
PreviousArtifactsDir: filepath.Join(root, config.PathInputsDirSegment, config.PathPreviousDirSegment, config.PathArtifactsDirSegment),
|
||||
ManifestPath: filepath.Join(root, config.PathManifestFile),
|
||||
LockPath: filepath.Join(root, config.PathLockFile),
|
||||
RestoreMarkerPath: filepath.Join(root, ".restore-incomplete.json"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user