eda: CEL expression environment (compile/validate at load, evaluate at dispatch) #437
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#437
Reference in new issue
Block a user
Sixth slice of docs/prds/eda-playbook-engine.md, implementing the 'Implementation placement' section of the resolved open question 1 (CEL). Builds internal/domain/eda/expr in isolation, no coordinator/dispatch yet -- mirrors how t2db.13 built ModuleRegistry as a standalone, fully-tested unit before anything consumed it.
This is pure infrastructure for the dispatch slice (t2db.15) that depends on it. No production wiring in this ticket.
Design
Package internal/domain/eda/expr (domain layer: no infrastructure imports).
Per the resolved doc section, build:
Follow docs/prds/eda-playbook-engine.md's reject-at-load philosophy throughout: anything not accepted by the schema is a reported error, never a silent default.
Acceptance criteria
internal/domain/eda/expr exists with: environment construction, Compile(expr string) (returned type, error), Eval(program, ctx) (value, error). Table-driven tests cover: a valid boolean expression against event fields evaluates correctly; a syntax error is a Compile-time error; a reference to an unknown root (e.g. 'foo.bar') is a Compile-time error; evaluating against a missing event field does not panic (returns an error or CEL's documented behavior, whichever is correct -- verify against real CEL semantics, don't guess); an expression that would exceed the cost limit is rejected, not silently truncated. go.mod gains cel.dev/cel-go v0.32.0 only. task check passes.
Close reason
Verified landed: internal/domain/eda/expr (Env, DefaultCostLimit) consumed by the playbook loader at load time.
Imported from beads
archie-core-t2db.14· GitHub #740 · type task · priority P2 · created 2026-09-02 · closed 2026-09-11