konveyor / konveyor/agentic-controller

ADR: Tekton-style explicit param wiring for workflow stages (remove ambient workflowParams / $(workflow.*) from AgentRun)

Open
#181 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2
Forks
12
Avg merge
2d 5h
Merged PRs (30d)
41

Description

### Problem

Today (as of #169) workflow→stage parameter passing uses an **ambient model**: the AgentWorkflowRun controller stamps a `workflowParams` bag onto every stage AgentRun's spec, and agent-facing text resolves an ambient `$(workflow.*)` scope in addition to `$(agent.*)`.

This diverges from Tekton and creates an API-hygiene problem raised in review of #169 (comment on `agentrun_types.go:128`): `workflowParams` is a `preserve-unknown-fields` field on the **user-writable** AgentRun spec with no validation, so a standalone run can set arbitrary `workflowParams` and splice `$(workflow.anything)` into the Agent's prompt. (Not a hard escalation — the same user controls `spec.instructions` — but it's a leak of a controller-internal mechanism onto the user surface.)

### How Tekton does it

- `Task` declares `spec.params` (its own inputs); `Pipeline` declares `spec.params`.
- Each `pipelineTask` **explicitly wires** pipeline params into the task's declared params: `params: [{name: pathToContext, value: "$(params.context)"}]`.
- The `TaskRun` carries **only the Task's own declared params** (resolved). There is no ambient "pipeline params" bag on the TaskRun.
- Referenced Tasks (vs inline) must have params passed explicitly.
- Cross-stage data flows through **results** (`$(tasks.taskA.results.foo)`).

### Proposed direction

- `AgentWorkflowStage` gains `params: [{name: , value: "$(workflow.)"}]` (like `pipelineTask.params`).
- The workflow controller resolves the wiring and stamps the result as the stage AgentRun's **own** `spec.params` (agent params). **Remove `workflowParams` from `AgentRun` and the `$(workflow.*)` scope from agent-facing text.**
- `$(workflow.*)` survives only in the **guide**, rendered by the workflow controller (which holds the values) — never delivered to the AgentRun as a scope.
- Sets up **results/outputs** (`$(stages.X.results.Y)`) as the natural home for cross-stage data.

This removes the injection vector at the root (a standalone run then has only agent params, already validated against declarations) and aligns with Tekton's explicit-wiring model.

### Scope / impact
- CRD change (stage `params`), workflow-controller resolution, substitution scopes, and the #87 snapshot.
- Supersedes part of ADR 0009/0018's parameter-delivery model — needs an ADR.

### Related
- #169 (introduces the current ambient mechanism), #87 (snapshot), #180 (agent-definition immunity), ADR 0009, ADR 0018.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with agentrun_types.go:128 and the AgentWorkflowStage and AgentRun CRD definitions, then trace workflow-controller resolution and substitution scopes. Compare the #87 snapshot with #169, #180, ADR 0009, and ADR 0018; done means explicit stage wiring, no workflowParams on AgentRun, no workflow scope in agent text, and an updated ADR and snapshot.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, infrastructure
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.