Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV

### Added

- `v1alpha4`, the next draft (decision D23): `v1alpha3` plus conditional steps (`when`, spec section 3.12, AEP-0001 accepted) and workflow steps (`type: workflow`, section 5.6.6, new AEP-0028 accepted), both by lead decision without the external review of D16. `v1alpha3` stays the current draft; the README, the Quickstart and the tool defaults are unchanged. New: `schema/awp.v1alpha4.json`, the conformance suite `conformance/v1alpha4/` (the `v1alpha3` cases plus cases for conditions and workflow steps), `conformance/conditions.mjs` (parser, limits and static rules of conditions), `migrate` from `v1alpha1`, `v1alpha2` and `v1alpha3` to `v1alpha4`, `spec/v1alpha4/` (text, glossary, examples including `cve-risk-then-fix.yaml`), and the CRDs in `schema/crd/` serve `v1alpha3` (storage version) and `v1alpha4`. The website lists `v1alpha4` as the next draft; `docs/aep-process.md` and `GOVERNANCE.md` name D19, D22 and D23 as the only exceptions to the external review.
- Website: informative pages for the `v1alpha3` draft, taken over from the explainer site `awp-v1alpha2-draft` and rewritten against main: "v1alpha3: how it fits together" (the kinds and who writes and reads them, the lifecycle from manifest to finished run with spec references, a worked example, profiles, checklists for authors and runtime implementers, the Draft AEPs on top), "Migrating to v1alpha3" (before and after examples, what `awp-check.mjs migrate` does and what it cannot do) and "Packaging manifests with Helm" (escaping AWP expressions, what the digest covers, image tags, CRDs in charts). Proposals of the former pull request #23, the gap classification and the example chart were not taken over.
- Website: `npm run check:examples` runs every YAML example marked with an `awp-check` comment through the reference checker (valid, or rejected with an expected code); part of `npm test` and the pages workflow.
- AEP-0026 (interactive execution: kind `AgentSession`, `sessions` opt-in with `maxAutonomy`, three autonomy levels) and AEP-0027 (agent engine: `agents[].engine`, repository configuration off by default) as Draft concepts with open questions; numbers to be confirmed. From runtime feedback G62, G63, G65, G73, G81, G82.
Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ that no single organization holds a majority of maintainers once the specificati
([decision log](docs/decisions.md)). An AEP is never accepted by its author or by the
project lead alone: it needs a reviewer who is not an author and, while all maintainers belong to
one organisation, an external one ([aep-process 5.1](docs/aep-process.md#51-review-before-acceptance)).
The only exceptions are the recorded lead decisions D19 (AEP-0022) and D22 (AEPs 0015 to 0020),
each limited to the AEPs it names.
The only exceptions are the recorded lead decisions D19 (AEP-0022), D22 (AEPs 0015 to 0020) and
D23 (AEPs 0001 and 0028), each limited to the AEPs it names.
- If consensus cannot be reached, the maintainers decide by simple majority; the project lead
breaks ties.

Expand Down
71 changes: 46 additions & 25 deletions aep/0001-conditional-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
| **AEP** | 0001 |
| **Title** | Conditional steps (`when`) with a restricted expression language |
| **Authors** | AI agent on behalf of @agenticworkflowprotocol |
| **Shepherd** | Project lead (proposed; not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) |
| **Shepherd** | Project lead (D23) |
| **Type** | Specification |
| **Status** | Review (proposed for `v1alpha3`; not accepted) |
| **Reviewer roles needed** | runtime implementer, language or schema reviewer, security reviewer. None identified yet; an external review is required before `Accepted` ([aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)). |
| **Owner decisions** | [D5](../docs/decisions.md#d5-when-uses-a-restricted-expression-grammar-not-cel), [D6](../docs/decisions.md#d6-executions-may-succeed-with-condition-skips) (2026-10-10) |
| **Target API version** | `v1alpha3` (`v1alpha2` until [D22](../docs/decisions.md#d22-v1alpha3-becomes-the-current-draft)) |
| **Status** | Accepted for `v1alpha4` (lead decision [D23](../docs/decisions.md#d23-conditional-steps-and-workflow-steps-start-v1alpha4), without the external review of D16) |
| **Reviewer roles needed** | runtime implementer, language or schema reviewer, security reviewer (still welcome; see Decision) |
| **Reviewers** | none yet |
| **Owner decisions** | [D5](../docs/decisions.md#d5-when-uses-a-restricted-expression-grammar-not-cel), [D6](../docs/decisions.md#d6-executions-may-succeed-with-condition-skips) (2026-10-10), [D23](../docs/decisions.md#d23-conditional-steps-and-workflow-steps-start-v1alpha4) (2026-11-27) |
| **Target API version** | `v1alpha4` (`v1alpha2` until [D22](../docs/decisions.md#d22-v1alpha3-becomes-the-current-draft), `v1alpha3` until D23); written into the `v1alpha4` draft as section 3.12 |
| **Profiles affected** | `core` (step semantics), `audit` (new event type) |
| **Created** | 2026-10-09 |
| **Discussion** | issue to be opened |
Expand All @@ -20,8 +21,8 @@
## Summary

Add an optional `when` field to workflow steps. `when` is a boolean condition in a small, typed,
side-effect-free expression language over workflow inputs, declared step outputs, the triggering
event (AEP-0004) and the execution environment. A step whose condition is false is **skipped by
side-effect-free expression language over workflow inputs, declared step outputs and the execution
environment. A step whose condition is false is **skipped by
condition**; this does not fail the execution. Evaluation errors fail the step, they are never
treated as `false`.

Expand All @@ -47,13 +48,19 @@ the author wanted skipped.

## Specification

> As accepted into `v1alpha4` (D23). Differences from the text proposed for `v1alpha2`: the
> section is 3.12, because 3.10 and 3.11 are taken in `v1alpha3`; there is no `event` root,
> because AEP-0004 is not accepted; and step outputs, which are text since `v1alpha3` (spec 5.6.4),
> are read as JSON in conditions. The normative text is
> [spec/v1alpha4 section 3.12](../spec/v1alpha4/README.md#312-conditions).

### Changes to section 5.6.1 (common step fields)

| Field | Type | Req. | Description |
| ----- | ---- | ---- | ----------- |
| `when` | string | no | Condition expression (section 3.10). The step runs only if it evaluates to `true`. |
| `when` | string | no | Condition expression (section 3.12). The step runs only if it evaluates to `true`. |

### New section 3.10: Conditions
### New section 3.12: Conditions

A condition is a string in the following grammar. It is written without `${{ }}`; the whole field
is the expression.
Expand All @@ -68,13 +75,15 @@ operand := literal | path | list | "exists" "(" path ")" | "(" expr ")"
path := root ( "." name | "[" index "]" )*
root := "inputs" "." name
| "steps" "." step-id "." "outputs" "." name
| "event" ; AEP-0004
| "execution" "." ( "environment" )
| "execution" "." "environment"
list := "[" ( literal ( "," literal )* )? "]"
literal := string | number | "true" | "false" | "null"
```

- Strings use double quotes with JSON escapes. Numbers use the JSON number syntax.
- A step output is text (spec 5.6.4). In a condition it is read as JSON if it parses as a JSON
value, otherwise as a string: the output text `true` is the boolean `true`, `high` is the string
`"high"`. Path segments after the output name select into the parsed value.
- Typing is strict: no truthiness and no coercion. `==` and `!=` compare two scalars of any type
(different types are unequal); `<`, `<=`, `>`, `>=` need two numbers or two strings (code point
order); `&&`, `||`, `!` need booleans; `in` tests whether a scalar is an element of a list
Expand Down Expand Up @@ -124,15 +133,15 @@ Under `payload: metadata` (section 10.2) the event MUST NOT contain the values t
## Examples

```yaml
apiVersion: awp.agenticworkflowprotocol.org/v1alpha2
apiVersion: awp.agenticworkflowprotocol.org/v1alpha4
kind: Workflow
metadata:
name: ticket-triage
spec:
version: 0.1.0
owner:
team: example-team
classification: internal
spec:
inputs:
- name: ticket
type: string
Expand All @@ -142,8 +151,6 @@ spec:
model: { provider: example-provider, name: example-model }
- id: writer
model: { provider: example-provider, name: example-model }
tools:
- { type: mcp, server: tickets, tools: [add_comment] }
workflow:
- id: analysis
agent: analyst
Expand All @@ -160,25 +167,30 @@ spec:
## Schema changes

- `Step.properties.when`: `{ "type": "string", "minLength": 1, "maxLength": 512 }`.
- Semantic rules: `when.syntax`, `when.limits`, `when.unknown-step`, `when.not-a-dependency`,
`when.undeclared-output`, warning `when.undeclared-input`.
- Semantic rules: `when.syntax`, `when.limit-exceeded`, `when.forbidden-segment`,
`when.unknown-root`, `when.unknown-step`, `when.not-a-dependency`, `when.undeclared-output`,
warning `when.undeclared-input` (as implemented in `conformance/conditions.mjs`).

## Conformance impact

- `core`: static rules above; runtime: readiness, skip reasons, success rule, evaluation errors.
- `audit`: `step.skipped`.
- New cases: `valid/5.6.1-step-when.yaml`; `invalid/3.10-when-syntax.yaml` (`when.syntax`),
`invalid/3.10-when-too-long.yaml` (`schema.maxLength`), `invalid/3.10-when-proto-segment.yaml`
(`when.syntax`), `invalid/3.10-when-step-not-dependency.yaml` (`when.not-a-dependency`),
`invalid/3.10-when-undeclared-output.yaml` (`when.undeclared-output`). Runtime tests once a
- Cases in `conformance/v1alpha4/`: `valid/5.6.1-when-on-every-step-type.yaml`,
`valid/5.6.1-when-exists-and-in.yaml`, `valid/5.6.1-when-json-path-into-output.yaml`;
`invalid/3.12-when-syntax.yaml` (`when.syntax`), `invalid/3.12-when-too-long.yaml`
(`schema.maxLength`), `invalid/3.12-when-forbidden-segment.yaml` (`when.forbidden-segment`),
`invalid/3.12-when-unknown-root.yaml` (`when.unknown-root`),
`invalid/3.12-when-not-dependency.yaml` (`when.not-a-dependency`),
`invalid/3.12-when-undeclared-output.yaml` (`when.undeclared-output`). Runtime tests once a
runtime suite exists: false condition skips and execution succeeds; evaluation error fails; output
of skipped step inside `exists()`.

## Compatibility and migration

Additive for manifests: `v1alpha1` manifests have no `when`. The success rule changes only for
manifests that use `when`. A `v1alpha1` runtime rejects `when` as an unknown field (fail closed),
which is the intended behaviour.
Additive for manifests: manifests of older versions have no `when`, and `migrate` converts them
to `v1alpha4` unchanged apart from `apiVersion`. The success rule changes only for manifests that
use `when`. A runtime of an older version rejects `when` as an unknown field (fail closed), which
is the intended behaviour.

## Security considerations

Expand Down Expand Up @@ -224,10 +236,19 @@ No implementation of this AEP exists.

## Decision

2026-11-27 ([D23](../docs/decisions.md#d23-conditional-steps-and-workflow-steps-start-v1alpha4)):
accepted for `v1alpha4` by the project lead, in the form written into the
`v1alpha4` draft (section 3.12 and the changes to 5.6.1, 5.6.3 and 10.4). The external review that
D16 requires was not held; reviews in the roles above are still invited, and their findings are
handled as errata of the `v1alpha4` draft. Open questions: 1. `when` is allowed on every step type,
including approval steps. 2. `execution.environment` is the only execution fact. 3. Not part of
`v1alpha4`.

2026-11-25 ([D22](../docs/decisions.md#d22-v1alpha3-becomes-the-current-draft)): the target is now `v1alpha3`, the current draft. The owner direction below is kept as recorded.

Owner direction of 2026-10-10: the grammar is a restricted expression grammar defined in this AEP, not CEL (D5); an execution may succeed when steps are skipped by a condition (D6). Target `v1alpha2`. Not accepted; needs the reviews listed in the header ([aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)).

## References

- Spec sections 3.9, 5.6, 10.4.
- [spec/v1alpha4 section 3.12](../spec/v1alpha4/README.md#312-conditions), sections 3.9, 5.6.3,
10.4.
2 changes: 2 additions & 0 deletions aep/0006-playbook-kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ enforce their own compliance requirements. This proposal makes no compliance pro

- **Workflow references a workflow** (sub-workflows): heavier, carries its own triggers and
governance sections that would conflict with the parent's.
[AEP-0028](0028-workflow-steps.md) (accepted for `v1alpha4`, D23) adds workflow steps that avoid
the conflict: the child runs as a separate execution with its own governance.
- **Skills as Markdown plus scripts without a manifest**: no identity, no permissions, no checks.
- **Do nothing**: procedures stay in prompts.

Expand Down
Loading