FAILURE MAP
← Case archive

FA-1331 / Workflow orchestration / Open access

Renew a durable activity heartbeat: A heartbeat resurrects an activity after its timeout · case 01

The workflow heartbeat operation is admitted even though a heartbeat resurrects an activity after its timeout.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The admission path omits the heartbeat expiry invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require r['heartbeat_expiry'][0] < r['heartbeat_expiry'][1] together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the heartbeat expiry check repairs the reported defect, but replacing the adjacent progress monotonic check loses that independent invariant.

Case contract

Return a Boolean admission decision for renew a durable activity heartbeat. The record r must satisfy all of: r['heartbeat_attempt'][0] == r['heartbeat_attempt'][1]; r['heartbeat_expiry'][0] < r['heartbeat_expiry'][1]; r['progress_monotonic'][0] >= r['progress_monotonic'][1]; len(r['payload_limit'][0]) <= r['payload_limit'][1]; r['absolute_deadline'][0] <= r['absolute_deadline'][1]. Extra tracing fields are ignored; validation does not mutate the record.

Why this case matters

A deterministic local contract for workflow orchestration. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['heartbeat_attempt'][0] == r['heartbeat_attempt'][1]) and (r['progress_monotonic'][0] >= r['progress_monotonic'][1]) and (len(r['payload_limit'][0]) <= r['payload_limit'][1]) and (r['absolute_deadline'][0] <= r['absolute_deadline'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'heartbeat_attempt': [4, 4], 'heartbeat_expiry': [9, 10], 'progress_monotonic': [20, 19], 'payload_limit': ['abc', 3], 'absolute_deadline': [20, 20]}
check('valid operation', solve(r), True)
check('A previous activity attempt keeps the new attempt alive', solve(dict(r, **{'heartbeat_attempt': [3, 4]})), False)
check('A heartbeat resurrects an activity after its timeout', solve(dict(r, **{'heartbeat_expiry': [10, 10]})), False)
check('A late heartbeat regresses the resumable progress marker', solve(dict(r, **{'progress_monotonic': [18, 19]})), False)
check('Heartbeat detail exceeds durable history payload limits', solve(dict(r, **{'payload_limit': ['abcd', 3]})), False)
check('Heartbeat renewal extends beyond schedule-to-close timeout', solve(dict(r, **{'absolute_deadline': [21, 20]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'heartbeat_attempt': [3, 4], 'heartbeat_expiry': [10, 10], 'progress_monotonic': [18, 19], 'payload_limit': ['abcd', 3], 'absolute_deadline': [21, 20]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
A previous activity attempt keeps the new attempt aliveFalseFalsePassed
A heartbeat resurrects an activity after its timeoutTrueFalseFailed
A late heartbeat regresses the resumable progress markerFalseFalsePassed
Heartbeat detail exceeds durable history payload limitsFalseFalsePassed
Heartbeat renewal extends beyond schedule-to-close timeoutFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / c0977b14d3d4194fdf421da5fd14e9ef7a724628d5e56c2d07a6b79399178971

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['heartbeat_attempt'][0] == r['heartbeat_attempt'][1]) and (r['heartbeat_expiry'][0] < r['heartbeat_expiry'][1]) and (len(r['payload_limit'][0]) <= r['payload_limit'][1]) and (r['absolute_deadline'][0] <= r['absolute_deadline'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'heartbeat_attempt': [4, 4], 'heartbeat_expiry': [9, 10], 'progress_monotonic': [20, 19], 'payload_limit': ['abc', 3], 'absolute_deadline': [20, 20]}
check('valid operation', solve(r), True)
check('A previous activity attempt keeps the new attempt alive', solve(dict(r, **{'heartbeat_attempt': [3, 4]})), False)
check('A heartbeat resurrects an activity after its timeout', solve(dict(r, **{'heartbeat_expiry': [10, 10]})), False)
check('A late heartbeat regresses the resumable progress marker', solve(dict(r, **{'progress_monotonic': [18, 19]})), False)
check('Heartbeat detail exceeds durable history payload limits', solve(dict(r, **{'payload_limit': ['abcd', 3]})), False)
check('Heartbeat renewal extends beyond schedule-to-close timeout', solve(dict(r, **{'absolute_deadline': [21, 20]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'heartbeat_attempt': [3, 4], 'heartbeat_expiry': [10, 10], 'progress_monotonic': [18, 19], 'payload_limit': ['abcd', 3], 'absolute_deadline': [21, 20]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
A previous activity attempt keeps the new attempt aliveFalseFalsePassed
A heartbeat resurrects an activity after its timeoutFalseFalsePassed
A late heartbeat regresses the resumable progress markerTrueFalseFailed
Heartbeat detail exceeds durable history payload limitsFalseFalsePassed
Heartbeat renewal extends beyond schedule-to-close timeoutFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / a6f2d0c8c5fb1ec46a2bc80211f59a22ed46575af0f958e35b1eb9e6d6465fd5

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['heartbeat_attempt'][0] == r['heartbeat_attempt'][1]) and (r['heartbeat_expiry'][0] < r['heartbeat_expiry'][1]) and (r['progress_monotonic'][0] >= r['progress_monotonic'][1]) and (len(r['payload_limit'][0]) <= r['payload_limit'][1]) and (r['absolute_deadline'][0] <= r['absolute_deadline'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'heartbeat_attempt': [4, 4], 'heartbeat_expiry': [9, 10], 'progress_monotonic': [20, 19], 'payload_limit': ['abc', 3], 'absolute_deadline': [20, 20]}
check('valid operation', solve(r), True)
check('A previous activity attempt keeps the new attempt alive', solve(dict(r, **{'heartbeat_attempt': [3, 4]})), False)
check('A heartbeat resurrects an activity after its timeout', solve(dict(r, **{'heartbeat_expiry': [10, 10]})), False)
check('A late heartbeat regresses the resumable progress marker', solve(dict(r, **{'progress_monotonic': [18, 19]})), False)
check('Heartbeat detail exceeds durable history payload limits', solve(dict(r, **{'payload_limit': ['abcd', 3]})), False)
check('Heartbeat renewal extends beyond schedule-to-close timeout', solve(dict(r, **{'absolute_deadline': [21, 20]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'heartbeat_attempt': [3, 4], 'heartbeat_expiry': [10, 10], 'progress_monotonic': [18, 19], 'payload_limit': ['abcd', 3], 'absolute_deadline': [21, 20]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
A previous activity attempt keeps the new attempt aliveFalseFalsePassed
A heartbeat resurrects an activity after its timeoutFalseFalsePassed
A late heartbeat regresses the resumable progress markerFalseFalsePassed
Heartbeat detail exceeds durable history payload limitsFalseFalsePassed
Heartbeat renewal extends beyond schedule-to-close timeoutFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 17faf5851470c09d2cd3cc35e2833b151f77e5265564ef5154be3d777697bd23

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:01.396578+00:00.

Case digest / 9e1149808afc69e2ed68be597d12dc0eb1f31758b963c20c0169e7314ea48566