Abid Ali Awan Codex commited on
Commit
60c7e53
·
1 Parent(s): 773ad7d

Drop safe step count from traces

Browse files

Co-Authored-By: Codex <codex@openai.com>

tests/test_tracing.py CHANGED
@@ -92,6 +92,7 @@ class TraceTests(unittest.TestCase):
92
  "raw_model_output_stored",
93
  "red_flag_count",
94
  "reply_draft_returned",
 
95
  "signal_account_threat",
96
  "signal_challan",
97
  "signal_cnic",
 
92
  "raw_model_output_stored",
93
  "red_flag_count",
94
  "reply_draft_returned",
95
+ "safe_next_step_count",
96
  "signal_account_threat",
97
  "signal_challan",
98
  "signal_cnic",
traces/data/trace_samples.jsonl CHANGED
@@ -1,6 +1,6 @@
1
- {"trace_id": "44123b4e-1e27-42db-a25e-c152d40db44f", "timestamp": "2026-06-07T06:57:14.262543+00:00", "input": "text: PAKISTAN POST: [NAME_OR_ENTITY] parcel [ADDRESS]. [NAME_OR_ENTITY] Rs. 85 today at [LINK] or the parcel will be destroyed.", "input_category": "courier", "urgency": true, "scam_tactics": "link, urgency, payment, courier", "result_summary": "Likely scam: Courier-style content with link, urgency, payment, courier signals. Known courier pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 4, "reply_draft_policy": "suppressed"}
2
- {"trace_id": "166594ae-e201-49cb-bbff-07482bcdd779", "timestamp": "2026-06-07T06:57:14.262745+00:00", "input": "text: FBR REFUND: [NAME_OR_ENTITY] are eligible for Rs 42,[NUMBER]. [NAME_OR_ENTITY] your CNIC and bank card [REDACTED] at the link today to receive payment.", "input_category": "fbr", "urgency": true, "scam_tactics": "cnic, credentials, urgency, payment, refund_or_prize", "result_summary": "Likely scam: FBR-style content with CNIC, credential, urgency, payment signals. Known FBR pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 4, "reply_draft_policy": "suppressed"}
3
- {"trace_id": "a8c5849b-19af-4ecd-9e31-482f594055ac", "timestamp": "2026-06-07T06:57:14.262936+00:00", "input": "text: HBL [NAME_OR_ENTITY]: [NAME_OR_ENTITY] account [REDACTED] be suspended. [NAME_OR_ENTITY] the OTP [REDACTED] to your phone with our support team immediately.", "input_category": "bank", "urgency": true, "scam_tactics": "otp, urgency, account_threat", "result_summary": "Likely scam: Bank-style content with OTP, urgency, account-threat signals. Known bank pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 5, "reply_draft_policy": "suppressed"}
4
- {"trace_id": "1f832008-9ab6-497a-9a15-1beaa0bf6410", "timestamp": "2026-06-07T06:57:14.263070+00:00", "input": "image: Courier-style content with link, urgency, courier signals", "input_category": "courier", "urgency": true, "scam_tactics": "link, urgency, courier", "result_summary": "Likely scam: Courier-style content with link, urgency, courier signals. Known courier pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 4, "reply_draft_policy": "suppressed"}
5
- {"trace_id": "4478636b-37d7-4646-b58c-7f8cb4d0be90", "timestamp": "2026-06-07T06:57:14.263462+00:00", "input": "image: Marketplace-style content with credential signals", "input_category": "marketplace", "urgency": false, "scam_tactics": "credentials", "result_summary": "Likely scam: Marketplace-style content with credential signals. Known marketplace pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 4, "reply_draft_policy": "suppressed"}
6
- {"trace_id": "c439562d-cafd-4c07-a44e-03002728d7ba", "timestamp": "2026-06-07T06:57:14.263640+00:00", "input": "image: Traffic-challan-style content with link, urgency, payment, challan signals", "input_category": "traffic_challan", "urgency": true, "scam_tactics": "link, urgency, payment, challan", "result_summary": "Likely scam: Traffic-challan-style content with link, urgency, payment, challan signals. Known traffic-challan pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "safe_next_step_count": 4, "reply_draft_policy": "suppressed"}
 
1
+ {"trace_id": "6d85b5a6-f66e-4aa9-8478-37fa10145e92", "timestamp": "2026-06-07T07:01:20.917037+00:00", "input": "text: PAKISTAN POST: [NAME_OR_ENTITY] parcel [ADDRESS]. [NAME_OR_ENTITY] Rs. 85 today at [LINK] or the parcel will be destroyed.", "input_category": "courier", "urgency": true, "scam_tactics": "link, urgency, payment, courier", "result_summary": "Likely scam: Courier-style content with link, urgency, payment, courier signals. Known courier pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
2
+ {"trace_id": "23bbdea8-824b-4b01-a797-de52813c94a3", "timestamp": "2026-06-07T07:01:20.917210+00:00", "input": "text: FBR REFUND: [NAME_OR_ENTITY] are eligible for Rs 42,[NUMBER]. [NAME_OR_ENTITY] your CNIC and bank card [REDACTED] at the link today to receive payment.", "input_category": "fbr", "urgency": true, "scam_tactics": "cnic, credentials, urgency, payment, refund_or_prize", "result_summary": "Likely scam: FBR-style content with CNIC, credential, urgency, payment signals. Known FBR pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
3
+ {"trace_id": "17558327-848a-4746-a847-1a05b0b6d143", "timestamp": "2026-06-07T07:01:20.917356+00:00", "input": "text: HBL [NAME_OR_ENTITY]: [NAME_OR_ENTITY] account [REDACTED] be suspended. [NAME_OR_ENTITY] the OTP [REDACTED] to your phone with our support team immediately.", "input_category": "bank", "urgency": true, "scam_tactics": "otp, urgency, account_threat", "result_summary": "Likely scam: Bank-style content with OTP, urgency, account-threat signals. Known bank pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
4
+ {"trace_id": "ce27c0cb-878a-44e7-bcc5-b8c3f39620e0", "timestamp": "2026-06-07T07:01:20.917462+00:00", "input": "image: Courier-style content with link, urgency, courier signals", "input_category": "courier", "urgency": true, "scam_tactics": "link, urgency, courier", "result_summary": "Likely scam: Courier-style content with link, urgency, courier signals. Known courier pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
5
+ {"trace_id": "afc06c6e-a510-42e5-8a69-d8c0734a82cd", "timestamp": "2026-06-07T07:01:20.917817+00:00", "input": "image: Marketplace-style content with credential signals", "input_category": "marketplace", "urgency": false, "scam_tactics": "credentials", "result_summary": "Likely scam: Marketplace-style content with credential signals. Known marketplace pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
6
+ {"trace_id": "95dacd6e-3947-40d2-ae1f-6e5bc709081c", "timestamp": "2026-06-07T07:01:20.917983+00:00", "input": "image: Traffic-challan-style content with link, urgency, payment, challan signals", "input_category": "traffic_challan", "urgency": true, "scam_tactics": "link, urgency, payment, challan", "result_summary": "Likely scam: Traffic-challan-style content with link, urgency, payment, challan signals. Known traffic-challan pattern. Strong scam indicators were found; avoid payments, links, and sharing credentials.", "risk_label": "Likely scam", "reply_draft_policy": "suppressed"}
traces/dataset_card.md CHANGED
@@ -41,8 +41,7 @@ and convert it into allow-listed categories, booleans, buckets, and counts.
41
  - `result_summary`: deterministic summary of the mapped pattern, whether it is
42
  known or unclassified, and why the risk label matters
43
  - `scam_tactics`: readable comma-separated tactics
44
- - Flat result columns such as `risk_label`, `safe_next_step_count`, and
45
- `reply_draft_policy`
46
 
47
  Every dataset cell is a scalar string, number, or boolean. No column contains a
48
  dictionary or nested object, which keeps the Hugging Face table easy to read.
 
41
  - `result_summary`: deterministic summary of the mapped pattern, whether it is
42
  known or unclassified, and why the risk label matters
43
  - `scam_tactics`: readable comma-separated tactics
44
+ - Flat result columns such as `risk_label` and `reply_draft_policy`
 
45
 
46
  Every dataset cell is a scalar string, number, or boolean. No column contains a
47
  dictionary or nested object, which keeps the Hugging Face table easy to read.
traces/runtime.py CHANGED
@@ -254,10 +254,6 @@ def build_trace_record(
254
  **input_profile,
255
  "result_summary": result_summary(risk_label, category, signals),
256
  "risk_label": risk_label,
257
- "safe_next_step_count": min(
258
- len(assessment.get("safe_next_steps", [])),
259
- 50,
260
- ),
261
  "reply_draft_policy": (
262
  "allowed"
263
  if risk_label in {"Verify first", "Suspicious"}
@@ -281,7 +277,6 @@ def validate_trace(record: Any) -> list[str]:
281
  "scam_tactics",
282
  "result_summary",
283
  "risk_label",
284
- "safe_next_step_count",
285
  "reply_draft_policy",
286
  }
287
  missing = required - record.keys()
@@ -328,6 +323,7 @@ def validate_trace(record: Any) -> list[str]:
328
  "raw_model_output_stored",
329
  "red_flag_count",
330
  "reply_draft_returned",
 
331
  "signal_account_threat",
332
  "signal_challan",
333
  "signal_cnic",
 
254
  **input_profile,
255
  "result_summary": result_summary(risk_label, category, signals),
256
  "risk_label": risk_label,
 
 
 
 
257
  "reply_draft_policy": (
258
  "allowed"
259
  if risk_label in {"Verify first", "Suspicious"}
 
277
  "scam_tactics",
278
  "result_summary",
279
  "risk_label",
 
280
  "reply_draft_policy",
281
  }
282
  missing = required - record.keys()
 
323
  "raw_model_output_stored",
324
  "red_flag_count",
325
  "reply_draft_returned",
326
+ "safe_next_step_count",
327
  "signal_account_threat",
328
  "signal_challan",
329
  "signal_cnic",