Skip to content

A desktop coding agent with free access to frontier models.

TypeScript
81.6 KB
Raw Blame
[
 {
  "name": "opencode edit of a .ts file keeps code in oldString/newString",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/a.ts",
            "oldString": "export function f(){}",
            "newString": "export async function f(token:string){await fetch(u)}"
           },
           "output": "Edit applied successfully.",
           "metadata": {
            "diff": "Index: /work/proj/src/a.ts\n===================================================================\n--- /work/proj/src/a.ts\n+++ /work/proj/src/a.ts\n@@ -1,1 +1,1 @@\n-export function f(){}\n+export async function f(token:string){await fetch(u)}\n",
            "filediff": {
             "file": "/work/proj/src/a.ts",
             "before": "export function f(){}\n",
             "after": "export async function f(token:string){await fetch(u)}\n",
             "additions": 1,
             "deletions": 1
            }
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/a.ts",
            "oldString": "export function f(){}",
            "newString": "export async function f(token:string){await fetch(u)}"
           },
           "output": "Edit applied successfully.",
           "metadata": {
            "diff": "Index: /work/proj/src/a.ts\n===================================================================\n--- /work/proj/src/a.ts\n+++ /work/proj/src/a.ts\n@@ -1,1 +1,1 @@\n-export function f(){}\n+export async function f(token:string){await fetch(u)}\n",
            "filediff": {
             "file": "/work/proj/src/a.ts",
             "before": "export function f(){}\n",
             "after": "export async function f(token:string){await fetch(u)}\n",
             "additions": 1,
             "deletions": 1
            }
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "opencode write of a .ts file keeps code with a real newline",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/b.ts",
            "content": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/b.ts",
            "content": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "pi edit with edits sent as a JSON string: escapes are never eaten",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/c.ts",
            "edits": "[{\"oldText\": \"a\", \"newText\": \"async(token:string)=>{}\\nfunction a(token:string){await b}\"}]"
           },
           "output": "ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/c.ts",
            "edits": "[{\"oldText\": \"a\", \"newText\": \"async(token:string)=>{}\\nfunction a(token:string){await b}\"}]"
           },
           "output": "ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "pi edit with an edits array and a details diff",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/c.ts",
            "edits": [
             {
              "oldText": "x",
              "newText": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
             }
            ]
           },
           "output": "ok",
           "metadata": {
            "diff": "-1 x\n+1 const g = async(token:string)=>{}\n+2 function a(token:string){await b}",
            "firstChangedLine": 1
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/c.ts",
            "edits": [
             {
              "oldText": "x",
              "newText": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
             }
            ]
           },
           "output": "ok",
           "metadata": {
            "diff": "-1 x\n+1 const g = async(token:string)=>{}\n+2 function a(token:string){await b}",
            "firstChangedLine": 1
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "the same code in a bash command keeps CONFIG treatment",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "cat > a.ts <<'EOF'\nexport async function f(token:string){await fetch(u)}\nEOF",
            "description": "write"
           },
           "output": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "cat > a.ts <<'EOF'\nexport async function f(token:[REDACTED] fetch(u)}\nEOF",
            "description": "write"
           },
           "output": "const g = async(token:[REDACTED]\nfunction a(token:[REDACTED] b}"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "a file tool call with no path keeps CONFIG treatment",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "content": "export async function f(token:string){await fetch(u)}"
           },
           "output": "?"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "content": "export async function f(token:[REDACTED] fetch(u)}"
           },
           "output": "?"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": ".env write still redacts a secret assignment",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env",
            "content": "API_TOKEN=abcdefgh123\nDEBUG=1\n"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env",
            "content": "API_TOKEN=[REDACTED]\nDEBUG=1\n"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": ".ts write still redacts a provider key",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/k.ts",
            "content": "const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAA\"\nexport async function f(token:string){await fetch(u)}"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/k.ts",
            "content": "const k = \"[REDACTED]\"\nexport async function f(token:string){await fetch(u)}"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": ".ts write still redacts a quoted secret literal and a private key",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "src/cfg.ts",
            "content": "const apiKey = \"abc123def456ghi\";\nconst pem = `-----BEGIN PRIVATE KEY-----\nMIIEv\n-----END PRIVATE KEY-----`;\n"
           },
           "output": "ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "src/cfg.ts",
            "content": "const apiKey = \"[REDACTED]\";\nconst pem = `[REDACTED]`;\n"
           },
           "output": "ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "apply_patch scrubs each file of the patch with its own mode",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "apply_patch",
          "state": {
           "status": "completed",
           "input": {
            "patchText": "*** Begin Patch\n*** Update File: src/a.ts\n@@\n-x\n+export async function f(token:string){await fetch(u)}\n*** Add File: .env\n+API_TOKEN=abcdefgh123\n*** End Patch"
           },
           "output": "Success. Updated the following files:\nM src/a.ts\nA .env",
           "metadata": {
            "diff": "Index: /work/proj/src/a.ts\n--- /work/proj/src/a.ts\n+++ /work/proj/src/a.ts\n@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n\nIndex: /work/proj/.env\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -0,0 +1 @@\n+API_TOKEN=abcdefgh123\n",
            "files": [
             {
              "filePath": "/work/proj/src/a.ts",
              "relativePath": "src/a.ts",
              "type": "update",
              "patch": "@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n",
              "before": "x\n",
              "after": "export async function f(token:string){await fetch(u)}\n"
             },
             {
              "filePath": "/work/proj/.env",
              "relativePath": ".env",
              "type": "add",
              "patch": "@@ -0,0 +1 @@\n+API_TOKEN=abcdefgh123\n",
              "after": "API_TOKEN=abcdefgh123\n"
             }
            ],
            "v2": {
             "files": [
              {
               "file": "src/a.ts",
               "patch": "+export async function f(token:string){await fetch(u)}\n",
               "status": "modified"
              },
              {
               "file": ".env",
               "patch": "+API_TOKEN=abcdefgh123\n",
               "status": "added"
              }
             ]
            }
           }
          },
          "name": "patch"
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "apply_patch",
          "state": {
           "status": "completed",
           "input": {
            "patchText": "*** Begin Patch\n*** Update File: src/a.ts\n@@\n-x\n+export async function f(token:string){await fetch(u)}\n*** Add File: .env\n+API_TOKEN=[REDACTED]\n*** End Patch"
           },
           "output": "Success. Updated the following files:\nM src/a.ts\nA .env",
           "metadata": {
            "diff": "Index: /work/proj/src/a.ts\n--- /work/proj/src/a.ts\n+++ /work/proj/src/a.ts\n@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n\nIndex: /work/proj/.env\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -0,0 +1 @@\n+API_TOKEN=[REDACTED]\n",
            "files": [
             {
              "filePath": "/work/proj/src/a.ts",
              "relativePath": "src/a.ts",
              "type": "update",
              "patch": "@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n",
              "before": "x\n",
              "after": "export async function f(token:string){await fetch(u)}\n"
             },
             {
              "filePath": "/work/proj/.env",
              "relativePath": ".env",
              "type": "add",
              "patch": "@@ -0,0 +1 @@\n+API_TOKEN=[REDACTED]\n",
              "after": "API_TOKEN=[REDACTED]\n"
             }
            ],
            "v2": {
             "files": [
              {
               "file": "src/a.ts",
               "patch": "+export async function f(token:string){await fetch(u)}\n",
               "status": "modified"
              },
              {
               "file": ".env",
               "patch": "+API_TOKEN=[REDACTED]\n",
               "status": "added"
              }
             ]
            }
           }
          },
          "name": "patch"
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "multiedit scrubs each edit with its own file's mode",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "multiedit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "src/m.ts",
            "edits": [
             {
              "filePath": "src/m.ts",
              "oldString": "a",
              "newString": "export async function f(token:string){await fetch(u)}"
             },
             {
              "filePath": "conf/app.ini",
              "oldString": "a",
              "newString": "auth_token=abcdefgh123"
             }
            ]
           },
           "output": "ok",
           "metadata": {
            "results": [
             {
              "diff": "@@\n+export async function f(token:string){await fetch(u)}\n"
             }
            ]
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "multiedit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "src/m.ts",
            "edits": [
             {
              "filePath": "src/m.ts",
              "oldString": "a",
              "newString": "export async function f(token:string){await fetch(u)}"
             },
             {
              "filePath": "conf/app.ini",
              "oldString": "a",
              "newString": "auth_token=[REDACTED]"
             }
            ]
           },
           "output": "ok",
           "metadata": {
            "results": [
             {
              "diff": "@@\n+export async function f(token:string){await fetch(u)}\n"
             }
            ]
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "read output of a .ts file keeps code; of a .env file is redacted",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/a.ts"
           },
           "output": "<file>\n00001| export async function f(token:string){await fetch(u)}\n</file>",
           "content": [
            {
             "type": "text",
             "text": "1: export async function f(token:string){await fetch(u)}"
            }
           ],
           "metadata": {
            "preview": "export async function f(token:string){await fetch(u)}",
            "truncated": false
           }
          }
         },
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env.local"
           },
           "output": "1: API_TOKEN=abcdefgh123",
           "metadata": {
            "preview": "API_TOKEN=abcdefgh123"
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/src/a.ts"
           },
           "output": "<file>\n00001| export async function f(token:string){await fetch(u)}\n</file>",
           "content": [
            {
             "type": "text",
             "text": "1: export async function f(token:string){await fetch(u)}"
            }
           ],
           "metadata": {
            "preview": "export async function f(token:string){await fetch(u)}",
            "truncated": false
           }
          }
         },
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env.local"
           },
           "output": "1: API_TOKEN=[REDACTED]",
           "metadata": {
            "preview": "API_TOKEN=[REDACTED]"
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "2.x tool part: native input path under v2 selects the mode",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_9",
          "tool": "write",
          "name": "write",
          "state": {
           "status": "completed",
           "input": {
            "content": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
           },
           "v2": {
            "input": {
             "path": "src/n.ts",
             "content": "export async function f(token:string){await fetch(u)}"
            }
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_9",
          "tool": "write",
          "name": "write",
          "state": {
           "status": "completed",
           "input": {
            "content": "const g = async(token:string)=>{}\nfunction a(token:string){await b}"
           },
           "v2": {
            "input": {
             "path": "src/n.ts",
             "content": "export async function f(token:string){await fetch(u)}"
            }
           }
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "other tool output keeps CONFIG treatment",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "grep",
          "state": {
           "status": "completed",
           "input": {
            "pattern": "token",
            "path": "src/a.ts"
           },
           "output": "src/a.ts:\n  Line 1: export async function f(token:string){await fetch(u)}"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "grep",
          "state": {
           "status": "completed",
           "input": {
            "pattern": "token",
            "path": "src/a.ts"
           },
           "output": "src/a.ts:\n  Line 1: export async function f(token:[REDACTED] fetch(u)}"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "turn.diff scrubs each file's hunk with its own mode",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.diff",
     "data": {
      "schema_version": 1,
      "files": [
       {
        "path": "src/a.ts",
        "status": "modified",
        "diff": "--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAA\"\n",
        "truncated": false,
        "reason": null
       },
       {
        "path": "conf/app.ini",
        "status": "modified",
        "diff": "--- a/conf/app.ini\n+++ b/conf/app.ini\n@@ -1 +1 @@\n-x\n+auth_token=abcdefgh123\n",
        "truncated": false,
        "reason": null
       }
      ],
      "file_count": 2,
      "omitted_file_count": 0,
      "truncated": false
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.diff",
     "data": {
      "schema_version": 1,
      "files": [
       {
        "path": "src/a.ts",
        "status": "modified",
        "diff": "--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1 @@\n-x\n+export async function f(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n",
        "truncated": false,
        "reason": null
       },
       {
        "path": "conf/app.ini",
        "status": "modified",
        "diff": "--- a/conf/app.ini\n+++ b/conf/app.ini\n@@ -1 +1 @@\n-x\n+auth_token=[REDACTED]\n",
        "truncated": false,
        "reason": null
       }
      ],
      "file_count": 2,
      "omitted_file_count": 0,
      "truncated": false
     }
    }
   ]
  }
 },
 {
  "name": "opencode turn.completed: nested apply_patch part, its metadata diffs and the user message's summary.diffs (`file` key) keep code per file; the prompt stays CONFIG",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "engine.request",
     "data": {
      "agent": "omnirush-cli",
      "prompt": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nAppend the line API_TOKEN=abcdefgh123 to .env.",
      "model": null
     }
    },
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.completed",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "sessionID": "ses_1",
         "role": "user",
         "summary": {
          "diffs": [
           {
            "file": ".env",
            "patch": "Index: .env\n===================================================================\n--- .env\t\n+++ .env\t\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=abcdefgh123\n",
            "additions": 1,
            "deletions": 0,
            "status": "modified"
           },
           {
            "file": "src/auth.ts",
            "patch": "Index: src/auth.ts\n===================================================================\n--- src/auth.ts\t\n+++ src/auth.ts\t\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n",
            "additions": 2,
            "deletions": 0,
            "status": "added"
           }
          ]
         }
        },
        "parts": [
         {
          "id": "prt_1",
          "type": "text",
          "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nAppend the line API_TOKEN=abcdefgh123 to .env."
         }
        ]
       },
       {
        "info": {
         "id": "msg_2",
         "sessionID": "ses_1",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_2",
          "type": "step-start"
         },
         {
          "id": "prt_3",
          "type": "tool",
          "callID": "call_1",
          "tool": "apply_patch",
          "state": {
           "status": "completed",
           "input": {
            "patchText": "*** Begin Patch\n*** Add File: src/auth.ts\n+export async function a(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n*** Update File: .env\n@@\n+API_TOKEN=abcdefgh123\n*** End Patch"
           },
           "output": "Success. Updated the following files:\nA src/auth.ts\nM .env",
           "metadata": {
            "diff": "Index: /work/proj/src/auth.ts\n===================================================================\n--- /work/proj/src/auth.ts\n+++ /work/proj/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n\nIndex: /work/proj/.env\n===================================================================\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=abcdefgh123\n\n",
            "files": [
             {
              "filePath": "/work/proj/src/auth.ts",
              "relativePath": "src/auth.ts",
              "type": "add",
              "patch": "Index: /work/proj/src/auth.ts\n===================================================================\n--- /work/proj/src/auth.ts\n+++ /work/proj/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n",
              "additions": 2,
              "deletions": 0
             },
             {
              "filePath": "/work/proj/.env",
              "relativePath": ".env",
              "type": "update",
              "patch": "Index: /work/proj/.env\n===================================================================\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=abcdefgh123\n",
              "additions": 1,
              "deletions": 0
             }
            ],
            "diagnostics": {},
            "truncated": false
           }
          }
         },
         {
          "id": "prt_4",
          "type": "patch",
          "files": [
           "/work/proj/src/auth.ts",
           "/work/proj/.env"
          ]
         }
        ]
       },
       {
        "info": {
         "id": "msg_3",
         "sessionID": "ses_1",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_5",
          "type": "tool",
          "callID": "call_2",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "echo 'export async function a(token:string){await fetch(u)}'; tail -n1 .env"
           },
           "output": "export async function a(token:string){await fetch(u)}\nAPI_TOKEN=abcdefgh123\n",
           "metadata": {
            "output": "export async function a(token:string){await fetch(u)}\nAPI_TOKEN=abcdefgh123\n"
           }
          }
         }
        ]
       }
      ]
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "engine.request",
     "data": {
      "agent": "omnirush-cli",
      "prompt": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:[REDACTED] fetch(u)}\nconst k = \"[REDACTED]\"\nAppend the line API_TOKEN=[REDACTED] to .env.",
      "model": null
     }
    },
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.completed",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "sessionID": "ses_1",
         "role": "user",
         "summary": {
          "diffs": [
           {
            "file": ".env",
            "patch": "Index: .env\n===================================================================\n--- .env\t\n+++ .env\t\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=[REDACTED]\n",
            "additions": 1,
            "deletions": 0,
            "status": "modified"
           },
           {
            "file": "src/auth.ts",
            "patch": "Index: src/auth.ts\n===================================================================\n--- src/auth.ts\t\n+++ src/auth.ts\t\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n",
            "additions": 2,
            "deletions": 0,
            "status": "added"
           }
          ]
         }
        },
        "parts": [
         {
          "id": "prt_1",
          "type": "text",
          "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:[REDACTED] fetch(u)}\nconst k = \"[REDACTED]\"\nAppend the line API_TOKEN=[REDACTED] to .env."
         }
        ]
       },
       {
        "info": {
         "id": "msg_2",
         "sessionID": "ses_1",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_2",
          "type": "step-start"
         },
         {
          "id": "prt_3",
          "type": "tool",
          "callID": "call_1",
          "tool": "apply_patch",
          "state": {
           "status": "completed",
           "input": {
            "patchText": "*** Begin Patch\n*** Add File: src/auth.ts\n+export async function a(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n*** Update File: .env\n@@\n+API_TOKEN=[REDACTED]\n*** End Patch"
           },
           "output": "Success. Updated the following files:\nA src/auth.ts\nM .env",
           "metadata": {
            "diff": "Index: /work/proj/src/auth.ts\n===================================================================\n--- /work/proj/src/auth.ts\n+++ /work/proj/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n\nIndex: /work/proj/.env\n===================================================================\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=[REDACTED]\n\n",
            "files": [
             {
              "filePath": "/work/proj/src/auth.ts",
              "relativePath": "src/auth.ts",
              "type": "add",
              "patch": "Index: /work/proj/src/auth.ts\n===================================================================\n--- /work/proj/src/auth.ts\n+++ /work/proj/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n",
              "additions": 2,
              "deletions": 0
             },
             {
              "filePath": "/work/proj/.env",
              "relativePath": ".env",
              "type": "update",
              "patch": "Index: /work/proj/.env\n===================================================================\n--- /work/proj/.env\n+++ /work/proj/.env\n@@ -1,2 +1,3 @@\n APP_NAME=demo\n DEBUG=1\n+API_TOKEN=[REDACTED]\n",
              "additions": 1,
              "deletions": 0
             }
            ],
            "diagnostics": {},
            "truncated": false
           }
          }
         },
         {
          "id": "prt_4",
          "type": "patch",
          "files": [
           "/work/proj/src/auth.ts",
           "/work/proj/.env"
          ]
         }
        ]
       },
       {
        "info": {
         "id": "msg_3",
         "sessionID": "ses_1",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_5",
          "type": "tool",
          "callID": "call_2",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "echo 'export async function a(token:[REDACTED] fetch(u)}'; tail -n1 .env"
           },
           "output": "export async function a(token:[REDACTED] fetch(u)}\nAPI_TOKEN=[REDACTED]\n",
           "metadata": {
            "output": "export async function a(token:[REDACTED] fetch(u)}\nAPI_TOKEN=[REDACTED]\n"
           }
          }
         }
        ]
       }
      ]
     }
    }
   ]
  }
 },
 {
  "name": "pi turn.completed: write by `path`, edit with edits[] and a display diff, read of .env, 2.x name/v2 fields; turn.diff hunk",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_2",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "engine.request",
     "data": {
      "method": "POST",
      "path": "/session/ses_2/prompt",
      "body": {
       "parts": [
        {
         "type": "text",
         "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nAppend the line API_TOKEN=abcdefgh123 to .env."
        }
       ],
       "agent": "omnirush-cli"
      }
     }
    },
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.completed",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "user",
         "type": "user",
         "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nAppend the line API_TOKEN=abcdefgh123 to .env."
        },
        "parts": [
         {
          "id": "prt_1",
          "type": "text",
          "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nAppend the line API_TOKEN=abcdefgh123 to .env."
         }
        ]
       },
       {
        "info": {
         "id": "msg_2",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_2",
          "type": "tool",
          "callID": "call_1|fc_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "path": ".env",
            "offset": 1,
            "limit": 200
           },
           "output": "APP_NAME=demo\nAPI_TOKEN=abcdefgh123\n",
           "content": [
            {
             "type": "text",
             "text": "APP_NAME=demo\nAPI_TOKEN=abcdefgh123\n"
            }
           ]
          },
          "name": "read",
          "executed": false,
          "v2": {
           "id": "call_1"
          }
         },
         {
          "id": "prt_3",
          "type": "tool",
          "callID": "call_2|fc_2",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/auth.ts",
            "content": "export async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\""
           },
           "output": "Successfully wrote to src/auth.ts",
           "content": [
            {
             "type": "text",
             "text": "Successfully wrote to src/auth.ts"
            }
           ]
          },
          "name": "write",
          "executed": false,
          "v2": {
           "id": "call_2"
          }
         },
         {
          "id": "prt_4",
          "type": "tool",
          "callID": "call_3|fc_3",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/auth.ts",
            "edits": [
             {
              "oldText": "await fetch(u)",
              "newText": "await fetch(u, {headers})"
             }
            ]
           },
           "output": "Successfully replaced 1 block(s) in src/auth.ts.",
           "metadata": {
            "diff": "-1 export async function a(token:string){await fetch(u)}\n+1 export async function a(token:string){await fetch(u, {headers})}",
            "patch": "--- src/auth.ts\n+++ src/auth.ts\n@@ -1,1 +1,1 @@\n-export async function a(token:string){await fetch(u)}\n+export async function a(token:string){await fetch(u, {headers})}\n",
            "firstChangedLine": 1
           }
          },
          "name": "edit",
          "executed": false,
          "v2": {
           "id": "call_3"
          }
         },
         {
          "id": "prt_5",
          "type": "tool",
          "callID": "call_4|fc_4",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": ".env",
            "edits": [
             {
              "oldText": "DEBUG=1\n",
              "newText": "DEBUG=1\nAPI_TOKEN=abcdefgh123\n"
             }
            ]
           },
           "output": "Successfully replaced 1 block(s) in .env.",
           "metadata": {
            "diff": " 1 DEBUG=1\n+2 API_TOKEN=abcdefgh123",
            "patch": "--- .env\n+++ .env\n@@ -1,1 +1,2 @@\n DEBUG=1\n+API_TOKEN=abcdefgh123\n",
            "firstChangedLine": 2
           }
          },
          "name": "edit",
          "executed": false,
          "v2": {
           "id": "call_4"
          }
         },
         {
          "id": "prt_6",
          "type": "patch",
          "files": [
           "/work/proj/src/auth.ts",
           "/work/proj/.env"
          ]
         }
        ]
       }
      ]
     }
    },
    {
     "at": "2026-10-04T00:00:02.000Z",
     "type": "turn.diff",
     "data": {
      "schema_version": 1,
      "files": [
       {
        "path": "src/auth.ts",
        "status": "added",
        "before_sha256": null,
        "after_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
        "additions": 2,
        "deletions": 0,
        "diff": "--- /dev/null\n+++ b/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n\\ No newline at end of file\n",
        "truncated": false,
        "reason": null
       },
       {
        "path": ".env",
        "status": "modified",
        "before_sha256": "1111111111111111111111111111111111111111111111111111111111111111",
        "after_sha256": "2222222222222222222222222222222222222222222222222222222222222222",
        "additions": 1,
        "deletions": 0,
        "diff": "--- a/.env\n+++ b/.env\n@@ -1,1 +1,2 @@\n DEBUG=1\n+API_TOKEN=abcdefgh123\n",
        "truncated": false,
        "reason": null
       }
      ],
      "file_count": 2,
      "omitted_file_count": 0,
      "truncated": false
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_2",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "engine.request",
     "data": {
      "method": "POST",
      "path": "/session/ses_2/prompt",
      "body": {
       "parts": [
        {
         "type": "text",
         "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:[REDACTED] fetch(u)}\nconst k = \"[REDACTED]\"\nAppend the line API_TOKEN=[REDACTED] to .env."
        }
       ],
       "agent": "omnirush-cli"
      }
     }
    },
    {
     "at": "2026-10-04T00:00:01.000Z",
     "type": "turn.completed",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "user",
         "type": "user",
         "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:[REDACTED] fetch(u)}\nconst k = \"[REDACTED]\"\nAppend the line API_TOKEN=[REDACTED] to .env."
        },
        "parts": [
         {
          "id": "prt_1",
          "type": "text",
          "text": "Create src/auth.ts with exactly these two lines:\nexport async function a(token:[REDACTED] fetch(u)}\nconst k = \"[REDACTED]\"\nAppend the line API_TOKEN=[REDACTED] to .env."
         }
        ]
       },
       {
        "info": {
         "id": "msg_2",
         "role": "assistant"
        },
        "parts": [
         {
          "id": "prt_2",
          "type": "tool",
          "callID": "call_1|fc_1",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "path": ".env",
            "offset": 1,
            "limit": 200
           },
           "output": "APP_NAME=demo\nAPI_TOKEN=[REDACTED]\n",
           "content": [
            {
             "type": "text",
             "text": "APP_NAME=demo\nAPI_TOKEN=[REDACTED]\n"
            }
           ]
          },
          "name": "read",
          "executed": false,
          "v2": {
           "id": "call_1"
          }
         },
         {
          "id": "prt_3",
          "type": "tool",
          "callID": "call_2|fc_2",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/auth.ts",
            "content": "export async function a(token:string){await fetch(u)}\nconst k = \"[REDACTED]\""
           },
           "output": "Successfully wrote to src/auth.ts",
           "content": [
            {
             "type": "text",
             "text": "Successfully wrote to src/auth.ts"
            }
           ]
          },
          "name": "write",
          "executed": false,
          "v2": {
           "id": "call_2"
          }
         },
         {
          "id": "prt_4",
          "type": "tool",
          "callID": "call_3|fc_3",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": "src/auth.ts",
            "edits": [
             {
              "oldText": "await fetch(u)",
              "newText": "await fetch(u, {headers})"
             }
            ]
           },
           "output": "Successfully replaced 1 block(s) in src/auth.ts.",
           "metadata": {
            "diff": "-1 export async function a(token:string){await fetch(u)}\n+1 export async function a(token:string){await fetch(u, {headers})}",
            "patch": "--- src/auth.ts\n+++ src/auth.ts\n@@ -1,1 +1,1 @@\n-export async function a(token:string){await fetch(u)}\n+export async function a(token:string){await fetch(u, {headers})}\n",
            "firstChangedLine": 1
           }
          },
          "name": "edit",
          "executed": false,
          "v2": {
           "id": "call_3"
          }
         },
         {
          "id": "prt_5",
          "type": "tool",
          "callID": "call_4|fc_4",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "path": ".env",
            "edits": [
             {
              "oldText": "DEBUG=1\n",
              "newText": "DEBUG=1\nAPI_TOKEN=[REDACTED]\n"
             }
            ]
           },
           "output": "Successfully replaced 1 block(s) in .env.",
           "metadata": {
            "diff": " 1 DEBUG=1\n+2 API_TOKEN=[REDACTED]",
            "patch": "--- .env\n+++ .env\n@@ -1,1 +1,2 @@\n DEBUG=1\n+API_TOKEN=[REDACTED]\n",
            "firstChangedLine": 2
           }
          },
          "name": "edit",
          "executed": false,
          "v2": {
           "id": "call_4"
          }
         },
         {
          "id": "prt_6",
          "type": "patch",
          "files": [
           "/work/proj/src/auth.ts",
           "/work/proj/.env"
          ]
         }
        ]
       }
      ]
     }
    },
    {
     "at": "2026-10-04T00:00:02.000Z",
     "type": "turn.diff",
     "data": {
      "schema_version": 1,
      "files": [
       {
        "path": "src/auth.ts",
        "status": "added",
        "before_sha256": null,
        "after_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
        "additions": 2,
        "deletions": 0,
        "diff": "--- /dev/null\n+++ b/src/auth.ts\n@@ -0,0 +1,2 @@\n+export async function a(token:string){await fetch(u)}\n+const k = \"[REDACTED]\"\n\\ No newline at end of file\n",
        "truncated": false,
        "reason": null
       },
       {
        "path": ".env",
        "status": "modified",
        "before_sha256": "1111111111111111111111111111111111111111111111111111111111111111",
        "after_sha256": "2222222222222222222222222222222222222222222222222222222222222222",
        "additions": 1,
        "deletions": 0,
        "diff": "--- a/.env\n+++ b/.env\n@@ -1,1 +1,2 @@\n DEBUG=1\n+API_TOKEN=[REDACTED]\n",
        "truncated": false,
        "reason": null
       }
      ],
      "file_count": 2,
      "omitted_file_count": 0,
      "truncated": false
     }
    }
   ]
  }
 },
 {
  "name": "session.diff event: each item's before/after/patch takes its own `file`'s mode, a pathless item stays CONFIG",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_3",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "session.diff",
     "data": {
      "sessionID": "ses_3",
      "diff": [
       {
        "file": "src/auth.ts",
        "before": "",
        "after": "export async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n",
        "additions": 2,
        "deletions": 0,
        "status": "added"
       },
       {
        "filename": "lib/b.py",
        "patch": "@@ -0,0 +1 @@\n+async def a(token:str)->Awaitable[None]: pass\n",
        "additions": 1,
        "deletions": 0
       },
       {
        "file": ".env",
        "before": "DEBUG=1\n",
        "after": "DEBUG=1\nAPI_TOKEN=abcdefgh123\n",
        "additions": 1,
        "deletions": 0,
        "status": "modified"
       },
       {
        "patch": "@@ -0,0 +1 @@\n+export async function a(token:string){await fetch(u)}\n",
        "additions": 1,
        "deletions": 0
       }
      ]
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_3",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "session.diff",
     "data": {
      "sessionID": "ses_3",
      "diff": [
       {
        "file": "src/auth.ts",
        "before": "",
        "after": "export async function a(token:string){await fetch(u)}\nconst k = \"[REDACTED]\"\n",
        "additions": 2,
        "deletions": 0,
        "status": "added"
       },
       {
        "filename": "lib/b.py",
        "patch": "@@ -0,0 +1 @@\n+async def a(token:str)->Awaitable[None]: pass\n",
        "additions": 1,
        "deletions": 0
       },
       {
        "file": ".env",
        "before": "DEBUG=1\n",
        "after": "DEBUG=1\nAPI_TOKEN=[REDACTED]\n",
        "additions": 1,
        "deletions": 0,
        "status": "modified"
       },
       {
        "patch": "@@ -0,0 +1 @@\n+export async function a(token:[REDACTED] fetch(u)}\n",
        "additions": 1,
        "deletions": 0
       }
      ]
     }
    }
   ]
  }
 },
 {
  "name": "pi toolCall blocks: write/edit arguments keep code by `path`/`file_path`; bash and read stay CONFIG",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_4",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "session.child",
     "data": {
      "child_session_id": "ses_5",
      "parent_session_id": "ses_4",
      "messages": [
       {
        "role": "assistant",
        "content": [
         {
          "type": "toolCall",
          "id": "call_1",
          "name": "write",
          "arguments": {
           "path": "src/auth.ts",
           "content": "export async function a(token:string){await fetch(u)}\nconst k = \"sk-proj-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\""
          }
         },
         {
          "type": "toolCall",
          "id": "call_2",
          "name": "edit",
          "arguments": {
           "file_path": "src/auth.ts",
           "old_string": "fetch(u)",
           "new_string": "fetch(u, {token:string})"
          }
         },
         {
          "type": "toolCall",
          "id": "call_3",
          "name": "edit",
          "arguments": {
           "path": ".env",
           "edits": [
            {
             "oldText": "DEBUG=1",
             "newText": "DEBUG=1\nAPI_TOKEN=abcdefgh123"
            }
           ]
          }
         },
         {
          "type": "toolCall",
          "id": "call_4",
          "name": "bash",
          "arguments": {
           "command": "echo 'export async function a(token:string){await fetch(u)}'"
          }
         },
         {
          "type": "toolCall",
          "id": "call_5",
          "name": "read",
          "arguments": {
           "path": "src/auth.ts"
          }
         }
        ]
       },
       {
        "role": "toolResult",
        "toolCallId": "call_5",
        "toolName": "read",
        "content": [
         {
          "type": "text",
          "text": "export async function a(token:string){await fetch(u)}"
         }
        ]
       }
      ]
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_4",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "session.child",
     "data": {
      "child_session_id": "ses_5",
      "parent_session_id": "ses_4",
      "messages": [
       {
        "role": "assistant",
        "content": [
         {
          "type": "toolCall",
          "id": "call_1",
          "name": "write",
          "arguments": {
           "path": "src/auth.ts",
           "content": "export async function a(token:string){await fetch(u)}\nconst k = \"[REDACTED]\""
          }
         },
         {
          "type": "toolCall",
          "id": "call_2",
          "name": "edit",
          "arguments": {
           "file_path": "src/auth.ts",
           "old_string": "fetch(u)",
           "new_string": "fetch(u, {token:string})"
          }
         },
         {
          "type": "toolCall",
          "id": "call_3",
          "name": "edit",
          "arguments": {
           "path": ".env",
           "edits": [
            {
             "oldText": "DEBUG=1",
             "newText": "DEBUG=1\nAPI_TOKEN=[REDACTED]"
            }
           ]
          }
         },
         {
          "type": "toolCall",
          "id": "call_4",
          "name": "bash",
          "arguments": {
           "command": "echo 'export async function a(token:[REDACTED] fetch(u)}'"
          }
         },
         {
          "type": "toolCall",
          "id": "call_5",
          "name": "read",
          "arguments": {
           "path": "src/auth.ts"
          }
         }
        ]
       },
       {
        "role": "toolResult",
        "toolCallId": "call_5",
        "toolName": "read",
        "content": [
         {
          "type": "text",
          "text": "export async function a(token:[REDACTED] fetch(u)}"
         }
        ]
       }
      ]
     }
    }
   ]
  }
 },
 {
  "name": "git diff: a .ts section keeps code, a config section is redacted",
  "kind": "git_diff",
  "input": "diff --git a/src/a.ts b/src/a.ts\nindex 1..2 100644\n--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1,2 @@\n-x\n+export async function f(token:string){await fetch(u)}\n+async(token:string)=>{}\ndiff --git a/conf/app.ini b/conf/app.ini\nindex 1..2 100644\n--- a/conf/app.ini\n+++ b/conf/app.ini\n@@ -1 +1 @@\n-x\n+auth_token=abcdefgh123\n+f(token:string){await fetch(u)}\n",
  "expected": "diff --git a/src/a.ts b/src/a.ts\nindex 1..2 100644\n--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1,2 @@\n-x\n+export async function f(token:string){await fetch(u)}\n+async(token:string)=>{}\ndiff --git a/conf/app.ini b/conf/app.ini\nindex 1..2 100644\n--- a/conf/app.ini\n+++ b/conf/app.ini\n@@ -1 +1 @@\n-x\n+auth_token=[REDACTED]\n+f(token:[REDACTED] fetch(u)}\n"
 },
 {
  "name": "dpkg and other version strings are not IPv4 addresses",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "dpkg-query -W -f '${Package} ${Version}\\n'"
           },
           "output": "postgresql-client-16 16.15-0ubuntu0.24.04.1\ntzdata 2024a-0ubuntu0.22.04.1\nlibc-bin 2.35-0ubuntu3.8\nopenssl 3.0.2-0ubuntu1.18\nsystemd ubuntu1.22.04.1\nlibfoo 1:2.3.4.5-1\nlibbar 1:2.3.4.5\ntool v1.2.3.4\nlibbaz 1.2.3.4.5\nlibqux 2.30-0ubuntu2.1.4.6\nlibx 1.0~rc1.2.3.4.5\nliby 9.9+dfsg-1.2.3.4\n"
          }
         }
        ]
       }
      ]
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "dpkg-query -W -f '${Package} ${Version}\\n'"
           },
           "output": "postgresql-client-16 16.15-0ubuntu0.24.04.1\ntzdata 2024a-0ubuntu0.22.04.1\nlibc-bin 2.35-0ubuntu3.8\nopenssl 3.0.2-0ubuntu1.18\nsystemd ubuntu1.22.04.1\nlibfoo 1:2.3.4.5-1\nlibbar 1:2.3.4.5\ntool v1.2.3.4\nlibbaz 1.2.3.4.5\nlibqux 2.30-0ubuntu2.1.4.6\nlibx 1.0~rc1.2.3.4.5\nliby 9.9+dfsg-1.2.3.4\n"
          }
         }
        ]
       }
      ]
     }
    }
   ]
  }
 },
 {
  "name": "public IPv4 addresses are still redacted; loopback, private and documentation ones are kept",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "curl http://203.0.113.9:8080/health"
           },
           "output": "10.0.0.5\nip=192.168.1.20\nGET http://203.0.113.9:8080 ok\nping from 8.8.8.8 (8.8.8.8): 56 bytes\nlisten 127.0.0.1:5432; peer 172.16.0.1.\nping 52.14.7.21 and 151.101.1.69\n"
          }
         }
        ]
       }
      ]
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "curl http://203.0.113.9:8080/health"
           },
           "output": "10.0.0.5\nip=192.168.1.20\nGET http://203.0.113.9:8080 ok\nping from [REDACTED_PII] ([REDACTED_PII]): 56 bytes\nlisten 127.0.0.1:5432; peer 172.16.0.1.\nping [REDACTED_PII] and [REDACTED_PII]\n"
          }
         }
        ]
       }
      ]
     }
    }
   ]
  }
 },
 {
  "name": "loopback, unspecified, example e-mail and a placeholder token written to code are kept (tester session, anonymised)",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/config.py",
            "content": "BIND_HOST = \"0.0.0.0\"\nDEFAULT_EMAIL = \"[email protected]\"\nFORM_PLACEHOLDER = \"e.g. Jane Doe\"\nAPI_TOKEN = \"fake-not-a-real-token-0000\"\n\n\ndef get_config():\n    return {\n        \"BIND_HOST\": BIND_HOST,\n        \"DEFAULT_EMAIL\": DEFAULT_EMAIL,\n        \"FORM_PLACEHOLDER\": FORM_PLACEHOLDER,\n        \"API_TOKEN\": API_TOKEN,\n    }\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_2",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/server.js",
            "content": "const http = require(\"http\");\n\nconst host = \"127.0.0.1\";\nconst port = 3000;\n\nconst server = http.createServer((req, res) => {\n  res.end(\"ok\");\n});\n\nserver.listen(port, host, () => {\n  console.log(\"serving on http://127.0.0.1:3000\");\n});\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_3",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/README.md",
            "oldString": "# demo\n",
            "newString": "# demo\n\n- `server.js` starts a minimal Node.js HTTP server on `127.0.0.1:3000` and responds with `ok`.\n"
           },
           "output": "Edit applied successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_4",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/config.py"
           },
           "output": "1: BIND_HOST = \"0.0.0.0\"\n2: DEFAULT_EMAIL = \"[email protected]\"\n4: API_TOKEN = \"fake-not-a-real-token-0000\""
          }
         },
         {
          "type": "tool",
          "callID": "call_5",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "node server.js & sleep 3; curl -s http://127.0.0.1:3000"
           },
           "output": "serving on http://127.0.0.1:3000\nok"
          }
         },
         {
          "type": "text",
          "text": "Start server.js bound to 0.0.0.0:3000, then fetch http://localhost:3000. Contact [email protected] or [email protected]."
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/config.py",
            "content": "BIND_HOST = \"0.0.0.0\"\nDEFAULT_EMAIL = \"[email protected]\"\nFORM_PLACEHOLDER = \"e.g. Jane Doe\"\nAPI_TOKEN = \"fake-not-a-real-token-0000\"\n\n\ndef get_config():\n    return {\n        \"BIND_HOST\": BIND_HOST,\n        \"DEFAULT_EMAIL\": DEFAULT_EMAIL,\n        \"FORM_PLACEHOLDER\": FORM_PLACEHOLDER,\n        \"API_TOKEN\": API_TOKEN,\n    }\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_2",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/server.js",
            "content": "const http = require(\"http\");\n\nconst host = \"127.0.0.1\";\nconst port = 3000;\n\nconst server = http.createServer((req, res) => {\n  res.end(\"ok\");\n});\n\nserver.listen(port, host, () => {\n  console.log(\"serving on http://127.0.0.1:3000\");\n});\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_3",
          "tool": "edit",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/README.md",
            "oldString": "# demo\n",
            "newString": "# demo\n\n- `server.js` starts a minimal Node.js HTTP server on `127.0.0.1:3000` and responds with `ok`.\n"
           },
           "output": "Edit applied successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_4",
          "tool": "read",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/config.py"
           },
           "output": "1: BIND_HOST = \"0.0.0.0\"\n2: DEFAULT_EMAIL = \"[email protected]\"\n4: API_TOKEN = \"fake-not-a-real-token-0000\""
          }
         },
         {
          "type": "tool",
          "callID": "call_5",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "node server.js & sleep 3; curl -s http://127.0.0.1:3000"
           },
           "output": "serving on http://127.0.0.1:3000\nok"
          }
         },
         {
          "type": "text",
          "text": "Start server.js bound to 0.0.0.0:3000, then fetch http://localhost:3000. Contact [email protected] or [email protected]."
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "real secrets and personal data next to the kept values are still redacted",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/settings.py",
            "content": "BIND_HOST = \"0.0.0.0\"\nUPSTREAM = \"52.14.7.21\"\nOWNER_EMAIL = \"[email protected]\"\nSUPPORT = \"[email protected]\"\nAPI_TOKEN = \"q7Xk2mP9vR4tL8wZ3nB6\"\nSTRIPE = \"sk_live_51Hx7Gq2eZvKYlo2C\"\nAWS_ACCESS_KEY_ID = \"AKIAIOSFODNN7EXAMPLE\"\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_2",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "cat .env"
           },
           "output": "API_TOKEN=q7Xk2mP9vR4tL8wZ3nB6\nDB_PASSWORD=hunter2hunter2\nping 151.101.1.69 ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/settings.py",
            "content": "BIND_HOST = \"0.0.0.0\"\nUPSTREAM = \"[REDACTED_PII]\"\nOWNER_EMAIL = \"[REDACTED_PII]\"\nSUPPORT = \"[REDACTED_PII]\"\nAPI_TOKEN = \"[REDACTED]\"\nSTRIPE = \"[REDACTED]\"\nAWS_ACCESS_KEY_ID = \"[REDACTED]\"\n"
           },
           "output": "Wrote file successfully."
          }
         },
         {
          "type": "tool",
          "callID": "call_2",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "cat .env"
           },
           "output": "API_TOKEN=[REDACTED]\nDB_PASSWORD=[REDACTED]\nping [REDACTED_PII] ok"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "kept IPv4 ranges (private, link-local, loopback, documentation, netmasks); public addresses are redacted",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "ip addr; ip route"
           },
           "output": "inet 10.1.2.3/8 brd 10.255.255.255\ninet 172.16.5.4 172.31.255.1 not-private 172.32.0.1\ninet 192.168.0.10 netmask 255.255.255.0\nlink 169.254.169.254 gw 0.0.0.0 bcast 255.255.255.255 mask 255.255.240.0 odd 255.255.0.255\ndocs 192.0.2.10 198.51.100.20 203.0.113.30 lo 127.0.0.53 ::1\npublic 8.8.8.8 1.1.1.1 52.14.7.21 192.0.3.1 198.51.101.2\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "ip addr; ip route"
           },
           "output": "inet 10.1.2.3/8 brd 10.255.255.255\ninet 172.16.5.4 172.31.255.1 not-private [REDACTED_PII]\ninet 192.168.0.10 netmask 255.255.255.0\nlink 169.254.169.254 gw 0.0.0.0 bcast 255.255.255.255 mask 255.255.240.0 odd [REDACTED_PII]\ndocs 192.0.2.10 198.51.100.20 203.0.113.30 lo 127.0.0.53 ::1\npublic [REDACTED_PII] [REDACTED_PII] [REDACTED_PII] [REDACTED_PII] [REDACTED_PII]\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "kept e-mails: reserved, test, placeholder and no-reply addresses; personal ones go",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "git log --format=%ae"
           },
           "output": "[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "git log --format=%ae"
           },
           "output": "[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[email protected]\n[REDACTED_PII]\n[REDACTED_PII]\n[REDACTED_PII]\n[REDACTED_PII]\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "placeholder assignment values are kept; secret-shaped ones are not",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env.example",
            "content": "API_TOKEN=your-token-here\nAPI_KEY=YOUR_API_KEY\nDB_PASSWORD=changeme\nSECRET_KEY=xxxxxxxxxxxxxxxx\nAUTH_TOKEN=fake-not-a-real-token-0000\nACCESS_TOKEN=replace-me-with-a-token\nSHORT_TOKEN=abc12\nREAL_TOKEN=9f8e7d6c5b4a39281706\nPASSWORD=password1234\nCLIENT_SECRET=Tq3vX8kPz2LmN7rB\n"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "write",
          "state": {
           "status": "completed",
           "input": {
            "filePath": "/work/proj/.env.example",
            "content": "API_TOKEN=your-token-here\nAPI_KEY=YOUR_API_KEY\nDB_PASSWORD=changeme\nSECRET_KEY=xxxxxxxxxxxxxxxx\nAUTH_TOKEN=fake-not-a-real-token-0000\nACCESS_TOKEN=replace-me-with-a-token\nSHORT_TOKEN=abc12\nREAL_TOKEN=[REDACTED]\nPASSWORD=[REDACTED]\nCLIENT_SECRET=[REDACTED]\n"
           },
           "output": "Wrote file successfully."
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "Arch and Debian package releases are versions, not IPv4 addresses",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "pacman -Q"
           },
           "output": "alsa-ucm-conf 1.2.15.3-1\nimagemagick 7.1.2.8-1\nlibmodplug 0.8.9.0-7\nsddm-git 0.21.0.12.gbc9eee8-1\nmirror 52.14.7.21\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "turn.messages",
     "data": {
      "messages": [
       {
        "info": {
         "id": "msg_1",
         "role": "assistant"
        },
        "parts": [
         {
          "type": "tool",
          "callID": "call_1",
          "tool": "bash",
          "state": {
           "status": "completed",
           "input": {
            "command": "pacman -Q"
           },
           "output": "alsa-ucm-conf 1.2.15.3-1\nimagemagick 7.1.2.8-1\nlibmodplug 0.8.9.0-7\nsddm-git 0.21.0.12.gbc9eee8-1\nmirror [REDACTED_PII]\n"
          }
         }
        ]
       }
      ],
      "part": 1,
      "parts": 1
     }
    }
   ]
  }
 },
 {
  "name": "a package version under a version key is not an IPv4 address; the same digits elsewhere are",
  "kind": "trace",
  "input": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "environment",
     "data": {
      "packages": [
       {
        "name": "update-notifier-common",
        "version": "3.192.1.7"
       },
       {
        "name": "alsa-ucm-conf",
        "version": "1.2.15.3-1"
       }
      ],
      "note": "mirror 3.192.1.7"
     }
    }
   ]
  },
  "expected": {
   "schema_version": 1,
   "session_id": "ses_1",
   "events": [
    {
     "at": "2026-10-04T00:00:00.000Z",
     "type": "environment",
     "data": {
      "packages": [
       {
        "name": "update-notifier-common",
        "version": "3.192.1.7"
       },
       {
        "name": "alsa-ucm-conf",
        "version": "1.2.15.3-1"
       }
      ],
      "note": "mirror [REDACTED_PII]"
     }
    }
   ]
  }
 }
]