Use a stable workspace lock for coordination

This commit is contained in:
2026-12-01 20:13:16 +00:00
parent 8e4627e262
commit 038105ece9
11 changed files with 140 additions and 101 deletions

View File

@@ -32,7 +32,6 @@ type SessionPaths struct {
PreviousManifestPath string
PreviousArtifactsDir string
ManifestPath string
LockPath string
RestoreMarkerPath string
}
@@ -41,6 +40,11 @@ func SessionInvocationProbeDir(paths SessionPaths, runID, application string) st
return filepath.Join(paths.RunsDir, ".preflight", runID, application)
}
// WorkspaceLockPath returns the stable coordination file outside the work tree.
func WorkspaceLockPath(rootDir string) string {
return filepath.Join(rootDir, config.PathLockFile)
}
// SessionWorkDirForCampaign returns the canonical campaign-aware work directory for one session.
func SessionWorkDirForCampaign(rootDir, campaign, sessionID string) string {
return filepath.Join(rootDir, config.PathWorkDirSegment, campaign, sessionID)
@@ -246,7 +250,6 @@ func buildSessionPathsFromRoot(workspaceRoot, campaign, sessionID, root string)
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"),
}
}