[
{
"name": "basic_suffix_formatting_and_redaction",
"input": {
"api_key_secret": "sk-123",
"created_at_epoch_ms": 1738886400000,
"file_size_bytes": 5242880,
"latency_ms": 1280
},
"expected_json": {
"api_key_secret": "***",
"created_at_epoch_ms": 1738886400000,
"file_size_bytes": 5242880,
"latency_ms": 1280
},
"expected_yaml": "---\napi_key_secret: \"***\"\ncreated_at_epoch_ms: 1738886400000\nfile_size_bytes: 5242880\nlatency_ms: 1280",
"expected_plain": "api_key=*** created_at=2025-02-07T00:00:00.000Z file_size=5.0MiB latency=1.28s"
},
{
"name": "negative_ms_uses_abs_threshold",
"input": {
"short_ms": -999,
"long_ms": -1500
},
"expected_json": {
"short_ms": -999,
"long_ms": -1500
},
"expected_yaml": "---\nlong_ms: -1500\nshort_ms: -999",
"expected_plain": "long=-1.5s short=-999ms"
},
{
"name": "collision_reverts_to_original_keys_and_raw_values",
"input": {
"response_ms": 150,
"response_bytes": 1024
},
"expected_json": {
"response_ms": 150,
"response_bytes": 1024
},
"expected_yaml": "---\nresponse_bytes: 1024\nresponse_ms: 150",
"expected_plain": "response_bytes=1024 response_ms=150"
},
{
"name": "negative_epoch_and_bytes_formatting",
"input": {
"created_epoch_ns": "-1",
"delta_bytes": -5242880
},
"expected_json": {
"created_epoch_ns": "-1",
"delta_bytes": -5242880
},
"expected_yaml": "---\ncreated_epoch_ns: \"-1\"\ndelta_bytes: -5242880",
"expected_plain": "created=1969-12-31T23:59:59.999Z delta_bytes=-5242880"
},
{
"name": "type_fallthrough_keeps_original_keys",
"input": {
"cpu_percent": true,
"size_bytes": "unknown",
"ttl_s": "auto"
},
"expected_json": {
"cpu_percent": true,
"size_bytes": "unknown",
"ttl_s": "auto"
},
"expected_yaml": "---\ncpu_percent: true\nsize_bytes: \"unknown\"\nttl_s: \"auto\"",
"expected_plain": "cpu_percent=true size_bytes=unknown ttl_s=auto"
},
{
"name": "uppercase_suffixes_are_supported",
"input": {
"API_KEY_SECRET": "sk-123",
"CACHE_TTL_S": 3600
},
"expected_json": {
"API_KEY_SECRET": "***",
"CACHE_TTL_S": 3600
},
"expected_yaml": "---\nAPI_KEY_SECRET: \"***\"\nCACHE_TTL_S: 3600",
"expected_plain": "API_KEY=*** CACHE_TTL=3600s"
},
{
"name": "secret_collision_never_leaks",
"input": {
"api_key": "public",
"api_key_secret": "sk-live-123"
},
"expected_json": {
"api_key": "public",
"api_key_secret": "***"
},
"expected_yaml": "---\napi_key: \"public\"\napi_key_secret: \"***\"",
"expected_plain": "api_key=public api_key_secret=***"
},
{
"name": "plain_escaping_special_chars",
"input": {
"message": "hello = \"world\" \\ path\nnext\trow"
},
"expected_json": {
"message": "hello = \"world\" \\ path\nnext\trow"
},
"expected_yaml": "---\nmessage: \"hello = \\\"world\\\" \\\\ path\\nnext\\trow\"",
"expected_plain": "message=\"hello = \\\"world\\\" \\\\ path\\nnext\\trow\""
},
{
"name": "integral_floats_render_without_trailing_decimal",
"input": {
"reserve_btc": 3.0,
"cpu_percent": 95.0,
"timeout_s": 30.0,
"balance_msats": 50000.0
},
"expected_json": {
"reserve_btc": 3.0,
"cpu_percent": 95.0,
"timeout_s": 30.0,
"balance_msats": 50000.0
},
"expected_yaml": "---\nbalance_msats: 50000\ncpu_percent: 95\nreserve_btc: 3\ntimeout_s: 30",
"expected_plain": "balance=50000msats cpu=95% reserve_btc=3 timeout=30s"
},
{
"name": "registry_suffix_coverage",
"input": {
"cached_epoch_s": 0,
"cert_days": 365,
"invoice_eur_cents": 12345,
"pause_ns": 450000,
"query_us": 830,
"timeout_minutes": 30,
"validity_hours": 24
},
"expected_json": {
"cached_epoch_s": 0,
"cert_days": 365,
"invoice_eur_cents": 12345,
"pause_ns": 450000,
"query_us": 830,
"timeout_minutes": 30,
"validity_hours": 24
},
"expected_yaml": "---\ncached_epoch_s: 0\ncert_days: 365\ninvoice_eur_cents: 12345\npause_ns: 450000\nquery_us: 830\ntimeout_minutes: 30\nvalidity_hours: 24",
"expected_plain": "cached=1970-01-01T00:00:00.000Z cert=\"365 days\" invoice=€123.45 pause=450000ns query=830μs timeout=\"30 minutes\" validity=\"24 hours\""
},
{
"name": "integral_floats_satisfy_integer_required_suffixes",
"input": {
"price_usd_cents": 999.0,
"file_size_bytes": 5242880.0,
"fee_jpy": 1500.0,
"created_at_epoch_ms": 1738886400000.0
},
"expected_json": {
"price_usd_cents": 999.0,
"file_size_bytes": 5242880.0,
"fee_jpy": 1500.0,
"created_at_epoch_ms": 1738886400000.0
},
"expected_yaml": "---\ncreated_at_epoch_ms: 1738886400000\nfee_jpy: 1500\nfile_size_bytes: 5242880\nprice_usd_cents: 999",
"expected_plain": "created_at=2025-02-07T00:00:00.000Z fee=\u00a51,500 file_size=5.0MiB price=$9.99"
},
{
"name": "fractional_floats_render_shortest_round_trip",
"input": {
"ratio_percent": 99.9,
"amount_btc": 0.5
},
"expected_json": {
"ratio_percent": 99.9,
"amount_btc": 0.5
},
"expected_yaml": "---\namount_btc: 0.5\nratio_percent: 99.9",
"expected_plain": "amount_btc=0.5 ratio=99.9%"
},
{
"name": "bytes_round_half_to_even",
"input": {
"a_bytes": 1280,
"b_bytes": 3328,
"c_bytes": 1310720
},
"expected_json": {
"a_bytes": 1280,
"b_bytes": 3328,
"c_bytes": 1310720
},
"expected_yaml": "---\na_bytes: 1280\nb_bytes: 3328\nc_bytes: 1310720",
"expected_plain": "a=1.2KiB b=3.2KiB c=1.2MiB"
},
{
"name": "strict_string_suffixes_pass_through",
"input": {
"language_bcp47": "zh-CN",
"timezone_utc_offset": "+08:00"
},
"expected_json": {
"language_bcp47": "zh-CN",
"timezone_utc_offset": "+08:00"
},
"expected_yaml": "---\nlanguage_bcp47: \"zh-CN\"\ntimezone_utc_offset: \"+08:00\"",
"expected_plain": "language_bcp47=zh-CN timezone_utc_offset=+08:00"
},
{
"name": "rfc3339_date_time_are_strict_strings",
"input": {
"created_at_rfc3339": "2026-06-13T09:30:00+08:00",
"invoice_due_rfc3339_date": "2026-06-13",
"market_open_rfc3339_time": "09:30:00"
},
"expected_json": {
"created_at_rfc3339": "2026-06-13T09:30:00+08:00",
"invoice_due_rfc3339_date": "2026-06-13",
"market_open_rfc3339_time": "09:30:00"
},
"expected_yaml": "---\ncreated_at_rfc3339: \"2026-06-13T09:30:00+08:00\"\ninvoice_due_rfc3339_date: \"2026-06-13\"\nmarket_open_rfc3339_time: \"09:30:00\"",
"expected_plain": "created_at=2026-06-13T09:30:00+08:00 invoice_due_rfc3339_date=2026-06-13 market_open_rfc3339_time=09:30:00"
},
{
"name": "rfc3339_date_time_non_strings_pass_through",
"input": {
"bad_date_rfc3339_date": 20260613,
"bad_time_rfc3339_time": false
},
"expected_json": {
"bad_date_rfc3339_date": 20260613,
"bad_time_rfc3339_time": false
},
"expected_yaml": "---\nbad_date_rfc3339_date: 20260613\nbad_time_rfc3339_time: false",
"expected_plain": "bad_date_rfc3339_date=20260613 bad_time_rfc3339_time=false"
},
{
"name": "epoch_ns_decimal_string_current_era",
"input": {
"created_epoch_ns": "1707868800000000000"
},
"expected_json": {
"created_epoch_ns": "1707868800000000000"
},
"expected_yaml": "---\ncreated_epoch_ns: \"1707868800000000000\"",
"expected_plain": "created=2024-02-14T00:00:00.000Z"
},
{
"name": "bitcoin_units_accept_decimal_integer_strings",
"input": {
"balance_msats": "9007199254740993",
"withdrawn_sats": "9007199254740993"
},
"expected_json": {
"balance_msats": "9007199254740993",
"withdrawn_sats": "9007199254740993"
},
"expected_yaml": "---\nbalance_msats: \"9007199254740993\"\nwithdrawn_sats: \"9007199254740993\"",
"expected_plain": "balance=9007199254740993msats withdrawn=9007199254740993sats"
},
{
"name": "container_secret_collision_never_leaks",
"input": {
"creds_secret": {
"inner": "sk-OBJ-SECRET"
},
"creds": "plain"
},
"expected_json": {
"creds_secret": "***",
"creds": "plain"
},
"expected_yaml": "---\ncreds: \"plain\"\ncreds_secret: \"***\"",
"expected_plain": "creds=plain creds_secret=***"
},
{
"name": "plain_array_objects_use_canonical_json",
"input": {
"items": [
{
"a": 1
},
{
"b_secret": "sk"
}
]
},
"expected_json": {
"items": [
{
"a": 1
},
{
"b_secret": "***"
}
]
},
"expected_yaml": "---\nitems:\n -\n a: 1\n -\n b_secret: \"***\"",
"expected_plain": "items=\"{\\\"a\\\":1},{\\\"b_secret\\\":\\\"***\\\"}\""
},
{
"name": "float_exponent_rendering",
"input": {
"small_percent": 1e-07,
"huge_s": 1e+21
},
"expected_json": {
"small_percent": 1e-07,
"huge_s": 1e+21
},
"expected_yaml": "---\nhuge_s: 1e+21\nsmall_percent: 1e-7",
"expected_plain": "huge=1e+21s small=1e-7%"
},
{
"name": "out_of_range_epoch_falls_through",
"input": {
"created_at_epoch_ms": 253402300800000,
"ok_epoch_ms": 253402300799999
},
"expected_json": {
"created_at_epoch_ms": 253402300800000,
"ok_epoch_ms": 253402300799999
},
"expected_yaml": "---\ncreated_at_epoch_ms: 253402300800000\nok_epoch_ms: 253402300799999",
"expected_plain": "created_at_epoch_ms=253402300800000 ok=9999-12-31T23:59:59.999Z"
},
{
"name": "dangerous_keys_are_escaped",
"input": {
"k\nadmin: true\nx": "v",
"sp ace": "a",
"eq=key": "b"
},
"expected_json": {
"k\nadmin: true\nx": "v",
"sp ace": "a",
"eq=key": "b"
},
"expected_yaml": "---\n\"eq=key\": \"b\"\n\"k\\nadmin: true\\nx\": \"v\"\n\"sp ace\": \"a\"",
"expected_plain": "\"eq=key\"=b \"k\\nadmin: true\\nx\"=v \"sp ace\"=a"
},
{
"name": "generic_cents_requires_currency_code",
"input": {
"fare_thb_cents": 15050,
"total_amount_cents": 15050
},
"expected_json": {
"fare_thb_cents": 15050,
"total_amount_cents": 15050
},
"expected_yaml": "---\nfare_thb_cents: 15050\ntotal_amount_cents: 15050",
"expected_plain": "fare=\"150.50 THB\" total_amount_cents=15050"
},
{
"name": "currency_micro",
"input": {
"cost_usd_micro": 170000,
"price_cny_micro": 5000000
},
"expected_json": {
"cost_usd_micro": 170000,
"price_cny_micro": 5000000
},
"expected_yaml": "---\ncost_usd_micro: 170000\nprice_cny_micro: 5000000",
"expected_plain": "cost=\"0.170000 USD\" price=\"5.000000 CNY\""
},
{
"name": "generic_micro_requires_currency_code",
"input": {
"fare_thb_micro": 15050,
"total_amount_micro": 15050
},
"expected_json": {
"fare_thb_micro": 15050,
"total_amount_micro": 15050
},
"expected_yaml": "---\nfare_thb_micro: 15050\ntotal_amount_micro: 15050",
"expected_plain": "fare=\"0.015050 THB\" total_amount_micro=15050"
},
{
"name": "plain_quotes_vt_ff_nbsp",
"input": {
"form_feed": "a\fb",
"nbsp": "a\u00a0b",
"vertical_tab": "a\u000bb"
},
"expected_json": {
"form_feed": "a\fb",
"nbsp": "a\u00a0b",
"vertical_tab": "a\u000bb"
},
"expected_yaml": "---\nform_feed: \"a\\fb\"\nnbsp: \"a\u00a0b\"\nvertical_tab: \"a\\vb\"",
"expected_plain": "form_feed=\"a\\fb\" nbsp=\"a\u00a0b\" vertical_tab=\"a\\vb\""
},
{
"name": "url_params_redacted_not_reformatted",
"input": {
"latency_ms": 1280,
"endpoint_url": "https://h/api?timeout_ms=5000&size_bytes=1048576&token_secret=abc&page=2"
},
"expected_json": {
"latency_ms": 1280,
"endpoint_url": "https://h/api?timeout_ms=5000&size_bytes=1048576&token_secret=***&page=2"
},
"expected_yaml": "---\nendpoint_url: \"https://h/api?timeout_ms=5000&size_bytes=1048576&token_secret=***&page=2\"\nlatency_ms: 1280",
"expected_plain": "endpoint_url=\"https://h/api?timeout_ms=5000&size_bytes=1048576&token_secret=***&page=2\" latency=1.28s"
}
]