---
id: ADR-PFM-OPS-003
title: 'A job kind declares its failure consequence once, applied from both settlement paths'
product_area: platform
module: operations
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
decision: >-
  Each kind declares one repeat-safe failure effect; ordinary failure paths apply it before settlement, while
  correction of execution success applies it after settlement.
constrains:
  - DOM-PFM-OPS-001
  - WF-PFM-OPS-002
  - WF-PFM-OPS-003
  - SVC-PFM-OPS-jobs
origin: >-
  services-platform:docs/jobs.md#2. Adding a job (step 4) and #4 (departure after the stranded workspace of
  2026-10-10)
alternatives:
  - option: Business recovery only in the workflow failure task
    why_not: An unstarted or timed-out execution may never run its failure task.
  - option: Apply every failure effect after settlement
    why_not: A failed effect would leave a final job that stalled-job reconciliation no longer retries.
consequences:
  - Registration tests require a consequence declaration or an explicit declaration of no effect.
  - Repeating an effect must preserve already recovered business state.
  - >-
    A failed effect before settlement is retried through open-job reconciliation; failure after corrected
    settlement lacks that path.
supersedes: []
evidence:
  - >-
    macroservice-libraries at 54536a4: engine/job-type-registry.ts:applyJobFailureConsequence,
    task/standard-job-operations.ts:recordJobFailureOperation, reconciler/job-reconciler.ts.
  - 'services-platform at ad3f6a6: modules/jobs/tests/unit/job-failure-consequences.spec.js.'
  - >-
    codex examination 2026-10-23: checked the pinned source anchors, planning references and enforcement
    boundaries; unresolved limits are recorded in module findings.
---

# A job kind declares its failure consequence once, applied from both settlement paths

## Context

Both workflow failure and reconciliation can discover that business work did not complete.

## Decision

Keep the effect in the kind registration and call the same applier from both paths. Explicit failure applies it before settling. Reconciliation that changes an apparent success into failure settles first, which leaves a recovery gap if the effect fails.

## Alternatives Considered

Workflow-only recovery misses jobs whose workflow never reaches failure handling. Uniform after-settlement recovery would expand the existing retry gap.

## Consequences

The implementation shares the consequence but does not guarantee identical ordering on every path.
