{"abstract":"Undeclared leaf targets disappear.","category":"Build systems","checks":8,"contract":"Return sorted unique reachable target names including roots. Traverse normal prerequisites, exclude order-only prerequisites, retain unknown leaves, and stop cycles.","contract_signature":"roots, edges","evaluation_group":"xt-target-closure","failed_approach":"The attempted repair substitutes seen.add(node)\n    if node in edges:\n        continue. Fixture 3 still yields ['a'] instead of ['a', 'b'].","family":"xt-target-closure-leaf-retention","id":"FA-9146","implementations":{"attempt":{"sha256":"57624ce7b8eec97687f3fb04a1cca70a88450a66e18254e36a902ef363057dcb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(roots, edges):\n    seen = set()\n    stack = list(roots)\n    while stack:\n        node = stack.pop()\n        if node in seen:\n            continue\n        seen.add(node)\n        if node in edges:\n            continue\n        stack.extend(dep for dep, kind in edges.get(node, []) if kind == 'normal')\n    return sorted(seen)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve([], {}), [])\ncheck('fixture 2', solve(['a'], {}), ['a'])\ncheck('fixture 3', solve(['a'], {'a': [('b', 'normal'), ('c', 'order')]}), ['a', 'b'])\ncheck('fixture 4', solve(['a'], {'a': [('b', 'normal')], 'b': [('c', 'normal')]}), ['a', 'b', 'c'])\ncheck('fixture 5', solve(['z', 'a'], {}), ['a', 'z'])\ncheck('fixture 6', solve(['a', 'a'], {'a': [('b', 'normal')]}), ['a', 'b'])\ncheck('fixture 7', solve(['a'], {'a': [('b', 'normal')], 'b': [('a', 'normal')]}), ['a', 'b'])\ncheck('fixture 8', solve(['a'], {'a': [('b', 'order')]}), ['a'])\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":"0e514e69c34ca2e15b16f63d88a3c0de3356ea4d2f7d7010b52258f02a7e4808","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(roots, edges):\n    seen = set()\n    stack = list(roots)\n    while stack:\n        node = stack.pop()\n        if node in seen:\n            continue\n        seen.update([node] if node in edges else [])\n        if node not in edges:\n            continue\n        stack.extend(dep for dep, kind in edges.get(node, []) if kind == 'normal')\n    return sorted(seen)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve([], {}), [])\ncheck('fixture 2', solve(['a'], {}), ['a'])\ncheck('fixture 3', solve(['a'], {'a': [('b', 'normal'), ('c', 'order')]}), ['a', 'b'])\ncheck('fixture 4', solve(['a'], {'a': [('b', 'normal')], 'b': [('c', 'normal')]}), ['a', 'b', 'c'])\ncheck('fixture 5', solve(['z', 'a'], {}), ['a', 'z'])\ncheck('fixture 6', solve(['a', 'a'], {'a': [('b', 'normal')]}), ['a', 'b'])\ncheck('fixture 7', solve(['a'], {'a': [('b', 'normal')], 'b': [('a', 'normal')]}), ['a', 'b'])\ncheck('fixture 8', solve(['a'], {'a': [('b', 'order')]}), ['a'])\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 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":"xt-target-closure-leaf-retention","generated_at":"2026-09-29T14:38:27.407111+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline model of build prerequisite closure, suitable for testing build and release tooling without external services.","root_cause":"The implementation substitutes seen.update([node] if node in edges else [])\n    if node not in edges:\n        continue for seen.add(node), so undeclared leaf targets disappear.","sha256":"91609efe35d267e7cf3cecfd21204cb9e023bff37ea98761bb42ec4dc0f91c53","title":"Build prerequisite closure: Undeclared leaf targets disappear · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.131,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["a"],"check":"fixture 2","expected":["a"],"passed":true},{"actual":["a"],"check":"fixture 3","expected":["a","b"],"passed":false},{"actual":["a"],"check":"fixture 4","expected":["a","b","c"],"passed":false},{"actual":["a","z"],"check":"fixture 5","expected":["a","z"],"passed":true},{"actual":["a"],"check":"fixture 6","expected":["a","b"],"passed":false},{"actual":["a"],"check":"fixture 7","expected":["a","b"],"passed":false},{"actual":["a"],"check":"fixture 8","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"fixture 5\", \"actual\": [\"a\", \"z\"], \"expected\": [\"a\", \"z\"], \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"fixture 7\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"fixture 8\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.236,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":[],"check":"fixture 2","expected":["a"],"passed":false},{"actual":["a"],"check":"fixture 3","expected":["a","b"],"passed":false},{"actual":["a","b"],"check":"fixture 4","expected":["a","b","c"],"passed":false},{"actual":[],"check":"fixture 5","expected":["a","z"],"passed":false},{"actual":["a"],"check":"fixture 6","expected":["a","b"],"passed":false},{"actual":["a","b"],"check":"fixture 7","expected":["a","b"],"passed":true},{"actual":["a"],"check":"fixture 8","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"fixture 5\", \"actual\": [], \"expected\": [\"a\", \"z\"], \"passed\": false}, {\"check\": \"fixture 6\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"fixture 7\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"fixture 8\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"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."}}