Skip to content

Spec 5: Outcome Artifacts

DWS Spec 5: Outcome Artifacts

Digital Worker Standard — DWS Specification

Version: 1.0 Tier: 1 — Core Primitive Status: Release Candidate Dependencies: Spec 4 (Intent Artifacts), Spec 6 (Workflow & Phases), Spec 11 (Events & Telemetry)


1. Overview

Outcome artifacts are the structured representation of what a worker produces and where it goes. They replace implicit output handling with codified, verifiable delivery contracts that close the loop between intent and execution.

An outcome artifact captures the primary output, its delivery channels, its success criteria, its escalation routing, and its failure handling. It is the unit against which the runtime evaluates output readiness before delivery. Without structured outcome, a worker’s output is undefined: it cannot be independently verified, cannot produce an auditable trail, cannot route work to downstream systems, and cannot be governed as an accountable entity.

Intent and Outcome are the two poles of a DWS worker’s execution contract:

  • Intent — the structured objective coming in: what the worker is asked to do, by whom, and what success looks like
  • Outcome — the structured result going out: what the worker produced, where it is routed, whether it succeeded, and what happens when it doesn’t

An outcome definition is part of the worker’s definition-time specification, authored alongside Intent, Skills, and Workflow. The runtime is responsible for the mechanics of delivery. The Outcome spec defines the what, where, success criteria, and failure handling. The runtime handles the how.


2. Outcome Artifact Schema

An outcome artifact is a JSON file stored in the outcomes/ directory of a job spec. Each outcome artifact defines the output contract for a specific workflow or workflow phase.

2.1 Required Fields

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["id", "name", "version", "workflow_ref", "primary_output", "delivery_channels", "success_criteria"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$"
},
"name": { "type": "string" },
"version": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"workflow_ref": {
"type": "string",
"description": "Format: '{workflow-name}' or '{workflow-name}:{phase-id}' for phase-specific outcomes."
},
"primary_output": {
"type": "object",
"required": ["type", "format", "description"],
"properties": {
"type": {
"type": "string",
"enum": ["document", "structured_data", "code_change", "decision", "analysis", "notification", "trigger", "none"]
},
"format": { "type": "string" },
"schema_ref": { "type": "string" },
"description": { "type": "string" }
}
},
"delivery_channels": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/delivery_channel" }
},
"success_criteria": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/success_criterion" }
},
"retention_policy": {
"type": "object",
"properties": {
"retain_output": { "type": "boolean", "default": true },
"retention_days": { "type": "integer", "minimum": 1 },
"data_classification": {
"type": "string",
"enum": ["public", "internal", "confidential", "restricted"],
"description": "Classification of the output artifact. Governs retention and export rules. See Spec 13."
}
},
"description": "How long output artifacts are retained and under what classification."
},
"escalation_routing": { "$ref": "#/$defs/escalation_routing" },
"failure_handling": { "$ref": "#/$defs/failure_handling" }
}
}

2.2 Output Format Values

Output TypeValid Formats
documentmarkdown, pdf, docx, html, plain_text
structured_datajson, csv, yaml
code_changediff, commit
decisionstructured_decision
analysismarkdown, json, html
notificationplain_text, html
triggerThe event type string (e.g., build.requested)
noneany

3. Delivery Channel Types

The delivery_channels array defines where output is routed after production. Channels are attempted in priority order (lower number = higher priority). Channels with the same priority are attempted in parallel.

3.1 Channel Types

TypeDescription
source_replyRespond via the same channel the intent arrived on. No target configuration required.
system_writeWrite to a named external system (CRM, ticketing, database). Target: { "system": "salesforce" }.
downstream_workerPass output as intent to another DWS worker. Target: { "worker_ref": "contract-reviewer:legal-review" }.
human_approverRoute to a named person or role for review. Target: { "role": "compliance-officer" }.
event_stream_onlyLog to the event store only. No active delivery.
webhookPOST the outcome envelope to a URL. Target: { "url": "https://hooks.example.com/outcomes" }.

3.2 Conditional Delivery

Any channel may include a conditions array. When conditions are defined, the channel is only used if all conditions evaluate to true. Otherwise, the channel is skipped and the next channel by priority is tried.

3.3 Failure Cascading

When delivery to a channel fails:

ActionBehaviour
fallback_to_nextTry the next channel by priority. If no more channels remain, escalate.
escalateTrigger the escalation routing defined on the outcome.
abortFail the workflow. Emit an outcome.delivery_failed event.

4. Success Criteria

Outcome success criteria evaluate output quality: whether the output is ready for delivery. They are evaluated after the primary output is produced and before any delivery channel is invoked.

Outcome success criteria reuse the same success_criterion schema as Intent (Spec 4):

Intent Success CriteriaOutcome Success Criteria
EvaluatesBusiness objectivesOutput quality
Defined byThe requesterThe worker designer
When evaluatedAfter execution completesAfter output produced, before delivery
BlocksWorkflow completionOutput delivery

Both must pass before the workflow can reach completed state.


5. Escalation Routing

Escalation routing defines how the worker communicates when it hits an authority boundary, a confidence threshold, or a verification failure.

5.1 Escalation Targets

Target TypeDescription
roleRoute to a role (e.g., compliance-officer). Runtime resolves the person.
named_personRoute to a specific person.
channelRoute to a delivery channel defined on this outcome.

