Skip to content

Spec 11: Events & Telemetry

DWS Spec 11: Event & Telemetry Schema

Digital Worker Standard — DWS Specification

Version: 1.0 Tier: 3 — Accumulation Status: Release Candidate Dependencies: All specs (cross-cutting observability layer)


1. Overview

This specification defines the structured event format for everything that happens during worker execution. Events are DWS’s write protocol: the stream of structured records that feeds institutional knowledge (Spec 2), enables observability, and supports compliance auditing (Spec 12).

Every DWS runtime artifact (knowledge entries, verification findings, intent mutations, coordination state) is event-sourced. Events are the single source of truth for what happened during execution. Definition-time artifacts live in git; runtime artifacts live in the event stream. The base_version field on every event connects the two.

DWS events are a superset of OpenTelemetry. They carry DWS-specific semantics (intent references, verification findings, knowledge operations) while maintaining compatibility with OTel export for organisations with existing observability infrastructure.


2. Common Event Fields

All events share these fields:

FieldTypeRequiredDescription
event_idstring (uuid)MUSTUnique event identifier.
event_typestring (dotted)MUSTEvent type from the taxonomy (Section 3).
timestampstring (ISO 8601 UTC)MUSTWhen the event occurred.
session_idstring (uuid)MUSTExecution session this event belongs to.
workflow_idstringMUSTWorkflow being executed.
phase_idstringSHOULDCurrent phase (if applicable).
worker_idstringSHOULDWorker that produced or is associated with this event.
correlation_idstringMAYLinks causal chains across workers and sessions.
base_versionstringMUSTGit commit hash of the definition-time artifacts.
sequence_numberintegerMUSTMonotonic within session. Establishes causal ordering.
contextobjectMAYActive knowledge entries, intent ref.
payloadobjectMUSTEvent-type-specific data.

3. Event Taxonomy

3.1 Lifecycle Events

Event TypeDescriptionRequired
lifecycle.worker_startedWorker instantiated and ready.Yes
lifecycle.worker_completedWorker finished successfully.Yes
lifecycle.worker_failedWorker failed and cannot continue.Yes
lifecycle.worker_escalatedWorker escalated to coordinator or human.Yes
lifecycle.worker_capacity_changedWorker’s effective capacity changed.No

3.2 Workflow Events

Event TypeDescriptionRequired
workflow.phase_enteredPhase began execution.Yes
workflow.phase_exitedPhase completed.Yes
workflow.gate_passedVerification gate passed.Yes
workflow.gate_failedVerification gate failed.Yes
workflow.completedEntire workflow completed.Yes
workflow.cancelledWorkflow cancelled.Yes
workflow.resumedWorkflow resumed from checkpoint.Yes
workflow.cost_threshold_reachedCost alert threshold crossed.Yes
workflow.checkpoint_createdExecution checkpoint persisted.Yes

3.3 Skill Events

Event TypeDescriptionRequired
skill.invokedSkill began execution.No
skill.completedSkill completed.No
skill.failedSkill failed.No
skill.tool_calledMCP tool invoked.No
skill.tool_returnedMCP tool returned.No

Skill events are RECOMMENDED for debugging and knowledge accumulation but not REQUIRED.

3.4 Coordination Events

Event TypeDescriptionRequired
coordination.task_assignedTask assigned to worker.Yes
coordination.task_completedTask completed.Yes
coordination.task_failedTask failed.Yes
coordination.task_progressWorker reported progress.No
coordination.conflict_detectedConflict between workers detected.Yes
coordination.conflict_resolvedConflict resolved.Yes
coordination.dependency_resolvedTask dependency satisfied.Yes
coordination.dependency_discoveredNew dependency discovered at runtime.Yes
coordination.escalation_triggeredEscalation initiated.Yes
coordination.escalation_resolvedEscalation resolved.Yes
coordination.contract_validatedArtifact validated against contract.Yes
coordination.contract_breachedArtifact failed contract validation.Yes

3.5 Knowledge Events

Event TypeDescriptionRequired
knowledge.entry_createdNew knowledge entry.Yes
knowledge.entry_promotedEntry promoted to institutional.Yes
knowledge.entry_retiredEntry retired.Yes
knowledge.entry_overriddenEntry overridden by conflict resolution.Yes
knowledge.conflict_detectedKnowledge conflict found.No
knowledge.conflict_resolvedKnowledge conflict resolved.No
knowledge.version_transferKnowledge carried forward to new worker version.No

3.6 Verification Events

Event TypeDescriptionRequired
verification.startedVerification began.Yes
verification.finding_issuedIndividual finding produced.Yes
verification.verdict_renderedFinal verdict (pass/conditional_pass/fail).Yes
verification.reverification_triggeredRe-verification loop started.Yes

3.7 Intent Events

Event TypeDescriptionRequired
intent.createdNew intent artifact.Yes
intent.approvedIntent approved for execution.Yes
intent.activatedIntent transitioned to active.Yes
intent.mutatedIntent modified during execution.Yes
intent.completedIntent completed.Yes

3.8 Guardrail Events

Event TypeDescriptionRequired
guardrail.blockedAction rejected by a guardrail.Yes
guardrail.warnedAction proceeded with warning.No
guardrail.loggedGuardrail triggered at log level.No
guardrail.exhaustedAll guardrail retries exhausted.Yes

