FAILURE MAP
← Case archive

FA-7361 / DNS resolution / Open access

Dns ttl is reduced by resident seconds and clamped · case 01

Dns ttl is reduced by resident seconds and clamped.

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

ROOT CAUSE

The faulty implementation uses `records` for the dns-ttl-is-reduced-by-resident-seconds-and-clamped decision.

VERIFIED REPAIR

Apply the explicit dns-ttl-is-reduced-by-resident-seconds-and-clamped contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `[(value,max(0,ttl-elapsed)) for value,ttl in records]` and still violates a separate fixture.

Case contract

Given records, elapsed, dns ttl is reduced by resident seconds and clamped. Return the protocol decision or transformed value; fields are validated and fixtures state boundary outcomes.

Why this case matters

This deterministic dns resolution model isolates the dns-ttl-is-reduced-by-resident-seconds-and-clamped policy at a network component boundary.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(records, elapsed):
    return records
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 10), ('b', 30)], 10), [('b', 20)])", "check('fixture 2', solve([], 3), [])", "check('fixture 3', solve([('a', 0)], 0), [])", "check('fixture 4', solve([('a', 10)], 3), [('a', 7)])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 2[][]Passed
fixture 3[['a', 0]][]Failed
fixture 4[['a', 10]][['a', 7]]Failed
fixture 1[['a', 10], ['b', 30]][['b', 20]]Failed

SHA-256 / 93f19c45256f9165cf3193a65a40cdcaf0e379b29b70ab967f84e26786f8fbb2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(records, elapsed):
    return [(value,max(0,ttl-elapsed)) for value,ttl in records]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 10), ('b', 30)], 10), [('b', 20)])", "check('fixture 2', solve([], 3), [])", "check('fixture 3', solve([('a', 0)], 0), [])", "check('fixture 4', solve([('a', 10)], 3), [('a', 7)])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 2[][]Passed
fixture 3[['a', 0]][]Failed
fixture 4[['a', 7]][['a', 7]]Passed
fixture 1[['a', 0], ['b', 20]][['b', 20]]Failed

SHA-256 / 43261b2808069a9d5608e5bfbe43580df6444dd2aa0256451a17a30af4aaab11

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(records, elapsed):
    return [(value,max(0,ttl-elapsed)) for value,ttl in records if ttl > elapsed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 10), ('b', 30)], 10), [('b', 20)])", "check('fixture 2', solve([], 3), [])", "check('fixture 3', solve([('a', 0)], 0), [])", "check('fixture 4', solve([('a', 10)], 3), [('a', 7)])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 2[][]Passed
fixture 3[][]Passed
fixture 4[['a', 7]][['a', 7]]Passed
fixture 1[['b', 20]][['b', 20]]Passed

SHA-256 / da4e4684080a37a0d06f454161d9c36d8162c27a931104d001ad1fab12240549

Verification & scope

Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. 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:11.094768+00:00.

Case digest / ba1cbbf19540417564380ef2add25a28773991faf1cba3e07425e5b9767e6f2e