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.
This commit is contained in:
sam committed 2026-09-24 20:29:33 +10:00
1 parent 7181e7917d
commit c431834e2b
118 files changed
+2163 -327

No files matched your search

+3 -1
View File
@@ -43,6 +43,8 @@ type Request struct {
WorktreeGrant string `json:"worktree_grant,omitempty"`
// WorkflowDefinition is the exact YAML pinned on Task before dispatch.
WorkflowDefinition string `json:"workflow_definition"`
// Tools is the agent profile's tool allowlist; empty allows every tool.
Tools []string `json:"tools,omitempty"`
}
// Validate rejects a full-task request that cannot be correlated to a real
@@ -54,7 +56,7 @@ func (r Request) Validate() error {
if r.Task.ID <= 0 {
return fmt.Errorf("task ID must be positive, got %d", r.Task.ID)
}
if r.WorktreeGrant == "" {
if r.WorktreeGrant == "" && r.Task.HasRepository() {
return errors.New("worktree grant is required")
}
if r.WorkflowDefinition == "" {
+13
View File
@@ -128,3 +128,16 @@ func TestRequestRoutingBindingsWireKeys(t *testing.T) {
}
}
}
// A task with no repository publishes nothing, so it runs without a
// worktree grant; a repository task still needs one.
func TestRequestValidateGrantFollowsRepository(t *testing.T) {
scratch := Request{Task: &workflow.Task{ID: 1}, WorkflowDefinition: "id: w\n"}
if err := scratch.Validate(); err != nil {
t.Errorf("no-repository request without a grant: %v", err)
}
repo := Request{Task: &workflow.Task{ID: 1, Owner: "acme", Repo: "api"}, WorkflowDefinition: "id: w\n"}
if err := repo.Validate(); err == nil {
t.Error("repository request without a grant was accepted")
}
}