Skip to content

simulate: evaluate CEL guards from a supplied --context #183

Description

@joshua-temple

Follow-up to #175 (crucible simulate).

#175 ships per-guard verdict seeding (-guard name=true/false, default false) so guarded transitions can be driven headlessly without Go bindings. That covers Go-func guards, but it's a manual verdict, not real evaluation.

For IRs whose guards carry CEL expressions (state/expr), simulate could instead evaluate guards live against a user-supplied context:

crucible simulate machine.json -events "checkout,paid" -context '{"items": 3, "paid": true}'

This would wire a celGuard per CEL-authored guard, project the supplied JSON context through the machine's ContextSchema activation, and resolve guarded transitions from real data instead of seeded verdicts.

Scope notes:

  • Only helps guards authored as CEL expressions; Go-func guards still need -guard seeding.
  • Requires schema detection on the loaded IR and the state/expr dependency in cmd/crucible.
  • -guard overrides and -context should compose (explicit -guard wins).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestroadmapPlanned enhancement / roadmap item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions