eda: action ids, validated at load, and actions.<id> resolution (J1) #449
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#449
Reference in new issue
Block a user
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:
idis a required field on every action that a later actionreferences; ids are validated at load (unique, stable-identifier-shaped); and
a
when/argsexpression naming an unknownactions.<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 nomeaning 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
actionsasmap(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