{"abstract":"A cue shifted slightly before zero is written at a positive time mirrored around the origin.","category":"Subtitle cue timing","checks":9,"contract":"Format integer milliseconds as a cue timestamp. Negative values clamp to 0. style \"srt\" gives HH:MM:SS,mmm (hours at least two digits, never wrapped); style \"vtt\" gives MM:SS.mmm when the hour field is zero and HH:MM:SS.mmm otherwise.","evaluation_group":"w2-subtitle-cue-timing-timestamp-format","failed_approach":"Clamping only values of a full second or more leaves sub-second negatives to be formatted with negative fields.","family":"w2-subtitle-cue-timing-timestamp-format-negative-clamp","id":"FA-77866","implementations":{"attempt":{"sha256":"669a3e44388abc5ab0be6f7f6dd14e7ebe84e8339b95a1fa8d6944a14cedc1ed","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ms, style):\n    if ms<=-1000: ms=0\n    h=ms//3600000\n    m=(ms-h*3600000)//60000\n    s=ms//1000%60\n    f=ms%1000\n    if style=='srt':\n        return '%02d:%02d:%02d,%03d'%(h,m,s,f)\n    if h==0:\n        return '%02d:%02d.%03d'%(m,s,f)\n    return '%02d:%02d:%02d.%03d'%(h,m,s,f)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative clamp', [-1, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [61001, 'vtt'], '01:01.001'), ('normal control', [7834, 'srt'], '00:00:07,834')], [('regression: negative clamp', [-999, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1000, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('normal control', [3192469, 'vtt'], '53:12.469'), ('normal control', [893654, 'srt'], '00:14:53,654'), ('normal control', [55880, 'vtt'], '00:55.880')], [('regression: negative clamp', [-5000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [11761, 'vtt'], '00:11.761'), ('normal control', [360000000, 'vtt'], '100:00:00.000'), ('normal control', [78935, 'srt'], '00:01:18,935')], [('regression: negative clamp', [-5000, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [3576784, 'srt'], '00:59:36,784'), ('normal control', [59999, 'vtt'], '00:59.999'), ('normal control', [1088867, 'srt'], '00:18:08,867')], [('regression: negative clamp', [-1000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3599999, 'srt'], '00:59:59,999'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [19225823, 'srt'], '05:20:25,823')]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"b8fcea50ad1e5262bfd71eb1a596939f3c2fc2a5753b3b30a29a1edb998b4d46","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ms, style):\n    if ms<0: ms=-ms\n    h=ms//3600000\n    m=(ms-h*3600000)//60000\n    s=ms//1000%60\n    f=ms%1000\n    if style=='srt':\n        return '%02d:%02d:%02d,%03d'%(h,m,s,f)\n    if h==0:\n        return '%02d:%02d.%03d'%(m,s,f)\n    return '%02d:%02d:%02d.%03d'%(h,m,s,f)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative clamp', [-1, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [61001, 'vtt'], '01:01.001'), ('normal control', [7834, 'srt'], '00:00:07,834')], [('regression: negative clamp', [-999, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1000, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('normal control', [3192469, 'vtt'], '53:12.469'), ('normal control', [893654, 'srt'], '00:14:53,654'), ('normal control', [55880, 'vtt'], '00:55.880')], [('regression: negative clamp', [-5000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [11761, 'vtt'], '00:11.761'), ('normal control', [360000000, 'vtt'], '100:00:00.000'), ('normal control', [78935, 'srt'], '00:01:18,935')], [('regression: negative clamp', [-5000, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [3576784, 'srt'], '00:59:36,784'), ('normal control', [59999, 'vtt'], '00:59.999'), ('normal control', [1088867, 'srt'], '00:18:08,867')], [('regression: negative clamp', [-1000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3599999, 'srt'], '00:59:59,999'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [19225823, 'srt'], '05:20:25,823')]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"14c40b4f5d3859a1c84c6196ac5ffa6641c7612a7e2099570dd41e3c55457dd7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ms, style):\n    if ms<0: ms=0\n    h=ms//3600000\n    m=(ms-h*3600000)//60000\n    s=ms//1000%60\n    f=ms%1000\n    if style=='srt':\n        return '%02d:%02d:%02d,%03d'%(h,m,s,f)\n    if h==0:\n        return '%02d:%02d.%03d'%(m,s,f)\n    return '%02d:%02d:%02d.%03d'%(h,m,s,f)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative clamp', [-1, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [61001, 'vtt'], '01:01.001'), ('normal control', [7834, 'srt'], '00:00:07,834')], [('regression: negative clamp', [-999, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1000, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('normal control', [3192469, 'vtt'], '53:12.469'), ('normal control', [893654, 'srt'], '00:14:53,654'), ('normal control', [55880, 'vtt'], '00:55.880')], [('regression: negative clamp', [-5000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [11761, 'vtt'], '00:11.761'), ('normal control', [360000000, 'vtt'], '100:00:00.000'), ('normal control', [78935, 'srt'], '00:01:18,935')], [('regression: negative clamp', [-5000, 'vtt'], '00:00.000'), ('regression variant: negative clamp', [-1, 'srt'], '00:00:00,000'), ('partial repair probe: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair variant: negative clamp', [-999, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [3576784, 'srt'], '00:59:36,784'), ('normal control', [59999, 'vtt'], '00:59.999'), ('normal control', [1088867, 'srt'], '00:18:08,867')], [('regression: negative clamp', [-1000, 'srt'], '00:00:00,000'), ('regression variant: negative clamp', [-999, 'vtt'], '00:00.000'), ('partial repair probe: negative clamp', [-999, 'srt'], '00:00:00,000'), ('partial repair variant: negative clamp', [-1, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3599999, 'srt'], '00:59:59,999'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [19225823, 'srt'], '05:20:25,823')]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with a stipulated toy contract; it does not claim conformance to any subtitle standard. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-subtitle-cue-timing-timestamp-format-negative-clamp","generated_at":"2026-09-29T14:49:29.978133+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Subtitle timing defects shift, hide or overlap captions that viewers depend on for comprehension and accessibility.","repair":"Clamp every negative value to 0 before splitting fields.","root_cause":"Negative milliseconds are negated with ms=-ms instead of being clamped to zero.","sha256":"1b7a26372d9121f5c7f347be9d5122a74d792a2c06aeb0862b57583fb24f1c3c","title":"SRT and WebVTT timestamp formatting: negative clamp · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.67,"exit_code":1,"observations":[{"actual":"-1:59:59,999","check":"regression: negative clamp","expected":"00:00:00,000","passed":false},{"actual":"-1:59:59,001","check":"regression variant: negative clamp","expected":"00:00:00,000","passed":false},{"actual":"-1:59:59.999","check":"partial repair probe: negative clamp","expected":"00:00.000","passed":false},{"actual":"-1:59:59.001","check":"partial repair variant: negative clamp","expected":"00:00.000","passed":false},{"actual":"00:00:00,000","check":"boundary control","expected":"00:00:00,000","passed":true},{"actual":"59:59.999","check":"boundary control","expected":"59:59.999","passed":true},{"actual":"00:00.000","check":"normal control","expected":"00:00.000","passed":true},{"actual":"01:01.001","check":"normal control","expected":"01:01.001","passed":true},{"actual":"00:00:07,834","check":"normal control","expected":"00:00:07,834","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative clamp\", \"actual\": \"-1:59:59,999\", \"expected\": \"00:00:00,000\", \"passed\": false}, {\"check\": \"regression variant: negative clamp\", \"actual\": \"-1:59:59,001\", \"expected\": \"00:00:00,000\", \"passed\": false}, {\"check\": \"partial repair probe: negative clamp\", \"actual\": \"-1:59:59.999\", \"expected\": \"00:00.000\", \"passed\": false}, {\"check\": \"partial repair variant: negative clamp\", \"actual\": \"-1:59:59.001\", \"expected\": \"00:00.000\", \"passed\": false}, {\"check\": \"boundary control\", \"actual\": \"00:00:00,000\", \"expected\": \"00:00:00,000\", \"passed\": true}, {\"check\": \"boundary control\", \"actual\": \"59:59.999\", \"expected\": \"59:59.999\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00.000\", \"expected\": \"00:00.000\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"01:01.001\", \"expected\": \"01:01.001\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00:07,834\", \"expected\": \"00:00:07,834\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.207,"exit_code":1,"observations":[{"actual":"00:00:00,001","check":"regression: negative clamp","expected":"00:00:00,000","passed":false},{"actual":"00:00:00,999","check":"regression variant: negative clamp","expected":"00:00:00,000","passed":false},{"actual":"00:00.001","check":"partial repair probe: negative clamp","expected":"00:00.000","passed":false},{"actual":"00:00.999","check":"partial repair variant: negative clamp","expected":"00:00.000","passed":false},{"actual":"00:00:00,000","check":"boundary control","expected":"00:00:00,000","passed":true},{"actual":"59:59.999","check":"boundary control","expected":"59:59.999","passed":true},{"actual":"00:00.000","check":"normal control","expected":"00:00.000","passed":true},{"actual":"01:01.001","check":"normal control","expected":"01:01.001","passed":true},{"actual":"00:00:07,834","check":"normal control","expected":"00:00:07,834","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative clamp\", \"actual\": \"00:00:00,001\", \"expected\": \"00:00:00,000\", \"passed\": false}, {\"check\": \"regression variant: negative clamp\", \"actual\": \"00:00:00,999\", \"expected\": \"00:00:00,000\", \"passed\": false}, {\"check\": \"partial repair probe: negative clamp\", \"actual\": \"00:00.001\", \"expected\": \"00:00.000\", \"passed\": false}, {\"check\": \"partial repair variant: negative clamp\", \"actual\": \"00:00.999\", \"expected\": \"00:00.000\", \"passed\": false}, {\"check\": \"boundary control\", \"actual\": \"00:00:00,000\", \"expected\": \"00:00:00,000\", \"passed\": true}, {\"check\": \"boundary control\", \"actual\": \"59:59.999\", \"expected\": \"59:59.999\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00.000\", \"expected\": \"00:00.000\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"01:01.001\", \"expected\": \"01:01.001\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00:07,834\", \"expected\": \"00:00:07,834\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.867,"exit_code":0,"observations":[{"actual":"00:00:00,000","check":"regression: negative clamp","expected":"00:00:00,000","passed":true},{"actual":"00:00:00,000","check":"regression variant: negative clamp","expected":"00:00:00,000","passed":true},{"actual":"00:00.000","check":"partial repair probe: negative clamp","expected":"00:00.000","passed":true},{"actual":"00:00.000","check":"partial repair variant: negative clamp","expected":"00:00.000","passed":true},{"actual":"00:00:00,000","check":"boundary control","expected":"00:00:00,000","passed":true},{"actual":"59:59.999","check":"boundary control","expected":"59:59.999","passed":true},{"actual":"00:00.000","check":"normal control","expected":"00:00.000","passed":true},{"actual":"01:01.001","check":"normal control","expected":"01:01.001","passed":true},{"actual":"00:00:07,834","check":"normal control","expected":"00:00:07,834","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative clamp\", \"actual\": \"00:00:00,000\", \"expected\": \"00:00:00,000\", \"passed\": true}, {\"check\": \"regression variant: negative clamp\", \"actual\": \"00:00:00,000\", \"expected\": \"00:00:00,000\", \"passed\": true}, {\"check\": \"partial repair probe: negative clamp\", \"actual\": \"00:00.000\", \"expected\": \"00:00.000\", \"passed\": true}, {\"check\": \"partial repair variant: negative clamp\", \"actual\": \"00:00.000\", \"expected\": \"00:00.000\", \"passed\": true}, {\"check\": \"boundary control\", \"actual\": \"00:00:00,000\", \"expected\": \"00:00:00,000\", \"passed\": true}, {\"check\": \"boundary control\", \"actual\": \"59:59.999\", \"expected\": \"59:59.999\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00.000\", \"expected\": \"00:00.000\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"01:01.001\", \"expected\": \"01:01.001\", \"passed\": true}, {\"check\": \"normal control\", \"actual\": \"00:00:07,834\", \"expected\": \"00:00:07,834\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}