3.9 Interaction Events

Event TypeDescriptionRequired
interaction.check_inWorker check-in report.No
interaction.question_askedWorker asked human a question.Yes
interaction.question_answeredHuman answered worker’s question.Yes
interaction.feedback_receivedHuman provided feedback.Yes
interaction.handoff_initiatedHandoff started.Yes
interaction.handoff_completedHandoff completed.Yes
interaction.handoff_failedHandoff failed.Yes

3.10 Outcome Events

Event TypeDescriptionRequired
outcome.producedWorker output ready.Yes
outcome.verification_passedOutcome criteria passed.Yes
outcome.verification_failedOutcome criteria failed.Yes
outcome.delivery_attemptedDelivery to channel started.Yes
outcome.delivery_succeededDelivery confirmed.Yes
outcome.delivery_failedDelivery failed.Yes
outcome.escalatedEscalation triggered.Yes
outcome.completedOutcome lifecycle closed.Yes

3.11 Approval Events

Event TypeDescriptionRequired
approval.requestedApproval gate activated.Yes
approval.decidedApprover rendered decision.Yes
approval.delegatedApproval authority delegated.Yes
approval.timed_outApproval SLA expired.Yes

4. Event Delivery Guarantees

  • Mandatory events: Required for audit, state reconstruction, and compliance.
  • Optional events: Recommended for debugging and knowledge accumulation.
  • Within session: Causal ordering via sequence_number (monotonic).
  • Across sessions: No ordering guarantee. timestamp for approximate ordering, correlation_id for causal chains.
  • Delivery: At-least-once semantics. Consumers must be idempotent.

5. Event Consumption Interface

5.1 Stream Interface

Real-time subscription with filtering:

{
"subscription": {
"event_types": ["workflow.*", "verification.*"],
"worker_ids": ["contract-analyst"],
"delivery": { "type": "webhook", "url": "https://hooks.example.com/events", "batch_size": 10 }
}
}

Filters support wildcards on event types. Delivery types: webhook (batched) or stream (WebSocket/SSE).

5.2 Query Interface

Historical event retrieval with cursor-based pagination:

{
"query": {
"event_types": ["verification.*"],
"session_ids": ["sess-001"],
"time_range": { "from": "2026-04-01T00:00:00Z", "to": "2026-04-10T23:59:59Z" },
"cursor": null,
"limit": 100
}
}

6. OpenTelemetry Mapping

DWS ConceptOTel Concept
Workflow executionTrace (trace ID = workflow execution ID)
PhaseSpan (parent = workflow trace)
Skill executionChild span
Tool callSpan event
VerificationSpan
DWS event (mandatory)Span event
DWS event (optional)Log
Knowledge entryResource attribute

OTel GenAI semantic convention alignment:

OTel GenAI ConventionDWS Mapping
gen_ai.agent spanlifecycle.worker_started / lifecycle.worker_completed
gen_ai.tool.call spanskill.tool_called / skill.tool_returned
gen_ai.agent.nameWorker descriptor identity.name
gen_ai.agent.versionWorker descriptor identity.version

Runtimes SHOULD support OTel export. The mapping above ensures DWS events can flow into existing OTel-compatible monitoring infrastructure (Datadog, Grafana, etc.) without information loss.


7. Event Retention

7.1 Retention Policies

CategoryMinimum RetentionDefault
Mandatory events30 days1 year
Optional events7 days90 days
Compliance-relevant eventsPer regulatory framework (see Spec 12)Per framework

7.2 Event Filtering and Subscription

Runtimes SHOULD support:

  • Event type filtering (including wildcards)
  • Worker-level filtering
  • Session-level filtering
  • Time-range filtering
  • Custom predicate filtering on payload fields

8. Privacy and Data Classification

Events may contain sensitive data. The data_classification field (from Spec 13) applies:

  • public — Exportable without restriction.
  • internal — Organisation-internal only.
  • confidential — Restricted access, redacted on export.
  • restricted — Requires explicit authorisation to access.

Runtimes MUST redact sensitive fields in events when exporting based on recipient access level.


9. CloudEvents Compatibility

DWS events SHOULD be expressible as CloudEvents (CNCF v1.0.2). The mapping:

CloudEvents FieldDWS Source
idevent_id
typedws.{event_type} (e.g., dws.workflow.phase_entered)
sourcedws://{dws-name}/{worker-id}
timetimestamp
subjectsession_id
datacontenttypeapplication/json
dataFull event payload

This enables DWS events to flow through any CloudEvents-compatible event infrastructure (Kafka, AWS EventBridge, Google Cloud Pub/Sub, etc.).


10. References

  • OpenTelemetry GenAI Semantic Conventions — Agent span conventions and attribute names.
  • CloudEvents v1.0.2 — Standard event envelope format.
  • Spec 2: Knowledge Schema — Knowledge events feed the knowledge lifecycle.
  • Spec 8: Verification Framework — Verification events track quality evaluation.
  • Spec 12: Compliance & Governance — Determines retention requirements for compliance-relevant events.
  • Spec 13: Security Model — Defines data classification levels for event privacy.