eda: action ids, validated at load, and actions.<id> resolution (J1) #449

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

Unshipped half of docs/prds/playbook-expression-syntax.md (J1). Found while
deciding whether that PRD could move from Approved to Finalised: it cannot,
because three of its decisions have no implementation. This is one.

J1 decides: id is a required field on every action that a later action
references; ids are validated at load (unique, stable-identifier-shaped); and
a when/args expression naming an unknown actions.<id> is a LOAD failure,
not a runtime miss -- the same reject-at-load rule as a binding collision.

Nothing of this exists. internal/domain/eda/playbook's rawAction carries
position/workflow/kind/when only, and single-action playbooks have no prior
action to reference.

Prerequisite for .26 and .27: both address actions.<id>, which has no
meaning until ids exist.

Design

CURRENT SHAPE (verified 2026-09-21). internal/domain/eda/playbook's rawAction
is position/workflow/kind/when -- no id field. loadOne enforces the t2db.15
hard boundary: exactly one action, position "workflow" only. Playbook.Actions
is []Action with a single element.

This bead adds the id field and its load-time validation. It does NOT relax
the hard boundary: multi-action playbooks stay rejected at load. An id on a
single-action playbook is inert but valid, which is what lets .26 and .27 land
afterwards without a second loader change.

Validation, per the PRD's J1: unique within the playbook, stable-identifier
shaped, and a when/args expression naming an unknown actions. is a LOAD
failure carrying the playbook path and the id. Reuse the existing error shape
in loadOne -- every failure there already names the file.

The CEL side already exists: expr.NewEnv declares actions as
map(string, dyn), and expr.Context.Actions is the map a dispatch fills. Today
the coordinator passes an empty map. Nothing in expr needs to change for this
bead.

SCOPED GATE COMMAND
go test ./internal/domain/eda/... -count=1 && go vet ./internal/domain/eda/...

OVERLAP: touches internal/domain/eda/playbook's loader, as does .24. Do not
run both in one wave without deciding who owns that file.

Acceptance criteria

A playbook action may declare an id; ids are validated at load for uniqueness and shape; a when or args expression referencing an unknown actions. fails the load with a reported error naming the playbook and the id.

Close reason

Shipped with the multi-action playbook work, not the original single-action lane. Acceptance met: an action may declare id (rawAction.ID / Action.ID), ids are validated at load through internal/domain/stableid (unique, stable-identifier shaped), and a when/args reference to an undeclared actions. fails the load naming the playbook and the id (compileExpr over the per-action CEL env). Verified: TestLoadMalformedActionIDFails, TestValidateActionIDs, TestLoadWorkflowActionIDKeepsStableIdentifierGrammar, TestCompileUndeclaredActionIDRejected.


Imported from beads archie-core-t2db.25 · GitHub #1129 · type task · priority P2 · created 2026-09-21 · closed 2026-09-29

Unshipped half of docs/prds/playbook-expression-syntax.md (J1). Found while deciding whether that PRD could move from Approved to Finalised: it cannot, because three of its decisions have no implementation. This is one. J1 decides: `id` is a required field on every action that a later action references; ids are validated at load (unique, stable-identifier-shaped); and a `when`/`args` expression naming an unknown `actions.<id>` is a LOAD failure, not a runtime miss -- the same reject-at-load rule as a binding collision. Nothing of this exists. internal/domain/eda/playbook's rawAction carries position/workflow/kind/when only, and single-action playbooks have no prior action to reference. Prerequisite for .26 and .27: both address `actions.<id>`, which has no meaning until ids exist. ### Design CURRENT SHAPE (verified 2026-09-21). internal/domain/eda/playbook's rawAction is position/workflow/kind/when -- no id field. loadOne enforces the t2db.15 hard boundary: exactly one action, position "workflow" only. Playbook.Actions is []Action with a single element. This bead adds the id field and its load-time validation. It does NOT relax the hard boundary: multi-action playbooks stay rejected at load. An id on a single-action playbook is inert but valid, which is what lets .26 and .27 land afterwards without a second loader change. Validation, per the PRD's J1: unique within the playbook, stable-identifier shaped, and a when/args expression naming an unknown actions.<id> is a LOAD failure carrying the playbook path and the id. Reuse the existing error shape in loadOne -- every failure there already names the file. The CEL side already exists: expr.NewEnv declares `actions` as map(string, dyn), and expr.Context.Actions is the map a dispatch fills. Today the coordinator passes an empty map. Nothing in expr needs to change for this bead. SCOPED GATE COMMAND go test ./internal/domain/eda/... -count=1 && go vet ./internal/domain/eda/... OVERLAP: touches internal/domain/eda/playbook's loader, as does .24. Do not run both in one wave without deciding who owns that file. ### Acceptance criteria A playbook action may declare an id; ids are validated at load for uniqueness and shape; a when or args expression referencing an unknown actions.<id> fails the load with a reported error naming the playbook and the id. ### Close reason Shipped with the multi-action playbook work, not the original single-action lane. Acceptance met: an action may declare id (rawAction.ID / Action.ID), ids are validated at load through internal/domain/stableid (unique, stable-identifier shaped), and a when/args reference to an undeclared actions.<id> fails the load naming the playbook and the id (compileExpr over the per-action CEL env). Verified: TestLoadMalformedActionIDFails, TestValidateActionIDs, TestLoadWorkflowActionIDKeepsStableIdentifierGrammar, TestCompileUndeclaredActionIDRejected. --- _Imported from beads `archie-core-t2db.25` · GitHub #1129 · type task · priority P2 · created 2026-09-21 · closed 2026-09-29_
sam added the mediumtask labels 2026-10-27 13:36:22 +00:00
sam self-assigned this 2026-10-27 13:36:22 +00:00
sam closed this issue 2026-10-27 13:36:22 +00:00
sam added a new dependency 2026-10-27 13:42:03 +00:00
sam added a new dependency 2026-10-27 13:42:04 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#449