build(workflow): command.run step type runs operator argv in the task container #1594

Closed
opened 2026-10-27 13:41:01 +00:00 by sam · 0 comments
Owner

Build bead for the accepted decision in archie-core-ndm8 (closed 2026-10-02). Decision: stored control-plane settings already drive argv execution (repository-policies Gate/Preflight via agentexec; tool-settings mcp stdio Command/Args), so a command step adds no new trust tier. Build it as a registered workflow step type reusing the repo.gate execution path, non-zero exit parks the run, level: warn makes it advisory.

RECON ALREADY DONE (resolves the decision's open item): the workflow engine has exactly one call site, internal/app/agentworker/task_execution.go:353 workflow.Run(ctx, wf, tc), and agentworker is what cmd/archie-agent runs. So the engine only ever executes inside the task container; the daemon never runs a stage. A step that execs argv in tc.Dir is therefore on the container path by construction, and the StageRepoStages error message ('migrate repository behavior to database-backed YAML workflow steps') finally names a target that exists. The repo.gate execution semantics to mirror are exec.CommandContext with output clipping (internal/agentexec/harness_runner.go:303).

Scope: the step type + settings schema (run list mirroring agentexec.Command{Name,Argv,ExpectFailure} plus level), park-on-non-zero with the advisory carve-out, registration through internal/infrastructure/workflowsteps so the State Store validating side and the agent executing side resolve it, the docs/prds/workflow-step-vocabulary.md entry (authority for the vocabulary), regenerated docs artifact, and red-first tests for: argv runs in the worktree, non-zero parks, level:warn does not park, expect_failure inverts, and the step is refused when settings are malformed.

Close reason

Shipped in 1ba38ac3. command.run is registered by a new 'command' provider contributing exactly one step type (the shape docs/prds/workflow-step-vocabulary.md prescribes); settings mirror the gate's command shape (name/argv/expect_failure) with level: warn advisory; a non-zero exit parks via Outcome (StatusParked) rather than failing the attempt; the run stops at the first failure. The settings type is local because agentexec.Command carries JSON tags only and YAML decoding silently dropped expect_failure — the reflection test TestCommandRunCarriesEveryGateCommandField holds the shapes together. Recon resolved the decision's open item: workflow.Run has exactly one call site (internal/app/agentworker/task_execution.go:353) and agentworker is what cmd/archie-agent serves, so argv runs in the task container and the daemon never executes a stage. The StageRepoStages refusal now names command.run as its migration target. Red/green + mutation-checked (dropping ExpectFailure fails both inversion subtests); the outcome-site ledger test forced the StatusParked adjudication. task check clean.


Imported from beads archie-core-trgm · GitHub #1418 · type feature · priority P1 · created 2026-10-02 · closed 2026-10-02

Build bead for the accepted decision in archie-core-ndm8 (closed 2026-10-02). Decision: stored control-plane settings already drive argv execution (repository-policies Gate/Preflight via agentexec; tool-settings mcp stdio Command/Args), so a command step adds no new trust tier. Build it as a registered workflow step type reusing the repo.gate execution path, non-zero exit parks the run, level: warn makes it advisory. RECON ALREADY DONE (resolves the decision's open item): the workflow engine has exactly one call site, internal/app/agentworker/task_execution.go:353 workflow.Run(ctx, wf, tc), and agentworker is what cmd/archie-agent runs. So the engine only ever executes inside the task container; the daemon never runs a stage. A step that execs argv in tc.Dir is therefore on the container path by construction, and the StageRepoStages error message ('migrate repository behavior to database-backed YAML workflow steps') finally names a target that exists. The repo.gate execution semantics to mirror are exec.CommandContext with output clipping (internal/agentexec/harness_runner.go:303). Scope: the step type + settings schema (run list mirroring agentexec.Command{Name,Argv,ExpectFailure} plus level), park-on-non-zero with the advisory carve-out, registration through internal/infrastructure/workflowsteps so the State Store validating side and the agent executing side resolve it, the docs/prds/workflow-step-vocabulary.md entry (authority for the vocabulary), regenerated docs artifact, and red-first tests for: argv runs in the worktree, non-zero parks, level:warn does not park, expect_failure inverts, and the step is refused when settings are malformed. ### Close reason Shipped in 1ba38ac3. command.run is registered by a new 'command' provider contributing exactly one step type (the shape docs/prds/workflow-step-vocabulary.md prescribes); settings mirror the gate's command shape (name/argv/expect_failure) with level: warn advisory; a non-zero exit parks via Outcome (StatusParked) rather than failing the attempt; the run stops at the first failure. The settings type is local because agentexec.Command carries JSON tags only and YAML decoding silently dropped expect_failure — the reflection test TestCommandRunCarriesEveryGateCommandField holds the shapes together. Recon resolved the decision's open item: workflow.Run has exactly one call site (internal/app/agentworker/task_execution.go:353) and agentworker is what cmd/archie-agent serves, so argv runs in the task container and the daemon never executes a stage. The StageRepoStages refusal now names command.run as its migration target. Red/green + mutation-checked (dropping ExpectFailure fails both inversion subtests); the outcome-site ledger test forced the StatusParked adjudication. task check clean. --- _Imported from beads `archie-core-trgm` · GitHub #1418 · type feature · priority P1 · created 2026-10-02 · closed 2026-10-02_
sam added the highfeature labels 2026-10-27 13:41:01 +00:00
sam self-assigned this 2026-10-27 13:41:01 +00:00
sam closed this issue 2026-10-27 13:41:01 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1594