Cotton code
540 lines · 17.3 KB · JSONRaw
{  "pair": "people merge",  "rust": "crates/cotton-tools/src/mcp/handlers/records_1/people.rs (merge_people)",  "worker": "apps/business/src/mcp/tools/records/people.ts",  "cases": [],  "differs": [    {      "name": "fold a duplicate in, asked by keep, merge",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. Read back, the phone's person also carries contact_source manual and null phones, emails and instagrams; the Worker's carries computed_unavailable.",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Asha Rao",            "city": "Hyderabad"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Asha R",            "org": "Tin Factory",            "city": "Chennai"          },          "at": "2026-01-02T00:00:00.000Z"        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000201",            "merge": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "answer": {              "kept": {                "id": "00000000-0000-4000-8000-000000000201",                "name": "Asha Rao"              },              "merged": {                "id": "00000000-0000-4000-8000-000000000202",                "name": "Asha R",                "trashed_at": "<instant>"              },              "filled": [                "org"              ],              "combined": [],              "device_card": "none",              "repointed": {},              "repeats_binned": {},              "said": "Merged Asha R into Asha Rao; Asha R waits in the bin"            }          }        },        {          "tool": "get_record_by_table",          "args": {            "table": "person",            "id": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "answer": {              "table": "person",              "id": "00000000-0000-4000-8000-000000000201",              "data": {                "full_name": "Asha Rao",                "language": "en",                "contact_source": "manual",                "city": "Hyderabad",                "phones": null,                "emails": null,                "instagrams": null              },              "created_at": "<instant>",              "updated_at": "<instant>",              "deleted_at": null,              "byline": null,              "edited_by_person_id": null,              "edited_by_photo_key": null            }          },          "worker": {            "answer": {              "table": "person",              "id": "00000000-0000-4000-8000-000000000201",              "data": {                "full_name": "Asha Rao",                "org": "Tin Factory",                "city": "Hyderabad",                "language": "en"              },              "created_at": "<instant>",              "updated_at": "<instant>",              "deleted_at": null,              "byline": null,              "computed_unavailable": [                "reached_at",                "reach_90d"              ],              "edited_by_person_id": null,              "edited_by_photo_key": null            }          }        }      ]    },    {      "name": "merge refusals, asked by keep, merge",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. ",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Asha Rao",            "city": "Hyderabad"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Asha R",            "org": "Tin Factory",            "city": "Chennai"          },          "at": "2026-01-02T00:00:00.000Z"        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000201",            "merge": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep and merge are the same person: name two people"          }        },        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "merge is required: the id of the person folded into keep"          }        },        {          "tool": "merge_people",          "args": {            "merge": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000201",            "merge": "00000000-0000-4000-8000-000000000999"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "merge is not a person: there is no person \"00000000-0000-4000-8000-000000000999\""          }        },        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000999",            "merge": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is not a person: there is no person \"00000000-0000-4000-8000-000000000999\""          }        },        {          "tool": "merge_people",          "args": {            "keep": "not-an-id",            "merge": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is not a person: there is no person \"not-an-id\""          }        }      ]    },    {      "name": "a person in the bin is not merged, asked by keep, merge",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. ",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Chitra"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Chitra K",            "trashed_at": "2026-01-03T00:00:00.000Z"          }        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000201",            "merge": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "merge is a person in the bin: restore_from_bin brings them back first"          }        },        {          "tool": "merge_people",          "args": {            "keep": "00000000-0000-4000-8000-000000000202",            "merge": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is a person in the bin: restore_from_bin brings them back first"          }        }      ]    },    {      "name": "fold a duplicate in, asked by survivorId, duplicateId",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. The answers also differ in shape: the phone answers { survivor, duplicate, repointed, deviceCard }, the Worker { kept, merged, filled, combined, device_card, repointed, repeats_binned, said }.",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Asha Rao",            "city": "Hyderabad"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Asha R",            "org": "Tin Factory",            "city": "Chennai"          },          "at": "2026-01-02T00:00:00.000Z"        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000201",            "duplicateId": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "answer": {              "survivor": {                "id": "00000000-0000-4000-8000-000000000201",                "full_name": "Asha Rao",                "org": "Tin Factory",                "role_title": null,                "city": "Hyderabad",                "phones": [],                "emails": []              },              "duplicate": {                "id": "00000000-0000-4000-8000-000000000202",                "name": "Asha R",                "archived": true              },              "repointed": {},              "deviceCard": "none"            }          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "get_record_by_table",          "args": {            "table": "person",            "id": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "answer": {              "table": "person",              "id": "00000000-0000-4000-8000-000000000201",              "data": {                "full_name": "Asha Rao",                "org": "Tin Factory",                "language": "en",                "contact_source": "manual",                "city": "Hyderabad",                "phones": null,                "emails": null,                "instagrams": null              },              "created_at": "<instant>",              "updated_at": "<instant>",              "deleted_at": null,              "byline": null,              "edited_by_person_id": null,              "edited_by_photo_key": null            }          },          "worker": {            "answer": {              "table": "person",              "id": "00000000-0000-4000-8000-000000000201",              "data": {                "full_name": "Asha Rao",                "city": "Hyderabad",                "language": "en"              },              "created_at": "<instant>",              "updated_at": "<instant>",              "deleted_at": null,              "byline": null,              "computed_unavailable": [                "reached_at",                "reach_90d"              ],              "edited_by_person_id": null,              "edited_by_photo_key": null            }          }        }      ]    },    {      "name": "merge refusals, asked by survivorId, duplicateId",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. The phone's refusal words differ from the Worker's for the same faults (same person, unknown id).",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Asha Rao",            "city": "Hyderabad"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Asha R",            "org": "Tin Factory",            "city": "Chennai"          },          "at": "2026-01-02T00:00:00.000Z"        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000201",            "duplicateId": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "survivorId and duplicateId are the same person"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "duplicateId must be a uuid"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "duplicateId": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000201",            "duplicateId": "00000000-0000-4000-8000-000000000999"          },          "rust": {            "refusal": "no person with id 00000000-0000-4000-8000-000000000999 (duplicateId)"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000999",            "duplicateId": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "no person with id 00000000-0000-4000-8000-000000000999 (survivorId)"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "survivorId": "not-an-id",            "duplicateId": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "refusal": "survivorId must be a uuid"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        }      ]    },    {      "name": "a person in the bin is not merged, asked by survivorId, duplicateId",      "why": "The two sides take different arguments: the phone's merge_people is { survivorId, duplicateId } (catalogue.rs), the Worker's { keep, merge } (catalogue.json), each refusing the other's spelling at its first check. The phone merges a duplicate that is in the bin (trashed_at set): it checks archived, not the bin; the Worker refuses it.",      "seed": [        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000201",          "data": {            "full_name": "Chitra"          }        },        {          "kind": "person",          "id": "00000000-0000-4000-8000-000000000202",          "data": {            "full_name": "Chitra K",            "trashed_at": "2026-01-03T00:00:00.000Z"          }        }      ],      "steps": [        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000201",            "duplicateId": "00000000-0000-4000-8000-000000000202"          },          "rust": {            "answer": {              "survivor": {                "id": "00000000-0000-4000-8000-000000000201",                "full_name": "Chitra",                "org": null,                "role_title": null,                "city": null,                "phones": [],                "emails": []              },              "duplicate": {                "id": "00000000-0000-4000-8000-000000000202",                "name": "Chitra K",                "archived": true              },              "repointed": {},              "deviceCard": "none"            }          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        },        {          "tool": "merge_people",          "args": {            "survivorId": "00000000-0000-4000-8000-000000000202",            "duplicateId": "00000000-0000-4000-8000-000000000201"          },          "rust": {            "refusal": "the survivor is archived — unarchive_person first, or pick the other one as survivor"          },          "worker": {            "refusal": "keep is required: the id of the person who stays"          }        }      ]    }  ]}