Report recorded decision evidence and harden the Pi artifacts env

Refinements on top of the human decision stage (a6aff47):

- `pipelines decide` now reports the feedback the server actually stored for
  the chosen option, so a repeated (idempotent) decision shows the recorded
  evidence instead of the ignored request text. A repeated decision is covered
  by a new assertion that also checks the step output does not change.
- The decision option/feedback output keys are defined once in protocol
  (DecisionOptionKey/DecisionFeedbackKey) with a DecisionEvidence reader, and
  the store and CLI use them instead of bare string literals.
- piEnvironment drops any inherited PIPELINES_ARTIFACTS_DIR before spawning Pi,
  so the artifactsDir argument is authoritative and an ambient directory (for
  example Pipelines' own when a stage runs inside another stage) never leaks
  into a child that was given none. Covered by a test with an ambient value set.
This commit is contained in:
2026-10-16 17:25:48 +01:00
parent a6aff47117
commit 98bbc2deac
6 changed files with 63 additions and 4 deletions
+1 -1
View File
@@ -689,7 +689,7 @@ JOIN pipeline_versions v ON v.pipeline_id=r.pipeline_id AND v.version=r.version
// stays in the output only - never the step diagnostic - so a deliberate,
// successful decision is not presented as a stop or error; the derived
// verdict reads the feedback as the step's reason.
output := map[string]any{"option": option, "feedback": feedback}
output := map[string]any{protocol.DecisionOptionKey: option, protocol.DecisionFeedbackKey: feedback}
encoded, err := json.Marshal(output)
if err != nil {
return protocol.RunStep{}, false, err