FAILURE MAP
← Case archive

FA-10116 / Deployment models / Open access

Deployment drift report: Replica count changes are ignored · case 01

Replica count changes are ignored.

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

ROOT CAUSE

The implementation substitutes False for desired['replicas'] != actual['replicas'], so replica count changes are ignored.

VERIFIED REPAIR

Detect both increases and decreases in desired replicas.

Unsuccessful approach: The attempted repair substitutes desired['replicas'] < actual['replicas']. Fixture 5 still yields [] instead of ['replicas'].

Case contract

Compare desired and actual image, environment mapping, replica count, ordered command and resource limits. Return changed fields in fixed schema order.

Why this case matters

An offline model of deployment drift report, suitable for testing build and release tooling without external services.

1 / The failure

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

N = 1
observations = []
def solve(desired, actual):
    result = []
    if desired['image'] != actual['image']: result.append('image')
    if desired['env'] != actual['env']: result.append('env')
    if False: result.append('replicas')
    if desired['command'] != actual['command']: result.append('command')
    if desired['limits'] != actual['limits']: result.append('limits')
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), [])
check('fixture 2', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v2', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['image'])
check('fixture 3', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '2'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['env'])
check('fixture 4', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 3, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 5', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 1, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 6', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['b', 'a'], 'limits': {'memory': 1}}), ['command'])
check('fixture 7', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 2}}), ['limits'])
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
fixture 1[][]Passed
fixture 2['image']['image']Passed
fixture 3['env']['env']Passed
fixture 4[]['replicas']Failed
fixture 5[]['replicas']Failed
fixture 6['command']['command']Passed
fixture 7['limits']['limits']Passed

SHA-256 / 97ba2911ddf6ffa01d7a4ff9a0dab746535b7c8960f5d1b3a0fe1b4a3bc74faa

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(desired, actual):
    result = []
    if desired['image'] != actual['image']: result.append('image')
    if desired['env'] != actual['env']: result.append('env')
    if desired['replicas'] < actual['replicas']: result.append('replicas')
    if desired['command'] != actual['command']: result.append('command')
    if desired['limits'] != actual['limits']: result.append('limits')
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), [])
check('fixture 2', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v2', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['image'])
check('fixture 3', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '2'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['env'])
check('fixture 4', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 3, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 5', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 1, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 6', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['b', 'a'], 'limits': {'memory': 1}}), ['command'])
check('fixture 7', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 2}}), ['limits'])
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
fixture 1[][]Passed
fixture 2['image']['image']Passed
fixture 3['env']['env']Passed
fixture 4['replicas']['replicas']Passed
fixture 5[]['replicas']Failed
fixture 6['command']['command']Passed
fixture 7['limits']['limits']Passed

SHA-256 / c946cae6ae5cf6107ada03975f53d3d83afa5edcd0c89cb90e6dfb6195d1f1f3

3 / The verified repair

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

N = 1
observations = []
def solve(desired, actual):
    result = []
    if desired['image'] != actual['image']: result.append('image')
    if desired['env'] != actual['env']: result.append('env')
    if desired['replicas'] != actual['replicas']: result.append('replicas')
    if desired['command'] != actual['command']: result.append('command')
    if desired['limits'] != actual['limits']: result.append('limits')
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), [])
check('fixture 2', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v2', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['image'])
check('fixture 3', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '2'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['env'])
check('fixture 4', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 3, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 5', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 1, 'command': ['a', 'b'], 'limits': {'memory': 1}}), ['replicas'])
check('fixture 6', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['b', 'a'], 'limits': {'memory': 1}}), ['command'])
check('fixture 7', solve({'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 1}}, {'image': 'v1', 'env': {'A': '1'}, 'replicas': 2, 'command': ['a', 'b'], 'limits': {'memory': 2}}), ['limits'])
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
fixture 1[][]Passed
fixture 2['image']['image']Passed
fixture 3['env']['env']Passed
fixture 4['replicas']['replicas']Passed
fixture 5['replicas']['replicas']Passed
fixture 6['command']['command']Passed
fixture 7['limits']['limits']Passed

SHA-256 / 962434b1e97b03316623228d0a3d7cfabbd039093f7fa7f7f5be26d4d5478322

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

Case digest / 57a2f004c4b800af9552c2ec3a91c17fcead48c0634146d84f625c5e788c25bf