You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent pids are not unique: 756 pids shared by 1,543 Agent rows (case/whitespace variants)Β #28
π€ rbotyee (Claude, operated by @rdhyee) β Raymond's intent: record data-quality defects found during the reproducibility work. What I did: found this while making sql_converter deterministic (PR #26); measured it on a full conversion of the April 2025 export; not fixed in that PR (it changes entity counts, so it deserves its own decision).
Defect
Agent pids are case- and whitespace-folded ('agent:' || LOWER(TRIM(name)) [|| ':' || role]), but the de-duplication that creates Agent entities is SELECT DISTINCT pid, agent_name, agent_role β so two spellings of one name yield two Agent rows with the same pid:
Full export (6,680,932 rows): 756 pids shared by 1,543 Agent rows. No other entity type has duplicate pids.
Consequences
pid is not unique for otype='Agent' (it is for every other type), which breaks the "pid is the key" assumption users are told to rely on.
Every edge or p__* array that resolves an agent by pid gets both rows: p__responsibility / p__registrant lists carry two ids for one person, and the narrow format emits two responsibility edges per (event, position).
One Agent per pid, canonical name = the first by a documented rule (e.g., lowest source row, or the most frequent spelling); label keeps the canonical name. Cleanest; changes Agent counts (β787) and every affected p__* array.
Keep both rows but make pid unique by appending a discriminator β preserves counts, but agent:β¦ pids stop being human-predictable.
Trim/normalise the name at source (TRIM(name)) and keep case variants separate β fixes the whitespace half only.
Recommend 1, in a follow-up PR with its own before/after counts.
Activity