Files
sam d320a1a01a feat(eda): workflow inputs, optional repository and agent profiles
Workflow definitions declare inputs, repository (none, optional or
required; default required) and profile. A binding assigns each input
from a mapped parameter or a constant and may take its repository from a
parameter, which must name a configured repo; both are checked when the
binding is saved and again at dispatch. Inputs travel as structured task
data (tasks.inputs, the task brief, and a JSON block in the agent's
mission), never as body text.

A task with no repository runs in a per-task scratch workspace with no
clone and no publication grant. The agent.run step runs one mission
without a repository and finishes the task in the new completed status.

Agent profiles live under [containers.profiles.<name>]: an image and an
allowlist over the tools archie adds (MCP, scripts, plugins).
[containers].image is the default profile; an unconfigured profile parks
the task. The workflow is now pinned before the container starts so the
profile can choose its image.

Also stop two archied tests writing embedded NATS state into the package
directory, refuse an empty state_dir for embedded NATS, and drop the NATS
store files an earlier lane commit tracked.
2026-09-24 20:29:33 +10:00

33 lines
968 B
Go

package worktree
import (
"fmt"
"os"
"path/filepath"
)
// ScratchDir is the workspace of a task that works on no repository. It sits
// beside the worktrees but outside their owner/repo tree, so no worktree path
// can name it.
func (m *Manager) ScratchDir(taskID int64) string {
return filepath.Join(m.WorkDir, "scratch", fmt.Sprintf("task-%d", taskID))
}
// PrepareScratch creates an empty scratch workspace for a task, discarding
// whatever an earlier attempt left there.
func (m *Manager) PrepareScratch(taskID int64) (string, error) {
dir := m.ScratchDir(taskID)
if err := os.RemoveAll(dir); err != nil {
return "", fmt.Errorf("reset scratch workspace: %w", err)
}
if err := os.MkdirAll(dir, 0o755); err != nil {
return "", fmt.Errorf("create scratch workspace: %w", err)
}
return dir, nil
}
// RemoveScratch deletes a task's scratch workspace.
func (m *Manager) RemoveScratch(taskID int64) error {
return os.RemoveAll(m.ScratchDir(taskID))
}