5.2 Escalation Formats

FormatDescription
structured_decision_requestStructured prompt with options and a recommendation.
plain_summaryProse summary of the situation.
full_contextComplete execution context passed to the escalation target.

5.3 Escalation Triggers

TriggerFired When
authority_boundary_hitWorker reaches the boundary of its authority level.
confidence_below_thresholdWorker’s confidence in its output falls below threshold.
verification_failedThe Verification Framework rejects the output.
success_criteria_unmetBlocking outcome success criteria fail.
delivery_failed_all_channelsAll delivery channels attempted and all failed.
cost_ceiling_exceededExecution costs exceed the configured ceiling.
human_requestedA human explicitly requests escalation.

6. Failure Handling

6.1 Execution Failure

When the worker fails before producing output:

ActionBehaviour
escalateTrigger escalation routing.
retryRe-execute up to max_retries times, waiting retry_delay between attempts.
abort_with_eventFail the workflow. Emit outcome.delivery_failed.

6.2 Success Criteria Failure

When output is produced but blocking success criteria fail:

ActionBehaviour
escalateTrigger escalation routing. Payload includes output and failing criteria.
deliver_with_flagRoute to delivery channels with status: "delivered_with_flag".
abort_with_eventDiscard the output and fail the workflow.

7. The Outcome Envelope

When the runtime delivers output, it wraps it in an Outcome Envelope: a standard structure carrying the output plus execution metadata.

{
"type": "object",
"required": ["outcome_id", "intent_ref", "worker_ref", "execution_id", "status", "produced_at", "primary_output", "success_criteria_results", "delivery_channel_id", "event_ref"],
"properties": {
"outcome_id": { "type": "string" },
"intent_ref": { "type": "string" },
"worker_ref": { "type": "string" },
"execution_id": { "type": "string" },
"status": {
"type": "string",
"enum": ["succeeded", "failed", "escalated", "delivered_with_flag"]
},
"produced_at": { "type": "string", "format": "date-time" },
"primary_output": {
"type": "object",
"properties": {
"type": { "type": "string" },
"format": { "type": "string" },
"content": {}
}
},
"success_criteria_results": {
"type": "array",
"items": {
"type": "object",
"required": ["dimension", "passed"],
"properties": {
"dimension": { "type": "string" },
"passed": { "type": "boolean" },
"evidence": { "type": ["string", "null"] }
}
}
},
"delivery_channel_id": { "type": "string" },
"event_ref": { "type": "string" }
}
}

8. Relationship to Intent

Intent is the work order. Outcome is the delivery receipt.

IntentOutcome
DirectionInboundOutbound
DefinesWhat to do, success criteria, constraintsWhat was produced, where it goes, quality criteria
Authored byThe requesterThe worker designer
LifecycleEvolves through git + event-sourced mutationsStatic definition; runtime produces envelopes against it

A worker without an Intent has no objective. A worker without an Outcome has no delivery contract. Together, they make a worker independently verifiable and auditable.


9. Verification Integration

9.1 Pre-Delivery Verification

After the worker produces output and before any delivery channel is invoked, the verifier evaluates output against all blocking: true Outcome success criteria.

  1. Worker completes execution and produces primary output.
  2. Runtime emits outcome.produced event.
  3. Verifier evaluates output against Outcome success criteria.
  4. If all blocking criteria pass: emit outcome.verification_passed, proceed to delivery.
  5. If any blocking criterion fails: emit outcome.verification_failed, follow failure handling.

9.2 Dual Verification Gates

GateEvaluatesWhenBlocks
Pre-deliveryOutcome success criteriaAfter output produced, before deliveryOutput delivery
Post-executionIntent success criteriaAfter delivery completesWorkflow completion

Both gates must pass for the workflow to reach completed state.


10. Outcome Events

Event TypeWhen Emitted
outcome.producedPrimary output ready.
outcome.verification_passedAll blocking criteria pass.
outcome.verification_failedBlocking criteria fail.
outcome.delivery_attemptedRuntime begins delivery to a channel.
outcome.delivery_succeededDelivery confirmed.
outcome.delivery_failedDelivery failed.
outcome.escalatedEscalation triggered.
outcome.escalation_respondedHuman response received.
outcome.escalation_timed_outResponse window expired.
outcome.completedAll delivery channels resolved.

11. Key Design Decisions

DecisionResolutionRationale
Outcome as definition-time objectPart of the worker spec, not generated at runtime.Keeps the output contract auditable and version-controlled.
Success criteria reuseSame schema as Intent.Avoids unnecessary divergence and tooling complexity.
Delivery channel resolutionChannels define what and where; runtime resolves how.Connection details are environment config, not spec.
Envelope as delivery unitAll channels receive a standardised envelope.Downstream systems need execution metadata.

12. References

  • Spec 4: Intent Artifacts — Intent defines the input contract; Outcome defines the output contract.
  • Spec 6: Workflow & Phases — Workflows reference outcomes via workflow_ref.
  • Spec 8: Verification Framework — Evaluates both intent and outcome success criteria.
  • Spec 11: Events & Telemetry — All outcome lifecycle events are emitted to the event stream.
  • Spec 13: Security Model — Governs data classification for output artifacts.