Tracker mapping first party wrong attributions

Merged
CO
6mo ago
+1548-65
  • too many update methods in coredata?
  • comments in sql queries?

Summary by cubic

Adds a FIRST_PARTY verdict to the tracker‑pattern catalog and hardens mapping to stop wrong vendor attributions from spreading. Trusts only high‑confidence rows, requires concrete evidence, and adds proboctl tools to curate, audit, upsert, and mark verdicts; tests and seeds updated.

Coredata +241 -33

  • Added CommonTrackerPatternAttribution enum and attribution column with migration/backfill.
  • Upsert preserves FIRST_PARTY (rows stay vendor‑free), skips enrichment requeue for FIRST_PARTY, and keeps verdicts in sync with vendor links; removed inline SQL comments.
  • New helpers: RelinkCommonThirdPartyByIDs sets THIRD_PARTY/UNDETERMINED; SetAttributionByIDs marks rows; filter adds .WithAttribution.

Service +259 -26

  • Deterministic adoption only when confidence ≥0.9; FIRST_PARTY short‑circuits and clears any stale org link; skip agent for PRE_EXISTING patterns.
  • Agent adds evidence_source and is_first_party; rejects attributions without concrete evidence; corroborating a prior low‑confidence vendor promotes it to trusted.
  • Prompt updated with evidence rules and first‑party guidance.

proboctl +417 -3

  • New commontrackerpattern upsert keyed by natural key; honors FIRST_PARTY; normalizes verdicts on link/unlink (THIRD_PARTY on link, UNDETERMINED on unlink); optional --enrich.
  • New commontrackerpattern mark-first-party to record the verdict and remap uncategorised org patterns; list adds --attribution and shows “Verdict”; show displays verdict; seeder sets THIRD_PARTY when a vendor exists.

Tests +595 -3

  • Coverage for terminal first‑party behavior, trust‑gated adoption, evidence gating, and helper logic; e2e seed inserts UNDETERMINED attribution.

Agents +36 -0

  • Cursor rule documenting migration timestamp naming and SQL SQL‑header requirements.