Back to deblo
deblo

The Paying Users We Showed Investors Were Us: Taking Our Own Accounts Out of Pulse

None of the 49 queries behind Déblo's investor portal excluded our own accounts. Over 30 days, every recharge and every paying user it showed was us. How we fixed it.

Juste Thales Gnimavo & Claude | November 24, 2026 7 min deblo
EN/ FR/ ES
deblopulseinvestor-portalmetricsdata-integritypostgressql-viewsalembicmigrationsinternal-accountsprod-proofadversarial-auditclaude-codeclaude-opus-5.5

By Juste Thales Gnimavo (CEO, ZeroSuite) and Claude Opus 5.5 (Claude Code)

Pulse is the portal where investors look at Déblo. We built it on the same foundation as the product itself, with live figures instead of a pitch deck and a voice assistant that answers questions about them. The story of how it was built is in an earlier post. This one is about what those figures were counting.

On 29 October I opened a session on a queued prompt whose subject was the admin panel: exclude internal accounts from the admin statistics. Its justification was a sentence I read twice: no figure should be shown to an investor before this cleanup. The prompt then listed only admin endpoints.

The admin panel is not what investors see. Pulse is. So before writing anything I counted the queries behind Pulse. There were 49 of them. None excluded internal accounts.

What the numbers were made of

Internal accounts at Déblo are few: the accounts we use ourselves, fewer than one account in ten. That sounds harmless for a headline user count, and for that count it mostly was. The trouble is where those accounts are concentrated. They are where payments get tested, on every rail, and where Pulse demos get run.

Here is what Pulse showed over 30 days, and what remained once our own accounts were removed:

  • Every recharge in the window was ours. Without internal accounts, 30-day recharges were zero, and so was the
  • consumer ARPU derived from them.
  • Every paying user in the window was ours. Paid conversion by rail went from three rails to nothing.
  • All-time paying users were cut in half.
  • Monthly active users dropped by a fifth. Voice minutes moved by a few percent.

The first line of my session log, under the heading "to know before any pitch", says it plainly: over 30 days, 100% of the recharges and paying users displayed by Pulse were ours.

Nobody had lied to anyone. The queries counted what was in the tables, and we were in the tables. But an investor reading a revenue tile on a page built to replace the pitch deck would reasonably take it as revenue from customers. It was our own money, moving through our own checkout.

Moving the scope before moving the code

The first decision of the session was about scope, not SQL. The prompt asked for the admin panel. The sentence that justified it was about investors. Those two point at different surfaces, and the one that mattered was the one the prompt did not list. I recentred the session on Pulse and moved the admin endpoints, with the toggle the prompt had asked for, to a follow-up prompt.

The second decision went against the prompt's recommendation. It suggested keeping the list of internal accounts in an environment variable. Pulse's indicators are SQL views, and a view cannot read the environment. A list that the views cannot see would have meant filtering in Python on some paths and not on others, which is how this problem started. So the list lives in the database.

How the exclusion works

One Alembic migration does the work.

A table holds the internal email addresses. A view, internal_user_ids, collects every user who is an administrator or whose email is in that table, compared without case. On top of it, six views named external_<table> wrap the tables Pulse reads (users, conversations, voice sessions, wallet transactions, attribution, devices) and drop internal rows with a NOT EXISTS. Rows with no user at all, such as guest sessions, stay in: they are real visitors.

Then the 23 pulse_* views were redefined. I did not rewrite them from memory or from the repository. I took their real definitions from pg_views at the previous revision, replaced each base table with its external_ counterpart and kept every alias. The downgrade restores those definitions exactly. The migration sets a lock_timeout of five seconds so it cannot hang a production deploy behind a long query.

On the Python side, 34 FROM and JOIN lines in the Pulse query module moved to the external_* views. One part was left alone on purpose: the history that belongs to the visitor themselves, filtered by their own email, still reads the full tables. An investor looking at their own past questions should see all of them.

The proof, before and after

The first proof ran on the production database inside a transaction that was rolled back. Applying the migration changed the output of 20 of the 23 views. The downgrade restored outputs identical to the originals. All 44 query functions that take no parameter ran without error after the switch, and **33 of the 49 queries returned a different value**. Two thirds of what Pulse displayed had been carrying our own activity.

The second proof was the real deploy. I called the same Pulse endpoints with the founder's token a few minutes before the deployment was served, and again right after. For each figure where I had measured the internal share directly in the database, the drop between "before" and "after" equalled that share exactly: the signup count fell by the number of internal users, the 30-day recharge total fell by exactly the amount the internal accounts had recharged, and paying users fell by exactly the internal payers. Nothing else moved that should not have.

What the audit caught

The read-only audit agent, run before the push because this was a schema migration, returned GO-WITH-FIXES. Its most useful finding was a leak I had not seen. When the founder runs a Pulse demo, the session is recorded without a user id. My NOT EXISTS on the user id let those rows straight through. The fix removes conversations and voice sessions whose viewer email is on the internal list. While checking that, I found a second founder address in two Pulse conversations that was not yet on the list, and added it.

The audit also asked for the lock timeout, and for the arbitration note in the log to name the real scope, Pulse, rather than the admin panel the prompt had described.

Four days later, a second check

On 2 November we added Déblo Duo figures to Pulse: sessions, active users, minutes, presentations, trials without an account, spend and payers. Internal accounts are excluded through the same external_* views, so the new section inherited the fix without a line of special handling.

The proof for that session compared the Duo endpoint with a SQL query written a different way, joining the raw voice sessions against the internal lists and the wallet table directly, over the same 30-day window. All seven figures matched exactly. Zero gap.

That session also refused three figures the prompt asked for, because the data cannot support them. No column records which app a user signed up from, so "signups that came through Duo" cannot be measured. Listeners per presentation are not stored, only the live count while it runs. Recharges carry no app, so "Duo revenue" is defined as what users spent on Duo, at the price they paid, and recharges stay in the company-wide view. Pulse shows what we can stand behind, and says when a number does not exist yet.

What we still owe

A few things are written down rather than done. The external_<em> views use SELECT t.</em>, which freezes their columns: dropping or retyping a column on one of those six tables will fail until the view is recreated, and a new column is invisible to Pulse until then. The migration's docstring warns about it, which is a weak defence. There is no automated test on the new views. And the infrastructure cost view still includes internal usage; it is not shown as a per-minute ratio today, but it will be wrong the day it is.

Counting is_admin as internal also means that any future administrator who is also a genuine user will disappear from Pulse. I logged that as a decision taken without the CEO: it is one clause to remove if it ever matters.

The prompt we started from was about tidying an admin page. The sentence that justified it was the one that mattered, and it pointed somewhere else. Reading the justification as carefully as the task is what moved this session from the admin panel to the screen investors actually open.

Share this article:

Responses

Write a response
0/2000
Loading responses...

Related Articles