Skip to content

feat(attribution): track agentic signup and workflow outcomes - #8558

Closed
waleedlatif1 wants to merge 3 commits into
stagingfrom
codex/freebuff-agentic-attribution
Closed

waleedlatif1 wants to merge 3 commits into
stagingfrom
codex/freebuff-agentic-attribution

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Extend auth, workflow completion, and the durable outbox with encrypted Freebuff agentic attribution for new accounts and successful deployed workflow runs.
  • Capture browser tokens before analytics load and queue the proposed CLI handoff after authenticated approval, with account-bound background retries that do not block login. Keep tokens out of browser URLs and CLI configuration; preserve platform scope through signup.
  • Preserve billed workflow completion when attribution fails and recover conversion events through an indexed durable queue and retained capture history, including after deployment-version deletion. Keep display conversions separate and align transient retries with the documented policy. Require deployment, CLI release, partner procedure review, and real signed-token verification before activation.

Type of Change

  • Feature
  • Bug fix

Testing

Seventeen real PostgreSQL/Redis integration checks pass against both schema push and the full migration history, including production Better Auth signup/session hooks, admin exclusion, approval claims, account-bound retries, stale-capture rejection, and billed completion recovery. Negative controls reproduce stale capture, cross-account claiming, approval failure, and delayed recovery regressions; JSON artifact at apps/sim/test-results/integration.json. All 349 root script tests and all 19 workspace tasks pass with bounded workers, including 34,597 application tests. Focused auth, CLI, execution logging, and outbox suites; app, CLI, and database type-checks; lint; all 57 audits; migration safety; docs manifest and block registry checks. Live partner handoff and deployed OAuth verification remain rollout gates.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 2, 2026 7:50am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 27 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/lib/analytics/freebuff-agentic/service.ts
Comment thread apps/sim/lib/analytics/freebuff-agentic/outbox.ts Outdated
Comment thread packages/sim-cli/src/auth/freebuff.ts Outdated
Comment thread apps/sim/lib/logs/execution/logger.ts Outdated
Comment thread apps/sim/lib/analytics/freebuff-agentic/handoff.ts Outdated
Comment thread apps/sim/lib/auth/auth.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[High risk] Adds database schema and new analytics tracking for signup attribution.

The PR does not appear safe to merge until CLI approval is independent of attribution failure and recovery preserves conversions across attribution changes.

Findings

  1. P1 Attribution can interrupt CLI approval ▶
  2. P1 Recovery can discard conversions ▶

Summary

The PR adds encrypted Freebuff attribution across browser capture, authenticated CLI approval, signup, deployed workflow completion, and durable outbox delivery. Since the prior review it adds account-bound handoff retries and a recovery queue for attribution failures. The new approval ordering can interrupt CLI login, and recovery can discard a conversion after attribution changes.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI[CLI handoff token] --> Redis[Redis claim]
  Redis --> Bind[Bind account attribution]
  Bind --> Approval[Create CLI approval]
  Run[Completed deployed run] --> Enqueue[Enqueue conversion]
  Enqueue -->|failure| Marker[Durable recovery marker]
  Marker --> Recovery[Re-read account attribution]
  Recovery --> Outbox[Conversion outbox]
Loading

Reviews (3) · Last reviewed commit: "fix(attribution): recover failed deliver..."

Comment thread apps/sim/app/api/attribution/freebuff/route.ts Outdated
Comment thread apps/sim/app/api/attribution/freebuff/route.ts Outdated
Comment thread apps/sim/lib/analytics/freebuff-agentic/attribution.integration.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/analytics/freebuff-agentic/handoff.ts Outdated
Comment thread apps/sim/lib/logs/execution/logger.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 28 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/analytics/freebuff-agentic/auth.integration.ts Outdated
Comment thread apps/sim/lib/analytics/freebuff-agentic/service.ts
Comment thread apps/sim/app/api/attribution/freebuff/route.ts
Comment thread apps/sim/lib/analytics/freebuff-agentic/handoff.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/app/api/cli/auth/approve/route.ts
Comment thread apps/sim/lib/analytics/freebuff-agentic/recovery.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 34 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/lib/analytics/freebuff-agentic/recovery.ts
Comment thread apps/sim/lib/analytics/freebuff-agentic/landing.integration.ts
Comment thread apps/sim/lib/analytics/freebuff-agentic/service.ts
Comment thread apps/sim/app/api/cli/auth/approve/route.ts
Comment thread apps/sim/lib/logs/execution/logger.ts
Comment thread apps/sim/lib/logs/execution/completion-ledger-order.integration.ts

This branch was successfully deployed

1 active deployment
Preview — efdbe71b Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant