FAILURE MAP
← Case archive

FA-10346 / Observability / Open access

Structured telemetry field redaction: Telemetry redaction stringifies numeric and boolean values · case 01

Telemetry redaction stringifies numeric and boolean values.

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

ROOT CAUSE

The implementation substitutes value = str(fields[key]) for value = fields[key], so telemetry redaction stringifies numeric and boolean values.

VERIFIED REPAIR

Preserve nonstring values and false values.

Unsuccessful approach: The attempted repair substitutes value = fields[key] if fields[key] else None. Fixture 5 still yields [('a', None), ('b', None)] instead of [('a', 0), ('b', False)].

Case contract

Remove forbidden keys, replace sensitive field values with REDACTED, truncate long public string values, preserve nonstring values, and return keys in lexical order. Forbidden removal dominates sensitive replacement.

Why this case matters

An offline model of structured telemetry field redaction, 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(fields, forbidden, sensitive, limit):
    result = {}
    for key in sorted(fields):
        if key in forbidden: continue
        value = str(fields[key])
        if key in sensitive: value = 'REDACTED'
        elif isinstance(value, str): value = value[:limit]
        result[key] = value
    return list(result.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, [], [], 3), [])
check('fixture 2', solve({'b': 'hello', 'a': 'xy'}, [], [], 3), [('a', 'xy'), ('b', 'hel')])
check('fixture 3', solve({'a': 'secret'}, ['a'], ['a'], 3), [])
check('fixture 4', solve({'a': 'secret'}, [], ['a'], 3), [('a', 'REDACTED')])
check('fixture 5', solve({'a': 0, 'b': False}, [], [], 3), [('a', 0), ('b', False)])
check('fixture 6', solve({'a': 'hello'}, [], [], 0), [('a', '')])
check('fixture 7', solve({'a': 'abc'}, [], [], 3), [('a', 'abc')])
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[['a', 'xy'], ['b', 'hel']][['a', 'xy'], ['b', 'hel']]Passed
fixture 3[][]Passed
fixture 4[['a', 'REDACTED']][['a', 'REDACTED']]Passed
fixture 5[['a', '0'], ['b', 'Fal']][['a', 0], ['b', False]]Failed
fixture 6[['a', '']][['a', '']]Passed
fixture 7[['a', 'abc']][['a', 'abc']]Passed

SHA-256 / 3f951e4e78edc160b330370b977b9406d5cfbd6cdd439d9b4d566ee33b10b972

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(fields, forbidden, sensitive, limit):
    result = {}
    for key in sorted(fields):
        if key in forbidden: continue
        value = fields[key] if fields[key] else None
        if key in sensitive: value = 'REDACTED'
        elif isinstance(value, str): value = value[:limit]
        result[key] = value
    return list(result.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, [], [], 3), [])
check('fixture 2', solve({'b': 'hello', 'a': 'xy'}, [], [], 3), [('a', 'xy'), ('b', 'hel')])
check('fixture 3', solve({'a': 'secret'}, ['a'], ['a'], 3), [])
check('fixture 4', solve({'a': 'secret'}, [], ['a'], 3), [('a', 'REDACTED')])
check('fixture 5', solve({'a': 0, 'b': False}, [], [], 3), [('a', 0), ('b', False)])
check('fixture 6', solve({'a': 'hello'}, [], [], 0), [('a', '')])
check('fixture 7', solve({'a': 'abc'}, [], [], 3), [('a', 'abc')])
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[['a', 'xy'], ['b', 'hel']][['a', 'xy'], ['b', 'hel']]Passed
fixture 3[][]Passed
fixture 4[['a', 'REDACTED']][['a', 'REDACTED']]Passed
fixture 5[['a', None], ['b', None]][['a', 0], ['b', False]]Failed
fixture 6[['a', '']][['a', '']]Passed
fixture 7[['a', 'abc']][['a', 'abc']]Passed

SHA-256 / 0dab88fd4747ce901f4d05a50b5767e27d340b23c81a3776b97828ad5be23750

3 / The verified repair

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

N = 1
observations = []
def solve(fields, forbidden, sensitive, limit):
    result = {}
    for key in sorted(fields):
        if key in forbidden: continue
        value = fields[key]
        if key in sensitive: value = 'REDACTED'
        elif isinstance(value, str): value = value[:limit]
        result[key] = value
    return list(result.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, [], [], 3), [])
check('fixture 2', solve({'b': 'hello', 'a': 'xy'}, [], [], 3), [('a', 'xy'), ('b', 'hel')])
check('fixture 3', solve({'a': 'secret'}, ['a'], ['a'], 3), [])
check('fixture 4', solve({'a': 'secret'}, [], ['a'], 3), [('a', 'REDACTED')])
check('fixture 5', solve({'a': 0, 'b': False}, [], [], 3), [('a', 0), ('b', False)])
check('fixture 6', solve({'a': 'hello'}, [], [], 0), [('a', '')])
check('fixture 7', solve({'a': 'abc'}, [], [], 3), [('a', 'abc')])
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[['a', 'xy'], ['b', 'hel']][['a', 'xy'], ['b', 'hel']]Passed
fixture 3[][]Passed
fixture 4[['a', 'REDACTED']][['a', 'REDACTED']]Passed
fixture 5[['a', 0], ['b', False]][['a', 0], ['b', False]]Passed
fixture 6[['a', '']][['a', '']]Passed
fixture 7[['a', 'abc']][['a', 'abc']]Passed

SHA-256 / 169f7043df42461de1fb63a690c7e1f5176f86c68bc043da8a33a4640416f00a

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

Case digest / 77ea06d3a77c9aa2a864e21de256c078ae7f05af1b3331578f32e7bab31e428d