diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_001.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_001.json new file mode 100644 index 0000000000000000000000000000000000000000..074baa0d9a8d65ebbd3c115125fc4337fa22fe2d --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_001.json @@ -0,0 +1 @@ +{"index": 1, "theme": "inspected_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42001, "finish_reason": "stop", "usage": {"prompt_tokens": 3712, "total_tokens": 3864, "completion_tokens": 152, "prompt_tokens_details": null}, "description": "Check if the submitted root has no direct anomaly and no queried known owner or child.", "code": "def check_rule_cand(ctx):\n if ctx.has_direct_anomaly(ctx.submitted_root):\n return True, 'ok'\n owner = ctx.owner_service(ctx.submitted_root)\n if owner != ctx.submitted_root and owner in ctx.queried_entities:\n return True, 'ok'\n children = ctx.observed_topology.get(ctx.submitted_root, {}).get('services', {})\n if any(child in ctx.queried_entities for child in children):\n return True, 'ok'\n return False, 'missing_owner_or_child'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_002.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_002.json new file mode 100644 index 0000000000000000000000000000000000000000..fb2baa7e64fc103422e48da3631923d6775c4b94 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_002.json @@ -0,0 +1 @@ +{"index": 2, "theme": "exact_root_verification", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42002, "finish_reason": "stop", "usage": {"prompt_tokens": 4583, "total_tokens": 4754, "completion_tokens": 171, "prompt_tokens_details": null}, "description": "Check if an instance or service is selected without inspecting its own metrics despite having stronger alternatives.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_layer = ctx.entity_layer(root)\n if root_layer not in ['instance', 'service']:\n return True, 'ok'\n if root in ctx.queried_entities:\n return True, 'ok'\n anomalous_services = ctx.distinct_observed_anomalous_services()\n if not anomalous_services:\n return True, 'ok'\n for service in anomalous_services:\n if service in ctx.queried_entities:\n return True, 'ok'\n return False, 'instance_or_service_not_inspected'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_003.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_003.json new file mode 100644 index 0000000000000000000000000000000000000000..6d3448aab3b8470a30c8ae0dd92916eed8917589 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_003.json @@ -0,0 +1 @@ +{"index": 3, "theme": "event_only_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42003, "finish_reason": "stop", "usage": {"prompt_tokens": 4193, "total_tokens": 4290, "completion_tokens": 97, "prompt_tokens_details": null}, "description": "Incidental event is used as root evidence despite quiet observed metrics and stronger independent anomalies.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if ctx.root_event_count > 0 and not any(ctx.has_direct_anomaly(id) for id in ctx.queried_entities):\n return False, 'incidental_event_without_metric_anomalies'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_004.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_004.json new file mode 100644 index 0000000000000000000000000000000000000000..2f9a7b8806eebe7f0675d3b6816f39f83f13fc03 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_004.json @@ -0,0 +1 @@ +{"index": 4, "theme": "early_competing_anomaly", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42004, "finish_reason": "stop", "usage": {"prompt_tokens": 5459, "total_tokens": 5622, "completion_tokens": 163, "prompt_tokens_details": null}, "description": "Check if there's an independently inspected cause candidate that begins significantly earlier than the submitted root.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_onset = ctx.earliest_anomaly_offset(root)\n if root_onset is None:\n return True, 'ok'\n for entity, z_score in ctx.root_neighbor_z['upstream']:\n if z_score > 3.0:\n entity_onset = ctx.earliest_anomaly_offset(entity)\n if entity_onset is not None and entity_onset < root_onset - 60:\n return False, 'early_independent_cause'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_005.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_005.json new file mode 100644 index 0000000000000000000000000000000000000000..047e0071e1fadc0e7289c0ec8d7b6d37a4dc1054 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_005.json @@ -0,0 +1 @@ +{"index": 5, "theme": "quiet_root_metric_slots", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42005, "finish_reason": "stop", "usage": {"prompt_tokens": 4576, "total_tokens": 4696, "completion_tokens": 120, "prompt_tokens_details": null}, "description": "Check if the submitted root shows no direct anomaly but has an anomalous co-located entity.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if not ctx.has_direct_anomaly(root):\n for ent, z in ctx.observed_topology[root].get('co_located_entities', {}).items():\n if z and z > 3.0:\n return False, 'root_no_anomaly_with_anomalous_co_located'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_006.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_006.json new file mode 100644 index 0000000000000000000000000000000000000000..1ebf377a4f5103f572e83dfdd32f56126c66ea45 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_006.json @@ -0,0 +1 @@ +{"index": 6, "theme": "isolated_weak_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42006, "finish_reason": "stop", "usage": {"prompt_tokens": 4094, "total_tokens": 4213, "completion_tokens": 119, "prompt_tokens_details": null}, "description": "Check if the root is missing from both the overview and observed neighborhoods, while an alternative root exists with coherent anomalies.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.overview_anomalies and root not in ctx.observed_topology:\n if any(ctx.has_direct_anomaly(id) for id in ctx.queried_entities if id != root):\n return (False, 'root_missing_with_alternative')\n return (True, 'ok')"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_007.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_007.json new file mode 100644 index 0000000000000000000000000000000000000000..0fd3324e5fc42387bafe0c3ec7660895c726a6fc --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_007.json @@ -0,0 +1 @@ +{"index": 7, "theme": "unexplored_outgoing", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42007, "finish_reason": "stop", "usage": {"prompt_tokens": 4413, "total_tokens": 4541, "completion_tokens": 128, "prompt_tokens_details": null}, "description": "Check if there are uninspected anomalous downstream neighbors of the root that are not reached by the path.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n path_set = set(y for _, y in ctx.submitted_path)\n anomalous_downstreams = ctx.uninspected_anomalous_downstream(root)\n if anomalous_downstreams and not any(d in path_set for d in anomalous_downstreams):\n return False, 'uninspected_anomalous_downstream'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_008.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_008.json new file mode 100644 index 0000000000000000000000000000000000000000..c80dd9ded0f5eacbd0c79beed68695ca9df588cd --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_008.json @@ -0,0 +1 @@ +{"index": 8, "theme": "inactive_submitted_edges", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42008, "finish_reason": "stop", "usage": {"prompt_tokens": 4769, "total_tokens": 4880, "completion_tokens": 111, "prompt_tokens_details": null}, "description": "An edge in the path has weak or absent traffic or error change despite competing active edges.", "code": "def check_rule_cand(ctx):\n for (caller, callee) in ctx.submitted_path:\n edge = ctx.observed_edges.get((caller, callee))\n if edge and not (edge.get('call_volume_change_rate') or edge.get('error_rate_change')):\n return False, 'weak_edge_traffic_or_error'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_009.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_009.json new file mode 100644 index 0000000000000000000000000000000000000000..01f817cc1e16ffdc06d2c5d955bb1667ba46aba7 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_009.json @@ -0,0 +1 @@ +{"index": 9, "theme": "lag_or_reversal", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42009, "finish_reason": "stop", "usage": {"prompt_tokens": 4919, "total_tokens": 5096, "completion_tokens": 177, "prompt_tokens_details": null}, "description": "Check for conflicting anomaly onset timing between submitted path and observed anomalies.", "code": "def check_rule_cand(ctx):\n path = ctx.submitted_path\n if len(path) < 2:\n return True, 'ok'\n u, v = path[0]\n u_onset = ctx.earliest_anomaly_offset(u)\n v_onset = ctx.earliest_anomaly_offset(v)\n if u_onset is None or v_onset is None:\n return True, 'ok'\n diff = ctx.onset_diff(u, v)\n if diff is None:\n return True, 'ok'\n if diff < 0:\n return False, 'conflicting_onset_order'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_010.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_010.json new file mode 100644 index 0000000000000000000000000000000000000000..03c5a4390731b9d605450b4fad00cd72fbfa47ab --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_010.json @@ -0,0 +1 @@ +{"index": 10, "theme": "co_location", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42010, "finish_reason": "stop", "usage": {"prompt_tokens": 4154, "total_tokens": 4347, "completion_tokens": 193, "prompt_tokens_details": null}, "description": "Host or pod-only diagnosis contradicts co-located measurements or a shared service ownership pattern.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_root in ctx.observed_topology:\n co_located = ctx.observed_topology[ctx.submitted_root].get('co_located_entities', [])\n if co_located and any(ctx.has_direct_anomaly(entity_id) for entity_id, _ in co_located):\n return False, 'host_or_pod_with_co_located_anomalies'\n shared_owner_neighbors = [u for u, v in ctx.submitted_path if ctx.owner_service(u) == ctx.owner_service(v)]\n if shared_owner_neighbors and any(ctx.has_direct_anomaly(u) for u in shared_owner_neighbors):\n return False, 'shared_owner_neighbors_with_anomalies'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_011.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_011.json new file mode 100644 index 0000000000000000000000000000000000000000..38ee9a443d7e9aad31f059071447cb71dfc3127c --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_011.json @@ -0,0 +1 @@ +{"index": 11, "theme": "path_edge_coverage", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42011, "finish_reason": "stop", "usage": {"prompt_tokens": 5044, "total_tokens": 5126, "completion_tokens": 82, "prompt_tokens_details": null}, "description": "Check for nontrivial propagation without inspecting visible cross-service edges or topology around its endpoints.", "code": "def check_rule_cand(ctx):\n inter_service_edges = ctx.inter_service_edges_in_submission()\n if not inter_service_edges:\n return (False, 'missing_cross_service_edges')\n return (True, 'ok')"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_012.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_012.json new file mode 100644 index 0000000000000000000000000000000000000000..ad9da373915abca26c1b9086e59cba1d726d6277 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_012.json @@ -0,0 +1 @@ +{"index": 12, "theme": "missing_evidence_ids", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42012, "finish_reason": "stop", "usage": {"prompt_tokens": 5320, "total_tokens": 5414, "completion_tokens": 94, "prompt_tokens_details": null}, "description": "Check if the cited observed evidence includes visible evidence IDs for the submitted root.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n cited_ids = set(ctx.observed_evidence_ids)\n if root in ctx.observed_metrics and root in cited_ids:\n return True, \"ok\"\n return False, \"missing_cited_evidence_for_root\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_013.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_013.json new file mode 100644 index 0000000000000000000000000000000000000000..b6744ed7b31e66c4a128f6c65c8c98ab48496f71 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_013.json @@ -0,0 +1 @@ +{"index": 13, "theme": "wrong_layer_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42013, "finish_reason": "stop", "usage": {"prompt_tokens": 4003, "total_tokens": 4136, "completion_tokens": 133, "prompt_tokens_details": null}, "description": "Check if the root is a host or instance but only a different layer was examined and local evidence is weak.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_layer = ctx.entity_layer(root)\n queried_layers = {ctx.entity_layer(e) for e in ctx.queried_entities}\n if root_layer in ['host', 'instance'] and root_layer not in queried_layers:\n if len(ctx.observed_metrics[root]) < 3:\n return False, 'local_evidence_weak'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_014.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_014.json new file mode 100644 index 0000000000000000000000000000000000000000..e511e35fb2b7c22826d7dc1f8473dddb47b4244c --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_014.json @@ -0,0 +1 @@ +{"index": 14, "theme": "anomalous_service_rank", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42014, "finish_reason": "stop", "usage": {"prompt_tokens": 4524, "total_tokens": 4753, "completion_tokens": 229, "prompt_tokens_details": null}, "description": "Check if the submitted owner has a strongly abnormal metric while its neighbors have weak or no anomalies.", "code": "def check_rule_cand(ctx):\n root_owner = ctx.owner_service(ctx.submitted_root)\n root_anomalies = [z for z in ctx.root_neighbor_z.get('downstream', []) if z[0] != root_owner]\n if not any(z > 3.0 for z, _, _ in root_anomalies):\n return True, 'ok'\n for neighbor, z, _ in root_anomalies:\n if z <= 3.0:\n continue\n neighbor_owner = ctx.owner_service(neighbor)\n if neighbor_owner == root_owner:\n return True, 'ok'\n if all(not ctx.has_direct_anomaly(neigh, z_thresh=3.0) for neigh in ctx.observed_topology.get(neighbor_owner, {}).get('services', {})):\n return False, 'missing_strong_neighbor_anomaly'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_015.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_015.json new file mode 100644 index 0000000000000000000000000000000000000000..4189ab939bd7c8237313621404ab6b6558071718 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_015.json @@ -0,0 +1 @@ +{"index": 15, "theme": "traffic_and_gap", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42015, "finish_reason": "stop", "usage": {"prompt_tokens": 5516, "total_tokens": 5643, "completion_tokens": 127, "prompt_tokens_details": null}, "description": "Checks if there is a significant error rate rise or queueing gap on the affected call edge without being noted in the submission path.", "code": "def check_rule_cand(ctx):\n for (caller, callee) in ctx.observed_edges:\n edge = ctx.observed_edges.get((caller, callee))\n if edge and (edge.error_rate_change or edge.span_gap_ms):\n if (caller, callee) not in ctx.submitted_path:\n return False, 'unreported_significant_edge_issue'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_016.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_016.json new file mode 100644 index 0000000000000000000000000000000000000000..7bae25e99c3bff41a17682391ffc53993f133c13 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_016.json @@ -0,0 +1 @@ +{"index": 16, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42016, "finish_reason": "stop", "usage": {"prompt_tokens": 5293, "total_tokens": 5373, "completion_tokens": 80, "prompt_tokens_details": null}, "description": "Check if the root service has any observed evidence of affecting downstream anomalous services.", "code": "def check_rule_cand(ctx):\n affected_services = ctx.uninspected_anomalous_downstream(ctx.submitted_root)\n if affected_services:\n return True, 'ok'\n return False, 'missing_downstream_effect'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_017.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_017.json new file mode 100644 index 0000000000000000000000000000000000000000..208520051e894eea32b14bb4c63f1aaa7e6834f6 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_017.json @@ -0,0 +1 @@ +{"index": 17, "theme": "unrepresentative_query", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42017, "finish_reason": "stop", "usage": {"prompt_tokens": 3990, "total_tokens": 4117, "completion_tokens": 127, "prompt_tokens_details": null}, "description": "Check if the root's direct neighbors have anomalous metrics and are queried.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n neighbors = set()\n for u, v in ctx.submitted_path:\n neighbors.add(u)\n neighbors.add(v)\n for n in neighbors - {root}:\n if ctx.has_direct_anomaly(n) and n in ctx.queried_entities:\n return True, 'ok'\n return False, 'missing_queried_neighbors_with_anomalies'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_018.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_018.json new file mode 100644 index 0000000000000000000000000000000000000000..423d491fbd8972e5ee7b99dcff04db2b6c2b909e --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_018.json @@ -0,0 +1 @@ +{"index": 18, "theme": "owned_instance_comparison", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42018, "finish_reason": "stop", "usage": {"prompt_tokens": 5039, "total_tokens": 5204, "completion_tokens": 165, "prompt_tokens_details": null}, "description": "An instance-level claim misses contrary evidence in other instances or their known service.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if ctx.entity_layer(root) != 'instance':\n return True, 'ok'\n service = ctx.owner_service(root)\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n if service not in anomalous_services:\n return True, 'ok'\n for ent in ctx.observed_topology[root].get('co_located_entities', {}):\n if ent != root and ctx.has_direct_anomaly(ent):\n return False, 'contrary_evidence_in_co_located'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_019.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_019.json new file mode 100644 index 0000000000000000000000000000000000000000..8ebfa4e3fa71df33c773d03a81e299e80093648b --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_019.json @@ -0,0 +1 @@ +{"index": 19, "theme": "few_distinct_inspections", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42019, "finish_reason": "stop", "usage": {"prompt_tokens": 4198, "total_tokens": 4316, "completion_tokens": 118, "prompt_tokens_details": null}, "description": "Check if a multi-service or high-degree case lacks direct evidence after multiple queries.", "code": "def check_rule_cand(ctx):\n if len(ctx.distinct_anomalous_services_in_overview()) > 1 and ctx.num_turns > 5:\n if len(ctx.queried_entities) == 1 and not any(ctx.has_direct_anomaly(ent) for ent in ctx.queried_entities):\n return False, 'missing_direct_evidence_after_repeated_queries'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_020.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_020.json new file mode 100644 index 0000000000000000000000000000000000000000..544444444c76fea5cb4d185286bff0cd8a1e82f0 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_020.json @@ -0,0 +1 @@ +{"index": 20, "theme": "multi_service_empty_path", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42020, "finish_reason": "stop", "usage": {"prompt_tokens": 5425, "total_tokens": 5535, "completion_tokens": 110, "prompt_tokens_details": null}, "description": "Check if a multi-service anomaly with a submitted path collapses within a single service.", "code": "def check_rule_cand(ctx):\n if len(ctx.submitted_path) == 0:\n return True, \"ok\"\n services = set(ctx.owner_service(callee) for _, callee in ctx.submitted_path)\n if len(services) <= 1:\n return False, \"path_collapses_within_one_service\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_021.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_021.json new file mode 100644 index 0000000000000000000000000000000000000000..e434db42e6424ae2ea60c366d7c08a593ed79e79 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_021.json @@ -0,0 +1 @@ +{"index": 21, "theme": "inspected_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42021, "finish_reason": "stop", "usage": {"prompt_tokens": 5448, "total_tokens": 5545, "completion_tokens": 97, "prompt_tokens_details": null}, "description": "Check if the submitted root has no inspected metrics/events and no inspected known owner or child.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.queried_entities and not any(ctx.owner_service(child) == root for child in ctx.queried_entities):\n return False, 'uninspected_root_and_owner'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_022.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_022.json new file mode 100644 index 0000000000000000000000000000000000000000..e2b1947678fb0a1bf4dabadd833fb233ebefdd84 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_022.json @@ -0,0 +1 @@ +{"index": 22, "theme": "exact_root_verification", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42022, "finish_reason": "stop", "usage": {"prompt_tokens": 3785, "total_tokens": 4005, "completion_tokens": 220, "prompt_tokens_details": null}, "description": "Checks if the root entity is an instance but its owning service has stronger anomalous metrics.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n owner = ctx.owner_service(root)\n if root == owner:\n return True, 'ok'\n if owner not in ctx.queried_entities:\n return True, 'ok'\n root_metrics = ctx.observed_metrics.get(root, {})\n owner_metrics = ctx.observed_metrics.get(owner, {})\n for slot in ['io_usage', 'mem_usage', 'latency_avg', 'error_rate']:\n root_z = root_metrics.get(slot, {}).get('robust_z')\n owner_z = owner_metrics.get(slot, {}).get('robust_z')\n if owner_z is not None and root_z is not None and abs(owner_z) > abs(root_z):\n return False, 'stronger_owner_metric'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_023.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_023.json new file mode 100644 index 0000000000000000000000000000000000000000..68c5b5986d6d7d48023a617484e36732a1ed7d59 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_023.json @@ -0,0 +1 @@ +{"index": 23, "theme": "event_only_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42023, "finish_reason": "stop", "usage": {"prompt_tokens": 4063, "total_tokens": 4136, "completion_tokens": 73, "prompt_tokens_details": null}, "description": "An incidental event is used as root evidence despite quiet observed metrics and stronger independent anomalies.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_evidence_ids and not ctx.observed_events:\n return False, 'incidental_event_as_root'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_024.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_024.json new file mode 100644 index 0000000000000000000000000000000000000000..a391fe2ac2a9aac2a1f21b3aa03d51e0a4ef7916 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_024.json @@ -0,0 +1 @@ +{"index": 24, "theme": "early_competing_anomaly", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42024, "finish_reason": "stop", "usage": {"prompt_tokens": 3805, "total_tokens": 3961, "completion_tokens": 156, "prompt_tokens_details": null}, "description": "An independently inspected cause candidate begins earlier than the submitted root by a meaningful time.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_onset = ctx.earliest_anomaly_offset(root)\n if root_onset is None:\n return True, 'ok'\n for entity in ctx.queried_entities:\n if entity == root:\n continue\n entity_onset = ctx.earliest_anomaly_offset(entity)\n if entity_onset is not None and entity_onset < root_onset - 300:\n return False, 'cause_begins_earlier'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_025.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_025.json new file mode 100644 index 0000000000000000000000000000000000000000..05890bc2e52f3c84131540648efd90879349a4f1 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_025.json @@ -0,0 +1 @@ +{"index": 25, "theme": "quiet_root_metric_slots", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42025, "finish_reason": "stop", "usage": {"prompt_tokens": 4499, "total_tokens": 4617, "completion_tokens": 118, "prompt_tokens_details": null}, "description": "Check if the submitted root shows no direct anomalies but an inspected neighbor has abnormal metrics.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if not ctx.has_direct_anomaly(root):\n for neighbor in ctx.observed_topology[root].get('co_located_entities', {}):\n neighbor_id, _ = neighbor\n if ctx.has_direct_anomaly(neighbor_id):\n return False, 'root_no_anomaly_neighbor_anomaly'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_026.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_026.json new file mode 100644 index 0000000000000000000000000000000000000000..26e1c819e088e063bde3ef8c9b1d72d6c4acd3de --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_026.json @@ -0,0 +1 @@ +{"index": 26, "theme": "isolated_weak_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42026, "finish_reason": "stop", "usage": {"prompt_tokens": 4123, "total_tokens": 4294, "completion_tokens": 171, "prompt_tokens_details": null}, "description": "Root is missing from both overview and observed neighborhoods but an alternative inspected entity exists.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_root in ctx.overview_anomalies:\n return True, 'ok'\n if any(n.get(ctx.submitted_root) for n in ctx.observed_topology.values()):\n return True, 'ok'\n if not ctx.queried_entities:\n return True, 'ok'\n alt_root = ctx.queried_entities[0]\n if alt_root not in ctx.overview_anomalies and not any(n.get(alt_root) for n in ctx.observed_topology.values()):\n return True, 'ok'\n return False, 'root_missing_from_inspection'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_027.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_027.json new file mode 100644 index 0000000000000000000000000000000000000000..8537c82b06f1b6b580ce40c844f7a323df1b3102 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_027.json @@ -0,0 +1 @@ +{"index": 27, "theme": "unexplored_outgoing", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42027, "finish_reason": "stop", "usage": {"prompt_tokens": 4726, "total_tokens": 4873, "completion_tokens": 147, "prompt_tokens_details": null}, "description": "Root has abnormal outgoing neighbors that are uninspected and not included in the path.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n neighbors = ctx.observed_topology[root].get('downstream', [])\n anomalous_neighbors = [n for n, z in neighbors if ctx.has_direct_anomaly(n)]\n uninspected_neighbors = [n for n in anomalous_neighbors if not any(n == affected for _, affected in ctx.submitted_path)]\n if uninspected_neighbors:\n return (False, 'uninspected_abnormal_outgoing_neighbors')\n return (True, 'ok')"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_028.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_028.json new file mode 100644 index 0000000000000000000000000000000000000000..068dac0fc298b98a5489dc7b1ea12a1229bb2c97 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_028.json @@ -0,0 +1 @@ +{"index": 28, "theme": "inactive_submitted_edges", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42028, "finish_reason": "stop", "usage": {"prompt_tokens": 5771, "total_tokens": 5966, "completion_tokens": 195, "prompt_tokens_details": null}, "description": "Check if a path edge has weak or absent traffic or error changes despite co-existing active edges.", "code": "def check_rule_cand(ctx):\n for (caller, callee) in ctx.submitted_path:\n edge = ctx.observed_edges.get((caller, callee))\n if edge and edge['detection_call_count'] == 0 and edge['error_rate_change'] is None:\n other_edges_active = any(ctx.observed_edges.get((u, v))['detection_call_count'] > 0 or ctx.observed_edges.get((u, v))['error_rate_change'] is not None for (u, v) in ctx.submitted_path if (u, v) != (caller, callee))\n if other_edges_active:\n return (False, 'weak_or_absent_edge_traffic_or_error')\n return (True, 'ok')"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_029.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_029.json new file mode 100644 index 0000000000000000000000000000000000000000..1ecfa18b1280f4675a460229934ed975c340db88 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_029.json @@ -0,0 +1 @@ +{"index": 29, "theme": "lag_or_reversal", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42029, "finish_reason": "stop", "usage": {"prompt_tokens": 5259, "total_tokens": 5397, "completion_tokens": 138, "prompt_tokens_details": null}, "description": "Check if any downstream service has an earlier anomaly onset than its upstream service along the submitted path.", "code": "def check_rule_cand(ctx):\n edges = ctx.inter_service_edges_in_submission()\n for caller, callee in edges:\n caller_onset = ctx.earliest_anomaly_offset(caller)\n callee_onset = ctx.earliest_anomaly_offset(callee)\n if caller_onset is not None and callee_onset is not None and callee_onset < caller_onset:\n return False, 'downstream_earlier_onset'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_030.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_030.json new file mode 100644 index 0000000000000000000000000000000000000000..ca43078e74aa1b6de0a1297b00d49e86434e25c9 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_030.json @@ -0,0 +1 @@ +{"index": 30, "theme": "co_location", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42030, "finish_reason": "stop", "usage": {"prompt_tokens": 4599, "total_tokens": 4770, "completion_tokens": 171, "prompt_tokens_details": null}, "description": "Host or pod-only diagnosis should not have significant co-located entities unless they share service ownership.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if not ctx.observed_topology.get(root):\n return True, \"ok\"\n co_located = ctx.observed_topology[root].get('co_located_entities', [])\n if not co_located:\n return True, \"ok\"\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n for ent, _ in co_located:\n if ent != root and ctx.owner_service(ent) not in anomalous_services:\n return False, \"inconsistent_co_located_entities\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_031.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_031.json new file mode 100644 index 0000000000000000000000000000000000000000..ead85ee49ce7c50d5ae4ee65fb33c4f94c99c5bd --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_031.json @@ -0,0 +1 @@ +{"index": 31, "theme": "path_edge_coverage", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42031, "finish_reason": "stop", "usage": {"prompt_tokens": 4045, "total_tokens": 4141, "completion_tokens": 96, "prompt_tokens_details": null}, "description": "Check if nontrivial propagation is submitted without inspecting visible cross-service edges or topology around its endpoints.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if not ctx.inter_service_edges_in_submission():\n if ctx.uninspected_anomalous_downstream(root):\n return False, 'uninspected_cross_service_edges'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_032.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_032.json new file mode 100644 index 0000000000000000000000000000000000000000..e288b18ccede2e04ecf03381b1811ed03e0ced3f --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_032.json @@ -0,0 +1 @@ +{"index": 32, "theme": "missing_evidence_ids", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42032, "finish_reason": "stop", "usage": {"prompt_tokens": 5669, "total_tokens": 5812, "completion_tokens": 143, "prompt_tokens_details": null}, "description": "Check if the cited evidence IDs do not include visible evidence IDs, especially if the claimed root is uninspected.", "code": "def check_rule_cand(ctx):\n if ctx.uninspected_anomalous_downstream(ctx.submitted_root):\n if len(ctx.observed_evidence_ids) == 0 or len(ctx.cited_observed_ids) == 0:\n return True, 'ok'\n if not any(evidence_id in ctx.observed_evidence_ids for evidence_id in ctx.cited_observed_ids):\n return False, 'uninspected_root_no_visible_evidence'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_033.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_033.json new file mode 100644 index 0000000000000000000000000000000000000000..0097e08f6e8c4c17d31094755763651da5051fad --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_033.json @@ -0,0 +1 @@ +{"index": 33, "theme": "wrong_layer_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42033, "finish_reason": "stop", "usage": {"prompt_tokens": 4313, "total_tokens": 4453, "completion_tokens": 140, "prompt_tokens_details": null}, "description": "Check if the root is a host or instance and a different layer was examined without strong local evidence.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n layer = ctx.entity_layer(root)\n if layer in ('host', 'instance') and len(ctx.queried_entities) == 1 and ctx.queried_entities[0] != root:\n if all(metric.get('robust_z', 0) < 3 for metric in ctx.observed_metrics[root].values()):\n return False, 'inconsistent_layer_examined'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_034.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_034.json new file mode 100644 index 0000000000000000000000000000000000000000..709e7d28fd169684910aae48b3345595afef4845 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_034.json @@ -0,0 +1 @@ +{"index": 34, "theme": "anomalous_service_rank", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42034, "finish_reason": "stop", "usage": {"prompt_tokens": 4670, "total_tokens": 4839, "completion_tokens": 169, "prompt_tokens_details": null}, "description": "Check if the root's owner has weak or no anomaly next to a strongly anomalous distinct owner.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_owner = ctx.owner_service(root)\n if root_owner == root:\n return True, \"ok\"\n strong_owners = ctx.distinct_anomalous_services_in_overview()\n if root_owner not in strong_owners:\n return True, \"ok\"\n weak_neighbors = [id for id in strong_owners if id != root_owner and not ctx.has_direct_anomaly(id)]\n if weak_neighbors:\n return False, \"weak_or_no_anomaly_next_to_strong\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_035.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_035.json new file mode 100644 index 0000000000000000000000000000000000000000..16d7e53737981bef06e516989a889c03181480cd --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_035.json @@ -0,0 +1 @@ +{"index": 35, "theme": "traffic_and_gap", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42035, "finish_reason": "stop", "usage": {"prompt_tokens": 5732, "total_tokens": 5919, "completion_tokens": 187, "prompt_tokens_details": null}, "description": "Detects if an edge between two services shows a significant error rate increase or span gap without being flagged as anomalous.", "code": "def check_rule_cand(ctx):\n for (caller, callee), edge in ctx.observed_edges.items():\n if edge.get('error_rate_change') and edge['error_rate_change'] > 10.0:\n if not ctx.has_direct_anomaly(caller) and not ctx.has_direct_anomaly(callee):\n return False, 'edge_error_rate_increase_unchecked'\n if edge.get('span_gap_ms') and edge['span_gap_ms'] > 500.0:\n if not ctx.has_direct_anomaly(caller) and not ctx.has_direct_anomaly(callee):\n return False, 'edge_span_gap_unchecked'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_036.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_036.json new file mode 100644 index 0000000000000000000000000000000000000000..078045c14212edea591c6bb49692869debf05acf --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_036.json @@ -0,0 +1 @@ +{"index": 36, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42036, "finish_reason": "stop", "usage": {"prompt_tokens": 5751, "total_tokens": 5864, "completion_tokens": 113, "prompt_tokens_details": null}, "description": "Check if the root service or instance directly affects other observed anomalous services through edges with significant error rate changes.", "code": "def check_rule_cand(ctx):\n for u, v in ctx.inter_service_edges_in_submission():\n edge = ctx.observed_edges.get((u, v))\n if edge and edge.error_rate_change:\n if ctx.has_direct_anomaly(v):\n return True, \"ok\"\n return False, \"no_significant_edge_effect\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_037.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_037.json new file mode 100644 index 0000000000000000000000000000000000000000..35efca9d103fc7d4220dd3ca4e5ee07eaa3e9418 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_037.json @@ -0,0 +1 @@ +{"index": 37, "theme": "unrepresentative_query", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42037, "finish_reason": "stop", "usage": {"prompt_tokens": 4354, "total_tokens": 4506, "completion_tokens": 152, "prompt_tokens_details": null}, "description": "Check if the root's direct neighbors have anomalies but were not inspected.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n neighbors = ctx.observed_topology[root].get('co_located_entities', {}) | ctx.observed_topology[root].get('upstream', {}) | ctx.observed_topology[root].get('downstream', {})\n uninspected_anomalies = [n for n in neighbors if ctx.has_direct_anomaly(n) and n not in ctx.queried_entities]\n if uninspected_anomalies:\n return False, 'uninspected_direct_neighbors_have_anomalies'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_038.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_038.json new file mode 100644 index 0000000000000000000000000000000000000000..5c4729c12bb722c2e02bcd6def354005b5ac35d9 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_038.json @@ -0,0 +1 @@ +{"index": 38, "theme": "owned_instance_comparison", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42038, "finish_reason": "stop", "usage": {"prompt_tokens": 4616, "total_tokens": 4822, "completion_tokens": 206, "prompt_tokens_details": null}, "description": "An instance-level anomaly claim misses contrary evidence in other instances or their known service.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_layer != 'instance':\n return True, 'ok'\n anomalous_services = ctx.distinct_observed_anomalous_services()\n for service in anomalous_services:\n if service != ctx.owner_service(ctx.submitted_root):\n return False, 'contrary_evidence_in_other_service'\n co_located_anomalies = [ctx.co_located_anomaly_ratio(id) for id in ctx.observed_topology.get(ctx.submitted_root, {}).get('co_located_entities', []) if ctx.co_located_anomaly_ratio(id) is not None]\n if any(ratio < 0 for ratio in co_located_anomalies):\n return False, 'contrary_evidence_in_co_located_instances'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_039.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_039.json new file mode 100644 index 0000000000000000000000000000000000000000..6fd5a721c2da2708988fa5cd0c8819f336854fb5 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_039.json @@ -0,0 +1 @@ +{"index": 39, "theme": "few_distinct_inspections", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42039, "finish_reason": "stop", "usage": {"prompt_tokens": 4306, "total_tokens": 4418, "completion_tokens": 112, "prompt_tokens_details": null}, "description": "Check if a multi-service or high-degree case lacks crucial direct evidence despite multiple query turns.", "code": "def check_rule_cand(ctx):\n if len(ctx.distinct_anomalous_services_in_overview()) > 1 and ctx.num_turns > 5:\n if all(not ctx.has_direct_anomaly(id) for id in ctx.distinct_observed_anomalous_services()):\n return False, 'missing_direct_evidence_multi_service'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_040.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_040.json new file mode 100644 index 0000000000000000000000000000000000000000..93c5601e153bb082d520db490b5a4146939d0204 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_040.json @@ -0,0 +1 @@ +{"index": 40, "theme": "multi_service_empty_path", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43040, "revision": 1, "previous_rejection": "denied_call", "finish_reason": "stop", "usage": {"prompt_tokens": 683, "total_tokens": 836, "completion_tokens": 153, "prompt_tokens_details": null}, "description": "Flag a missing inter-service path when two or more observed anomalous services include at least two different overview metric groups.", "code": "def check_rule_cand(ctx):\n anomalous_services_count = ctx.distinct_observed_anomalous_services()\n if anomalous_services_count < 2:\n return True, \"ok\"\n metric_groups = {a['metric_group'] for a in ctx.overview_anomalies.values()}\n if len(metric_groups) < 2:\n return True, \"ok\"\n if not ctx.inter_service_edges_in_submission():\n return False, \"missing_inter_service_path\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_041.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_041.json new file mode 100644 index 0000000000000000000000000000000000000000..9f0976286dc500f0cc9fc8f9d2468de5c3ea1f8b --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_041.json @@ -0,0 +1 @@ +{"index": 41, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43041, "revision": 1, "previous_rejection": "individual_fpr_or_tpr", "finish_reason": "stop", "usage": {"prompt_tokens": 725, "total_tokens": 938, "completion_tokens": 213, "prompt_tokens_details": null}, "description": "Flag an absent inter-service path in a multi-service anomaly when its service-level submitted root has been directly measured, or if its service-level root has not been directly measured and a separate service in the overview was measured.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_service = ctx.owner_service(root)\n paths = ctx.submitted_path\n if not paths:\n return True, 'ok'\n if ctx.has_direct_anomaly(root_service):\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_inter_service_path_with_measured_root'\n else:\n for service in ctx.overview_anomalies:\n if ctx.entity_layer(service) == 'service' and ctx.has_direct_anomaly(service):\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_inter_service_path_with_other_measured_service'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_042.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_042.json new file mode 100644 index 0000000000000000000000000000000000000000..8c8a3da41ef5b05b77b3ff7d17c80ef7ac02fe19 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_042.json @@ -0,0 +1 @@ +{"index": 42, "theme": "owned_instance_comparison", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43042, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 688, "total_tokens": 882, "completion_tokens": 194, "prompt_tokens_details": null}, "description": "Flag a multi-service anomaly submitted with an instance root and only same-owner edges, when root topology has not been inspected. Require a nonempty raw path.", "code": "def check_rule_cand(ctx):\n if not ctx.submitted_path:\n return True, \"ok\"\n root = ctx.submitted_root\n if ctx.entity_layer(root) != 'instance':\n return True, \"ok\"\n if ctx.distinct_anomalous_services_in_overview() <= 1:\n return True, \"ok\"\n if any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in ctx.inter_service_edges_in_submission()):\n return True, \"ok\"\n if root in ctx.queried_topology_entities:\n return True, \"ok\"\n return False, \"uninspected_instance_root\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_043.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_043.json new file mode 100644 index 0000000000000000000000000000000000000000..d29c67f9c0bc4587a3bad4020d155397d8819f16 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_043.json @@ -0,0 +1 @@ +{"index": 43, "theme": "unexplored_outgoing", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43043, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 642, "total_tokens": 762, "completion_tokens": 120, "prompt_tokens_details": null}, "description": "Flag a multi-service anomaly without an inter-service path when the submitted root has a known topology observation.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_root not in ctx.queried_topology:\n return True, \"ok\"\n if ctx.distinct_anomalous_services_in_overview() < 2:\n return True, \"ok\"\n if ctx.inter_service_edges_in_submission():\n return True, \"ok\"\n return False, \"missing_inter_service_path\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_044.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_044.json new file mode 100644 index 0000000000000000000000000000000000000000..9c9c364ad95d7bc7752017f787fd151afed625e0 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_044.json @@ -0,0 +1 @@ +{"index": 44, "theme": "path_edge_coverage", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43044, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 647, "total_tokens": 818, "completion_tokens": 171, "prompt_tokens_details": null}, "description": "Flag a multi-service anomaly without a cross-owner path when the root's own topology has never been queried. Presence of a direct root metric cannot replace topology inspection.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.queried_topology_entities:\n if ctx.distinct_anomalous_services_in_overview() > 1:\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_root_topology_with_multi_service_anomaly'\n if all(ctx.owner_service(caller) == ctx.owner_service(callee) for caller, callee in ctx.inter_service_edges_in_submission()):\n return False, 'missing_root_topology_with_multi_service_anomaly'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_045.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_045.json new file mode 100644 index 0000000000000000000000000000000000000000..39a8298654133e65bd729283f5eebffd11ef642d --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_045.json @@ -0,0 +1 @@ +{"index": 45, "theme": "multi_service_empty_path", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43045, "revision": 1, "previous_rejection": "denied_string_literal", "finish_reason": "stop", "usage": {"prompt_tokens": 644, "total_tokens": 790, "completion_tokens": 146, "prompt_tokens_details": null}, "description": "Flag a missing cross-owner path when the overview shows at least three anomalous services and at least one infrastructure metric group.", "code": "def check_rule_cand(ctx):\n if ctx.distinct_anomalous_services_in_overview() < 3:\n return True, \"ok\"\n if 'infrastructure' not in {a['metric_group'] for a in ctx.overview_anomalies.values() if a['metric_group'] is not None}:\n return True, \"ok\"\n if ctx.inter_service_edges_in_submission():\n return True, \"ok\"\n return False, \"missing_cross_owner_path\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_046.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_046.json new file mode 100644 index 0000000000000000000000000000000000000000..092e6a3de07a5c9bf33672c052a49a5714e9ee15 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_046.json @@ -0,0 +1 @@ +{"index": 46, "theme": "inspected_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 44046, "revision": 2, "previous_rejection": "individual_fpr_or_tpr", "finish_reason": "stop", "usage": {"prompt_tokens": 642, "total_tokens": 784, "completion_tokens": 142, "prompt_tokens_details": null}, "description": "Checker for an immutable anonymous diagnosis context with specific conditions.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if not any(ctx.owner_service(e) == ctx.owner_service(root) for e in ctx.queried_entities):\n return False, \"uninspected_diagnosis_family\"\n if ctx.distinct_observed_anomalous_services() >= 2 and root in ctx.observed_metrics and root not in ctx.queried_topology_entities and not ctx.inter_service_edges_in_submission():\n return False, \"multi_service_missing_cross_owner_path\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_047.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_047.json new file mode 100644 index 0000000000000000000000000000000000000000..5ab64960289283ff9e511e0e0a1a6f6c701d5b71 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_047.json @@ -0,0 +1 @@ +{"index": 47, "theme": "lag_or_reversal", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43047, "revision": 1, "previous_rejection": "execution_errors_or_timeout", "finish_reason": "stop", "usage": {"prompt_tokens": 690, "total_tokens": 892, "completion_tokens": 202, "prompt_tokens_details": null}, "description": "Flag cross-owner edges with a measured negative onset difference. Also flag when many services are anomalous, the root onset has been measured and the submitted path still contains no inter-service edges.", "code": "def check_rule_cand(ctx):\n for cause, affected in ctx.submitted_path:\n if ctx.owner_service(cause) != ctx.owner_service(affected):\n onset_diff = ctx.onset_diff(cause, affected)\n if onset_diff is not None and onset_diff < 0:\n return False, 'negative_onset_diff_cross_owner'\n anomalous_services_count = ctx.distinct_observed_anomalous_services()\n if anomalous_services_count >= 2 and not ctx.inter_service_edges_in_submission() and ctx.earliest_anomaly_offset(ctx.submitted_root) is not None:\n return False, 'unexplained_multi_service_anomalies'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_048.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_048.json new file mode 100644 index 0000000000000000000000000000000000000000..51e3a632ca54be7a92ff7e225a0569df5edee859 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_048.json @@ -0,0 +1 @@ +{"index": 48, "theme": "exact_root_verification", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42048, "finish_reason": "stop", "usage": {"prompt_tokens": 4321, "total_tokens": 4436, "completion_tokens": 115, "prompt_tokens_details": null}, "description": "Check if a multi-service case was investigated beyond the submitted root scope by verifying the presence of inter-service paths when the root's owner is the only owner in queried entities.", "code": "def check_rule_cand(ctx):\n owners = set(ctx.owner_service(e) for e in ctx.queried_entities)\n if len(owners) == 1:\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_inter_service_path'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_049.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_049.json new file mode 100644 index 0000000000000000000000000000000000000000..623b6ac62f3967c48bff6c4082f705a4912145d0 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_049.json @@ -0,0 +1 @@ +{"index": 49, "theme": "quiet_root_metric_slots", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43049, "revision": 1, "previous_rejection": "denied_call", "finish_reason": "stop", "usage": {"prompt_tokens": 707, "total_tokens": 945, "completion_tokens": 238, "prompt_tokens_details": null}, "description": "Repair the Python checker for an immutable anonymous diagnosis context according to the specified condition.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.observed_metrics:\n return True, \"ok\"\n if ctx.distinct_observed_anomalous_services() > 1:\n return True, \"ok\"\n if not ctx.inter_service_edges_in_submission():\n root_metrics = ctx.observed_metrics[root]\n if all(metric is None or metric.get('robust_z') is None or metric['robust_z'] <= 3.0 for metric in root_metrics.values()):\n for service, metrics in ctx.observed_metrics.items():\n if service == root:\n continue\n if any(metric is not None and metric.get('robust_z') is not None and metric['robust_z'] > 3.0 for metric in metrics.values()):\n return False, \"measured_quiet_root_with_strong_abnormal_direct_metric\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_050.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_050.json new file mode 100644 index 0000000000000000000000000000000000000000..72e01299366017d78287966b5c0c8059bd8199c3 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_050.json @@ -0,0 +1 @@ +{"index": 50, "theme": "co_location", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43050, "revision": 1, "previous_rejection": "execution_errors_or_timeout", "finish_reason": "stop", "usage": {"prompt_tokens": 660, "total_tokens": 809, "completion_tokens": 149, "prompt_tokens_details": null}, "description": "Check the instance versus service boundary. When an instance-rooted multi-service submission has no cross-owner edges yet has distinct observable service anomalies in the initial view, flag the unsupported inference that the incident stayed inside that instance's service.", "code": "def check_rule_cand(ctx):\n if ctx.entity_layer(ctx.submitted_root) != 'instance':\n return True, 'ok'\n services = ctx.distinct_observed_anomalous_services()\n if services < 2:\n return True, 'ok'\n if ctx.inter_service_edges_in_submission():\n return True, 'ok'\n return False, 'unsupported_instance_service_boundary'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_051.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_051.json new file mode 100644 index 0000000000000000000000000000000000000000..a757acb982b97fc3a4b731393a54d03f43d70e76 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_051.json @@ -0,0 +1 @@ +{"index": 51, "theme": "anomalous_service_rank", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43051, "revision": 1, "previous_rejection": "denied_call", "finish_reason": "stop", "usage": {"prompt_tokens": 695, "total_tokens": 864, "completion_tokens": 169, "prompt_tokens_details": null}, "description": "Check if there's a single metric group across all visible anomalous entities and ensure there's a cross-owner effect.", "code": "def check_rule_cand(ctx):\n metric_groups = {anomaly['metric_group'] for anomaly in ctx.overview_anomalies.values() if anomaly.get('metric_group')}\n if len(metric_groups) == 1 and ctx.inter_service_edges_in_submission():\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n for u in range(anomalous_services):\n for v in range(anomalous_services):\n if u != v and ctx.owner_service(u) != ctx.owner_service(v):\n return True, 'ok'\n return False, 'missing_cross_owner_effect'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_052.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_052.json new file mode 100644 index 0000000000000000000000000000000000000000..3e3405f7c95493a3592299efe5443ac1f271a3fe --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_052.json @@ -0,0 +1 @@ +{"index": 52, "theme": "unrepresentative_query", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42052, "finish_reason": "stop", "usage": {"prompt_tokens": 4088, "total_tokens": 4237, "completion_tokens": 149, "prompt_tokens_details": null}, "description": "Check if a multi-service case with at least two independently queried owners explains cross-owner propagation by having at least one cross-owner edge.", "code": "def check_rule_cand(ctx):\n queried_owners = set(ctx.owner_service(e) for e in ctx.queried_entities)\n if len(queried_owners) < 2:\n return True, \"ok\"\n inter_service_edges = ctx.inter_service_edges_in_submission()\n if not any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in inter_service_edges):\n return False, \"missing_cross_owner_edge\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_053.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_053.json new file mode 100644 index 0000000000000000000000000000000000000000..2b50a8566a5bdf42dc0d66f3016e3bd06d460f6a --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_053.json @@ -0,0 +1 @@ +{"index": 53, "theme": "few_distinct_inspections", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42053, "finish_reason": "stop", "usage": {"prompt_tokens": 4486, "total_tokens": 4582, "completion_tokens": 96, "prompt_tokens_details": null}, "description": "Reject a missing inter-service path when there is only one successfully queried metric or event entity or no direct query.", "code": "def check_rule_cand(ctx):\n if len(ctx.queried_entities) <= 1:\n return True, \"ok\"\n if not ctx.inter_service_edges_in_submission():\n return False, \"missing_inter_service_path\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_054.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_054.json new file mode 100644 index 0000000000000000000000000000000000000000..0078e2c8e29b5c1e8cb38cbc9a62f2b1919d9081 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_054.json @@ -0,0 +1 @@ +{"index": 54, "theme": "path_edge_coverage", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42054, "finish_reason": "stop", "usage": {"prompt_tokens": 4208, "total_tokens": 4340, "completion_tokens": 132, "prompt_tokens_details": null}, "description": "Check if an unsupported multi-service isolation claim exists by verifying the presence of cross-owner edges in the observed root topology.", "code": "def check_rule_cand(ctx):\n if not ctx.submitted_path or all(ctx.owner_service(c) == ctx.owner_service(a) for c, a in ctx.submitted_path):\n cross_owner_edges = any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in ctx.observed_edges)\n if not cross_owner_edges:\n return False, 'unsupported_multi_service_isolation'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_055.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_055.json new file mode 100644 index 0000000000000000000000000000000000000000..bd5435ae1dbeb99e4804a9080881eadb41de01a5 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_055.json @@ -0,0 +1 @@ +{"index": 55, "theme": "missing_evidence_ids", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43055, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 644, "total_tokens": 768, "completion_tokens": 124, "prompt_tokens_details": null}, "description": "Check unverified cross-owner effects when the multi-service submission lacks inter-service edges and its cited evidence is absent from tool history or the root's topology was not queried.", "code": "def check_rule_cand(ctx):\n if not ctx.inter_service_edges_in_submission():\n if not any(evidence in ctx.observed_evidence_ids for evidence in ctx.submitted_evidence_ids):\n if ctx.submitted_root not in ctx.queried_entities:\n return False, 'unverified_cross_owner_effects'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_056.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_056.json new file mode 100644 index 0000000000000000000000000000000000000000..2ecb93ed696cf31ebb07424b231c918669d14686 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_056.json @@ -0,0 +1 @@ +{"index": 56, "theme": "early_competing_anomaly", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 44056, "revision": 2, "previous_rejection": "denied_call", "finish_reason": "stop", "usage": {"prompt_tokens": 661, "total_tokens": 896, "completion_tokens": 235, "prompt_tokens_details": null}, "description": "Checker for omitted inter-service path and cross-owner time reversal in an immutable anonymous diagnosis context.", "code": "def check_rule_cand(ctx):\n # Check for cross-owner time reversal\n for src, dst in ctx.inter_service_edges_in_submission():\n diff = ctx.onset_diff(src, dst)\n if diff is not None and diff < 0:\n return False, \"cross_owner_time_reversal\"\n \n # Check for omitted inter-service path\n if not ctx.inter_service_edges_in_submission() and ctx.distinct_observed_anomalous_services() >= 2 and ctx.submitted_root in ctx.observed_metrics:\n if ctx.submitted_root in ctx.queried_topology_entities:\n return False, \"omitted_inter_service_path\"\n for e in ctx.queried_entities:\n if ctx.owner_service(e) != ctx.owner_service(ctx.submitted_root) and ctx.has_direct_anomaly(e):\n return False, \"omitted_inter_service_path\"\n \n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_057.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_057.json new file mode 100644 index 0000000000000000000000000000000000000000..fa9419cdadc474bd751afdf1c225ce33d0192925 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_057.json @@ -0,0 +1 @@ +{"index": 57, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43057, "revision": 1, "previous_rejection": "execution_errors_or_timeout", "finish_reason": "stop", "usage": {"prompt_tokens": 723, "total_tokens": 948, "completion_tokens": 225, "prompt_tokens_details": null}, "description": "In a multi-service anomaly, require a cross-owner effect when the submitted root has direct abnormal metrics and the initial overview shows anomalies on distinct owners.", "code": "def check_rule_cand(ctx):\n if not ctx.has_direct_anomaly(ctx.submitted_root):\n return True, \"ok\"\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n if anomalous_services < 2:\n return True, \"ok\"\n owners = {ctx.owner_service(svc) for svc in range(anomalous_services)}\n if len(owners) < 2:\n return True, \"ok\"\n inter_service_edges = ctx.inter_service_edges_in_submission()\n if not inter_service_edges:\n return False, \"missing_cross_owner_effect\"\n if not any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in inter_service_edges):\n return False, \"missing_cross_owner_effect\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_058.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_058.json new file mode 100644 index 0000000000000000000000000000000000000000..89d77852beefd2fefeed088ef48f6e2f538c4cd6 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_058.json @@ -0,0 +1 @@ +{"index": 58, "theme": "traffic_and_gap", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43058, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 659, "total_tokens": 823, "completion_tokens": 164, "prompt_tokens_details": null}, "description": "Check lack of cross-service transport validation. Flag a collapsed path with multiple observed anomalous owners when the root has a topology response or at least one call edge detail was queried.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.queried_topology_entities and not ctx.observed_edges:\n return True, \"ok\"\n anomalous_services = {ctx.owner_service(entity) for entity in ctx.overview_anomalies if ctx.has_direct_anomaly(entity)}\n if len(anomalous_services) > 1 and root in anomalous_services:\n return False, \"collapsed_path_with_multiple_anomalous_owners\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/candidate_059.json b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_059.json new file mode 100644 index 0000000000000000000000000000000000000000..4bd959a47aeae9a77128975bd70257fedef4bd0c --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/candidate_059.json @@ -0,0 +1 @@ +{"index": 59, "theme": "event_only_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 44059, "revision": 2, "previous_rejection": "execution_errors_or_timeout", "finish_reason": "stop", "usage": {"prompt_tokens": 608, "total_tokens": 767, "completion_tokens": 159, "prompt_tokens_details": null}, "description": "Flag a multi-service isolation claim made after measuring the root with no new independent direct evidence from a different service and no observed root events.", "code": "def check_rule_cand(ctx):\n if ctx.distinct_observed_anomalous_services() >= 2:\n root = ctx.submitted_root\n if root in ctx.observed_metrics and not ctx.inter_service_edges_in_submission():\n root_owner = ctx.owner_service(root)\n if not ctx.observed_events.get(root):\n if all(ctx.owner_service(entity) == root_owner for entity in ctx.observed_metrics if entity != root):\n return False, 'multi_service_isolation_no_new_evidence'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_040.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_040.json new file mode 100644 index 0000000000000000000000000000000000000000..620b93ecfa283c79b476163ef6892acd3fb2413d --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_040.json @@ -0,0 +1 @@ +{"index": 40, "theme": "multi_service_empty_path", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42040, "finish_reason": "stop", "usage": {"prompt_tokens": 4660, "total_tokens": 4837, "completion_tokens": 177, "prompt_tokens_details": null}, "description": "Flag missing inter-service path when two or more observed anomalous services have at least two different overview metric groups.", "code": "def check_rule_cand(ctx):\n anomalous_services = ctx.distinct_observed_anomalous_services()\n if len(anomalous_services) < 2:\n return True, \"ok\"\n metric_groups = set()\n for service in anomalous_services:\n for _, group, _ in ctx.overview_anomalies.get(service, ()):\n metric_groups.add(group)\n if len(metric_groups) < 2:\n return True, \"ok\"\n paths = ctx.inter_service_edges_in_submission()\n if not paths:\n return False, \"missing_inter_service_path\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_041.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_041.json new file mode 100644 index 0000000000000000000000000000000000000000..0cc1444c24746e706170d6c5edd4441764381fd0 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_041.json @@ -0,0 +1 @@ +{"index": 41, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42041, "finish_reason": "stop", "usage": {"prompt_tokens": 5278, "total_tokens": 5508, "completion_tokens": 230, "prompt_tokens_details": null}, "description": "Flag an absent inter-service path in a multi-service anomaly when its service-level submitted root has been directly measured, or if its service-level root has not been directly measured and a separate service in the overview was measured.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_service = ctx.owner_service(root)\n paths = ctx.submitted_path\n if not paths:\n return True, 'ok'\n if any(c != a for c, a in paths):\n return True, 'ok'\n if ctx.has_direct_anomaly(root_service):\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_inter_service_path_with_measured_root'\n else:\n for service in ctx.distinct_anomalous_services_in_overview():\n if ctx.has_direct_anomaly(service):\n if not ctx.inter_service_edges_in_submission():\n return False, 'missing_inter_service_path_with_other_measured_service'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_042.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_042.json new file mode 100644 index 0000000000000000000000000000000000000000..7c45982da293ab65ba3e614f1c19aa367381b981 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_042.json @@ -0,0 +1 @@ +{"index": 42, "theme": "owned_instance_comparison", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42042, "finish_reason": "stop", "usage": {"prompt_tokens": 5573, "total_tokens": 5767, "completion_tokens": 194, "prompt_tokens_details": null}, "description": "Flag a multi-service anomaly submitted with an instance root and only same-owner edges, when root topology has not been inspected. Require a nonempty raw path.", "code": "def check_rule_cand(ctx):\n if not ctx.submitted_path:\n return True, \"ok\"\n root = ctx.submitted_root\n if ctx.entity_layer(root) != 'instance':\n return True, \"ok\"\n if len(ctx.distinct_anomalous_services_in_overview()) <= 1:\n return True, \"ok\"\n if any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in ctx.inter_service_edges_in_submission()):\n return True, \"ok\"\n if root in ctx.queried_topology:\n return True, \"ok\"\n return False, \"uninspected_instance_root\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_043.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_043.json new file mode 100644 index 0000000000000000000000000000000000000000..913c72c8a208f5f88b5020079986775293c181cc --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_043.json @@ -0,0 +1 @@ +{"index": 43, "theme": "unexplored_outgoing", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42043, "finish_reason": "stop", "usage": {"prompt_tokens": 4596, "total_tokens": 4717, "completion_tokens": 121, "prompt_tokens_details": null}, "description": "Flag multi-service anomalies without an inter-service path when the submitted root has a known topology observation.", "code": "def check_rule_cand(ctx):\n if ctx.submitted_root not in ctx.queried_topology:\n return True, \"ok\"\n if len(ctx.distinct_anomalous_services_in_overview()) < 2:\n return True, \"ok\"\n if any(ctx.inter_service_edges_in_submission()):\n return True, \"ok\"\n return False, \"missing_inter_service_path\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_044.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_044.json new file mode 100644 index 0000000000000000000000000000000000000000..f85ae014bea144144ccb6af447a175b3cf0c0df0 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_044.json @@ -0,0 +1 @@ +{"index": 44, "theme": "path_edge_coverage", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42044, "finish_reason": "stop", "usage": {"prompt_tokens": 3836, "total_tokens": 3970, "completion_tokens": 134, "prompt_tokens_details": null}, "description": "Flag a multi-service anomaly without a cross-owner path when the root's own topology has never been queried.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.queried_topology:\n if len(ctx.distinct_anomalous_services_in_overview()) > 1:\n if not any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in ctx.inter_service_edges_in_submission()):\n return False, 'missing_root_topology_with_multi_service_anomaly'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_045.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_045.json new file mode 100644 index 0000000000000000000000000000000000000000..8697a85db77bcacfae4b160ad0db38605075ddae --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_045.json @@ -0,0 +1 @@ +{"index": 45, "theme": "multi_service_empty_path", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42045, "finish_reason": "stop", "usage": {"prompt_tokens": 5453, "total_tokens": 5589, "completion_tokens": 136, "prompt_tokens_details": null}, "description": "Flag missing cross-owner path when overview shows at least three anomalous services and at least one infrastructure metric group.", "code": "def check_rule_cand(ctx):\n if len(ctx.distinct_anomalous_services_in_overview()) < 3:\n return True, \"ok\"\n if not any(metric.get('metric_group') == 'infrastructure' for metric in ctx.overview_anomalies.values()):\n return True, \"ok\"\n if ctx.inter_service_edges_in_submission():\n return True, \"ok\"\n return False, \"missing_cross_owner_path\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.draft1.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.draft1.json new file mode 100644 index 0000000000000000000000000000000000000000..3ec245880d22cc91f6473c5968afd0a252bbf8f3 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.draft1.json @@ -0,0 +1 @@ +{"index": 46, "theme": "inspected_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43046, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 685, "total_tokens": 857, "completion_tokens": 172, "prompt_tokens_details": null}, "description": "Check missing verification of the root family: reject if every queried entity has a different owner than the root. Also reject a missing inter-service path when the multi-service case includes a confirmed root metric but the root's topology remains unqueried.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_owner = ctx.owner_service(root)\n queried_owners = {ctx.owner_service(ent) for ent in ctx.queried_entities}\n if all(owner != root_owner for owner in queried_owners):\n return False, 'different_owners'\n if root in ctx.queried_entities and root not in ctx.queried_topology:\n return False, 'unqueried_root_topology'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.json new file mode 100644 index 0000000000000000000000000000000000000000..c96adf79000284d225f0b1a8279be1c10556e336 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_046.json @@ -0,0 +1 @@ +{"index": 46, "theme": "inspected_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42046, "finish_reason": "stop", "usage": {"prompt_tokens": 4063, "total_tokens": 4216, "completion_tokens": 153, "prompt_tokens_details": null}, "description": "Check if every queried entity has a different owner than the root or if the root's topology is unqueried despite having a confirmed root metric.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n root_owner = ctx.owner_service(root)\n queried_owners = {ctx.owner_service(ent) for ent in ctx.queried_entities}\n if all(owner != root_owner for owner in queried_owners):\n return False, 'different_owners'\n if root in ctx.queried_entities and root not in ctx.queried_topology:\n return False, 'unqueried_root_topology'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_047.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_047.json new file mode 100644 index 0000000000000000000000000000000000000000..4192bccf92aea8fdf5f1727aa4de9c3373d36516 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_047.json @@ -0,0 +1 @@ +{"index": 47, "theme": "lag_or_reversal", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42047, "finish_reason": "stop", "usage": {"prompt_tokens": 4855, "total_tokens": 5027, "completion_tokens": 172, "prompt_tokens_details": null}, "description": "Check if the onset of an effect is before its cause in a cross-owner path or if a single-owner path does not explain all anomalies.", "code": "def check_rule_cand(ctx):\n for cause, affected in ctx.submitted_path:\n if ctx.owner_service(cause) != ctx.owner_service(affected):\n onset_diff = ctx.onset_diff(cause, affected)\n if onset_diff is not None and onset_diff < 0:\n return False, 'negative_onset_diff_cross_owner'\n anomalous_services = ctx.distinct_observed_anomalous_services()\n if len(anomalous_services) > len(ctx.submitted_path):\n return False, 'unexplained_multi_service_anomalies'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_049.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_049.json new file mode 100644 index 0000000000000000000000000000000000000000..421b0416ffe0e42efd174904b8fbcb08cd686662 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_049.json @@ -0,0 +1 @@ +{"index": 49, "theme": "quiet_root_metric_slots", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42049, "finish_reason": "stop", "usage": {"prompt_tokens": 4974, "total_tokens": 5178, "completion_tokens": 204, "prompt_tokens_details": null}, "description": "Rejects missing cross-owner path when the multi-service case has metric observations for the submitted root and no more than one distinct inspected owner. Also rejects a truly measured quiet root when a different observed owner has a strongly abnormal direct metric.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.observed_metrics:\n return True, \"ok\"\n if len(ctx.distinct_observed_anomalous_services()) > 1:\n return True, \"ok\"\n if not ctx.ctx.inter_service_edges_in_submission():\n for service, metrics in ctx.observed_metrics.items():\n if service != root and any(metric.get('robust_z', 0) > 3.0 for metric in metrics.values()):\n return False, \"measured_quiet_root_with_strong_abnormal_direct_metric\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_050.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_050.json new file mode 100644 index 0000000000000000000000000000000000000000..f79e5f5b19825623fbc533a2f8f07d3feed3f5e5 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_050.json @@ -0,0 +1 @@ +{"index": 50, "theme": "co_location", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42050, "finish_reason": "stop", "usage": {"prompt_tokens": 4438, "total_tokens": 4578, "completion_tokens": 140, "prompt_tokens_details": null}, "description": "Check if an instance-rooted multi-service submission has distinct service anomalies but no cross-owner edges, suggesting an unsupported inference that the incident stayed within the instance's service.", "code": "def check_rule_cand(ctx):\n if ctx.entity_layer(ctx.submitted_root) != 'instance':\n return True, 'ok'\n services = ctx.distinct_observed_anomalous_services()\n if len(services) < 2:\n return True, 'ok'\n if ctx.inter_service_edges_in_submission():\n return True, 'ok'\n return False, 'unsupported_instance_service_boundary'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_051.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_051.json new file mode 100644 index 0000000000000000000000000000000000000000..7f7d5b166783d7127604deeb07f9fb94610f93d5 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_051.json @@ -0,0 +1 @@ +{"index": 51, "theme": "anomalous_service_rank", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42051, "finish_reason": "stop", "usage": {"prompt_tokens": 5854, "total_tokens": 6030, "completion_tokens": 176, "prompt_tokens_details": null}, "description": "Check if a single metric group is observed across all anomalous entities and ensure there is a cross-owner effect.", "code": "def check_rule_cand(ctx):\n metric_groups = set()\n for anomaly in ctx.overview_anomalies.values():\n if anomaly.get('metric_group'):\n metric_groups.add(anomaly['metric_group'])\n if len(metric_groups) == 1 and ctx.inter_service_edges_in_submission():\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n for u in anomalous_services:\n for v in anomalous_services:\n if u != v and ctx.owner_service(u) != ctx.owner_service(v):\n return True, 'ok'\n return False, 'missing_cross_owner_effect'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_055.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_055.json new file mode 100644 index 0000000000000000000000000000000000000000..267c5b155cfd1db9ba59cddeb47092fa534e2f66 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_055.json @@ -0,0 +1 @@ +{"index": 55, "theme": "missing_evidence_ids", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42055, "finish_reason": "stop", "usage": {"prompt_tokens": 4512, "total_tokens": 4626, "completion_tokens": 114, "prompt_tokens_details": null}, "description": "Check for unverified cross-owner effects in multi-service submissions without inter-service edges and missing cited evidence or root topology.", "code": "def check_rule_cand(ctx):\n if not ctx.inter_service_edges_in_submission():\n if not any(evidence in ctx.observed_evidence_ids for evidence in ctx.submitted_evidence_ids):\n if ctx.submitted_root not in ctx.queried_topology:\n return False, 'unverified_cross_owner_effects'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.draft1.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.draft1.json new file mode 100644 index 0000000000000000000000000000000000000000..94636725aedc5ca9e2e0c53175325ee814fe6a03 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.draft1.json @@ -0,0 +1 @@ +{"index": 56, "theme": "early_competing_anomaly", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43056, "revision": 1, "previous_rejection": "denied_attribute", "finish_reason": "stop", "usage": {"prompt_tokens": 726, "total_tokens": 946, "completion_tokens": 220, "prompt_tokens_details": null}, "description": "Repair the Python checker for an immutable anonymous diagnosis context according to the specified condition.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root in ctx.queried_entities or root in ctx.queried_topology_entities:\n return False, 'root_inspected'\n for alt in range(ctx.distinct_anomalous_services_in_overview()):\n service = ctx.distinct_observed_anomalous_services()[alt]\n if service in ctx.queried_entities or service in ctx.queried_topology_entities:\n return False, 'alternative_inspected'\n for u, v in ctx.submitted_path:\n onset_u = ctx.earliest_anomaly_offset(u)\n onset_v = ctx.earliest_anomaly_offset(v)\n if onset_u is not None and onset_v is not None and onset_v < onset_u:\n return False, 'propagation_started_earlier'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.json new file mode 100644 index 0000000000000000000000000000000000000000..11775903968e7af9400726f7682ce9128c7f5de2 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_056.json @@ -0,0 +1 @@ +{"index": 56, "theme": "early_competing_anomaly", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42056, "finish_reason": "stop", "usage": {"prompt_tokens": 5246, "total_tokens": 5469, "completion_tokens": 223, "prompt_tokens_details": null}, "description": "Reject a confined path despite multiple anomalous services if root and alternative were inspected or its root topology was inspected. Also reject measured propagation to an affected node that started earlier by a nonzero amount.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root in ctx.queried_entities or root in ctx.queried_topology:\n return False, 'root_inspected'\n for alt in ctx.distinct_anomalous_services_in_overview():\n if alt in ctx.queried_entities or alt in ctx.queried_topology:\n return False, 'alternative_inspected'\n for u, v in ctx.submitted_path:\n onset_u = ctx.earliest_anomaly_offset(u)\n onset_v = ctx.earliest_anomaly_offset(v)\n if onset_u is not None and onset_v is not None and onset_v < onset_u:\n return False, 'propagation_started_earlier'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_057.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_057.json new file mode 100644 index 0000000000000000000000000000000000000000..5cbc8134520658160ceb109e18c7cc8b024c48d8 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_057.json @@ -0,0 +1 @@ +{"index": 57, "theme": "empty_path_with_root_evidence", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42057, "finish_reason": "stop", "usage": {"prompt_tokens": 4727, "total_tokens": 4933, "completion_tokens": 206, "prompt_tokens_details": null}, "description": "In a multi-service anomaly, require a cross-owner effect when the submitted root has direct abnormal metrics and the initial overview shows anomalies on distinct owners.", "code": "def check_rule_cand(ctx):\n if not ctx.has_direct_anomaly(ctx.submitted_root):\n return True, \"ok\"\n anomalous_services = ctx.distinct_anomalous_services_in_overview()\n if len(anomalous_services) < 2:\n return True, \"ok\"\n owners = {ctx.owner_service(svc) for svc in anomalous_services}\n if len(owners) < 2:\n return True, \"ok\"\n inter_service_edges = ctx.inter_service_edges_in_submission()\n if not any(ctx.owner_service(caller) != ctx.owner_service(callee) for caller, callee in inter_service_edges):\n return False, \"missing_cross_owner_effect\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_058.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_058.json new file mode 100644 index 0000000000000000000000000000000000000000..8187e2494186af7da7b3d9d24cd3ec68da64ccbb --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_058.json @@ -0,0 +1 @@ +{"index": 58, "theme": "traffic_and_gap", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42058, "finish_reason": "stop", "usage": {"prompt_tokens": 5047, "total_tokens": 5188, "completion_tokens": 141, "prompt_tokens_details": null}, "description": "Flag a collapsed path with multiple observed anomalous owners when the root has a topology response or at least one call edge detail was queried.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n if root not in ctx.queried_topology and not ctx.observed_edges:\n return True, \"ok\"\n anomalous_services = ctx.distinct_observed_anomalous_services()\n if len(anomalous_services) > 1 and root in anomalous_services:\n return False, \"collapsed_path_with_multiple_anomalous_owners\"\n return True, \"ok\""} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.draft1.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.draft1.json new file mode 100644 index 0000000000000000000000000000000000000000..942e802d69d34ba264016d4fc6079a1ea3494249 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.draft1.json @@ -0,0 +1 @@ +{"index": 59, "theme": "event_only_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 43059, "revision": 1, "previous_rejection": "execution_errors_or_timeout", "finish_reason": "stop", "usage": {"prompt_tokens": 727, "total_tokens": 924, "completion_tokens": 197, "prompt_tokens_details": null}, "description": "Reject a multi-service claim restricted to one owner when the model has measured its proposed root and received no events or no alternative owner's direct metrics.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n owner = ctx.owner_service(root)\n if ctx.distinct_anomalous_services_in_overview() > 1 and all(ctx.owner_service(svc) == owner for svc in ctx.distinct_anomalous_services_in_overview()):\n if not ctx.observed_events or not any(event for event in ctx.observed_events.values()):\n if not any(metric for svc in ctx.distinct_anomalous_services_in_overview() for slot, metric in ctx.observed_metrics.get(svc, {}).items() if ctx.owner_service(svc) != owner):\n return False, 'no_cross_owner_metrics_or_events'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.json b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.json new file mode 100644 index 0000000000000000000000000000000000000000..05c2e26fb3da06df4a35c812639b0d3f24135370 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/candidates/drafts/candidate_059.json @@ -0,0 +1 @@ +{"index": 59, "theme": "event_only_root", "model": "Qwen2.5-Coder-32B-Instruct", "seed": 42059, "finish_reason": "stop", "usage": {"prompt_tokens": 3984, "total_tokens": 4180, "completion_tokens": 196, "prompt_tokens_details": null}, "description": "Rejects a multi-service claim restricted to one owner when no events or direct metrics from another owner are observed.", "code": "def check_rule_cand(ctx):\n root = ctx.submitted_root\n owner = ctx.owner_service(root)\n if len(ctx.distinct_anomalous_services_in_overview()) > 1 and all(ctx.owner_service(svc) == owner for svc in ctx.distinct_anomalous_services_in_overview()):\n if not ctx.observed_events or not any(event['evidence_id'] for event in ctx.observed_events.values()):\n if not any(metric for svc in ctx.distinct_anomalous_services_in_overview() for slot, metric in ctx.observed_metrics.get(svc, {}).items() if ctx.owner_service(svc) != owner):\n return False, 'no_cross_owner_metrics_or_events'\n return True, 'ok'"} diff --git a/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_01.py b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_01.py new file mode 100644 index 0000000000000000000000000000000000000000..a0903d516c1ce9bc12cb8574ad76869a6c025dab --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_01.py @@ -0,0 +1,6 @@ +def check_rule_01(ctx): + if not ctx.submitted_path or all((ctx.owner_service(c) == ctx.owner_service(a) for (c, a) in ctx.submitted_path)): + cross_owner_edges = any((ctx.owner_service(caller) != ctx.owner_service(callee) for (caller, callee) in ctx.observed_edges)) + if not cross_owner_edges: + return (False, 'unsupported_multi_service_isolation') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_02.py b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_02.py new file mode 100644 index 0000000000000000000000000000000000000000..bc0a0fd6b61471e52e9c6c0084c90e4a265a66bb --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_02.py @@ -0,0 +1,8 @@ +def check_rule_02(ctx): + queried_owners = set((ctx.owner_service(e) for e in ctx.queried_entities)) + if len(queried_owners) < 2: + return (True, 'ok') + inter_service_edges = ctx.inter_service_edges_in_submission() + if not any((ctx.owner_service(caller) != ctx.owner_service(callee) for (caller, callee) in inter_service_edges)): + return (False, 'missing_cross_owner_edge') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_03.py b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_03.py new file mode 100644 index 0000000000000000000000000000000000000000..e6085e76734315c9bd48e3d783380bf2d87bb273 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_03.py @@ -0,0 +1,6 @@ +def check_rule_03(ctx): + if len(ctx.queried_entities) <= 1: + return (True, 'ok') + if not ctx.inter_service_edges_in_submission(): + return (False, 'missing_inter_service_path') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_04.py b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_04.py new file mode 100644 index 0000000000000000000000000000000000000000..1f2ef651ed3674bd2cbcfce9da0eb15a51e3aef7 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/expanded_verified/check_rule_04.py @@ -0,0 +1,5 @@ +def check_rule_04(ctx): + inter_service_edges = ctx.inter_service_edges_in_submission() + if not inter_service_edges: + return (False, 'missing_cross_service_edges') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/first_verified/check_rule_01.py b/faisi/W2-02-checker-synthesizer/private/first_verified/check_rule_01.py new file mode 100644 index 0000000000000000000000000000000000000000..d044fcdc448f8408f9123f817e97079632f92c41 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/first_verified/check_rule_01.py @@ -0,0 +1,5 @@ +def check_rule_01(ctx): + inter_service_edges = ctx.inter_service_edges_in_submission() + if not inter_service_edges: + return (False, 'missing_cross_service_edges') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_01.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_01.py new file mode 100644 index 0000000000000000000000000000000000000000..213c7fe2e8483e527767d5812226b82524dc0d83 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_01.py @@ -0,0 +1,11 @@ +def check_rule_01(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + if ctx.distinct_observed_anomalous_services() >= 2: + root = ctx.submitted_root + if root in ctx.observed_metrics and (not ctx.inter_service_edges_in_submission()): + root_owner = ctx.owner_service(root) + if not ctx.observed_events.get(root): + if all((ctx.owner_service(entity) == root_owner for entity in ctx.observed_metrics if entity != root)): + return (False, 'multi_service_isolation_no_new_evidence') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_02.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_02.py new file mode 100644 index 0000000000000000000000000000000000000000..f2bcd4d2a3d7a3d6e08376560ee51b9a3e874f72 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_02.py @@ -0,0 +1,8 @@ +def check_rule_02(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + owners = set((ctx.owner_service(e) for e in ctx.queried_entities)) + if len(owners) == 1: + if not ctx.inter_service_edges_in_submission(): + return (False, 'missing_inter_service_path') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_03.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_03.py new file mode 100644 index 0000000000000000000000000000000000000000..fe24c52833fab2f796ea1859db9cf9a3500bdacc --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_03.py @@ -0,0 +1,15 @@ +def check_rule_03(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + if not ctx.submitted_path: + return (True, 'ok') + root = ctx.submitted_root + if ctx.entity_layer(root) != 'instance': + return (True, 'ok') + if ctx.distinct_anomalous_services_in_overview() <= 1: + return (True, 'ok') + if any((ctx.owner_service(caller) != ctx.owner_service(callee) for (caller, callee) in ctx.inter_service_edges_in_submission())): + return (True, 'ok') + if root in ctx.queried_topology_entities: + return (True, 'ok') + return (False, 'uninspected_instance_root') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_04.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_04.py new file mode 100644 index 0000000000000000000000000000000000000000..23c7a57ea39ed8ed00ea8415dfdaec4d7239e9ed --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_04.py @@ -0,0 +1,11 @@ +def check_rule_04(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + if ctx.entity_layer(ctx.submitted_root) != 'instance': + return (True, 'ok') + services = ctx.distinct_observed_anomalous_services() + if services < 2: + return (True, 'ok') + if ctx.inter_service_edges_in_submission(): + return (True, 'ok') + return (False, 'unsupported_instance_service_boundary') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_05.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_05.py new file mode 100644 index 0000000000000000000000000000000000000000..64be37201524871cfafa082c807545a644b1d5ca --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_05.py @@ -0,0 +1,8 @@ +def check_rule_05(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + if not ctx.submitted_path or all((ctx.owner_service(c) == ctx.owner_service(a) for (c, a) in ctx.submitted_path)): + cross_owner_edges = any((ctx.owner_service(caller) != ctx.owner_service(callee) for (caller, callee) in ctx.observed_edges)) + if not cross_owner_edges: + return (False, 'unsupported_multi_service_isolation') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_06.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_06.py new file mode 100644 index 0000000000000000000000000000000000000000..771708d76831b9e1e7ae971ed75c95e4993d267a --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_06.py @@ -0,0 +1,7 @@ +def check_rule_06(ctx: 'TrajectoryContext') -> tuple[bool, str]: + if ctx.distinct_observed_anomalous_services() < 2: + return (True, 'ok') + inter_service_edges = ctx.inter_service_edges_in_submission() + if not inter_service_edges: + return (False, 'missing_cross_service_edges') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_07.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_07.py new file mode 100644 index 0000000000000000000000000000000000000000..b32dec3206ba779e754d17bbb8f45c3751e1d777 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_07.py @@ -0,0 +1,10 @@ +def check_rule_07(ctx: 'TrajectoryContext') -> tuple[bool, str]: + for (cause, affected) in ctx.submitted_path: + if ctx.owner_service(cause) != ctx.owner_service(affected): + onset_diff = ctx.onset_diff(cause, affected) + if onset_diff is not None and onset_diff < 0: + return (False, 'negative_onset_diff_cross_owner') + anomalous_services_count = ctx.distinct_observed_anomalous_services() + if anomalous_services_count >= 2 and (not ctx.inter_service_edges_in_submission()) and (ctx.earliest_anomaly_offset(ctx.submitted_root) is not None): + return (False, 'unexplained_multi_service_anomalies') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_08.py b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_08.py new file mode 100644 index 0000000000000000000000000000000000000000..e45c154f15f0f92fad76028661ad44ee01de716b --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/verified_checkers/check_rule_08.py @@ -0,0 +1,7 @@ +def check_rule_08(ctx: 'TrajectoryContext') -> tuple[bool, str]: + root = ctx.submitted_root + if not any((ctx.owner_service(e) == ctx.owner_service(root) for e in ctx.queried_entities)): + return (False, 'uninspected_diagnosis_family') + if ctx.distinct_observed_anomalous_services() >= 2 and root in ctx.observed_metrics and (root not in ctx.queried_topology_entities) and (not ctx.inter_service_edges_in_submission()): + return (False, 'multi_service_missing_cross_owner_path') + return (True, 'ok') diff --git a/faisi/W2-02-checker-synthesizer/private/isolated_output/w2_02_checker_gate_report.json b/faisi/W2-02-checker-synthesizer/private/isolated_output/w2_02_checker_gate_report.json new file mode 100644 index 0000000000000000000000000000000000000000..2df0f8d7348c1748d7004bf362cae368b6e34c4a --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/private/isolated_output/w2_02_checker_gate_report.json @@ -0,0 +1,1362 @@ +{ + "overall_pass": true, + "generator": { + "model": "Qwen2.5-Coder-32B-Instruct", + "tensor_parallel_size": 4, + "seed_base": 42000 + }, + "allowlist_sha256": "34709abed3cf336ab21ee9c2bf7c24e08b037ca0936d16ebd74985199eb278b4", + "input_isolation": { + "allowlisted_train_cases": 621, + "w200_train_byte_offsets": { + "Qwen2.5-7B-Instruct": 3422317, + "Qwen2.5-14B-Instruct": 6645497 + }, + "trajectory_counts_by_model": { + "Qwen2.5-7B-Instruct": 4968, + "Qwen2.5-14B-Instruct": 4968 + }, + "root_hit_counts_by_model": { + "Qwen2.5-7B-Instruct": 1168, + "Qwen2.5-14B-Instruct": 1077 + }, + "cases_without_observable_canonical_root": 0, + "test_payloads_read": 0, + "out_of_scope_trajectory_payloads_decoded": 0, + "ground_truth_vault_files_opened": 0, + "causal_path_files_opened": 0, + "scoring_inputs": { + "openrca_v1": "Bank and Telecom official component columns", + "propagation_bench": "authorized injection JSON root metadata", + "openrca_v2": "authorized manifest root_services fields" + }, + "filesystem_and_network_isolated_final_gate": true + }, + "mining": { + "train_cases": 621, + "trajectories": 9936, + "anchor_pos": 1499, + "conflict_fp_pairs": 1371, + "conflict_div_pairs": 903, + "conflict_negative_union": 2274, + "anchors_also_in_negative_union": 167 + }, + "gate_thresholds": { + "trajectory_timeout_ms": 10, + "max_mean_ms": 2.0, + "max_error_rate": 0, + "max_individual_fpr": 0.05, + "min_individual_tpr": 0.15, + "min_delta_tpr": 0.03, + "max_joint_fpr": 0.15, + "min_joint_tpr": 0.45 + }, + "total_candidates": 60, + "syntactically_and_statistically_eligible": 16, + "revised_candidates": 16, + "model_draft_revisions": 19, + "selected_rule_count": 8, + "selected_rules": [ + { + "function": "check_rule_01", + "candidate_index": 59, + "theme": "event_only_root", + "description": "Flag a multi-service isolation claim made after measuring the root with no new independent direct evidence from a different service and no observed root events.", + "delta_tpr": 0.21152154793315744, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.21152154793315744, + "mean_ms": 0.041676361714975844, + "p99_ms": 0.182188, + "max_ms": 0.281741, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "multi_service_isolation_no_new_evidence": 1947 + } + }, + { + "function": "check_rule_02", + "candidate_index": 48, + "theme": "exact_root_verification", + "description": "Check if a multi-service case was investigated beyond the submitted root scope by verifying the presence of inter-service paths when the root's owner is the only owner in queried entities.", + "delta_tpr": 0.05980650835532102, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.2700087950747581, + "mean_ms": 0.03286803874798712, + "p99_ms": 0.183272, + "max_ms": 0.248765, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "missing_inter_service_path": 2446 + } + }, + { + "function": "check_rule_03", + "candidate_index": 42, + "theme": "owned_instance_comparison", + "description": "Flag a multi-service anomaly submitted with an instance root and only same-owner edges, when root topology has not been inspected. Require a nonempty raw path.", + "delta_tpr": 0.08179419525065963, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.20932277924362358, + "mean_ms": 0.0308292634863124, + "p99_ms": 0.178662, + "max_ms": 0.290233, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "uninspected_instance_root": 1763 + } + }, + { + "function": "check_rule_04", + "candidate_index": 50, + "theme": "co_location", + "description": "Check the instance versus service boundary. When an instance-rooted multi-service submission has no cross-owner edges yet has distinct observable service anomalies in the initial view, flag the unsupported inference that the incident stayed inside that instance's service.", + "delta_tpr": 0.06948109058927, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.3095866314863676, + "mean_ms": 0.03154352687198068, + "p99_ms": 0.176041, + "max_ms": 0.251559, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "unsupported_instance_service_boundary": 2609 + } + }, + { + "function": "check_rule_05", + "candidate_index": 54, + "theme": "path_edge_coverage", + "description": "Check if an unsupported multi-service isolation claim exists by verifying the presence of cross-owner edges in the observed root topology.", + "delta_tpr": 0.03518029903254178, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.2928759894459103, + "mean_ms": 0.026458997987117552, + "p99_ms": 0.178663, + "max_ms": 0.26709, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "unsupported_multi_service_isolation": 2779 + } + }, + { + "function": "check_rule_06", + "candidate_index": 11, + "theme": "path_edge_coverage", + "description": "Check for nontrivial propagation without inspecting visible cross-service edges or topology around its endpoints.", + "delta_tpr": 0.030782761653474055, + "exclusive_tpr_in_final_library": 0.0, + "fpr": 0.0, + "tpr": 0.48856640281442393, + "mean_ms": 0.02573168921095008, + "p99_ms": 0.161892, + "max_ms": 0.217825, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "missing_cross_service_edges": 4006 + } + }, + { + "function": "check_rule_07", + "candidate_index": 47, + "theme": "lag_or_reversal", + "description": "Flag cross-owner edges with a measured negative onset difference. Also flag when many services are anomalous, the root onset has been measured and the submitted path still contains no inter-service edges.", + "delta_tpr": 0.04661389621811785, + "exclusive_tpr_in_final_library": 0.04661389621811785, + "fpr": 0.01467645096731154, + "tpr": 0.4925241864555849, + "mean_ms": 0.027957318236714976, + "p99_ms": 0.171815, + "max_ms": 0.216112, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "unexplained_multi_service_anomalies": 3702, + "negative_onset_diff_cross_owner": 310 + } + }, + { + "function": "check_rule_08", + "candidate_index": 46, + "theme": "inspected_root", + "description": "Checker for an immutable anonymous diagnosis context with specific conditions.", + "delta_tpr": 0.031222515391380826, + "exclusive_tpr_in_final_library": 0.031222515391380826, + "fpr": 0.0, + "tpr": 0.24538258575197888, + "mean_ms": 0.02789222725442834, + "p99_ms": 0.179523, + "max_ms": 0.280446, + "evaluated_trajectories": 9936, + "errors": 0, + "failure_reason_counts": { + "multi_service_missing_cross_owner_path": 1711, + "uninspected_diagnosis_family": 146 + } + } + ], + "joint_fpr": 0.01467645096731154, + "joint_tpr": 0.5664028144239226, + "joint_anchor_rejections": 22, + "joint_conflict_rejections": 1288, + "joint_metrics_by_dataset": { + "openrca_v1": { + "anchor_count": 176, + "conflict_count": 495, + "joint_fpr": 0.11931818181818182, + "joint_tpr": 0.2202020202020202 + }, + "propagation_bench": { + "anchor_count": 490, + "conflict_count": 857, + "joint_fpr": 0.0, + "joint_tpr": 0.6686114352392065 + }, + "openrca_v2": { + "anchor_count": 833, + "conflict_count": 922, + "joint_fpr": 0.0012004801920768306, + "joint_tpr": 0.6572668112798264 + } + }, + "candidate_results": [ + { + "index": 0, + "theme": "multi_service_empty_path", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42000, + "normalized_schema_or_scope": true, + "fpr": 0.8779186124082722, + "tpr": 0.8759894459102903, + "anchors_rejected": 1316, + "conflicts_rejected": 1992, + "mean_ms": 0.02967679639694042, + "p99_ms": 0.167426, + "max_ms": 2.300956, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "path_collapses_within_single_service": 8907 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 1, + "theme": "inspected_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42001, + "fpr": 0.004669779853235491, + "tpr": 0.055848724714160074, + "anchors_rejected": 7, + "conflicts_rejected": 127, + "mean_ms": 0.008874286936392915, + "p99_ms": 0.149681, + "max_ms": 0.235486, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_owner_or_child": 281 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 2, + "theme": "exact_root_verification", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42002, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.008472228565203181, + "p99_ms": 0.01539, + "max_ms": 0.239645, + "evaluated_trajectories": 9936, + "errors": 757, + "error_types": { + "TypeError": 757 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 3, + "theme": "event_only_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42003, + "rejected": "denied_attribute" + }, + { + "index": 4, + "theme": "early_competing_anomaly", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42004, + "rejected": "denied_attribute" + }, + { + "index": 5, + "theme": "quiet_root_metric_slots", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42005, + "fpr": 0.00133422281521014, + "tpr": 0.014072119613016711, + "anchors_rejected": 2, + "conflicts_rejected": 32, + "mean_ms": 0.0083884501157535, + "p99_ms": 0.015661, + "max_ms": 0.206499, + "evaluated_trajectories": 9936, + "errors": 865, + "error_types": { + "KeyError": 865 + }, + "failure_reason_counts": { + "root_no_anomaly_with_anomalous_co_located": 71 + }, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 6, + "theme": "isolated_weak_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42006, + "fpr": 0.02401601067378252, + "tpr": 0.06904133685136324, + "anchors_rejected": 36, + "conflicts_rejected": 157, + "mean_ms": 0.006036349637681159, + "p99_ms": 0.149808, + "max_ms": 0.22904, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "root_missing_with_alternative": 432 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 7, + "theme": "unexplored_outgoing", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42007, + "normalized_schema_or_scope": true, + "fpr": 0.3135423615743829, + "tpr": 0.17678100263852242, + "anchors_rejected": 470, + "conflicts_rejected": 402, + "mean_ms": 0.03185811231884058, + "p99_ms": 0.172759, + "max_ms": 0.257605, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "uninspected_anomalous_downstream": 1759 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 8, + "theme": "inactive_submitted_edges", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42008, + "fpr": 0.0, + "tpr": 0.0021987686895338612, + "anchors_rejected": 0, + "conflicts_rejected": 5, + "mean_ms": 0.009510392814009661, + "p99_ms": 0.153877, + "max_ms": 0.246335, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "weak_edge_traffic_or_error": 14 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 9, + "theme": "lag_or_reversal", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42009, + "fpr": 0.004669779853235491, + "tpr": 0.007475813544415127, + "anchors_rejected": 7, + "conflicts_rejected": 17, + "mean_ms": 0.005737226348631239, + "p99_ms": 0.152966, + "max_ms": 0.214017, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "conflicting_onset_order": 80 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 10, + "theme": "co_location", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42010, + "fpr": 0.00066711140760507, + "tpr": 0.001759014951627089, + "anchors_rejected": 1, + "conflicts_rejected": 4, + "mean_ms": 0.0072389740259740255, + "p99_ms": 0.153394, + "max_ms": 0.235804, + "evaluated_trajectories": 9936, + "errors": 5008, + "error_types": { + "ValueError": 5008 + }, + "failure_reason_counts": { + "shared_owner_neighbors_with_anomalies": 20 + }, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 11, + "theme": "path_edge_coverage", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42011, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.48856640281442393, + "anchors_rejected": 0, + "conflicts_rejected": 1111, + "mean_ms": 0.02573168921095008, + "p99_ms": 0.161892, + "max_ms": 0.217825, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_cross_service_edges": 4006 + } + }, + { + "index": 12, + "theme": "missing_evidence_ids", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42012, + "fpr": 1.0, + "tpr": 1.0, + "anchors_rejected": 1499, + "conflicts_rejected": 2274, + "mean_ms": 0.01529899033816425, + "p99_ms": 0.16073, + "max_ms": 0.237917, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_cited_evidence_for_root": 9936 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 13, + "theme": "wrong_layer_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42013, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.01535006182014001, + "p99_ms": 0.161791, + "max_ms": 0.244715, + "evaluated_trajectories": 9936, + "errors": 651, + "error_types": { + "KeyError": 651 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 14, + "theme": "anomalous_service_rank", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42014, + "normalized_schema_or_scope": true, + "rejected": "denied_attribute" + }, + { + "index": 15, + "theme": "traffic_and_gap", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42015, + "rejected": "denied_attribute" + }, + { + "index": 16, + "theme": "empty_path_with_root_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42016, + "normalized_schema_or_scope": true, + "fpr": 0.45030020013342226, + "tpr": 0.758575197889182, + "anchors_rejected": 675, + "conflicts_rejected": 1725, + "mean_ms": 0.026187165358293074, + "p99_ms": 0.170907, + "max_ms": 0.254896, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_downstream_effect": 7046 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 17, + "theme": "unrepresentative_query", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42017, + "normalized_schema_or_scope": true, + "rejected": "denied_call" + }, + { + "index": 18, + "theme": "owned_instance_comparison", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42018, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.02460824878944732, + "p99_ms": 0.052396, + "max_ms": 0.269188, + "evaluated_trajectories": 9936, + "errors": 3947, + "error_types": { + "TypeError": 3947 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 19, + "theme": "few_distinct_inspections", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42019, + "normalized_schema_or_scope": true, + "fpr": 0.00066711140760507, + "tpr": 0.00395778364116095, + "anchors_rejected": 1, + "conflicts_rejected": 9, + "mean_ms": 0.03259147926731079, + "p99_ms": 0.17833, + "max_ms": 0.243643, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_direct_evidence_after_repeated_queries": 30 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 20, + "theme": "multi_service_empty_path", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42020, + "normalized_schema_or_scope": true, + "fpr": 0.36224149432955305, + "tpr": 0.6992084432717678, + "anchors_rejected": 543, + "conflicts_rejected": 1590, + "mean_ms": 0.029701788949275363, + "p99_ms": 0.176512, + "max_ms": 0.266084, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "path_collapses_within_one_service": 6498 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 21, + "theme": "inspected_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42021, + "fpr": 0.10406937958639093, + "tpr": 0.1517150395778364, + "anchors_rejected": 156, + "conflicts_rejected": 345, + "mean_ms": 0.005817654388083736, + "p99_ms": 0.154981, + "max_ms": 0.224516, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "uninspected_root_and_owner": 759 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 22, + "theme": "exact_root_verification", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42022, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.00587765548098434, + "p99_ms": 0.029026, + "max_ms": 0.342854, + "evaluated_trajectories": 9936, + "errors": 2784, + "error_types": { + "AttributeError": 2784 + }, + "failure_reason_counts": { + "stronger_owner_metric": 40 + }, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 23, + "theme": "event_only_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42023, + "fpr": 0.3655770513675784, + "tpr": 0.43051890941073, + "anchors_rejected": 548, + "conflicts_rejected": 979, + "mean_ms": 0.00541841425120773, + "p99_ms": 0.155374, + "max_ms": 0.206294, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "incidental_event_as_root": 3975 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 24, + "theme": "early_competing_anomaly", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42024, + "fpr": 0.0020013342228152103, + "tpr": 0.0013192612137203166, + "anchors_rejected": 3, + "conflicts_rejected": 3, + "mean_ms": 0.009164973027375201, + "p99_ms": 0.158029, + "max_ms": 0.230408, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "cause_begins_earlier": 25 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 25, + "theme": "quiet_root_metric_slots", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42025, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.008648914072921298, + "p99_ms": 0.027829, + "max_ms": 0.227999, + "evaluated_trajectories": 9936, + "errors": 940, + "error_types": { + "KeyError": 865, + "ValueError": 75 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 26, + "theme": "isolated_weak_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42026, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.005905844990345419, + "p99_ms": 0.155563, + "max_ms": 0.219948, + "evaluated_trajectories": 9936, + "errors": 614, + "error_types": { + "TypeError": 614 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 27, + "theme": "unexplored_outgoing", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42027, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.03051176679429168, + "p99_ms": 0.054969, + "max_ms": 0.217341, + "evaluated_trajectories": 9936, + "errors": 7063, + "error_types": { + "KeyError": 3653, + "ValueError": 3410 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 28, + "theme": "inactive_submitted_edges", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42028, + "fpr": 0.0, + "tpr": 0.00043975373790677223, + "anchors_rejected": 0, + "conflicts_rejected": 1, + "mean_ms": 0.009717438028312455, + "p99_ms": 0.139963, + "max_ms": 0.198403, + "evaluated_trajectories": 9936, + "errors": 117, + "error_types": { + "TypeError": 117 + }, + "failure_reason_counts": { + "weak_or_absent_edge_traffic_or_error": 1 + }, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 29, + "theme": "lag_or_reversal", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42029, + "fpr": 0.01467645096731154, + "tpr": 0.04661389621811785, + "anchors_rejected": 22, + "conflicts_rejected": 106, + "mean_ms": 0.008511533715780999, + "p99_ms": 0.150973, + "max_ms": 0.219627, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "downstream_earlier_onset": 310 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 30, + "theme": "co_location", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42030, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.006043543831168831, + "p99_ms": 0.010779, + "max_ms": 0.215502, + "evaluated_trajectories": 9936, + "errors": 5008, + "error_types": { + "ValueError": 5008 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 31, + "theme": "path_edge_coverage", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42031, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.08135444151275285, + "anchors_rejected": 0, + "conflicts_rejected": 185, + "mean_ms": 0.02616620219404187, + "p99_ms": 0.166651, + "max_ms": 0.222184, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "uninspected_cross_service_edges": 345 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 32, + "theme": "missing_evidence_ids", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42032, + "rejected": "denied_attribute" + }, + { + "index": 33, + "theme": "wrong_layer_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42033, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.008492990330378727, + "p99_ms": 0.163906, + "max_ms": 0.245053, + "evaluated_trajectories": 9936, + "errors": 1249, + "error_types": { + "TypeError": 1249 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 34, + "theme": "anomalous_service_rank", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42034, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.024552958584453718, + "p99_ms": 0.179103, + "max_ms": 0.263826, + "evaluated_trajectories": 9936, + "errors": 3465, + "error_types": { + "TypeError": 3465 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 35, + "theme": "traffic_and_gap", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42035, + "fpr": 0.0, + "tpr": 0.001759014951627089, + "anchors_rejected": 0, + "conflicts_rejected": 4, + "mean_ms": 0.0067886515700483095, + "p99_ms": 0.160917, + "max_ms": 0.213377, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "edge_span_gap_unchecked": 5 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 36, + "theme": "empty_path_with_root_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42036, + "normalized_schema_or_scope": true, + "rejected": "denied_attribute" + }, + { + "index": 37, + "theme": "unrepresentative_query", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42037, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": null, + "p99_ms": null, + "max_ms": null, + "evaluated_trajectories": 9936, + "errors": 9936, + "error_types": { + "TypeError": 6283, + "KeyError": 3653 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 38, + "theme": "owned_instance_comparison", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42038, + "normalized_schema_or_scope": true, + "rejected": "denied_attribute" + }, + { + "index": 39, + "theme": "few_distinct_inspections", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42039, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.029274790555555555, + "p99_ms": 0.038911, + "max_ms": 0.201088, + "evaluated_trajectories": 9936, + "errors": 8136, + "error_types": { + "TypeError": 8136 + }, + "failure_reason_counts": {}, + "rejected": "execution_errors_or_timeout" + }, + { + "index": 40, + "theme": "multi_service_empty_path", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43040, + "revision": 1, + "previous_rejection": "denied_call", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.23922603342128407, + "anchors_rejected": 0, + "conflicts_rejected": 544, + "mean_ms": 0.04931848983494364, + "p99_ms": 0.187439, + "max_ms": 0.266398, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_inter_service_path": 984 + } + }, + { + "index": 41, + "theme": "empty_path_with_root_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43041, + "revision": 1, + "previous_rejection": "individual_fpr_or_tpr", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.4050131926121372, + "anchors_rejected": 0, + "conflicts_rejected": 921, + "mean_ms": 0.030642504730273752, + "p99_ms": 0.173249, + "max_ms": 0.225346, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_inter_service_path_with_measured_root": 3168, + "missing_inter_service_path_with_other_measured_service": 25 + } + }, + { + "index": 42, + "theme": "owned_instance_comparison", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43042, + "revision": 1, + "previous_rejection": "denied_attribute", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.20932277924362358, + "anchors_rejected": 0, + "conflicts_rejected": 476, + "mean_ms": 0.0308292634863124, + "p99_ms": 0.178662, + "max_ms": 0.290233, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "uninspected_instance_root": 1763 + } + }, + { + "index": 43, + "theme": "unexplored_outgoing", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43043, + "revision": 1, + "previous_rejection": "denied_attribute", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.23658751099384345, + "anchors_rejected": 0, + "conflicts_rejected": 538, + "mean_ms": 0.030421341988727858, + "p99_ms": 0.176026, + "max_ms": 0.271699, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_inter_service_path": 2004 + } + }, + { + "index": 44, + "theme": "path_edge_coverage", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43044, + "revision": 1, + "previous_rejection": "denied_attribute", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.2519788918205805, + "anchors_rejected": 0, + "conflicts_rejected": 573, + "mean_ms": 0.02854544212962963, + "p99_ms": 0.175454, + "max_ms": 0.285233, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_root_topology_with_multi_service_anomaly": 2002 + } + }, + { + "index": 45, + "theme": "multi_service_empty_path", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43045, + "revision": 1, + "previous_rejection": "denied_string_literal", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.48856640281442393, + "anchors_rejected": 0, + "conflicts_rejected": 1111, + "mean_ms": 0.047498116344605476, + "p99_ms": 0.194309, + "max_ms": 2.276153, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_cross_owner_path": 3995 + } + }, + { + "index": 46, + "theme": "inspected_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 44046, + "revision": 2, + "previous_rejection": "individual_fpr_or_tpr", + "fpr": 0.0, + "tpr": 0.24538258575197888, + "anchors_rejected": 0, + "conflicts_rejected": 558, + "mean_ms": 0.02789222725442834, + "p99_ms": 0.179523, + "max_ms": 0.280446, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "multi_service_missing_cross_owner_path": 1711, + "uninspected_diagnosis_family": 146 + } + }, + { + "index": 47, + "theme": "lag_or_reversal", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43047, + "revision": 1, + "previous_rejection": "execution_errors_or_timeout", + "fpr": 0.01467645096731154, + "tpr": 0.4925241864555849, + "anchors_rejected": 22, + "conflicts_rejected": 1120, + "mean_ms": 0.027957318236714976, + "p99_ms": 0.171815, + "max_ms": 0.216112, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "unexplained_multi_service_anomalies": 3702, + "negative_onset_diff_cross_owner": 310 + } + }, + { + "index": 48, + "theme": "exact_root_verification", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42048, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.2700087950747581, + "anchors_rejected": 0, + "conflicts_rejected": 614, + "mean_ms": 0.03286803874798712, + "p99_ms": 0.183272, + "max_ms": 0.248765, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_inter_service_path": 2446 + } + }, + { + "index": 49, + "theme": "quiet_root_metric_slots", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43049, + "revision": 1, + "previous_rejection": "denied_call", + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.023273061896135268, + "p99_ms": 0.168431, + "max_ms": 0.385339, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": {}, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 50, + "theme": "co_location", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43050, + "revision": 1, + "previous_rejection": "execution_errors_or_timeout", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.3095866314863676, + "anchors_rejected": 0, + "conflicts_rejected": 704, + "mean_ms": 0.03154352687198068, + "p99_ms": 0.176041, + "max_ms": 0.251559, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "unsupported_instance_service_boundary": 2609 + } + }, + { + "index": 51, + "theme": "anomalous_service_rank", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43051, + "revision": 1, + "previous_rejection": "denied_call", + "normalized_schema_or_scope": true, + "rejected": "denied_call" + }, + { + "index": 52, + "theme": "unrepresentative_query", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42052, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.21635883905013192, + "anchors_rejected": 0, + "conflicts_rejected": 492, + "mean_ms": 0.03357352455716586, + "p99_ms": 0.183915, + "max_ms": 0.328985, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_cross_owner_edge": 1553 + } + }, + { + "index": 53, + "theme": "few_distinct_inspections", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42053, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.32497801231310464, + "anchors_rejected": 0, + "conflicts_rejected": 739, + "mean_ms": 0.024929126912238322, + "p99_ms": 0.171888, + "max_ms": 0.248929, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "missing_inter_service_path": 2467 + } + }, + { + "index": 54, + "theme": "path_edge_coverage", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 42054, + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.2928759894459103, + "anchors_rejected": 0, + "conflicts_rejected": 666, + "mean_ms": 0.026458997987117552, + "p99_ms": 0.178663, + "max_ms": 0.26709, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "unsupported_multi_service_isolation": 2779 + } + }, + { + "index": 55, + "theme": "missing_evidence_ids", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43055, + "revision": 1, + "previous_rejection": "denied_attribute", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.0, + "anchors_rejected": 0, + "conflicts_rejected": 0, + "mean_ms": 0.026230442330917876, + "p99_ms": 0.171465, + "max_ms": 0.268051, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": {}, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 56, + "theme": "early_competing_anomaly", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 44056, + "revision": 2, + "previous_rejection": "denied_call", + "fpr": 0.01467645096731154, + "tpr": 0.3909410729991205, + "anchors_rejected": 22, + "conflicts_rejected": 889, + "mean_ms": 0.01863396930354267, + "p99_ms": 0.149062, + "max_ms": 0.22967, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "omitted_inter_service_path": 2650, + "cross_owner_time_reversal": 310 + } + }, + { + "index": 57, + "theme": "empty_path_with_root_evidence", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43057, + "revision": 1, + "previous_rejection": "execution_errors_or_timeout", + "normalized_schema_or_scope": true, + "rejected": "denied_call" + }, + { + "index": 58, + "theme": "traffic_and_gap", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 43058, + "revision": 1, + "previous_rejection": "denied_attribute", + "normalized_schema_or_scope": true, + "fpr": 0.15543695797198132, + "tpr": 0.1442392260334213, + "anchors_rejected": 233, + "conflicts_rejected": 328, + "mean_ms": 0.03697868880837359, + "p99_ms": 0.188219, + "max_ms": 0.49956, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "collapsed_path_with_multiple_anomalous_owners": 1434 + }, + "rejected": "individual_fpr_or_tpr" + }, + { + "index": 59, + "theme": "event_only_root", + "model": "Qwen2.5-Coder-32B-Instruct", + "seed": 44059, + "revision": 2, + "previous_rejection": "execution_errors_or_timeout", + "normalized_schema_or_scope": true, + "fpr": 0.0, + "tpr": 0.21152154793315744, + "anchors_rejected": 0, + "conflicts_rejected": 481, + "mean_ms": 0.041676361714975844, + "p99_ms": 0.182188, + "max_ms": 0.281741, + "evaluated_trajectories": 9936, + "errors": 0, + "error_types": {}, + "failure_reason_counts": { + "multi_service_isolation_no_new_evidence": 1947 + } + } + ] +} diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/__init__.py b/faisi/W2-02-checker-synthesizer/src/checkers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/context_api.py b/faisi/W2-02-checker-synthesizer/src/checkers/context_api.py new file mode 100644 index 0000000000000000000000000000000000000000..557aa018eb92aa49f4194db62b13a37725a3acf7 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/context_api.py @@ -0,0 +1,236 @@ +"""Immutable, observation-only view of a schema v2 anonymous trajectory.""" +from collections import defaultdict +from dataclasses import dataclass, field +import math +import re +from types import MappingProxyType +from typing import Mapping + +ENTITY = re.compile(r"(?:SVC|INST|HOST)_[0-9]{2,5}") +EVIDENCE = re.compile(r"EV_[0-9a-f]{12}") +GROUPS = ( + "latency_p99", "latency_avg", "error_rate", "request_rate", "cpu_usage", + "mem_usage", "io_usage", "network_usage", "other", +) +METRIC_FIELDS = ("median_base", "mean_detect", "robust_z", "anomaly_count", "onset_offset_sec") +OVERVIEW_FIELDS = ( + "entity_id", "layer", "in_degree_quantile", "out_degree_quantile", "multi_tenant_host", + "metric_group", "robust_z", +) +NEIGHBOR_GROUPS = ("upstream", "downstream", "services", "instances", "hosts", "co_located_entities") +EDGE_FIELDS = ( + "baseline_call_count", "detection_call_count", "call_volume_change_rate", "baseline_error_rate", + "detection_error_rate", "error_rate_change", "caller_p99_ms", "callee_p99_ms", "span_gap_ms", + "onset_offset_sec", +) +EVENT_FIELDS = ("event_template", "count", "first_offset_sec", "sample_message", "evidence_id") +LAYERS = {"SVC": "service", "INST": "instance", "HOST": "host"} +EMPTY = MappingProxyType({}) + + +def _entity(value): + return value if isinstance(value, str) and ENTITY.fullmatch(value) else None + + +def entity_layer(value): + return LAYERS.get(value.split("_", 1)[0]) if _entity(value) else None + + +def _number(value): + return value if type(value) in (int, float) and math.isfinite(value) else None + + +def _evidence(value): + return value if isinstance(value, str) and EVIDENCE.fullmatch(value) else None + + +def _pairs(fields, rows): + for row in rows: + yield dict(zip(fields, row)) + + +@dataclass(frozen=True, slots=True) +class TrajectoryContext: + submitted_root: str | None + submitted_path: tuple + submitted_evidence_ids: tuple + num_turns: int + queried_entities: frozenset + queried_topology_entities: frozenset + queried_edges: frozenset + overview_anomalies: Mapping + observed_metrics: Mapping + observed_edges: Mapping + observed_events: Mapping + observed_topology: Mapping + observed_evidence_ids: frozenset + _owners: Mapping = field(repr=False) + _neighbor_peaks: Mapping = field(repr=False) + _onsets: Mapping = field(repr=False) + + @classmethod + def from_trace(cls, trace): + initial = trace["initial_observation"]["result"] + turns = trace["turns"] + if len(turns) != trace["num_turns"] or len(turns) > 21: + raise ValueError("invalid_turn_count") + original = trace["submission"] or {} + root = _entity(original.get("root_entity_id")) + path = tuple((src, dst) for src, dst in original.get("propagation_path", ()) + if _entity(src) and _entity(dst)) + submitted_evidence = tuple(filter(None, map(_evidence, original.get("key_evidence_ids", ())))) + overview = {} + for anomaly in _pairs(initial["fields"], initial["anomalies"]): + entity = _entity(anomaly["entity_id"]) + z = _number(anomaly["robust_z"]) + group = anomaly["metric_group"] + if entity and z is not None and group in GROUPS: + overview[entity] = MappingProxyType({ + "layer": entity_layer(entity), + "in_degree_quantile": _number(anomaly["in_degree_quantile"]), + "out_degree_quantile": _number(anomaly["out_degree_quantile"]), + "multi_tenant_host": anomaly["multi_tenant_host"] is True, + "metric_group": group, "robust_z": z, + }) + + metrics, events, edges = {}, defaultdict(dict), {} + topology, peaks = {}, {} + direct_owners, inverse_owners = defaultdict(set), defaultdict(set) + queried_entities, queried_topology, queried_edges, evidence = set(), set(), set(), set() + if initial_evidence := _evidence(initial.get("evidence_id")): + evidence.add(initial_evidence) + + for turn in turns: + for call in turn["tool_calls"]: + name = call["name"] + args = call.get("arguments") or {} + result = call["result"] + if not isinstance(args, dict) or not isinstance(result, dict): + continue + entity = _entity(args.get("entity_id")) + caller, callee = (_entity(args.get(key)) for key in ("caller_id", "callee_id")) + if name == "query_call_edge_detail" and caller and callee: + queried_edges.add((caller, callee)) + if "error" in result: + continue + if token := _evidence(result.get("evidence_id")): + evidence.add(token) + if name == "query_call_edge_detail" and caller and callee: + if (result["caller_id"], result["callee_id"]) == (caller, callee): + edges[caller, callee] = MappingProxyType({k: _number(result.get(k)) for k in EDGE_FIELDS}) + if entity is None or result.get("entity_id") != entity: + continue + if name == "query_entity_metrics": + queried_entities.add(entity) + metrics[entity] = MappingProxyType({ + group: None if (values := result["slots"].get(group)) is None else MappingProxyType({ + k: _number(v) for k, v in zip(result["fields"], values) if k in METRIC_FIELDS + }) for group in GROUPS + }) + elif name == "query_entity_events": + queried_entities.add(entity) + bag = events[entity] + for event in _pairs(result["fields"], result["events"]): + token = _evidence(event.get("evidence_id")) + if token: + evidence.add(token) + bag[token] = MappingProxyType({ + "evidence_id": token, "count": _number(event.get("count")), + "first_offset_sec": _number(event.get("first_offset_sec")), + "event_template": event["event_template"][:95], + "sample_message": event["sample_message"][:200], + }) + elif name == "get_topology_neighbors": + queried_topology.add(entity) + entry = topology.setdefault(entity, {group: {} for group in NEIGHBOR_GROUPS}) + entry["hop"] = max(entry.get("hop", 0), result["hop"]) + structure = result["structure"] + entry["structure"] = MappingProxyType({ + "layer": entity_layer(entity), + "in_degree_quantile": _number(structure.get("in_degree_quantile")), + "out_degree_quantile": _number(structure.get("out_degree_quantile")), + "multi_tenant_host": structure.get("multi_tenant_host") is True, + }) + for group in NEIGHBOR_GROUPS: + for other, raw_z in result[group]: + if not _entity(other): + continue + z = _number(raw_z) + entry[group][other] = z + if z is not None: + peaks[other] = max(z, peaks.get(other, z)) + relation = (entity, other) if group == "services" else (other, entity) + if (group in ("services", "instances") + and entity_layer(relation[0]) == "instance" + and entity_layer(relation[1]) == "service"): + observed = direct_owners if group == "services" else inverse_owners + observed[relation[0]].add(relation[1]) + observations = MappingProxyType({ + entity: MappingProxyType({ + **{group: MappingProxyType(entry[group]) for group in NEIGHBOR_GROUPS}, + "hop": entry["hop"], "structure": entry["structure"], + }) for entity, entry in topology.items() + }) + onsets = {} + for entity, slots in metrics.items(): + values = [slot["onset_offset_sec"] for slot in slots.values() + if slot is not None and slot.get("onset_offset_sec") is not None] + if values: + onsets[entity] = min(values) + owners = {} + for entity in direct_owners.keys() | inverse_owners.keys(): + parents = direct_owners.get(entity) or inverse_owners[entity] + if len(parents) == 1: + owners[entity] = next(iter(parents)) + return cls( + root, path, submitted_evidence, len(turns), frozenset(queried_entities), + frozenset(queried_topology), frozenset(queried_edges), MappingProxyType(overview), + MappingProxyType(metrics), MappingProxyType(edges), + MappingProxyType({entity: tuple(rows.values()) for entity, rows in events.items()}), + observations, frozenset(evidence), MappingProxyType(owners), MappingProxyType(peaks), + MappingProxyType(onsets), + ) + + def owner_service(self, entity_id): + return self._owners.get(entity_id, entity_id) + + def entity_layer(self, entity_id): + return entity_layer(entity_id) + + def inter_service_edges_in_submission(self): + return tuple((src, dst) for src, dst in self.submitted_path + if self.owner_service(src) != self.owner_service(dst)) + + def _distinct_services(self, entities): + return len({service for entity in entities if entity_layer(service := self.owner_service(entity)) == "service"}) + + def distinct_anomalous_services_in_overview(self): + return self._distinct_services(self.overview_anomalies) + + def distinct_observed_anomalous_services(self): + return self._distinct_services(set(self.overview_anomalies) | { + entity for entity, score in self._neighbor_peaks.items() if score >= 3.0 + }) + + def earliest_anomaly_offset(self, entity_id): + return self._onsets.get(entity_id) + + def onset_diff(self, u, v): + left, right = self._onsets.get(u), self._onsets.get(v) + return right - left if left is not None and right is not None else None + + def co_located_anomaly_ratio(self, entity_id): + peers = self.observed_topology.get(entity_id, EMPTY).get("co_located_entities", EMPTY) + return sum( + (score is not None and score >= 3.0) or self.has_direct_anomaly(other) + for other, score in peers.items() + ) / len(peers) if peers else None + + def uninspected_anomalous_downstream(self, entity_id): + downstream = self.observed_topology.get(entity_id, EMPTY).get("downstream", EMPTY) + return frozenset(other for other, score in downstream.items() + if score is not None and score >= 3.0 and other not in self.queried_entities) + + def has_direct_anomaly(self, entity_id, z_thresh=3.0): + return any(slot is not None and slot.get("robust_z") is not None and slot["robust_z"] >= z_thresh + for slot in self.observed_metrics.get(entity_id, EMPTY).values()) diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/engine.py b/faisi/W2-02-checker-synthesizer/src/checkers/engine.py new file mode 100644 index 0000000000000000000000000000000000000000..d404d28bdb2224ffbdbfa8cb8e54316d754df3d4 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/engine.py @@ -0,0 +1,300 @@ +"""Validator and bounded executor for the generated Python checker subset.""" +import ast +from copy import deepcopy +from dataclasses import dataclass +import math +import operator +from pathlib import Path +import re +import time + +from checkers.context_api import ( + EDGE_FIELDS, EVENT_FIELDS, GROUPS, METRIC_FIELDS, NEIGHBOR_GROUPS, OVERVIEW_FIELDS, + TrajectoryContext, +) + +PUBLIC_FIELDS = frozenset(name for name in TrajectoryContext.__slots__ if not name.startswith("_")) +CONTEXT_METHODS = frozenset({ + "owner_service", "entity_layer", "inter_service_edges_in_submission", + "distinct_anomalous_services_in_overview", "distinct_observed_anomalous_services", + "earliest_anomaly_offset", "onset_diff", "co_located_anomaly_ratio", + "uninspected_anomalous_downstream", "has_direct_anomaly", +}) +CONTAINER_METHODS = {"get", "items", "keys", "values", "startswith"} +STRINGS = frozenset({ + "ok", "service", "instance", "host", "SVC_", "INST_", "HOST_", "structure", "hop", + *GROUPS, *EDGE_FIELDS, *EVENT_FIELDS, *METRIC_FIELDS, *NEIGHBOR_GROUPS, *OVERVIEW_FIELDS, +}) +BUILTINS = {item.__name__: item for item in ( + abs, all, any, bool, enumerate, len, max, min, set, sorted, sum, tuple, zip, +)} +EXPR_TYPES = ( + ast.Assign, ast.For, ast.If, ast.Return, ast.Break, ast.Continue, ast.Pass, ast.Expr, + ast.BoolOp, ast.BinOp, ast.UnaryOp, ast.Compare, ast.Call, ast.Name, ast.Attribute, + ast.Constant, ast.Subscript, ast.Slice, ast.IfExp, ast.Tuple, ast.List, ast.Dict, + ast.Set, ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ast.comprehension, + ast.Load, ast.Store, ast.And, ast.Or, ast.Not, ast.UAdd, ast.USub, + ast.Add, ast.Sub, ast.Mult, ast.Div, ast.FloorDiv, ast.Mod, ast.BitAnd, ast.BitOr, + ast.Eq, ast.NotEq, ast.Lt, ast.LtE, ast.Gt, ast.GtE, ast.Is, ast.IsNot, ast.In, ast.NotIn, ast.keyword, +) +REASON = re.compile(r"[a-z][a-z0-9_]{0,63}") +LOCAL = re.compile(r"(?:[A-Za-z][A-Za-z0-9_]{0,63}|_)") +DATASET_WORD = re.compile( + r"(?:openrca|train[ _-]?ticket|propagation[ _-]?bench|(? 10_000: + raise UnsafeChecker("source_size") + try: + module = ast.parse(source) + except (SyntaxError, ValueError, RecursionError) as exc: + raise UnsafeChecker("invalid_python") from exc + if len(module.body) != 1 or not isinstance(module.body[0], ast.FunctionDef): + raise UnsafeChecker("one_function_required") + function = module.body[0] + args = function.args + if (not FUNC.fullmatch(function.name) or function.decorator_list or args.posonlyargs + or args.vararg or args.kwarg or args.kwonlyargs or args.defaults + or len(args.args) != 1 or args.args[0].arg != "ctx"): + raise UnsafeChecker("invalid_function_signature") + for annotation in (args.args[0].annotation, function.returns): + if annotation is not None: + declared = annotation.value if isinstance(annotation, ast.Constant) else ast.unparse(annotation) + if declared not in ("TrajectoryContext", "tuple[bool, str]"): + raise UnsafeChecker("invalid_annotation") + args.args[0].annotation = function.returns = None + if ast.get_docstring(function) is not None: + function.body.pop(0) + + nodes = [node for stmt in function.body for node in ast.walk(stmt)] + if not nodes or len(nodes) > 1100: + raise UnsafeChecker("invalid_ast_size") + local = {node.id for node in nodes if isinstance(node, ast.Name) and isinstance(node.ctx, ast.Store)} + if local & (BUILTINS.keys() | {"ctx"}) or any(not LOCAL.fullmatch(name) for name in local): + raise UnsafeChecker("invalid_local_name") + reasons = set() + for node in nodes: + if isinstance(node, ast.Return): + value = node.value + if (not isinstance(value, ast.Tuple) or len(value.elts) != 2 + or not isinstance(value.elts[1], ast.Constant) + or not isinstance(value.elts[1].value, str) or not REASON.fullmatch(value.elts[1].value) + or DATASET_WORD.search(value.elts[1].value)): + raise UnsafeChecker("invalid_return_shape") + reasons.add(id(value.elts[1])) + if not reasons: + raise UnsafeChecker("missing_return") + + for node in nodes: + if not isinstance(node, EXPR_TYPES): + raise UnsafeChecker(f"denied_ast_{type(node).__name__}") + if isinstance(node, ast.Name) and node.id not in local | BUILTINS.keys() | {"ctx"}: + raise UnsafeChecker("unknown_name") + if isinstance(node, ast.Attribute): + if not isinstance(node.ctx, ast.Load) or node.attr not in PUBLIC_FIELDS | CONTEXT_METHODS | CONTAINER_METHODS: + raise UnsafeChecker("denied_attribute") + if isinstance(node, ast.Subscript) and not isinstance(node.ctx, ast.Load): + raise UnsafeChecker("container_mutation") + if isinstance(node, ast.Call): + target = node.func + if isinstance(target, ast.Name): + permitted = target.id in BUILTINS + else: + permitted = isinstance(target, ast.Attribute) and ( + target.attr in CONTAINER_METHODS or target.attr in CONTEXT_METHODS + and isinstance(target.value, ast.Name) and target.value.id == "ctx" + ) + if not permitted or any(keyword.arg is None for keyword in node.keywords): + raise UnsafeChecker("denied_call") + if isinstance(node, ast.Dict) and any(key is None for key in node.keys): + raise UnsafeChecker("denied_dictionary_unpack") + if isinstance(node, ast.Constant): + value = node.value + if isinstance(value, str): + if value not in STRINGS and id(node) not in reasons: + raise UnsafeChecker("denied_string_literal") + elif type(value) in (int, float): + if not -1e12 <= value <= 1e12: + raise UnsafeChecker("constant_out_of_range") + elif value is not None and type(value) is not bool: + raise UnsafeChecker("denied_constant") + if isinstance(node, ast.comprehension) and node.is_async: + raise UnsafeChecker("async_comprehension") + return module + + +class Instrument(ast.NodeTransformer): + @staticmethod + def guarded(name, node): + return ast.copy_location(ast.Call(ast.Name(name, ast.Load()), [node], []), node) + + def visit_Tuple(self, node): + self.generic_visit(node) + return self.guarded("_bounded", node) if isinstance(node.ctx, ast.Load) else node + + def visit_List(self, node): + return self.visit_Tuple(node) + + def visit_Set(self, node): + self.generic_visit(node) + node.elts = [self.guarded("_key", element) for element in node.elts] + return self.guarded("_bounded", node) + + def visit_SetComp(self, node): + self.generic_visit(node) + node.elt = self.guarded("_key", node.elt) + return self.guarded("_bounded", node) + + def visit_ListComp(self, node): + self.generic_visit(node) + return self.guarded("_bounded", node) + + def visit_Dict(self, node): + self.generic_visit(node) + node.keys = [self.guarded("_key", key) for key in node.keys] + return self.guarded("_bounded", node) + + def visit_DictComp(self, node): + self.generic_visit(node) + node.key = self.guarded("_key", node.key) + return self.guarded("_bounded", node) + + def visit_For(self, node): + self.generic_visit(node) + node.iter = ast.Call(ast.Name("_guard_iter", ast.Load()), [node.iter], []) + return node + + def visit_comprehension(self, node): + self.generic_visit(node) + node.iter = ast.Call(ast.Name("_guard_iter", ast.Load()), [node.iter], []) + return node + + def visit_BinOp(self, node): + self.generic_visit(node) + return ast.copy_location(ast.Call(ast.Name("_binary", ast.Load()), [ + ast.Constant(type(node.op).__name__), node.left, node.right + ], []), node) + + +def _binary(op, left, right): + if op in ("BitAnd", "BitOr"): + if type(left) not in (set, frozenset) or type(right) not in (set, frozenset): + raise TypeError("set_operands_required") + return left & right if op == "BitAnd" else left | right + if type(left) not in (int, float) or type(right) not in (int, float): + raise TypeError("numeric_operands_required") + answer = NUMERIC_OPS[op](left, right) + if not math.isfinite(answer) or abs(answer) > 1e18: + raise ArithmeticError("numeric_bound") + return answer + + +def _key(value): + simple = (str, int, float, bool, type(None)) + if type(value) in simple or ( + type(value) is tuple and len(value) <= 8 and all(type(part) in simple for part in value) + ): + return value + raise TypeError("checker_key_not_a_scalar_or_short_tuple") + + +def _bounded(value): + """Limit constructed structures before comparison, sorting or further expansion.""" + stack = [(0, value)] + seen = 0 + while stack: + depth, item = stack.pop() + seen += 1 + if seen > 512 or depth > 5: + raise CheckerTimeout("checker_collection_bound") + if type(item) in (tuple, list, set, dict): + if len(item) > 256: + raise CheckerTimeout("checker_collection_bound") + stack.extend((depth + 1, member) for member in item) + if type(item) is dict: + stack.extend((depth + 1, member) for member in item.values()) + return value + + +class ExecutionBudget: + __slots__ = ("start", "deadline", "remaining") + + def __init__(self): + self.start = time.perf_counter_ns() + self.deadline = self.start + LIMIT_NS + self.remaining = 4096 + + def iterate(self, rows): + for row in rows: + self.remaining -= 1 + if self.remaining < 0 or time.perf_counter_ns() >= self.deadline: + raise CheckerTimeout("checker_iteration_or_time_limit") + yield row + + +@dataclass(frozen=True, slots=True) +class Checker: + source: str + name: str + _code: object + + @classmethod + def compile(cls, source, name=None): + program = validate(source) + if name is not None: + if not FUNC.fullmatch(name): + raise UnsafeChecker("invalid_checker_name") + program.body[0].name = name + name = program.body[0].name + exported = deepcopy(program) + exported.body[0].args.args[0].annotation = ast.Constant("TrajectoryContext") + exported.body[0].returns = ast.parse("tuple[bool, str]", mode="eval").body + normalized = ast.unparse(exported) + "\n" + program = ast.fix_missing_locations(Instrument().visit(program)) + return cls(normalized, name, compile(program, "", "exec", dont_inherit=True)) + + def timed(self, ctx): + if type(ctx) is not TrajectoryContext: + raise TypeError("trajectory_context_required") + budget = ExecutionBudget() + builtin_scope = BUILTINS | { + "set": lambda rows=(): _bounded(set(_key(row) for row in budget.iterate(rows))), + "tuple": lambda rows=(): _bounded(tuple(budget.iterate(rows))), + } + scope = {"__builtins__": builtin_scope, "_guard_iter": budget.iterate, "_binary": _binary, + "_key": _key, "_bounded": _bounded} + exec(self._code, scope) + result = scope[self.name](ctx) + elapsed = time.perf_counter_ns() - budget.start + if elapsed >= LIMIT_NS: + raise CheckerTimeout("checker_time_limit") + if (type(result) is not tuple or len(result) != 2 or type(result[0]) is not bool + or type(result[1]) is not str or result[0] != (result[1] == "ok")): + raise ValueError("invalid_checker_result") + return result, elapsed + + def run(self, ctx): + return self.timed(ctx)[0] + + +def load_library(directory): + """Load vetted source through the same validator used by the offline gate.""" + return tuple(Checker.compile(path.read_text(encoding="utf-8")) + for path in sorted(Path(directory).glob("check_rule_*.py"))) diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/generation.py b/faisi/W2-02-checker-synthesizer/src/checkers/generation.py new file mode 100644 index 0000000000000000000000000000000000000000..e6965f3adbdf042d34eeac833cf340782d704b71 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/generation.py @@ -0,0 +1,428 @@ +"""Prompt construction and local Qwen candidate synthesis.""" +import argparse +import asyncio +from collections import Counter +import json +from pathlib import Path +import random +from urllib.parse import urlparse + +import httpx + +from checkers.inventory import train_allowlist +from checkers.mine_conflicts import load_training, mine + +CODER = "Qwen2.5-Coder-32B-Instruct" +THEMES = ( + ("multi_service_empty_path", "A multi-service anomaly with a submitted path that collapses within one service."), + ("inspected_root", "The submitted root has neither an inspected metric/event nor an inspected known owner or child."), + ("exact_root_verification", "An instance or service is selected without checking its own metrics despite a stronger inspected alternative."), + ("event_only_root", "An incidental event is used as root evidence despite quiet observed metrics and stronger independent anomalies."), + ("early_competing_anomaly", "An independently inspected cause candidate begins earlier than the submitted root by a meaningful time."), + ("quiet_root_metric_slots", "Direct measurements at the submitted root show no anomaly while an inspected neighbor has abnormal metrics."), + ("isolated_weak_root", "The root is missing from the overview and observed neighborhoods while a coherent inspected alternative exists."), + ("unexplored_outgoing", "Several abnormal outgoing neighbors of the root are visible but uninspected and the path fails to reach them."), + ("inactive_submitted_edges", "A checked edge included in the path has weak or absent traffic or error change despite competing active edges."), + ("lag_or_reversal", "The direction of a submitted chain conflicts with abnormal onset ordering where both timestamps were measured."), + ("co_location", "Host or pod-only diagnosis contradicts co-located measurements or a shared service ownership pattern."), + ("path_edge_coverage", "Nontrivial propagation submitted without inspecting visible cross-service edges or topology around its endpoints."), + ("missing_evidence_ids", "Cited evidence does not include visible evidence IDs, especially if the claimed root is uninspected."), + ("wrong_layer_evidence", "The root is a host or instance but only a different layer was examined and local evidence is weak."), + ("anomalous_service_rank", "Submitted owner has weak or no observed anomaly next to strongly abnormal, inspected distinct owners."), + ("traffic_and_gap", "Direction or root reasoning ignores a measured error-rate rise or queueing gap on the affected call edge."), + ("empty_path_with_root_evidence", "Even a checked root needs evidence of how its service affects other observed abnormal services."), + ("unrepresentative_query", "Many tool turns fail to inspect the root neighborhood or credible high-anomaly alternatives."), + ("owned_instance_comparison", "Instance-level claim misses contrary evidence in other instances or their known service."), + ("few_distinct_inspections", "Repeated queries leave crucial direct evidence missing for a multi-service or high-degree case."), +) +REFINEMENTS = ( + ("multi_service_empty_path", "Flag a missing inter-service path when two or more observed anomalous services " + "include at least two different overview metric groups. Test the tuple returned by inter_service_edges_in_submission."), + ("empty_path_with_root_evidence", "Flag an absent inter-service path in a multi-service anomaly when its " + "service-level submitted root has been directly measured, or if its service-level root has " + "not been directly measured and a separate service in the overview was measured."), + ("owned_instance_comparison", "Flag a multi-service anomaly submitted with an instance root and only " + "same-owner edges, when root topology has not been inspected. Require a nonempty raw path."), + ("unexplored_outgoing", "Flag a multi-service anomaly without an inter-service path when the submitted " + "root has a known topology observation. An observed topology plus several anomalous owners " + "warrants checking external effects. Do not require a particular neighbor ID."), + ("path_edge_coverage", "Flag a multi-service anomaly without a cross-owner path when the root's " + "own topology has never been queried. Presence of a direct root metric cannot replace topology inspection."), + ("multi_service_empty_path", "Flag a missing cross-owner path when the overview shows at least three " + "anomalous services and at least one infrastructure metric group. The helper returns an integer count."), + ("inspected_root", "Check missing verification of the root family: reject if every queried entity has " + "a different owner than the root. Also reject a missing inter-service path when the multi-service " + "case includes a confirmed root metric but the root's topology remains unqueried. These are two " + "distinct evidence prerequisites. Use numeric counts directly."), + ("lag_or_reversal", "Check cause-to-effect ordering. Even after measurement, a multi-service submitted " + "path confined within the root owner does not explain the other anomalies. For a cross-owner " + "path, independently reject an edge when observed onset_diff(cause, affected) is negative. " + "Use a finite comparison after an explicit None guard."), + ("exact_root_verification", "Check whether a multi-service case was investigated beyond the submitted " + "root scope. Reject a missing inter-service path when that root's owner is the only owner in " + "queried_entities. Build owner sets with set(ctx.owner_service(e) for e in ctx.queried_entities)."), + ("quiet_root_metric_slots", "Reject a missing cross-owner path when the multi-service case has " + "metric observations for the submitted root and no more than one distinct inspected owner. " + "Separately reject a truly measured quiet root when a different observed owner has a strongly " + "abnormal direct metric. Guard missing slots and numeric values."), + ("co_location", "Check the instance versus service boundary. When an instance-rooted multi-service " + "submission has no cross-owner edges yet has distinct observable service anomalies in the initial " + "view, flag the unsupported inference that the incident stayed inside that instance's service."), + ("anomalous_service_rank", "When a multi-service overview shows a single metric group across all " + "visible anomalous entities, require a cross-owner effect instead of treating a common signal " + "as confined within one owner. Iterate ctx.overview_anomalies.values() to get metric_group."), + ("unrepresentative_query", "A multi-service case with at least two independently queried owners " + "should explain cross-owner propagation. Reject a submission with no cross-owner edge " + "despite this evidence. Do not assume unqueried metadata."), + ("few_distinct_inspections", "A single directly inspected entity cannot justify a collapsed path " + "in a multi-service anomaly. Reject a missing inter-service path when there is only one " + "successfully queried metric or event entity or no direct query."), + ("path_edge_coverage", "Check an unsupported multi-service isolation claim. Flag it when the " + "submitted path is empty or owner-internal, and the observed root topology has no eligible " + "cross-owner connection established by an edge detail query. Count only observed relationships."), + ("missing_evidence_ids", "Check unverified cross-owner effects when the multi-service " + "submission lacks inter-service edges and its cited evidence is absent from tool history " + "or the root's topology was not queried. IDs are opaque and evidence IDs can only be compared " + "with the observed_evidence_ids set."), + ("early_competing_anomaly", "Reject a confined path despite multiple anomalous services if " + "root and alternative were inspected or its root topology was inspected. Also reject measured " + "propagation to an affected node that started earlier by a nonzero amount. Never compare " + "None with a number."), + ("empty_path_with_root_evidence", "In a multi-service anomaly, require a cross-owner " + "effect when the submitted root has direct abnormal metrics and the initial overview " + "shows anomalies on distinct owners. Use has_direct_anomaly rather than reimplementing it."), + ("traffic_and_gap", "Check lack of cross-service transport validation. Flag a collapsed " + "path with multiple observed anomalous owners when the root has a topology response " + "or at least one call edge detail was queried. Call reachability is different from fault direction."), + ("event_only_root", "Reject a multi-service claim restricted to one owner when the model has " + "measured its proposed root and received no events or no alternative owner's direct metrics. " + "Evidence filtered from empty slots must not be treated as a normal measurement."), +) +SYSTEM = """You write one safe executable consistency check for anonymized SRE diagnosis. Return JSON with two +string fields, description (brief plain English), and code (one Python function). Infer a generally useful +condition from a wrong/under-supported vs right pair. A rule should normally pass when a prerequisite +observation is missing; reject absence of required evidence only when the context itself justifies it. +Do not memorize IDs, labels, systems, numeric case fingerprints or row metadata. Do not use query counts +as a case fingerprint. Detect a genuine inconsistency or missing verification. + +Interface: def check_rule_cand(ctx): returns exactly (True, "ok") or (False, "snake_case_reason"). +No imports, helpers, decorators, mutation, try/except, while, range, recursion, or complex formatting. +Use if, for with simple local assignments (no +=), comprehensions, and abs/all/any/bool/enumerate/len/max/min/ +set/sorted/sum/tuple/zip. Use defensive .get() rather than indexing a possibly unknown key. Only context field, +enum and metric strings below are allowed in conditions. Never compare to a literal anonymous ID or evidence ID. +Each metric slot can be None and its numeric fields can also be None. A missing edge, node, event, or time is +unknown, and absence in a truncated overview does not establish normality. + +Read-only ctx fields: +submitted_root: opaque entity ID; submitted_path: tuple of directed (cause,affected) pairs; +submitted_evidence_ids and observed_evidence_ids; num_turns; queried_entities (successful metrics/events); +queried_topology_entities; queried_edges (attempted caller/callee pairs). +overview_anomalies[id]: layer ("service","instance","host"), in_degree_quantile, out_degree_quantile, +multi_tenant_host, metric_group, robust_z. observed_metrics[id][slot] has median_base, mean_detect, robust_z, +anomaly_count, onset_offset_sec. Slots: latency_p99, latency_avg, error_rate, request_rate, cpu_usage, +mem_usage, io_usage, network_usage, other. +observed_events[id] is a tuple of mappings with event_template, count, first_offset_sec, sample_message, evidence_id. +observed_edges[(caller,callee)] has baseline_call_count, detection_call_count, call_volume_change_rate, +baseline_error_rate, detection_error_rate, error_rate_change, caller_p99_ms, callee_p99_ms, +span_gap_ms, onset_offset_sec. Call direction is caller to callee; fault effect direction can differ. +observed_topology[id] has upstream/downstream/services/instances/hosts/co_located_entities submappings +neighbor ID -> highest observed robust_z or None, hop (1 or 2), and structure metadata. +Only these helpers: ctx.owner_service(id) returns known parent service else the id; +ctx.entity_layer(id); ctx.inter_service_edges_in_submission() drops pairs with shared owners; +ctx.distinct_anomalous_services_in_overview(); ctx.distinct_observed_anomalous_services() including neighbor summaries; +ctx.earliest_anomaly_offset(id) or None; ctx.onset_diff(u, v) is onset(v) minus onset(u), or None; +ctx.co_located_anomaly_ratio(id) or None; ctx.uninspected_anomalous_downstream(id); +ctx.has_direct_anomaly(id, z_thresh=3.0) means a directly queried metric meets that threshold. +A rule cannot see ground truth, filesystem, network, dataset/case ID, or assignment labels. +Aim for fewer than 26 lines and a selective, interpretable trigger. Use explicit return branches.""" + + +def synopsis(ctx): + root = ctx.submitted_root + related = {root, ctx.owner_service(root)} | {entity for edge in ctx.submitted_path for entity in edge} + strongest = sorted(ctx.overview_anomalies, key=lambda entity: -ctx.overview_anomalies[entity]["robust_z"]) + related.update(strongest[:4]) + metrics = {} + for entity, slots in sorted(ctx.observed_metrics.items(), key=lambda kv: (kv[0] not in related, kv[0]))[:6]: + ranked = sorted( + [(name, round(item["robust_z"], 2), item.get("onset_offset_sec"), item.get("anomaly_count")) + for name, item in slots.items() if item and item.get("robust_z") is not None], + key=lambda item: (-abs(item[1]), item[0]), + ) + metrics[entity] = ranked[:4] + neighbors = ctx.observed_topology.get(root, ctx.observed_topology.get(ctx.owner_service(root), {})) + return { + "root": root, "owner": ctx.owner_service(root), "layer": ctx.entity_layer(root), + "path": ctx.submitted_path, "cross_edges": len(ctx.inter_service_edges_in_submission()), + "multi_service_anomalies": ctx.distinct_observed_anomalous_services(), "turns": ctx.num_turns, + "overview": [[e, ctx.overview_anomalies[e]["metric_group"], + round(ctx.overview_anomalies[e]["robust_z"], 2)] for e in strongest], + "queried_entities": sorted(ctx.queried_entities), "queried_topology": sorted(ctx.queried_topology_entities), + "metrics_group_z_onset_count": metrics, + "root_neighbor_z": {k: list(neighbors.get(k, {}).items())[:4] + for k in ("upstream", "downstream", "hosts", "co_located_entities")}, + "edges_error_change_gap_onset": [ + [a, b, edge.get("error_rate_change"), edge.get("span_gap_ms"), edge.get("onset_offset_sec")] + for (a, b), edge in sorted(ctx.observed_edges.items())[:4] + ], + "root_event_count": len(ctx.observed_events.get(root, ())), + "cited_observed_ids": len(set(ctx.submitted_evidence_ids) & ctx.observed_evidence_ids), + "cited_total": len(ctx.submitted_evidence_ids), + } + + +def relevance(theme, ctx): + root = ctx.submitted_root + topology = ctx.observed_topology.get(root, {}) + root_onset = ctx.earliest_anomaly_offset(root) + return { + "multi_service_empty_path": ctx.distinct_observed_anomalous_services() >= 2 and not ctx.inter_service_edges_in_submission(), + "inspected_root": not any(ctx.owner_service(e) == ctx.owner_service(root) for e in ctx.queried_entities), + "exact_root_verification": root not in ctx.observed_metrics and len(ctx.observed_metrics) > 0, + "event_only_root": bool(ctx.observed_events.get(root)) and not ctx.has_direct_anomaly(root), + "early_competing_anomaly": root_onset is not None and any( + (start := ctx.earliest_anomaly_offset(e)) is not None and start < root_onset for e in ctx.observed_metrics), + "quiet_root_metric_slots": root in ctx.observed_metrics and not ctx.has_direct_anomaly(root), + "isolated_weak_root": root not in ctx.overview_anomalies and root not in ctx.queried_entities, + "unexplored_outgoing": bool(ctx.uninspected_anomalous_downstream(root)), + "inactive_submitted_edges": bool(ctx.observed_edges and ctx.submitted_path), + "lag_or_reversal": any((gap := ctx.onset_diff(a, b)) is not None and gap < 0 for a, b in ctx.submitted_path), + "co_location": bool(topology.get("co_located_entities")) or ctx.entity_layer(root) == "host", + "path_edge_coverage": bool(ctx.inter_service_edges_in_submission()) and not ctx.queried_edges, + "missing_evidence_ids": not bool(set(ctx.submitted_evidence_ids) & ctx.observed_evidence_ids), + "wrong_layer_evidence": ctx.entity_layer(root) in {"host", "instance"} and root not in ctx.queried_entities, + "anomalous_service_rank": ctx.owner_service(root) not in ctx.overview_anomalies, + "traffic_and_gap": bool(ctx.observed_edges), + "empty_path_with_root_evidence": root in ctx.observed_metrics and not ctx.inter_service_edges_in_submission() + and ctx.distinct_observed_anomalous_services() >= 2, + "unrepresentative_query": ctx.num_turns >= 7 and root not in ctx.queried_entities, + "owned_instance_comparison": ctx.entity_layer(root) == "instance" and ctx.owner_service(root) != root, + "few_distinct_inspections": len(ctx.queried_entities) <= 2 and ctx.distinct_observed_anomalous_services() >= 2, + }[theme] + + +def pair_examples(mined, theme, index, uncovered=None): + pairs = list(mined.comparisons) + rng = random.Random(42_000 + index) + rng.shuffle(pairs) + if uncovered is not None: + pairs = [p for p in pairs if p.wrong in uncovered] + # Randomized order inside each evidence preference tier and distinct cases. + pairs.sort(key=lambda p: (not relevance(theme, mined.rows[p.wrong].ctx), + relevance(theme, mined.rows[p.right].ctx))) + used, examples = set(), [] + for pair in pairs: + bad, good = mined.rows[pair.wrong], mined.rows[pair.right] + if bad.case in used: + continue + used.add(bad.case) + examples.append({"comparison": pair.kind, "wrong_or_unsupported": synopsis(bad.ctx), + "right": synopsis(good.ctx)}) + if len(examples) == 3: + break + return examples + + +SCHEMA = { + "type": "json_schema", + "json_schema": {"name": "checker_candidate", "strict": True, "schema": { + "type": "object", "additionalProperties": False, "required": ["description", "code"], + "properties": {"description": {"type": "string"}, "code": {"type": "string"}}, + }}, +} + + +async def completion(client, payload, record): + for attempt in range(3): + try: + reply = (await client.post("/v1/chat/completions", json=payload)).raise_for_status().json() + choice = reply["choices"][0] + body = json.loads(choice["message"]["content"]) + return record | {"finish_reason": choice["finish_reason"], "usage": reply.get("usage", {}), + "description": body["description"], "code": body["code"]} + except (httpx.HTTPError, KeyError, ValueError) as error: + if attempt == 2: + return record | {"error": type(error).__name__} + await asyncio.sleep(attempt + 1) + + +async def generate(mined, directory, endpoint, start, count, uncovered=None, avoid=()): + parsed = urlparse(endpoint) + if (parsed.scheme != "http" or parsed.hostname not in {"127.0.0.1", "::1"} + or parsed.username or parsed.password or parsed.query or parsed.fragment or parsed.path): + raise ValueError("local_coder_endpoint_required") + directory.mkdir(mode=0o700, parents=True, exist_ok=True) + semaphore = asyncio.Semaphore(16) + async with httpx.AsyncClient(base_url=endpoint, timeout=180, trust_env=False) as client: + model_list = (await client.get("/v1/models")).raise_for_status().json() + if CODER not in {model["id"] for model in model_list["data"]}: + raise ValueError("unexpected_coder_model") + + async def task(index): + theme, goal = THEMES[index % len(THEMES)] if index < 40 else REFINEMENTS[(index - 40) % len(REFINEMENTS)] + path = directory / f"candidate_{index:03d}.json" + if path.exists(): + return + async with semaphore: + pairs = pair_examples(mined, theme, index, None if index >= 40 else uncovered) + if index >= 40 and uncovered and index % 4 == 2: + pairs[-1:] = pair_examples(mined, theme, index, uncovered)[:1] + prompt = ( + f"Focus on this mechanism. {goal}\n" + "Choose an observed trigger that separates at least one pair and avoids broad overlap with generic " + "missing-evidence rules. Use one or more independent observations where possible.\n" + + ("Implement the precise predicate in the mechanism above. Match the actual API exactly. " + "In earlier attempts we saw two common bugs: using len or iteration on an integer service count " + "and accessing summary keys as ctx attributes. Do neither. Prefix sample content is anonymous " + "and may show cases where the rule abstains.\n" if index >= 40 else "") + + (f"Earlier mechanisms: {', '.join(avoid)}.\n" if avoid else "") + + "Same-case contrast summaries:\n" + json.dumps(pairs, separators=(",", ":")) + ) + payload = { + "model": CODER, "messages": [{"role": "system", "content": SYSTEM}, + {"role": "user", "content": prompt}], + "temperature": 0.35 if index >= 40 else 0.7 if index < 20 else 0.82, "top_p": 0.93, + "max_tokens": 1200, "seed": 42000 + index, "response_format": SCHEMA, + } + record = await completion(client, payload, { + "index": index, "theme": theme, "model": CODER, "seed": payload["seed"], + }) + temporary = path.with_suffix(".tmp") + temporary.write_text(json.dumps(record, ensure_ascii=False) + "\n") + temporary.replace(path) + print(json.dumps({"generated_candidate": index, "theme": theme, + "status": record.get("error", "ok")}), flush=True) + + await asyncio.gather(*(task(index) for index in range(start, start + count))) + + +REPAIR_CONTEXT = """Repair one Python checker for an immutable anonymous diagnosis context. Output JSON keys +description and code. Only one def check_rule_cand(ctx), with no imports, no additional functions, no mutations. +Return True, "ok" by default and False, "specific_snake_case_reason" only on the given condition. + +These calls and attributes have EXACT types: +ctx.distinct_anomalous_services_in_overview() -> int +ctx.distinct_observed_anomalous_services() -> int +ctx.inter_service_edges_in_submission() -> tuple of pairs; use 'not ctx.inter_service_edges_in_submission()' +ctx.submitted_path -> tuple of pairs; ctx.submitted_root -> str +ctx.queried_topology_entities -> set of str; do not use 'ctx.queried_topology' +ctx.queried_entities -> set of str; ctx.queried_edges -> set of pairs +ctx.observed_metrics -> mapping from entity ID to nine metric slots; each slot is a mapping or None +ctx.observed_events -> mapping from entity ID to tuple of events +ctx.overview_anomalies -> mapping from entity ID to a mapping with 'metric_group' and 'robust_z' +ctx.observed_topology -> mapping from entity ID to its typed neighbor mappings +ctx.observed_edges -> mapping from caller/callee pairs to observed edge details +ctx.has_direct_anomaly(entity) -> bool +ctx.entity_layer(entity) -> 'service', 'instance', or 'host' +ctx.owner_service(entity) -> str; ctx.onset_diff(src,dst) -> float or None +ctx.earliest_anomaly_offset(entity) -> float or None +ctx.observed_evidence_ids -> set; ctx.submitted_evidence_ids -> tuple +Use straightforward if conditions, variables, safe comprehensions and for loops. +Use len only on containers, never on a count already returned by a method; +e.g. 'ctx.distinct_observed_anomalous_services() >= 2' is correct. +Use '{a["metric_group"] for a in ctx.overview_anomalies.values()}' for the observed groups. +Infrastructure slots: 'cpu_usage', 'mem_usage', 'io_usage', 'network_usage'. These are exact strings. +Use comparisons only after explicit None guards. Do not call set.add or reference example-summary keys. +The designated condition below is authoritative, and must retain the original mechanism.""" + + +FOLLOWUP_REPAIRS = { + 46: ( + "Flag an uninspected diagnosis family when no successful metric/event query shares the root owner. " + "Separately flag a multi-service anomaly with a measured root but a missing cross-owner path and no " + "root topology query.", + """Use two independent rejection branches. Exact first condition: +not any(ctx.owner_service(e) == ctx.owner_service(root) for e in ctx.queried_entities) +Exact second condition: +ctx.distinct_observed_anomalous_services() >= 2 and root in ctx.observed_metrics and root not in ctx.queried_topology_entities and not ctx.inter_service_edges_in_submission() +Use root = ctx.submitted_root, and use the conditions as written. Return True, "ok" otherwise.""", + ), + 56: ( + "Flag an omitted inter-service path when both the proposed cause and an independent anomalous owner " + "were inspected. Also flag a measured time reversal on any cross-owner submitted edge.", + """Use two rejection branches. Cross-owner time reversal: iterate over +ctx.inter_service_edges_in_submission() and check a non-None onset_diff(src,dst) < 0. +For the missing-path branch, require not ctx.inter_service_edges_in_submission(), +ctx.distinct_observed_anomalous_services() >= 2, and root in ctx.observed_metrics. +Then reject when root is in ctx.queried_topology_entities or a queried entity e has +ctx.owner_service(e) != ctx.owner_service(root) and ctx.has_direct_anomaly(e). +Successful inspections themselves never cause a rejection when a supported path exists.""", + ), + 59: ( + "Flag a multi-service isolation claim made after measuring the root with no new independent " + "direct evidence from a different service and no observed root events.", + """First require ctx.distinct_observed_anomalous_services() >= 2. +Then reject only when all of these are true: root in ctx.observed_metrics, +not ctx.inter_service_edges_in_submission(), and either +not ctx.observed_events.get(root) or no entity in ctx.observed_metrics has an owner different from the root's owner. +Use no synthetic IDs or range.""", + ), +} + + +async def repair(directory, review, endpoint, round_number=1): + parsed = urlparse(endpoint) + if (parsed.scheme != "http" or parsed.hostname not in {"127.0.0.1", "::1"} + or parsed.username or parsed.password or parsed.query or parsed.fragment or parsed.path): + raise ValueError("local_coder_endpoint_required") + rejected = [entry for entry in review["candidate_results"] + if entry["index"] >= 40 and "rejected" in entry and entry["index"] < 60 + and (round_number == 1 or entry["index"] in FOLLOWUP_REPAIRS)] + archive = directory / "drafts" + archive.mkdir(mode=0o700, exist_ok=True) + async with httpx.AsyncClient(base_url=endpoint, timeout=150, trust_env=False) as client: + async def task(error): + index = error["index"] + path = directory / f"candidate_{index:03d}.json" + previous = json.loads(path.read_text()) + if previous.get("revision", 0) != round_number - 1 or "code" not in previous: + return + theme, intent = REFINEMENTS[index - 40] + if index == 47: + intent = ("Flag cross-owner edges with a measured negative onset difference. " + "Also flag when many services are anomalous, the root onset has been measured and " + "the submitted path still contains no inter-service edges.") + prompt = (f"Intended condition: {intent}\n" + f"Previous draft failed: {error['rejected']}, {error.get('error_types', {})}\n" + "Repair this draft to implement the exact condition. Drop any invented fields.\n" + previous["code"]) + if round_number == 2: + intent, specifics = FOLLOWUP_REPAIRS[index] + prompt = f"Intended condition: {intent}\n{specifics}\nWrite the matching function." + payload = { + "model": CODER, "messages": [{"role": "system", "content": REPAIR_CONTEXT}, + {"role": "user", "content": prompt}], + "temperature": 0.05, "top_p": 0.9, "seed": 42000 + round_number * 1000 + index, + "max_tokens": 1000, "response_format": SCHEMA, + } + record = await completion(client, payload, { + "index": index, "theme": theme, "model": CODER, "seed": payload["seed"], + "revision": round_number, "previous_rejection": error["rejected"], + }) + archived = archive / f"{path.stem}.draft{round_number - 1}.json" + archived.write_text(json.dumps(previous, ensure_ascii=False) + "\n") + temporary = path.with_suffix(".tmp") + temporary.write_text(json.dumps(record, ensure_ascii=False) + "\n") + temporary.replace(path) + print(json.dumps({"revised_candidate": index, "status": record.get("error", "ok")}), flush=True) + + await asyncio.gather(*(task(entry) for entry in rejected)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--allowlist", type=Path) + parser.add_argument("--training", type=Path) + parser.add_argument("--candidates", type=Path, required=True) + parser.add_argument("--endpoint", default="http://127.0.0.1:19202") + parser.add_argument("--start", type=int, default=0) + parser.add_argument("--count", type=int, default=40) + parser.add_argument("--repair-review", type=Path) + parser.add_argument("--repair-round", type=int, choices=(1, 2), default=1) + args = parser.parse_args() + if args.repair_review is not None: + asyncio.run(repair(args.candidates, json.loads(args.repair_review.read_text()), args.endpoint, args.repair_round)) + else: + if args.allowlist is None or args.training is None: + parser.error("--allowlist and --training are required for initial synthesis") + result = mine(load_training(args.training, train_allowlist(args.allowlist))) + asyncio.run(generate(result, args.candidates, args.endpoint, args.start, args.count)) diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/inventory.py b/faisi/W2-02-checker-synthesizer/src/checkers/inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..957fe8c437e0fd301126c035bb308535c12727ff --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/inventory.py @@ -0,0 +1,27 @@ +"""Pinned W2-01 training inventory shared by the producer and consumer.""" +import hashlib +import json +from pathlib import Path +import re + +ALLOWLIST_SHA256 = "34709abed3cf336ab21ee9c2bf7c24e08b037ca0936d16ebd74985199eb278b4" +W200_WORKLIST_SHA256 = "c98895206e34e79cc9e30752705b4febab0859d96d576725b8658f7e2d8c84df" +DATASETS = ("openrca_v1", "propagation_bench", "openrca_v2") +MODELS = ("Qwen2.5-7B-Instruct", "Qwen2.5-14B-Instruct") +CASE = re.compile(r"case-[0-9a-f]{24}") +SAMPLES = 8 + + +def train_allowlist(path): + raw = Path(path).read_bytes() + if hashlib.sha256(raw).hexdigest() != ALLOWLIST_SHA256: + raise ValueError("unpinned_w201_allowlist") + prefix = '{"train":' + text = raw.decode() + if not text.startswith(prefix): + raise ValueError("unrecognized_allowlist_layout") + rows, _ = json.JSONDecoder().raw_decode(text, len(prefix)) + cases = {(dataset, case) for dataset, case in rows if dataset in DATASETS and CASE.fullmatch(case)} + if len(cases) != len(rows) or len(cases) != 621: + raise ValueError("training_allowlist_inventory") + return frozenset(cases) diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/mine_conflicts.py b/faisi/W2-02-checker-synthesizer/src/checkers/mine_conflicts.py new file mode 100644 index 0000000000000000000000000000000000000000..699357a6780461e97a1c4be0136f9a854c9ce795 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/mine_conflicts.py @@ -0,0 +1,124 @@ +"""Build contrast pairs using only the allowlisted traces and canonical root-hit bits.""" +import argparse +from collections import defaultdict +from dataclasses import dataclass +import json +from pathlib import Path + +from checkers.context_api import TrajectoryContext +from checkers.inventory import MODELS, SAMPLES, train_allowlist + + +@dataclass(frozen=True, slots=True) +class Observation: + case: tuple[str, str] + model: str + sample_idx: int + hit: bool + ctx: TrajectoryContext + + +@dataclass(frozen=True, slots=True) +class Contrast: + wrong: int + right: int + kind: str + + +@dataclass(frozen=True, slots=True) +class MiningResult: + rows: tuple[Observation, ...] + anchors: frozenset[int] + comparisons: tuple[Contrast, ...] + + @property + def negatives(self): + return frozenset(pair.wrong for pair in self.comparisons) + + def summary(self): + return { + "train_cases": len({row.case for row in self.rows}), + "trajectories": len(self.rows), + "anchor_pos": len(self.anchors), + "conflict_fp_pairs": sum(pair.kind == "fp" for pair in self.comparisons), + "conflict_div_pairs": sum(pair.kind == "div" for pair in self.comparisons), + "conflict_negative_union": len(self.negatives), + "anchors_also_in_negative_union": len(self.anchors & self.negatives), + } + + +def load_training(path, allowlist): + rows, seen = [], set() + with Path(path).open(encoding="utf-8") as stream: + for line in stream: + if not line.endswith("\n"): + raise ValueError("truncated_training_trajectory") + row = json.loads(line) + case = row["dataset"], row["case_id"] + model, index, hit = row["model"], row["sample_idx"], row["canonical_root_hit"] + key = case, model, index + if (case not in allowlist or model not in MODELS or type(index) is not int + or not 0 <= index < SAMPLES or type(hit) is not bool or key in seen): + raise ValueError("unauthorized_or_invalid_training_trajectory") + context = TrajectoryContext.from_trace(row) + if context.submitted_root is None: + raise ValueError("missing_validated_submission") + seen.add(key) + rows.append(Observation(case, model, index, hit, context)) + if len(seen) != len(allowlist) * len(MODELS) * SAMPLES: + raise ValueError("incomplete_authorized_training_trajectories") + return tuple(sorted(rows, key=lambda row: (row.case, row.model, row.sample_idx))) + + +def mine(rows): + by_case = defaultdict(list) + anchors = set() + coverage = {} + for index, row in enumerate(rows): + by_case[row.case].append(index) + ctx = row.ctx + svc = ctx.owner_service(ctx.submitted_root) + direct = any(ctx.owner_service(entity) == svc for entity in ctx.queried_entities) + multi = ctx.distinct_observed_anomalous_services() >= 2 + cross = ctx.inter_service_edges_in_submission() + if row.hit and direct and (not multi or cross): + anchors.add(index) + coverage[index] = ( + ctx.submitted_root in ctx.observed_metrics, multi, cross, + len(ctx.queried_entities) + len(ctx.queried_edges) + len(ctx.queried_topology_entities), + len(set(ctx.submitted_evidence_ids) & ctx.observed_evidence_ids), + ) + comparisons = [] + for group in by_case.values(): + correct = [index for index in group if rows[index].hit] + if not correct: + continue + good = [index for index in correct if index in anchors] + thorough = [index for index in good if coverage[index][0]] + for index in group: + direct_metrics, multi, cross, _, _ = coverage[index] + kind, matches = None, [] + if not rows[index].hit: + kind, matches = "fp", good or correct + elif not direct_metrics or (multi and not cross): + kind, matches = "div", [ + other for other in thorough if other != index and (not multi or coverage[other][2]) + ] + if matches: + right = max(matches, key=lambda other: ( + rows[other].model == rows[index].model, bool(coverage[other][2]), + coverage[other][0], coverage[other][3], coverage[other][4], -other, + )) + comparisons.append(Contrast(index, right, kind)) + if not anchors or not comparisons: + raise ValueError("empty_gate_denominator") + return MiningResult(rows, frozenset(anchors), tuple(comparisons)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--allowlist", type=Path, required=True) + parser.add_argument("--training", type=Path, required=True) + args = parser.parse_args() + result = mine(load_training(args.training, train_allowlist(args.allowlist))) + print(json.dumps(result.summary(), indent=2)) diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/normalize_draft.py b/faisi/W2-02-checker-synthesizer/src/checkers/normalize_draft.py new file mode 100644 index 0000000000000000000000000000000000000000..f9eed008b920e7a80306e5fdc887c0f239700141 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/normalize_draft.py @@ -0,0 +1,71 @@ +"""Restricted schema normalization for model drafts before sandbox validation.""" +import ast + +COUNT_METHODS = { + "distinct_anomalous_services_in_overview", "distinct_observed_anomalous_services", +} +INFRA_GROUPS = ("cpu_usage", "mem_usage", "io_usage", "network_usage") +MULTI_SERVICE_THEMES = { + "multi_service_empty_path", "empty_path_with_root_evidence", "owned_instance_comparison", + "unexplored_outgoing", "path_edge_coverage", "anomalous_service_rank", "unrepresentative_query", + "few_distinct_inspections", +} +REFINED_MULTI_SERVICE_THEMES = { + "exact_root_verification", "co_location", "missing_evidence_ids", "traffic_and_gap", "event_only_root", +} + + +def is_context_member(node): + return isinstance(node.value, ast.Name) and node.value.id == "ctx" + + +class Normalize(ast.NodeTransformer): + def visit_Attribute(self, node): + self.generic_visit(node) + if node.attr == "queried_topology" and is_context_member(node): + node.attr = "queried_topology_entities" + return node + + def visit_Call(self, node): + self.generic_visit(node) + if (isinstance(node.func, ast.Name) and node.func.id == "len" + and len(node.args) == 1 and not node.keywords): + inner = node.args[0] + if (isinstance(inner, ast.Call) and isinstance(inner.func, ast.Attribute) + and is_context_member(inner.func) and inner.func.attr in COUNT_METHODS + and not inner.args and not inner.keywords): + return inner + return node + + def visit_Compare(self, node): + self.generic_visit(node) + if (isinstance(node.left, ast.Constant) and node.left.value == "infrastructure" + and len(node.ops) == 1 and isinstance(node.ops[0], (ast.In, ast.NotIn)) + and isinstance(node.comparators[0], ast.SetComp)): + intersect = ast.BinOp(ast.Set([ast.Constant(group) for group in INFRA_GROUPS]), + ast.BitAnd(), node.comparators[0]) + present = ast.Call(ast.Name("bool", ast.Load()), [intersect], []) + return ast.UnaryOp(ast.Not(), present) if isinstance(node.ops[0], ast.NotIn) else present + return node + + +def normalize(candidate): + source = candidate["code"] + if len(source.encode()) > 10_000: + return source, False + try: + module = ast.parse(source) + except (SyntaxError, ValueError, RecursionError): + return source, False + if len(module.body) != 1 or not isinstance(module.body[0], ast.FunctionDef): + return source, False + original = ast.dump(module) + module = Normalize().visit(module) + scoped = candidate["theme"] in MULTI_SERVICE_THEMES or ( + candidate["index"] >= 40 and candidate["theme"] in REFINED_MULTI_SERVICE_THEMES + ) + if scoped: + guard = ast.parse('if ctx.distinct_observed_anomalous_services() < 2:\n return True, "ok"').body[0] + insert = int(ast.get_docstring(module.body[0]) is not None) + module.body[0].body.insert(insert, guard) + return ast.unparse(ast.fix_missing_locations(module)), ast.dump(module) != original diff --git a/faisi/W2-02-checker-synthesizer/src/checkers/prepare_training.py b/faisi/W2-02-checker-synthesizer/src/checkers/prepare_training.py new file mode 100644 index 0000000000000000000000000000000000000000..285590ef9bd1d70b7daccf56d1f04d1fd8351712 --- /dev/null +++ b/faisi/W2-02-checker-synthesizer/src/checkers/prepare_training.py @@ -0,0 +1,169 @@ +"""Trusted projection of root-only source metadata onto the pinned W2-00 train trajectories. + +The input vault and causal-graph files are never opened. This offline adapter is +separate from the miner, model prompt builder and checker execution. +""" +import argparse +from collections import Counter +import csv +import hashlib +import json +import mmap +from pathlib import Path +import re + +from data_engine.adapters import case_id, roots_in +from eval_only.entity_projection import service_key +from runner.protocol import load_plan +from sandbox.id_mapper import IdMapper +from sandbox.snapshot import calculate_graph + +from checkers.inventory import DATASETS, MODELS, SAMPLES, W200_WORKLIST_SHA256, train_allowlist + +HEADER = re.compile( + rb'\{"schema_version":2,"model":"([^"]+)","mode":"([^"]+)","dataset":"([^"]+)",' + rb'"case_id":"(case-[0-9a-f]{24})","sample_idx":([0-7]),"session_seed":(100[0-7]),' +) +MANIFEST_NAME = re.compile(rb'"name"\s*:\s*("(?:[^"\\]|\\.)*")') +MANIFEST_ROOT = re.compile(r'"root_services"\s*:\s*') + + +def authorized_roots(raw, allowlist): + v1, propagation, v2 = DATASETS + answers = {} + for system in ("Bank", "Telecom"): + with (raw / v1 / system / "record.csv").open("rb") as stream: + header = next(csv.reader([stream.readline().decode("utf-8-sig")])) + for index, line in enumerate(stream): + key = v1, case_id(v1, f"{system}/{index}") + if key in allowlist: + row = next(csv.reader([line.decode("utf-8")])) + answers[key] = [row[header.index("component")]] + base = raw / propagation / "datapacks" + for directory in base.iterdir(): + key = propagation, case_id(propagation, directory.name) + if key not in allowlist: + continue + if (directory / "causal_graph.json").exists(): + raise ValueError("unexpected_propagation_root_precedence") + injection = json.loads((directory / "injection.json").read_bytes()) + answers[key] = roots_in(injection.get("ground_truth", injection.get("groundtruth"))) + base = raw / v2 / "cases" + approved = {} + for directory in base.rglob("injection.json"): + relative = directory.parent.relative_to(base) + key = v2, case_id(v2, relative.as_posix()) + if key in allowlist: + if directory.parent.name in approved: + raise ValueError("ambiguous_manifest_name") + approved[directory.parent.name] = key + with (raw / v2 / "manifest.jsonl").open("rb") as stream: + for line in stream: + name = MANIFEST_NAME.search(line) + if not name or (key := approved.get(json.loads(name[1]))) is None: + continue + record = line.decode() + field = MANIFEST_ROOT.search(record) + if not field or key in answers: + raise ValueError("invalid_manifest_root") + answers[key] = roots_in(json.JSONDecoder().raw_decode(record, field.end())[0]) + if answers.keys() != allowlist or any(not values or not all(values) for values in answers.values()): + raise ValueError("root_metadata_inventory_mismatch") + return answers + + +def trajectory_rows(path, train_offset, model, all_train_cases, allowlist, worklist_hash): + seen = set() + with path.open("rb") as stream, mmap.mmap(stream.fileno(), 0, access=mmap.ACCESS_READ) as data: + cursor = train_offset + if not 0 < cursor < len(data): + raise ValueError("invalid_train_offset") + while cursor < len(data): + end = data.find(b"\n", cursor) + if end < 0: + raise ValueError("partial_training_row") + header = HEADER.match(data, cursor, min(end, cursor + 350)) + if header is None: + raise ValueError("malformed_training_header") + model_name, mode, dataset, case, index, seed = (field.decode() for field in header.groups()) + key = dataset, case, int(index) + if (model_name != model or mode != "train" or key[:2] not in all_train_cases + or int(seed) != 1000 + key[2] or key in seen): + raise ValueError("invalid_training_header") + seen.add(key) + if key[:2] in allowlist: + row = json.loads(data[cursor:end]) + if row["worklist_sha256"] != worklist_hash or row["termination"] != "accepted": + raise ValueError("invalid_w200_training_trace") + yield row + cursor = end + 1 + if seen != {(dataset, case, n) for dataset, case in all_train_cases for n in range(SAMPLES)}: + raise ValueError("incomplete_w200_training_segment") + + +def prepare(args): + allowlist = train_allowlist(args.allowlist) + plan, worklist_hash = load_plan(args.worklist) + if worklist_hash != W200_WORKLIST_SHA256: + raise ValueError("unpinned_w200_worklist") + all_train_cases = {(dataset, case) for dataset, splits in plan.items() for case in splits["train"]} + if not allowlist <= all_train_cases: + raise ValueError("allowlist_contains_nontraining_cases") + answers = authorized_roots(args.raw_root, allowlist) + graphs, layers, targets = {}, {}, {} + for dataset, case in sorted(allowlist): + key = dataset, case + graph = json.loads((args.snapshots / dataset / case / "topology.json").read_bytes()) + graphs[key] = calculate_graph(graph)[0] + layers[key] = {name: entity.layer for name, entity in graphs[key].items()} + targets[key] = {target for root in answers[key] if (target := service_key(root, graphs[key])) is not None} + + args.output.mkdir(parents=True, exist_ok=True, mode=0o700) + counts, hits, offsets = Counter(), Counter(), {} + temporary = args.output / "training.jsonl.tmp" + with temporary.open("w", encoding="utf-8") as stream: + for model in MODELS: + name = f"{model}.jsonl" + # The saved greedy-only copy is used solely as an offset via stat. + offsets[model] = (args.greedy_prefixes / name).stat().st_size + for row in trajectory_rows(args.trajectories / name, offsets[model], model, all_train_cases, + allowlist, worklist_hash): + key = row["dataset"], row["case_id"] + mapper = IdMapper(layers[key], row["session_seed"], "/".join(key)) + decoded = mapper._resolve(row["submission"]["root_entity_id"]) + if decoded is None: + raise ValueError("unreplayable_anonymous_root") + hit = service_key(decoded, graphs[key]) in targets[key] + view = {name: row[name] for name in ( + "dataset", "case_id", "model", "sample_idx", "initial_observation", "turns", + "num_turns", "submission", + )} + view["canonical_root_hit"] = hit + stream.write(json.dumps(view, ensure_ascii=False, separators=(",", ":"), allow_nan=False) + "\n") + counts[model] += 1 + hits[model] += hit + if any(counts[model] != len(allowlist) * SAMPLES for model in MODELS): + raise ValueError("filtered_trajectory_coverage") + temporary.replace(args.output / "training.jsonl") + audit = { + "allowlisted_train_cases": len(allowlist), + "w200_train_byte_offsets": offsets, + "trajectory_counts_by_model": dict(counts), "root_hit_counts_by_model": dict(hits), + "cases_without_observable_canonical_root": sum(not value for value in targets.values()), + "test_payloads_read": 0, "out_of_scope_trajectory_payloads_decoded": 0, + "ground_truth_vault_files_opened": 0, "causal_path_files_opened": 0, + "scoring_inputs": { + "openrca_v1": "Bank and Telecom official component columns", + "propagation_bench": "authorized injection JSON root metadata", + "openrca_v2": "authorized manifest root_services fields", + }, + } + (args.output / "input_audit.json").write_text(json.dumps(audit, indent=2) + "\n") + print(json.dumps(audit), flush=True) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + for option in ("allowlist", "worklist", "trajectories", "greedy_prefixes", "raw_root", "snapshots", "output"): + parser.add_argument("--" + option.replace("_", "-"), type=Path, required=True) + prepare(parser.parse_args())