# Launch funnel feed

`GET /ops/funnel?from=<instant>&to=<instant>&cutoff=<instant>` is the read-only launch scoreboard for growth.
Use `Authorization: Bearer <X_OPS_TOKEN>`, the same operator credential as [X operations](https://app.flaghand.com/docs/x-ops), from 1Password
Trellis Agents `trellis-flaghand-x-ops`. Workspace tokens cannot read it; it cannot approve, schedule, post, connect
accounts or change billing. Every response is `Cache-Control: no-store`; only GET is accepted.

All three arguments are required ISO 8601 instants, including seconds and a timezone (`Z` or an offset). The event
window is **[from, to)**. Require `from < to <= cutoff <= now`; cutoff comparisons include equality. UTC normalization
makes the repeated hour at the November DST change unambiguous. Percentages below are returned as fractions, not
0–100 values. A zero denominator is **null (N/A)**, never a fabricated 0%.

Example (pipe the token into curl's configuration, never an argument or a saved file):

```sh
trellis-auth get trellis-flaghand-x-ops |
  python3 -c 'import sys; print("header = \"Authorization: Bearer " + sys.stdin.read().strip() + "\"")' |
  curl --fail-with-body --silent --show-error --config - --get https://app.flaghand.com/ops/funnel \
    --data-urlencode 'from=2026-11-06T00:00:00Z' \
    --data-urlencode 'to=2026-11-07T02:00:00Z' \
    --data-urlencode 'cutoff=2026-11-07T02:00:00Z'
```

Replace the opening instant with the actual launch date, not a planned date. The Nov 6 18:00 Pacific checkpoint is
`2026-11-07T02:00:00Z`. Nov 20 and Dec 6 reads likewise name their exact cutoff; do not silently move a cohort's
start if opening moves. Waitlist-only counts remain at `https://flaghand.com/api/waitlist/stats`; visits are not unique
people. Use `combined_unique_signups` below for de-duplicated first entries; do not add the separate waitlist and account
counts together as unique sign-ups.

## Population, joins and historical evidence

The unit is a billing **account**, not seats or workspace members. `accounts_workspace` and `accounts_waitlist` are
unique; public sign-up makes one account and one billing projection per workspace. This version of the product has one
current subscription per account, not several independently billable subscriptions. Trial dates and first payment are
the existing `entitlements` fields, not event-delivery counts. Duplicate Stripe webhooks cannot multiply them.

Only the live Stripe key is accepted. Test-mode projections, currently comped workspaces, linked `waitlist.is_test`
rows, reserved test domains (`example.com`, `example.net`, `example.org`, their subdomains, `*.test`, `*.invalid`),
the company's own addresses (its domains and plus-addressed company Gmail) and T-718's company live-check workspace are excluded. An account with no subscription yet (`livemode` null) is
included in the live site's account/onboarding counts. Operator-only workspaces without an account are not sign-ups.
Addresses are tested only inside SQL for reserved-domain classification, never selected or returned. The only waitlist
join is `accounts.waitlist_signup_id = WAITLIST.waitlist.signup_id`.

`0020_funnel_history.sql` versions the existing billing projection on completed writes of `updated_at`, with an initial
baseline and `meta['funnel:history_started_at']`. This is **observed-time** history: it preserves what the server knew at
cutoff, including after a later cancellation, rescission, restart or plan change. The server-created Stripe customer
association is versioned internally too; reads use the cutoff customer's invoices, plus earlier live customer associations
needed for the original paid cohort after a restart. No customer reference leaves the endpoint. It cannot invent state
from before this deployment, or move a late webhook observation backwards in time. Both `from` and `cutoff` must be at
or after the history baseline: a later cutoff cannot restore missing pre-baseline cancellation transitions. Invoice paid/refund times come from Stripe's
financial timestamps; a re-read can therefore reflect a late-arriving financial fact. Save the aggregate response at
each checkpoint with its extraction/coverage metadata, and label revised reads. Historical reports are not a substitute
for complete webhooks and the hourly reconcile.

Stripe reads are GETs only, scoped to each eligible account's server-created customer, subscription invoice parent and
Flaghand's configured monthly/yearly price IDs. Every invoice, invoice-line, invoice-payment and refund page is exhausted.
No raw Stripe response is persisted. Its restricted key needs Prices, Invoices, Invoice Payments and Refunds read.
Unrelated products, one-time lines, test invoices and future invoices are not money in this feed. A price that cannot
be interpreted, a prorated-only current paid period or an unsupported payment method produces Unknown, not guessed MRR.

Deletion intentionally erases accounts, events and projection versions, in accordance with the product's retention
policy, so a deleted account is in none of the counts. The retained billing records still show that it existed:
`coverage.deleted_accounts` counts the deleted external accounts (live or never reached Checkout; not comped, test mode
or the company live-check) whose workspace was created by cutoff and deleted at or after `from`. An account deleted
before `from` had nothing in the window and nothing at cutoff. Read every count, numerator and denominator as possibly
short by at most that number; print it beside the read, and don't claim a conversion rate is exact while it is above
zero. This feed does not extend personal-data retention.

## Envelope and coverage fields

- `generated_at`, `from`, `to`, `cutoff`: normalized ISO UTC timestamps; `generated_at` is extraction start.
- `livemode`: always true on success.
- `coverage.complete`: true only after all source queries succeed; no cached or partial success.
- `coverage.history_started_at`: first available observed billing projection baseline.
- `coverage.billing_state`: `observed_at` (not a claim about unreceived events).
- `coverage.stripe_pages_complete`: true only after all relevant pages finish, including nested lists.
- `coverage.reconcile_at`: latest hourly reconciliation attempt (ISO UTC).
- `coverage.reconcile_through`: Stripe event cursor, ISO UTC; the newest ten minutes are normally left to webhooks.
- `coverage.unprocessed_events`: live billing events through cutoff not processed; zero on success.
- `coverage.deleted_accounts`: deleted external accounts that could have counted in this read and are erased from it
  (see above); zero means no deletion touches this read.
- `coverage.attribution_unknown`: included accounts whose opaque waitlist link points to a missing row. These accounts
  remain in the account metric totals and the `unknown` source/video buckets; account UTMs are not a fallback.
- `coverage.first_entry_unknown`: those missing-linked-row accounts created at or after `from` (and through cutoff).
  Their first entry could have been inside the window, even if their account was created at or after `to`. A positive
  count makes `combined_unique_signups` null. An account created before `from` necessarily entered before the window,
  so its missing row affects attribution but cannot change this window's unique-entry count.
- `excluded`: counts of `comped`, `test_mode`, `company_live_check`, `waitlist_test` accounts created through cutoff.
  Categories are mutually exclusive, with company live-check, comped, test mode, then waitlist test precedence.
- `totals`: the metric object below.
- `by_plan`, `by_utm_source`, `by_source`, `by_launch_video`, `by_link_method`, `by_directory_via`, `by_agent_client`, `by_found_via`,
  `by_agent_name`, `by_oauth_client`, `by_user_agent_family`, `by_oauth_redirect_host`, `by_agent_auth`: arrays of
  `{value, ...metricObject}`. Every field has the same semantics and denominator as `totals`; a group with no eligible
  denominator returns null rates. Counts sum to totals; medians, rates and cohort ages must be recomputed from their
  denominators, never added or averaged between groups. Only observed groups appear; an absent bucket means zero accounts,
  trials and payers, not a missing read. These are independent margins, not their joint intersections.
- `combined_unique_signups`: the distinct first-entry object below, or null when its first-entry dates are unknown.
- `free_start`: `{granted, used_elsewhere, by_day}` over the same accounts and exclusions as `totals`: free-start credit
  grants made in [from, to), and workspaces refused one in [from, to) because their X account or owner's email address
  already had one. `by_day` lists `{day, granted, used_elsewhere}` for each UTC day with a nonzero count, ascending.

Coverage being complete means the source reads succeeded, not that deleted accounts or missing linked rows were
reconstructed. `coverage.deleted_accounts` and `coverage.attribution_unknown` apply to the video groups and combined
counts as well as existing metrics; always retain these disclosures when displaying or saving a read.

A malformed window is HTTP 400. A missing/failed source, unknown historical state, stale reconciliation or incomplete
Stripe pagination is HTTP 503, `{error: <fixed code>, coverage: {complete: false}, totals: null}`. No upstream error text,
SQL, IDs, emails or customer-provided strings are returned. Codes: `source_unavailable`, `live_billing_unavailable`,
`cutoff_not_covered`, `window_not_covered`, `customer_history_unavailable`, `stripe_page_incomplete`, `payment_schema_unsupported`,
`price_schema_unsupported`, `invoice_schema_unsupported`, `prorated_mrr_unavailable`, `paid_period_unavailable`,
`waitlist_unavailable`, `billing_events_unprocessed`, `billing_reconcile_stale`. The freshness check follows the existing
hourly reconcile and ten-minute settling period (plus one cron tick); it does not throttle or gate customer activity.
An absent cursor, a reconcile attempt older than 61 minutes, or a cursor older than 71 minutes cannot establish complete
source coverage. Unknown is not zero and must not trigger a pricing or growth verdict.

## Metric object (identical in totals and each group)

| Field | Definition |
|---|---|
| `accounts_created` | Accounts first created in [from, to). |
| `checkouts_started` | Accounts with a `checkout.started` event in [from, to), on either the subscription or a prepaid Checkout. |
| `subscribed` | Accounts with a `billing.subscribed` event in [from, to): a subscription they did not hold before, on a free start or paid. |
| `trials_started` | Accounts whose first `trial_started_at` falls in [from, to). A restart is not another trial. |
| `trial_cohort.mature` | Those first trials with original `trial_scheduled_end_at <= cutoff`, **including early cancellations**. |
| `trial_cohort.paid` | Mature accounts with `first_paid_invoice_at <= cutoff` and a positive settled Flaghand subscription invoice by cutoff, not fully refunded by cutoff. |
| `trial_cohort.immature` | First trials in the window not yet mature, including early-cancelled trials whose original end is still in the future, and trials with unknown scheduled end. |
| `trial_cohort.paid_share` | Paid / mature, null when mature is zero. Not lifetime conversion; this is right-censored at cutoff. |
| `trial_cohort.pending_payment` | Mature accounts without a net-positive settled invoice whose cutoff state is past_due, unpaid or incomplete. |
| `trial_cohort.min_days_since_end`, `max_days_since_end` | Smallest/largest fractional UTC days between mature trials' original scheduled end and cutoff; null for no mature trials. |
| `paying_accounts` | Accounts active in the cutoff projection, paid through cutoff, with a net-positive settled invoice covering that subscription/price/period. Trialing, unpaid, ended, delinquent and fully-refunded current periods do not qualify. An active Stripe status alone is insufficient. |
| `mrr[]` | `{currency, minor_units}` per lowercase ISO currency, no FX or combined total. Sum of eligible recurring invoice lines, net of discounts and exclusive of tax/one-time charges; year ÷ 12 (including interval_count). Values may be fractional minor units: round only for display. No $19 multiplier. |
| `cancellations.requested` | Distinct accounts with a cancellation request timestamp in [from, to). Rescinding it does not erase the original request. |
| `cancellations.requested_paid`, `requested_trial_only` | Requested accounts that had/had not paid a positive subscription invoice by the request time, respectively. An account with separate pre- and post-payment requests can occur in both subcategories; each headline account count remains distinct. A later refund does not turn paid churn into a trial-only exit. |
| `cancellations.ended` | Distinct accounts whose actual subscription service ended in [from, to); Stripe's `canceled_at` is a request, whereas our `entitlements.canceled_at` comes from its actual `ended_at`. |
| `cancellations.ended_paid`, `ended_trial_only` | Ended accounts with/without a positive invoice paid by actual end; same distinct/subcategory semantics as requested. |
| `cancellations.pending` | Accounts with cancellation still pending at cutoff, not actually ended; independent of the event window. |
| `cancellations.rescinded` | Accounts with a recorded cancellation rescission in [from, to). |
| `quality.payment_failed` | Accounts with a live `invoice.payment_failed` event in [from, to), distinct regardless of event duplicates. |
| `quality.delinquent` | Accounts past_due or unpaid in the cutoff projection. |
| `quality.refunded`, `fully_refunded` | Accounts with any succeeded refund / a fully refunded positive subscription invoice by cutoff. All-history quality flags, not refund counts or revenue deductions. Partial refunds do not change the recurring contractual MRR, but full refunds disqualify that paid invoice/period. A refund after cutoff is ignored. |
| `quality.zero_invoices` | Accounts with a paid $0 Flaghand subscription invoice by cutoff; never proves paid conversion. |
| `quality.unpaid_active` | Active accounts with no net-positive settled subscription invoice by cutoff, including fully refunded accounts; never counted as payers. |
| `onboarding.accounts` | Account-created cohort in [from, to); one account per workspace, so also distinct workspaces. |
| `onboarding.connected` | Cohort workspaces with a `connection.connected` event from account creation through cutoff. Repeated connections and later disconnections do not multiply or undo it. |
| `onboarding.approved` | Cohort workspaces with a first real `approval.created` from account creation through cutoff. An approval request is not an approval. |
| `onboarding.first_published_post` | Cohort workspaces with a `job.posted` audit event from account creation through cutoff. This is a **recorded** post, not independent proof of publication: it includes an owner's by-hand report, even if the owner later says it was not posted. A request, approval, inbox delivery or failed job does not qualify. Multiple recorded jobs count once. |
| `onboarding.awaiting_approval` | Cohort accounts without one by cutoff; censored, not a zero-minute approval. |
| `onboarding.median_minutes` | Median account-created → first approval minutes among approved accounts only; even samples average the middle two, empty samples are null. |
| `onboarding.under_5_minutes` | Cohort accounts with their first approval strictly under 5 minutes (exactly 5 does not qualify). |
| `onboarding.under_5_share` | Under-five accounts / all cohort accounts, including those still awaiting approval. |
| `onboarding.first_draft_recorded` | Cohort accounts with any `draft.created` by cutoff. |
| `onboarding.first_draft_token` | Cohort accounts whose **first** draft.created actor is token (not their account sign-up channel, approval-request actor, or most recent draft). |
| `onboarding.first_draft_token_share` | First-token-draft accounts / all cohort accounts. No draft is not silently dropped from the denominator. |

MRR uses the latest settled invoice's full recurring lines for the effective subscription price covering cutoff. Founding
first-year MRR is the discounted amount actually charged (for example 14900 / 12), not the undiscounted renewal price.
After its next full-price invoice, MRR follows that invoice. Inclusive tax is removed using Clover line `taxes`; invoice
`discount_amounts` are subtracted once. Prorations are never annualized as though they were full-period charges.

Groups use the **effective cutoff plan** (monthly/yearly/founding/unknown), falling back to the account's chosen plan
before subscribing. Source **and video** attribution use the linked waitlist row's first-touch fields when there is a
link; otherwise they use the immutable account first-touch fields for direct arrivals. The waitlist snapshot wins as
a whole, even when its source, campaign or content is blank. Never fill its blanks with later account UTMs. A missing
linked row is `unknown` for both groups, not `unattributed` and not a fallback to account UTMs.

Fixed source buckets: youtube, x, linkedin, mcp-directory, newsletter, hn, producthunt, reddit, tiktok, instagram,
connector, previewer, llms-txt, other (any other nonempty label), unattributed (a present row with no label), unknown
(a missing linked row).
Raw UTM strings can contain personal text, so they are never echoed. Link methods are invite, email_match, unlinked.
`by_source` is a separate first-touch margin: an observed campaign source takes precedence; otherwise a retained
external referrer is classified into fixed search, social or AI-service labels (`google`, `bing`, `duckduckgo`,
`chatgpt`, `claude`, `perplexity`, `gemini`, and the matching source labels above). An unrecognized host is
`other`, a blank is `unattributed`, and a missing linked waitlist row is `unknown`. The referrer host itself is never
returned, and this classification is not proof that a service recommended the product.

## Directory, agent and registration evidence

These breakdowns use the account's own stored attribution, not the linked waitlist's UTMs. They use the same eligible
accounts, event window, cutoff, billing exclusions and complete metric object as `by_utm_source`. In particular,
`accounts_created` and the three onboarding milestones refer to the **account-created cohort**, while trials and payers
retain their separate existing time semantics. Events at cutoff count, even when after `to`. Stages are not required to be
sequential: an account can connect before approval, or lack a retained earlier event. Missing, deleted or pre-migration
evidence is not reconstructed; the deleted-account coverage disclosure still applies.

- `by_directory_via` is the measured account `directory_via` tag; `by_found_via` is the agent's separate self-report.
  Neither proves that a directory actually caused the signup. A measured tag does not replace a self-report or vice versa.
- `by_agent_client` is MCP initialize's `agent_client_name`; `by_agent_name` is the separately self-reported signup
  `agent_name`. `by_oauth_client`, `by_user_agent_family`, and `by_oauth_redirect_host` are independent evidence from
  their corresponding account fields; none is substituted for initialize's client name or an identity proof.
  Client versions are not reported.
- `by_agent_auth` uses the earliest completed signup linked to the account by cutoff. `service_auth` means that
  signup recorded auth.md `service_auth`; `not_service_auth` means a linked signup has no agent_auth value; `unknown`
  means no linked completed signup is retained by cutoff, or it has an unrecognized value. These are workspaces, not
  counts of registration attempts. The separate signup reader below keeps its attempt-based unit.

To prevent names, secrets or other customer-supplied free text leaking into the report, only fixed recognized values are
returned; other nonempty values are `other`, and blank values are `unattributed`. Directory labels are `registry`,
`docker`, `cline`, `kilo`, `lobehub`, `mcpservers`, `cursor-directory`, `glama`, `smithery`, `pulsemcp`, `mcp-so` and
`t1977-test`. Recognized client and signup-agent labels are `claude`, `claude-code`, `claude-ai`, `claude-desktop`,
`codex`, `cursor`, `vscode`, `vs-code`, `visual-studio-code`, `gemini`, `gemini-cli`, `chatgpt`, `openai`, `openclaw`, `goose`,
`copilot`, `cline` and `kilo`. Recognized UA families additionally include `claude-user`, `chatgpt-user`,
`perplexity-user`, `node`, `node-fetch`, `python`, `curl` and `mozilla`; known OAuth hosts are `claude.ai`, `chatgpt.com`,
`openai.com`, `localhost`, `127.0.0.1` and `vscode.dev`. `found_via` recognizes these source, directory and client
labels plus `search`, `google`, `github`, `reddit`, `friend`, `referral`, `social`, `docs`, `website` and `auth.md`.
These fields are trimmed, case-folded and spaces/underscores are replaced by hyphens before matching. A self-reported
`MCP Registry` is grouped as `registry`. Unknown labels are
still counted, but cannot be named without a deliberate change to the fixed-label privacy contract; no label is rejected
at collection time. Account attribution fields and the signup's auth marker have no historical version timestamp, so
first-seen evidence recorded after a cutoff may change a later reread of the same window. Save the original read; don't
interpret it as a point-in-time snapshot of attribution.

## Launch-video account cohorts

`by_launch_video[]` has the same metric object as `totals`, including `accounts_created`, `trials_started`,
`trial_cohort` and `paying_accounts`. Its fixed `value` buckets are:

- `v1`, `v2`, `v3`, `v4`, `v5`: exact, case-sensitive `utm_campaign=flaghand_launch_nov2026` and matching `utm_content`.
- `other_campaign`: any other nonempty campaign/content combination, including an unrecognized or absent video in the
  launch campaign, or a video label without that campaign. Raw campaign/content values never leave the endpoint.
- `unattributed`: both campaign and content absent or empty on the effective first-touch row.
- `unknown`: a linked waitlist row is missing; counted in `coverage.attribution_unknown`.

These are acquisition-attributed **metric groups**, not a new restriction to accounts created in the window. As with
`by_utm_source`, accounts_created is in [from, to), trials_started is first trial in [from, to), and paying_accounts is
current paid service at cutoff. A person who joined before `from` can start a trial in the window or still pay at
cutoff. For mature trial conversion use `trial_cohort.paid / trial_cohort.mature` (the supplied paid_share, null for zero
denominator), not paying_accounts / accounts_created. The same exclusions, observed billing baseline, deletion caveat,
cutoff evidence, invoice/refund checks and completeness rules apply. Growth's `per_video_account_signups` can use
`by_launch_video` values v1..v5 and their accounts_created; trial and payer counts come from those same objects.

## Combined unique first entries

`combined_unique_signups` counts entry once across the two entry routes. It is an object with:

| Field | Definition |
|---|---|
| `total` | `waitlist_signups + direct_accounts`, distinct by the stored opaque account/waitlist link. |
| `waitlist_signups` | Non-test retained waitlist rows whose first acceptance `created_at` is in [from, to), excluding rows linked to an excluded account created through cutoff. A linked eligible account is not added again. |
| `direct_accounts` | Eligible accounts with **no** waitlist_signup_id, first created in [from, to). Pre-Checkout accounts are included. |
| `by_utm_source[]` | `{value, total, waitlist_signups, direct_accounts}` in the fixed source buckets above. Counts sum to this object's totals. |
| `by_launch_video[]` | The same count objects in the fixed video buckets above. Counts sum to this object's totals. |

A waitlist arrival counts at the waitlist's first acceptance, not at its eventual account creation, trial or payment.
Thus a waitlist entry before `from` followed by an account in the window adds **zero** first entries; an entry in the
window followed by an account after `to` adds **one**. A future account (after cutoff) is not read and cannot change the
waitlist's cutoff entry. Direct accounts use their account date and account attribution. Attribution for waitlist
entries comes only from their own first-touch snapshot. All comparisons use the same exact window and cutoff as the
billing feed; the feed still requires a covered billing window, even for these first-entry counts.

The waitlist binding must be readable even when there are no accounts. Test waitlist rows are always excluded.
A waitlist entry linked through accounts.waitlist_signup_id to a company live-check, comped, test-mode or waitlist-test
account created through cutoff is excluded along with that account. `excluded` remains **account** counts, not counts
of standalone waitlist tests. No reverse waitlist.account_id or email join is used. An unlinked waitlist row and an
unlinked account are distinct stored entries even if an address happens to match: the feed never guesses identity or
claims to recognize the same person across different addresses. De-duplication is only as complete as the saved link.

If coverage.first_entry_unknown is positive the entire combined_unique_signups field is **null**, not a partial total
or a guessed first date. Existing account metrics still return, with unknown attribution disclosed. Zero known entries
returns `{total: 0, waitlist_signups: 0, direct_accounts: 0, by_utm_source: [], by_launch_video: []}`; no ratio is fabricated.
Only nonzero entry groups appear. If an account is deleted, its direct entry and account metric history are erased;
a retained waitlist row still counts as its own first-entry evidence. coverage.deleted_accounts bounds potentially
missing entries just as it bounds missing account counts; never claim an exact unique-person total while it is nonzero.

## Anonymous MCP initialize probes

Unauthenticated `initialize` requests with a client name increment `mcp_probes` by UTC day and fixed client label;
unknown names become `other` before storage. A failed best-effort write never blocks the 401 OAuth challenge. These are
requests, not unique clients or signups, and may include repeated probes. Read counts only from a company-authenticated
clone, separately from account and human visit totals:

```sh
npx -y wrangler@4.156.0 d1 execute post-scheduler --remote --config scheduler/wrangler.jsonc \
  --command 'SELECT day, client_name, count FROM mcp_probes ORDER BY day, client_name'
```

No raw client name, version, IP, workspace, token or other request metadata is stored in these global counts.

## Agent sign-up steps (operator reader)

`tools/funnel.mjs` also reads sign-up progress directly from the app's D1 `DB` binding. This is an independent
`signups` section in the operator command, **not** an extension of the live-only HTTP feed above. Run it alone on
Node 24 from a company-authenticated clone:

```sh
node tools/funnel.mjs --signup-only \
  --from 2026-10-26T00:00:00Z --to 2026-10-26T18:30:00Z --cutoff 2026-10-26T18:30:00Z
```

Supply actual past instants. The cohort is **retained successful startSignup attempts** first stored in `[from, to)`;
all later steps are reached at or before `cutoff`, including after `to`. Each attempt counts at most once per step,
regardless of repeated Checkouts, webhook deliveries, connections, approval requests or approvals. A retry that creates
another signup row is another attempt, not another person. An existing account's events before that attempt do not
count. Closed/rejected startSignup calls create no row: zeros before launch mean no accepted starts, **not** no demand.

`signups.totals` and every `signups.by_via.api`, `.oauth`, `.desk` object contain these fixed count fields, including
explicit zeros for empty channels after a successful read:

| Field | Stored evidence |
|---|---|
| `startSignup` | `signups.created_at` in the cohort window; unfinished and expired attempts remain in the denominator. |
| `passkey_added` | `signups.completed_at <= cutoff` with a retained linked account. |
| `claimed` | `signups.claimed_at <= cutoff` with that account: the starting agent collected its token. This is separate from enrollment. |
| `checkout_started` | At least one `checkout_sessions.created_at` for the linked workspace between the attempt's start and cutoff, in the population's Stripe mode. This is not completed Checkout. |
| `trialing` | A retained `entitlement_versions` observation through cutoff records `trial_started_at` between the start and cutoff in the population's Stripe mode. It counts reaching a trial even if the trial later ends; not current trial status or payment. |
| `first_connection` | At least one `connection.connected` event between the attempt's start and cutoff. A later disconnect does not undo reaching this step. |
| `first_approval_request` | At least one `draft.approval_requested` event between start and cutoff. An agent may request it. |
| `first_approved_post` | At least one real `approval.created` event between start and cutoff, after the owner's passkey. **Not** a request and **not** a successfully published job. |
| `first_published_post` | At least one trigger-written `job.posted` event between start and cutoff; repeated jobs count once per attempt. This includes owner-reported by-hand posts, even if later retracted, and is not independent proof of publication. |

Channel attribution is the stored first-start channel: `signups.via=api` → `api`; other browser starts with
`utm_medium=oauth` (the existing OAuth sign-up link's tag) → `oauth`; remaining public browser starts (`via=web`) →
`desk`. This is acquisition attribution, not a claim about who later clicked Checkout or connected a social account.
An API start stays `api` after its owner opens the browser link. UTMs are supplied attribution, not an identity proof.
These steps are not a strict sequence: OAuth/desk may never claim an API token, and connecting can precede Checkout.
`signups.by_directory_via` and `signups.by_agent_client` are separate attempt-based margins with the same steps; they
classify the linked account's first-seen evidence (or the signup's if there is no account yet) into the fixed privacy-safe
labels above. Unrecognized input counts as `other`; no raw client name or tag leaves D1. Attribution fields have no
historical version time and may be added after cutoff, so save the original result rather than treating a later reread
as a point-in-time snapshot.

Production is labelled `population: production_external`. SQL excludes operator starts, comped accounts, test-mode
accounts, the company live-check workspace and the exact case-insensitive synthetic harness address pattern
`^accounts\+test-fa-[0-9a-f]{6}@trellisbyte\.com$`. Only an SQL boolean tests the address; no email, ID, free-form UTM,
raw event or customer row is returned to the process. `excluded.harness`, `.internal`, `.non_harness` are attempt
counts, not account counts. Harness matching takes precedence over internal exclusions, then internal over external.

For the isolated rehearsal, use `--signup-only --rehearsal-config /absolute/path/to/scheduler/rehearsal/wrangler.jsonc`
with the same window arguments. It reads only that config's `DB`, counts **only** the exact harness pattern, expects
test-mode Checkout/trials and labels output `rehearsal_harness`. No live Stripe or production waitlist read is made.
Use the actual harness batch window and save the response before a rehearsal reset.

A successful section has `complete: true` and `unit: retained_signup_attempt`. Missing/failed SQL, malformed aggregates
or a linked completed account without an observed billing version by cutoff yield `complete: false, totals: null,
error: signup_unavailable` and process exit 1. Other independent sections may still succeed. This is a source-read
check, not a customer gate. Deletion erases attempts and their history (`coverage.deleted_signups: not_reconstructable`);
blocked starts are `coverage.blocked_starts: not_recorded`. These are explicit coverage gaps, not measured zeros.
Current comped classification and deletion can revise a later rerun; preserve each dated checkpoint. Do not add these
attempts to waitlist/account unique-entry totals or call them unique people.

## Spec event mapping

The early-access spec's onboarding list uses conceptual names; use the actual code's evidence:

| Spec | Code / evidence |
|---|---|
| account.created | `accounts.created_at`; `events.action = account.created` also logged |
| trial.started | first `entitlements.trial_started_at`; `events.action = trial.started` |
| connection.created | `events.action = connection.connected` |
| token.created | `events.action = token.created` |
| draft.created | `events.action = draft.created`, with `actor_type` user or token |
| approval_request.created | `events.action = draft.approval_requested` (not owner approval) |
| approval.created | `events.action = approval.created` after the passkey, not the request |
| job.posted | `events.action = job.posted` written by the `jobs_outcome_event` / `jobs_insert_outcome_event` triggers when a job reaches `posted`; event time is `jobs.updated_at`. |

Fixture coverage is in `tests/ops-funnel.test.mjs`: exact windows/DST, missing attribution, linked waitlist precedence,
company/test exclusions, duplicate live webhooks, early-cancelled mature and immature cohorts, late conversion, annual
and founding discounts, zero/failed/refunded invoices, refunds after cutoff, onboarding censoring, historical cancellation
and rescission, fully refunded renewals after earlier payments, pre-baseline windows, deleted accounts (disclosed, not counted),
Stripe customer replacement, pagination failures, stale reconciliation, secret-free failures and authorization. Video and
first-entry fixtures cover v1..v5, waitlist snapshot precedence (including blank fields), fixed safe fallback buckets,
opaque-link de-duplication, different waitlist/account windows, exact edges, standalone waitlist tests, linked exclusions,
missing-row nullability, pre-Checkout arrivals, unavailable waitlist reads and read-only/no-email SQL. No real account is
approved, posted, billed, refunded or changed by these tests or this feed.
