FAILURE MAP
← Case archive

FA-10341 / Observability / Open access

Structured telemetry field redaction: Public strings exceed the configured field limit · case 01

Public strings exceed the configured field limit.

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

ROOT CAUSE

The implementation substitutes value = value for value = value[:limit], so public strings exceed the configured field limit.

VERIFIED REPAIR

Apply the exact string limit, including zero.

Unsuccessful approach: The attempted repair substitutes value = value[:max(1, limit)]. Fixture 6 still yields [('a', 'h')] instead of [('a', '')].

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 = fields[key]
        if key in sensitive: value = 'REDACTED'
        elif isinstance(value, str): value = value
        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', 'hello']][['a', 'xy'], ['b', 'hel']]Failed
fixture 3[][]Passed
fixture 4[['a', 'REDACTED']][['a', 'REDACTED']]Passed
fixture 5[['a', 0], ['b', False]][['a', 0], ['b', False]]Passed
fixture 6[['a', 'hello']][['a', '']]Failed
fixture 7[['a', 'abc']][['a', 'abc']]Passed

SHA-256 / b58f385db89746fd788dc60d1bd777240a9c2515cc477cfcbc217883de0035dc

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 key in sensitive: value = 'REDACTED'
        elif isinstance(value, str): value = value[:max(1, 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', 'h']][['a', '']]Failed
fixture 7[['a', 'abc']][['a', 'abc']]Passed

SHA-256 / 29e107f31505a9787dc0fd0c3f4297398973197c8f261c5461fb6bec33f806ef

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

Case digest / d65cf45d808fb440cddd86ed67730e746cbf60225bd473d99119ee2b68e7a9c8