Add artifact workdir layout and locking
This commit is contained in:
@@ -2,7 +2,40 @@ package artifacts
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
// SessionPaths contains canonical local paths for one session work directory.
|
||||
type SessionPaths struct {
|
||||
Root string
|
||||
InputsDir string
|
||||
AudioDir string
|
||||
TranscriptsDir string
|
||||
TranscriptsRawDir string
|
||||
TranscriptsNormalizedDir string
|
||||
ArtifactsDir string
|
||||
ConfigDir string
|
||||
LogsDir string
|
||||
ManifestPath string
|
||||
LockPath string
|
||||
}
|
||||
|
||||
// SessionWorkDir returns the work directory for one session.
|
||||
func SessionWorkDir(rootDir, sessionID string) string {
|
||||
return filepath.Join(rootDir, "work", sessionID)
|
||||
}
|
||||
|
||||
func buildSessionPaths(workspaceRoot, sessionID string) SessionPaths {
|
||||
root := SessionWorkDir(workspaceRoot, sessionID)
|
||||
transcripts := filepath.Join(root, "transcripts")
|
||||
return SessionPaths{
|
||||
Root: root,
|
||||
InputsDir: filepath.Join(root, "inputs"),
|
||||
AudioDir: filepath.Join(root, "audio"),
|
||||
TranscriptsDir: transcripts,
|
||||
TranscriptsRawDir: filepath.Join(transcripts, "raw"),
|
||||
TranscriptsNormalizedDir: filepath.Join(transcripts, "normalized"),
|
||||
ArtifactsDir: filepath.Join(root, "artifacts"),
|
||||
ConfigDir: filepath.Join(root, "config"),
|
||||
LogsDir: filepath.Join(root, "logs"),
|
||||
ManifestPath: filepath.Join(root, "manifest.json"),
|
||||
LockPath: filepath.Join(root, ".lock"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user