1e987a2009
CI / build (push) Successful in 19s
CI / helm (push) Successful in 22s
CI / security (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / quality (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / status-check (push) Has been cancelled
CI / coverage (push) Has been cancelled
Co-authored-by: Luis Mendes <luis.mendes@cleverthis.com> Co-committed-by: Luis Mendes <luis.mendes@cleverthis.com>
146 lines
7.2 KiB
Gherkin
146 lines
7.2 KiB
Gherkin
Feature: Domain event emission wiring across services
|
|
As an infrastructure operator
|
|
I want all 38 EventType values to be emitted from the correct services
|
|
So that the audit log, observability, and reactive subscribers work correctly
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Plan Lifecycle event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: PlanLifecycleService emits PLAN_STATE_CHANGED on complete_strategize
|
|
Given an in-memory PlanLifecycleService with a tracking event bus
|
|
And a plan in Strategize/PROCESSING phase
|
|
When I call complete_strategize on that plan
|
|
Then ew the audit log should contain a "plan.state_changed" event
|
|
And ew the event details should contain key "processing_state"
|
|
|
|
Scenario: PlanLifecycleService emits PLAN_ERRORED on fail_strategize
|
|
Given an in-memory PlanLifecycleService with a tracking event bus
|
|
And a plan in Strategize/PROCESSING phase
|
|
When I call fail_strategize with error "Test error"
|
|
Then ew the audit log should contain a "plan.errored" event
|
|
And ew the event details should contain key "error_message"
|
|
|
|
Scenario: PlanLifecycleService emits PLAN_ERRORED on fail_execute
|
|
Given an in-memory PlanLifecycleService with a tracking event bus
|
|
And a plan in Execute/PROCESSING phase
|
|
When I call fail_execute with error "Execution failed"
|
|
Then ew the audit log should contain a "plan.errored" event
|
|
|
|
Scenario: PlanLifecycleService emits PLAN_ERRORED on fail_apply
|
|
Given an in-memory PlanLifecycleService with a tracking event bus
|
|
And a plan in Apply/PROCESSING phase
|
|
When I call fail_apply with error "Apply failed"
|
|
Then ew the audit log should contain a "plan.errored" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Decision event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: DecisionService emits DECISION_APPROVED for non-correction decisions
|
|
Given an in-memory DecisionService with a tracking event bus
|
|
When I record a normal decision
|
|
Then ew the audit log should contain a "decision.approved" event
|
|
And ew the audit log should contain a "decision.created" event
|
|
|
|
Scenario: DecisionService emits DECISION_CORRECTED for correction decisions
|
|
Given an in-memory DecisionService with a tracking event bus
|
|
When I record a correction decision
|
|
Then ew the audit log should contain a "decision.corrected" event
|
|
|
|
Scenario: DecisionService emits DECISION_SUPERSEDED on mark_superseded
|
|
Given an in-memory DecisionService with a tracking event bus
|
|
And ew two decisions exist for the same plan
|
|
When ew I mark the first decision as superseded by the second
|
|
Then ew the audit log should contain a "decision.superseded" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Invariant event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: InvariantService emits INVARIANT_ENFORCED and INVARIANT_RECONCILED
|
|
Given an InvariantService with a tracking event bus
|
|
And an active invariant exists
|
|
When I enforce invariants for a plan
|
|
Then ew the audit log should contain a "invariant.enforced" event
|
|
And ew the audit log should contain a "invariant.reconciled" event
|
|
|
|
Scenario: InvariantService emits INVARIANT_VIOLATED for violated invariants
|
|
Given an InvariantService with a tracking event bus
|
|
And an active invariant exists with known ID
|
|
When I enforce invariants with violations for that invariant
|
|
Then ew the audit log should contain a "invariant.violated" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Session event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: SessionService emits SESSION_MESSAGE_SENT on append_message
|
|
Given a PersistentSessionService with a tracking event bus
|
|
And a session exists
|
|
When I append a message to the session
|
|
Then ew the audit log should contain a "session.message_sent" event
|
|
And ew the event details should contain key "message_id"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Checkpoint / Sandbox event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: CheckpointService emits CHECKPOINT_CREATED on create_checkpoint
|
|
Given a CheckpointService with a tracking event bus
|
|
When I create a checkpoint
|
|
Then ew the audit log should contain a "checkpoint.created" event
|
|
And ew the event details should contain key "checkpoint_id"
|
|
|
|
Scenario: CheckpointService emits SANDBOX_CREATED on register_sandbox
|
|
Given a CheckpointService with a tracking event bus
|
|
When I register a sandbox for a plan
|
|
Then ew the audit log should contain a "sandbox.created" event
|
|
|
|
Scenario: CheckpointService emits SANDBOX_COMMITTED on mark_plan_applied
|
|
Given a CheckpointService with a tracking event bus
|
|
When I mark a plan as applied
|
|
Then ew the audit log should contain a "sandbox.committed" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Validation event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: ValidationPipeline emits VALIDATION_STARTED and VALIDATION_PASSED
|
|
Given a ValidationPipeline with a tracking event bus and a passing validation
|
|
When I run the pipeline
|
|
Then ew the audit log should contain a "validation.started" event
|
|
And ew the audit log should contain a "validation.passed" event
|
|
|
|
Scenario: ValidationPipeline emits VALIDATION_FAILED when required fails
|
|
Given a ValidationPipeline with a tracking event bus and a failing validation
|
|
When I run the pipeline
|
|
Then ew the audit log should contain a "validation.started" event
|
|
And ew the audit log should contain a "validation.failed" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Tool Lifecycle event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: ToolRuntime emits TOOL_INVOKED and TOOL_COMPLETED on execute
|
|
Given a ToolRuntime with a tracking event bus and a registered tool
|
|
When I execute the tool
|
|
Then ew the audit log should contain a "tool.invoked" event
|
|
And ew the audit log should contain a "tool.completed" event
|
|
|
|
Scenario: ToolRuntime emits TOOL_ERRORED when execution fails
|
|
Given a ToolRuntime with a tracking event bus and a failing tool
|
|
When I execute the failing tool expecting an error
|
|
Then ew the audit log should contain a "tool.invoked" event
|
|
And ew the audit log should contain a "tool.errored" event
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Actor Runtime event emissions
|
|
# ---------------------------------------------------------------------------
|
|
|
|
Scenario: ToolCallingRuntime emits ACTOR_INVOKED and ACTOR_COMPLETED
|
|
Given a ToolCallingRuntime with a tracking event bus and a simple LLM
|
|
When I run the tool loop with a simple prompt
|
|
Then ew the audit log should contain a "actor.invoked" event
|
|
And ew the audit log should contain a "actor.completed" event
|