Architecture Note · Operations & RevOps
Deterministic B2B Attribution & PLG Upgrade Scoring: Rolling 14-Day PQA Signals and Conflict-Safe AE Handoffs
Why prompting an LLM over raw product logs breaks RevOps trust—and how explicit scoring rules, local SQLite persistence, and HTTP 409 handoff gates keep pipeline math auditable.
The Problem: High-Intent Self-Serve Accounts Lost in Noise and Double-Touches
Product-led growth teams track thousands of free and trial workspaces across seat invites, SAML/SSO setup, API key creation, quota warnings, and executive signups. Yet VP Growth, Demand Gen, and Product-Led Sales leads still argue over two basic questions: which workspaces are genuinely ready for an enterprise upgrade, and which marketing touchpoints—LinkedIn, Search, Events, or Docs—earned the pipeline credit. Without unified scoring and handoff suppression, high-value trials stall in self-serve limbo or get pinged twice by overlapping Account Executives.
Why Naive AI Wrappers Fail in Revenue Operations
Dropping product telemetry and CRM touchpoints into a generic LLM prompt fails production RevOps along four concrete fault lines:
- Nondeterministic scoring and silent drift: Asking a model to rank account readiness produces shifting scores on identical event streams as weights, context truncation, or prompt phrasing vary—making quarterly conversion comparisons impossible.
- Hallucinated attribution math: Language models approximate positional credit splits unevenly when journeys vary in length, breaking exact sum-to-one revenue reconciliation across multi-touch deals.
- Data egress from raw telemetry uploads: Shipping customer actor emails, workspace domains, and commercial ARR figures to external endpoints creates unnecessary privacy exposure when deterministic computation can stay local.
- Uncontrolled outbound routing and zero auditability: Auto-dispatching sales tasks without cooldown checks, domain-level conflict detection, or tamper-evident logs causes duplicate AE outreach and unattributable overrides.
The Deterministic Architecture That Fixes It
Our shipped architecture separates deterministic telemetry math, multi-touch credit allocation, and human-gated sales routing inside an isolated FastAPI and SQLite WAL-mode service verified by 12 pytest tests across five test modules, protected by tenant-scoped SHA-256/HMAC invite tokens and a 60-second sliding-window rate limiter in auth.py:
- Rolling 14-day PQA scoring with stale-event exclusion:
POST /api/events/productaccepts JSON batches or CSV/JSON uploads, storing ephemeral files with0600permissions and an automated 1-hour (3600s) wipe loop while keeping only SHA-256 digests. Inpqa_scoring.py, events older than 14 days are strictly excluded (included_in_window = 0), and active signals receive a bounded recency factor across seat velocity, SSO/API setup, quota saturation, executive domain signups, and feature adoption to output reproducible activation, expansion propensity, and composite tier scores. - Reproducible multi-touch attribution with zero-key local execution:
POST /api/attribution/computesorts touchpoints chronologically and applies exact positional weights forfirst_touch,linear,u_shaped, andw_shaped(30/30/30/10) models inattribution.py, correcting rounding drift so channel shares sum to1.0. Executive summaries default toOfflineDeterministicAdapter, requiring zero external API keys or outbound telemetry egress unless an OpenAI-compatible endpoint is explicitly configured. - Cohort expansion lift and formula-safe CSV export:
GET /api/funnels/cohortsaggregates conversion rates, CAC payback months by channel, and milestone expansion multipliers—flagging activation milestones that deliver at least2.0x90-day expansion lift—whileexport_cohorts_csvneutralizes OWASP CSV formula prefixes (=,+,-,@) in RFC 4180 output. - HTTP 409 duplicate-outreach suppression and SHA-256 audit chain:
POST /api/pqa/{id}/handoffchecks active AE owners, cooldown windows, and sibling workspaces sharing the same normalized domain. Any duplicate or cooldown conflict fails closed with HTTP409 Conflictuntil a Sales-Ops or AE lead supplies explicithuman_signoff_byandoverride_reasonfields. Every ingestion, attribution run, suppression, and override appends to an immutable SHA-256 hash-chainedaudit_logstable verifiable viaGET /api/audit/logs.
Operational Takeaway
Revenue and growth teams do not need probabilistic guesswork to score upgrades or allocate channel budgets. By binding rolling 14-day telemetry rules, exact attribution splits, OWASP-safe exports, and HTTP 409 human sign-off gates to a hash-chained local store, PLG organizations get fast sales-assist routing without sacrificing reconciliation or governance.