FAILURE MAP
← Case archive

FA-1346 / Workflow orchestration / Open access

Renew a durable activity heartbeat: Heartbeat renewal extends beyond schedule-to-close timeout · case 01

The workflow heartbeat operation is admitted even though heartbeat renewal extends beyond schedule-to-close timeout.

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

ROOT CAUSE

The admission path omits the absolute deadline invariant while validating the other operation preconditions.

VERIFIED REPAIR

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

Unsuccessful approach: Adding the absolute deadline check repairs the reported defect, but replacing the adjacent heartbeat attempt 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['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])
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 timeoutTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 7ab319ba353ec150097ac34072f9d8af099a713603b839efb8a80cd067fa45f0

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_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 aliveTrueFalseFailed
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 / 43d84aaccb47389d6ccaa3609e6b6ee251eb717f6dbfd729b4f1a6ff8bdc31a6

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.486209+00:00.

Case digest / 8f6f7686f006b71be42b386a0430a89895a78745ef7ac9e92155a03016738c09