{"abstract":"Prompt length is omitted from a total context cap.","category":"Model output stopping rules","checks":6,"contract":"Retain generated tokens so prompt plus retained output is at most total_limit. Return retained tokens and whether truncation occurred.","contract_signature":"tokens, prompt_len, total_limit","evaluation_group":"w3-output-total-budget","failed_approach":"Subtracting one extra slot truncates output even when it exactly fits the remaining room.","family":"w3-model-output-stopping-rules-total-token-budget","id":"FA-100761","implementations":{"attempt":{"sha256":"fc3a7da61e95f0f8f15addae41c88db322eb8640688f12f2a0f831e2eeac469e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, prompt_len, total_limit):\n    room=max(0,total_limit-prompt_len-1)\n    kept=tokens[:room]\n    return kept,len(kept)<len(tokens)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('prompt consumes room',solve(list(range(N+2)),N, N+2),([0,1],True))\ncheck('exact fit',solve([1,2],N, N+2),([1,2],False))\ncheck('prompt fills limit',solve([1],N,N),([],True))\ncheck('empty suffix',solve([],N,N+1),([],False))\ncheck('zero total',solve([1],N,0),([],True))\ncheck('one slot',solve([8,9],N,N+1),([8],True))\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":"66a7768eeac4d4473240bcc49c7a6471e013cc0cca4e25e4f025e3f3838a87a9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, prompt_len, total_limit):\n    room=max(0,total_limit)\n    kept=tokens[:room]\n    return kept,len(kept)<len(tokens)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('prompt consumes room',solve(list(range(N+2)),N, N+2),([0,1],True))\ncheck('exact fit',solve([1,2],N, N+2),([1,2],False))\ncheck('prompt fills limit',solve([1],N,N),([],True))\ncheck('empty suffix',solve([],N,N+1),([],False))\ncheck('zero total',solve([1],N,0),([],True))\ncheck('one slot',solve([8,9],N,N+1),([8],True))\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":"This toy contract covers the supplied token records only; it does not claim compatibility with a particular model runtime or tokenizer. 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":"w3-model-output-stopping-rules-total-token-budget","generated_at":"2026-09-30T16:48:39.562738+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic output-control model isolates one finish or streaming boundary from any particular runtime.","root_cause":"The cap is applied to generated tokens without subtracting the prompt length.","sha256":"9816505d546328507e8c8903f3d3166dc59918a8a859b1d102030445bd5b43cf","title":"Output stopping: Prompt length is omitted from a total context cap · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":33.664,"exit_code":1,"observations":[{"actual":[[0],true],"check":"prompt consumes room","expected":[[0,1],true],"passed":false},{"actual":[[1],true],"check":"exact fit","expected":[[1,2],false],"passed":false},{"actual":[[],true],"check":"prompt fills limit","expected":[[],true],"passed":true},{"actual":[[],false],"check":"empty suffix","expected":[[],false],"passed":true},{"actual":[[],true],"check":"zero total","expected":[[],true],"passed":true},{"actual":[[],true],"check":"one slot","expected":[[8],true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"prompt consumes room\", \"actual\": [[0], true], \"expected\": [[0, 1], true], \"passed\": false}, {\"check\": \"exact fit\", \"actual\": [[1], true], \"expected\": [[1, 2], false], \"passed\": false}, {\"check\": \"prompt fills limit\", \"actual\": [[], true], \"expected\": [[], true], \"passed\": true}, {\"check\": \"empty suffix\", \"actual\": [[], false], \"expected\": [[], false], \"passed\": true}, {\"check\": \"zero total\", \"actual\": [[], true], \"expected\": [[], true], \"passed\": true}, {\"check\": \"one slot\", \"actual\": [[], true], \"expected\": [[8], true], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.063,"exit_code":1,"observations":[{"actual":[[0,1,2],false],"check":"prompt consumes room","expected":[[0,1],true],"passed":false},{"actual":[[1,2],false],"check":"exact fit","expected":[[1,2],false],"passed":true},{"actual":[[1],false],"check":"prompt fills limit","expected":[[],true],"passed":false},{"actual":[[],false],"check":"empty suffix","expected":[[],false],"passed":true},{"actual":[[],true],"check":"zero total","expected":[[],true],"passed":true},{"actual":[[8,9],false],"check":"one slot","expected":[[8],true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"prompt consumes room\", \"actual\": [[0, 1, 2], false], \"expected\": [[0, 1], true], \"passed\": false}, {\"check\": \"exact fit\", \"actual\": [[1, 2], false], \"expected\": [[1, 2], false], \"passed\": true}, {\"check\": \"prompt fills limit\", \"actual\": [[1], false], \"expected\": [[], true], \"passed\": false}, {\"check\": \"empty suffix\", \"actual\": [[], false], \"expected\": [[], false], \"passed\": true}, {\"check\": \"zero total\", \"actual\": [[], true], \"expected\": [[], true], \"passed\": true}, {\"check\": \"one slot\", \"actual\": [[8, 9], false], \"expected\": [[8], true], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}