feat(workflow): add the command.run step type

archie-core-ndm8 accepted the command-step trust decision, so a stored
workflow definition may run operator argv. The workflow engine has exactly one
call site -- agentworker, which is what the container agent serves -- so the
step runs on the container path by construction. A non-zero exit parks the run;
level: warn makes it advisory.

Settings mirror the repository gate's command shape (name, argv,
expect_failure) so a command means the same thing in both places. The settings
type is local rather than agentexec.Command because that struct carries JSON
wire tags only, and YAML decoding silently dropped expect_failure -- a command
declared to fail would have been reported as passing. A reflection test holds
the two shapes together.
This commit is contained in:
sam committed 2026-10-03 02:07:45 +10:00
1 parent 8f8e732b3a
commit 703692ca7a
7 files changed
+406 -13

No files matched your search

@@ -67,6 +67,27 @@ func (eventSteps) StepTypes() []workflow.StepType {
return []workflow.StepType{workflow.AgentRunStepType(), workflow.WorkflowCallStepType()}
}
// commandSteps is the provider for the command.run step type: the single step
// type the maintainer's command-step trust decision allows
// (archie-core-ndm8), and the migration target that the refusal of
// .archie/stages/*.go now names.
//
// It is a contributor of exactly one step type, which is the shape
// docs/prds/workflow-step-vocabulary.md prescribes for this case -- "a new
// contributor of exactly one step type at a named provider" -- and it is a
// provider of its own rather than part of repoHooks because a command step is
// not a repository hook: repoHooks carries the replacement for .archie/gate.go,
// whose rules the *repository* authored, while this carries the replacement for
// .archie/stages/*.go, whose commands the *operator* authors in the stored
// definition.
type commandSteps struct{}
func (commandSteps) Name() string { return "command" }
func (commandSteps) StepTypes() []workflow.StepType {
return []workflow.StepType{workflow.CommandRunStepType()}
}
// Providers returns the provider set the roots that resolve a workflow step
// type register at their composition root, before the first resolution: it is
// what NewManager registers, and what the roots' guards read to hold a
@@ -82,7 +103,7 @@ func (eventSteps) StepTypes() []workflow.StepType {
// provider_secrets.go). Until one exists for step types, adding a step type
// means adding a provider here.
func Providers() []workflow.StepTypeProvider {
return []workflow.StepTypeProvider{shippedStages{}, repoHooks{}, eventSteps{}}
return []workflow.StepTypeProvider{shippedStages{}, repoHooks{}, eventSteps{}, commandSteps{}}
}
// NewManager builds this process's workflow step-type manager by registering