← Back to Pull requests

Run Lively Pro paywall experiments and keyword analytics in house #31

Open
iangcarroll opened this pull request with 3125 lines diff across 109 files
View on GitHub
iangcarroll iangcarroll commented on Nov 29, 2026 04:00 UTC
Author

Native offerings

Lively's broker assigns installations to three variants. A offers yearly and monthly. B offers a seven-day yearly trial and monthly. C offers the same yearly trial and weekly. StoreKit and Play Billing provide prices, renewal periods, offer eligibility and checkout. The mobile strings cover all 14 supported locales.

Experiment operations and reporting

Paywall managers can create weighted three-arm experiments, target platform, placement or a verified Apple Ads keyword, preserve existing assignments during a pause and roll out a selected offering. The initial experiment starts paused. Analysts can compare the unique-install funnel, verified 14-day conversion and gross receipts by currency. The keyword summary compares paid leaders with the highest observed gross per mature installation in each storefront currency. A 60-day view shows repeat payments, billing issues, canceled renewals, refunds and expirations. Per-assignment store references keep late events attributed to their original experiment.

Daily free listening time

Hosted live translation defaults to five minutes per installation signed out and 30 minutes per account signed in, resetting at midnight UTC. Signing in carries today's anonymous listening from this device into the account budget shared across devices. The broker returns the assigned allowances without consuming time. It reserves bounded, single-use connections atomically, releases failed grants, and supplies the exact connection cap to Soniox. Unused time at the end of a short connection can remain reserved. Free clients request keys on demand. Reaching the Lively-funded live translation allowance opens Pro. The paywall shows the free viewer’s own assigned minutes on both entry paths. Read-aloud retains independent provider budgets and does not enroll playback-only users in allowance reporting. On-device translation, personal provider keys and typed translation spend no live allowance.

Managers can start and end a separate weighted allowance A/B test in Paywalls. Overview reports distinct listeners and the proportion reaching the limit by treatment and sign-in state. The quota experiment starts inactive.

Verification

  • Worker typecheck, 253 Worker tests, six script tests, staff Worker dry-run and localization checks.

  • 19 iOS unit tests cover the StoreKit catalog, purchase, restore, refund and existing behavior. Six iPhone UI tests exercise each offering, plan switches and demo checkout.

  • 251 Android unit tests and emulator checks covering sign-in, daily limits and checkout. Apple-silicon macOS build with signing disabled.
  • Release state

    Ian approved the three native paywalls, renewal disclosures, seven-day annual trial, $2.99 US weekly price, staff experiment controls and report, and the revised public privacy and subscription terms. Ian also approved the allowance screens, staff controls, report and public copy as shown. Ian approved the simplified paywall subtitle and its placement for both sign-in states. Apply migrations 0011 and 0012, configure the store products and trial, register production Play version codes, verify Play push delivery and authorize staff before paywall enrollment. Coordinate the broker cap change with the native release because older apps contain the previous limits in their copy. No store settings or production allocations were changed. The broker README covers setup. The capability map in AppStore/paywall-platform.md distinguishes this native experiment release from broader billing-platform parity.

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Medium Risk

    Changes monetization, usage limits, and broker key flows that gate live translation, with coordinated server release required; UI/copy is low risk but incorrect allowance or paywall assignment would affect revenue and free-tier behavior.

    > Overview

    Replaces fixed “1–2 hours free” messaging and a static yearly/monthly paywall with broker-driven daily minute allowances and server-assigned subscription offerings.

    > Free tier: New FreeAllowance is fetched from POST /v1/allowance and surfaced in Account, Settings, and Pro copy. The key broker returns allowance policy with keys and when free live time is exhausted; SonioxKeyProvider only maintains spare keys for Pro, while free users request keys on demand. App Store listings and localized strings shift to dynamic minutes instead of hard-coded hour counts.

    > Lively Pro paywall: Paywall calls POST /v1/paywall for plan assignment (control yearly/monthly vs experiment variants with 7-day yearly trial and weekly plan), logs view/checkout/received events via install paywallID, and wires purchase appAccountToken to experiment references. StoreKit catalog adds yearly_trial and weekly products; ProView shows trial badges, “Start free trial,” and placement-specific subtitles from the user’s allowance.

    > Supporting changes: App privacy metadata notes Pro offer impressions/checkout; new paywall-platform.md documents first-party monetization scope; minor transcriber handling for temp_api_key_session_expired; DEBUG account/allowance preview hooks.

    > <sup>Reviewed by Cursor Bugbot for commit 4d5a1f079227daa667c8024f3a3582d303add212. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    Diff: 3125 lines (+2627 / -498) across 109 files Reviewer: cursor[bot] Review duration: 62m
    All Vouch review confidence checks passed
    Residual risk 0.36 = Change Risk (0.95) × (1 − Review Confidence (0.62)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.95 · 3125 lines diff across 109 files
    0.95
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.50 · 5 substantive comment(s)
    0.50
    Model 3 · Review Timing & Attention
    Session adequacy: 80% · Reviewer familiarity: 35%
    62%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Sensitive Paths sensitive_paths
    0.095
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    11 items
    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:13 UTC
    Code Review
    Lively/Model/Paywall.swift:1
    @@ -0,0 +1,51 @@
    +import Foundation
    +
    +/// The broker returns an ordered offering. StoreKit remains authoritative for
    +/// price and eligibility. Without both products the existing paywall still works.
    +struct Paywall: Decodable {
    +    let experiment: String?
    +    let plans: [String]
    +    var reference: UUID? = nil
    +
    +    static let control = Paywall(experiment: nil, plans: ["yearly", "monthly"])
    +    static let catalog = ["yearly", "monthly", "yearly_trial", "weekly"]
    +    static let prefix = "hk.cautela.lively.pro."
    +
    +    static func request(_ action: String, placement: String, reference: UUID? = nil, eligible: Bool = false, currency: String? = nil) async -> Data? {
    +        guard let broker = SonioxKeyProvider.brokerURL, let id = AppleAdsAttribution.shared.paywallID else { return nil }
    +        var request = URLRequest(url: broker.appending(path: "v1/paywall"))
    +        request.httpMethod = "POST"
    +        request.timeoutInterval = 3
    +        request.setValue(id.uuidString, forHTTPHeaderField: "Lively-Paywall-ID")
    +        #if os(iOS)
    +        request.setValue("ios", forHTTPHeaderField: "Lively-Platform")
    +        #else
    +        request.setValue("macos", forHTTPHeaderField: "Lively-Platform")
    +        #endif
    +        request.setValue(placement, forHTTPHeaderField: "Lively-Placement")
    +        request.setValue(currency, forHTTPHeaderField: "Lively-Store-Currency")
    +        request.setValue(eligible ? "1" : "0", forHTTPHeaderField: "Lively-Trial-Eligible")
    +        request.setValue(reference?.uuidString, forHTTPHeaderField: "Lively-Paywall-Reference")
    +        request.setValue(action, forHTTPHeaderField: "Lively-Paywall-Action")
    +        guard let (data, response) = try? await URLSession.shared.data(for: request),
    +              let response = response as? HTTPURLResponse, (200..<300).contains(response.statusCode) else { return nil }
    +        return data

    Timeout enrolls users into wrong offering

    Medium Severity

    <!-- DESCRIPTION START -->
    The 3s assign call commits a sticky cohort on the broker before the client reads the response. On timeout the app shows control with no reference, so checkout uses the install token instead of the cohort UUID. Those users stay enrolled in a treatment they never saw, and store-verified payments never join paywall_orders.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: afa93033-a674-4754-ab14-726258af7162 -->

    <!-- LOCATIONS START
    Lively/Model/Paywall.swift#L13-L32
    Lively/Model/Pro.swift#L106-L116
    android/app/src/main/java/sh/ian/lively/model/Pro.kt#L246-L260
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (2)</summary>

  • Lively/Model/Pro.swift#L106-L116

  • android/app/src/main/java/sh/ian/lively/model/Pro.kt#L246-L260
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg5NThhMTk2LWMyMTUtNDkxZS1iMTNjLTM0NDRkMThkNDQ2MiIsImVuY3J5cHRpb25LZXkiOiJJMFM1WWN2end0TE9aTHc0a0lyMFJzV0drV2ZfSVo2dUpkNUprS3RXVHdjIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg5NThhMTk2LWMyMTUtNDkxZS1iMTNjLTM0NDRkMThkNDQ2MiIsImVuY3J5cHRpb25LZXkiOiJJMFM1WWN2end0TE9aTHc0a0lyMFJzV0drV2ZfSVo2dUpkNUprS3RXVHdjIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiYjExNWRmMWFlZjAyMzdmNGRkNWY4ZmI5NjcxYmMzNjNkMTMzZWZkMCIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit b115df1aef0237f4dd5f8fb9671bc363d133efd0. Configure here.</sup>

    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:13 UTC
    Code Review
    android/app/src/main/java/sh/ian/lively/model/Pro.kt:1
    @@ -208,27 +216,54 @@ class Pro(
         }
     
         private fun offers(details: List<ProductDetails>): List<Offer> {
    -        val raw = details.sortedBy { PRODUCT_IDS.indexOf(it.productId) }.mapNotNull { product ->
    -            // The base plan: the offer with no special pricing phases.
    -            val offer = product.subscriptionOfferDetails?.minByOrNull { it.pricingPhases.pricingPhaseList.size } ?: return@mapNotNull null
    -            val phase = offer.pricingPhases.pricingPhaseList.lastOrNull() ?: return@mapNotNull null
    -            Triple(product, offer.offerToken, phase)
    +        val raw = details.mapNotNull { product ->
    +            val options = product.subscriptionOfferDetails.orEmpty()
    +            val trial = options.firstOrNull { option ->
    +                val phases = option.pricingPhases.pricingPhaseList
    +                product.productId == Paywall.PREFIX + "yearly_trial" && option.offerId == "free-week" &&
    +                    phases.size == 2 && phases.first().priceAmountMicros == 0L &&
    +                    phases.first().billingCycleCount == 1 && phases.first().billingPeriod in listOf("P1W", "P7D")
    +            }
    +            val offer = trial ?: options.firstOrNull { it.offerId == null && it.pricingPhases.pricingPhaseList.size == 1 }
    +                ?: return@mapNotNull null
    +            val phase = offer.pricingPhases.pricingPhaseList.last()
    +            if (phase.recurrenceMode != ProductDetails.RecurrenceMode.INFINITE_RECURRING ||
    +                phase.billingPeriod !in listOf("P1W", "P1M", "P1Y") || phase.priceAmountMicros <= 0) return@mapNotNull null
    +            Triple(product, offer, phase)
             }
    -        val monthly = raw.firstOrNull { it.third.billingPeriod == "P1M" }?.third?.priceAmountMicros
    -        return raw.map { (product, token, phase) ->
    -            val yearly = phase.billingPeriod == "P1Y"
    -            Offer(
    -                productID = product.productId,
    -                title = if (yearly) modelString(R.string.yearly) { "Yearly" } else modelString(R.string.monthly) { "Monthly" },
    -                price = phase.formattedPrice,
    -                period = if (yearly) "year" else "month",
    -                badge = if (yearly && monthly != null) savingBadge(phase.priceAmountMicros, monthly) else null,
    -                details = product,
    -                offerToken = token,
    -            )
    +        val monthly = raw.firstOrNull { it.first.productId == Paywall.PREFIX + "monthly" }?.third?.priceAmountMicros
    +        return raw.map { (product, offer, phase) ->
    +            val (title, period) = when (phase.billingPeriod) {
    +                "P1Y" -> modelString(R.string.yearly) { "Yearly" } to "year"
    +                "P1W" -> modelString(R.string.weekly) { "Weekly" } to "week"
    +                else -> modelString(R.string.monthly) { "Monthly" } to "month"
    +            }
    +            Offer(product.productId, title, phase.formattedPrice, period,
    +                if (product.productId == Paywall.PREFIX + "yearly" && monthly != null) savingBadge(phase.priceAmountMicros, monthly) else null,
    +                product, offer.offerToken, offer.offerId == "free-week", phase.priceCurrencyCode)
             }
         }
     
    +    suspend fun offering(catalog: List<Offer>, placement: String): Pair<List<Offer>, String?> {
    +        if (isDemo()) {
    +            val preview = when (sh.ian.lively.support.DebugFlags.paywall) {
    +                "B" -> Paywall("plans-v1", listOf("yearly_trial", "monthly"))
    +                "C" -> Paywall("plans-v1", listOf("yearly_trial", "weekly"))
    +                else -> Paywall.CONTROL
    +            }
    +            return preview.resolve(catalog).first to null
    +        }
    +        val remote = if (broker != null && ownershipKnown && !isPro && catalog.size == PRODUCT_IDS.size) {
    +            Paywall.request(broker, paywallID, placement, "assign", eligible = catalog.any { it.freeWeek }, currency = catalog.first().currency)
    +        } else null

    Android enrolls test installs in experiments

    Medium Severity

    <!-- DESCRIPTION START -->
    Android calls assign whenever ownership is known, the user is not Pro, and all four SKUs load. iOS also requires a production AppTransaction. Internal testing and license-tester devices hitting the production broker therefore receive sticky paywall_cohort rows. Test purchases are omitted from receipts, so those installs sit in the funnel as non-converters and pull down paid rate and revenue per install.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: 44a3b881-5981-4acd-8092-881b2c304bd1 -->

    <!-- LOCATIONS START
    android/app/src/main/java/sh/ian/lively/model/Pro.kt#L246-L258
    Lively/Model/Pro.swift#L106-L111
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (1)</summary>

  • Lively/Model/Pro.swift#L106-L111
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmIwNzgyMDNmLTA1MjItNDcxMC1iYWNlLWRmNTkzY2YzMzI1OCIsImVuY3J5cHRpb25LZXkiOiJYNE84Wk5JaG8yYWtWbF9rWThvMEJQMkdKX3pfdmhCdGRpcnlQa3g0OGVRIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmIwNzgyMDNmLTA1MjItNDcxMC1iYWNlLWRmNTkzY2YzMzI1OCIsImVuY3J5cHRpb25LZXkiOiJYNE84Wk5JaG8yYWtWbF9rWThvMEJQMkdKX3pfdmhCdGRpcnlQa3g0OGVRIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiYjExNWRmMWFlZjAyMzdmNGRkNWY4ZmI5NjcxYmMzNjNkMTMzZWZkMCIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit b115df1aef0237f4dd5f8fb9671bc363d133efd0. Configure here.</sup>

    cursor[bot] cursor[bot] commented on Nov 29, 2026 04:13 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    <!-- BUGBOT_REVIEW_STALE -->
    Stale Bugbot comment from a previous run.

    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:22 UTC
    Code Review
    Server/key-broker/src/paywall.ts:1
    @@ -0,0 +1,114 @@
    +import { overLimit } from "./auth";
    +import { error, hash, INSTALL_ID, json, networkOf, type Env } from "./broker";
    +import { attributionHash } from "./apple-ads";
    +import type { SignedTransaction } from "./appstore";
    +
    +import { offerings, type Variant } from "./offerings";
    +
    +interface Decision {
    +  id: string; state: string; winner: Variant | null; offerings: string;
    +  a: number; b: number; c: number; reference: string | null; variant: Variant | null;
    +}
    +
    +// Active/paused assignments are sticky across placements and late attribution.
    +// Otherwise a keyword rule wins over a placement rule, then platform, then newest.
    +const decision = (eligible: string) => `SELECT e.*, c.reference, c.variant FROM paywall_experiments e
    +  LEFT JOIN paywall_cohort c ON c.experiment=e.id AND c.install_hash=?1 AND c.platform=?2
    +  WHERE (c.reference IS NOT NULL AND e.state IN ('running','paused'))
    +    OR ((e.state='rollout' OR (e.state='running' AND ${eligible}=1)) AND e.platform IN ('all',?2) AND e.placement IN ('all',?3)
    +    AND (e.keyword_id IS NULL OR (?2='ios' AND e.keyword_id=(SELECT keyword_id FROM apple_ads_installs WHERE install_hash=?1))))
    +  ORDER BY (c.reference IS NOT NULL AND e.state IN ('running','paused')) DESC,
    +    (e.keyword_id IS NOT NULL) DESC,(e.placement!='all') DESC,(e.platform!='all') DESC,e.created_ms DESC,e.id LIMIT 1`;
    +
    +export async function paywall(request: Request, env: Env, now: number): Promise<Response> {
    +  const id = request.headers.get("Lively-Paywall-ID") ?? "";
    +  const platform = request.headers.get("Lively-Platform") ?? "";
    +  const action = request.headers.get("Lively-Paywall-Action");
    +  const placement = request.headers.get("Lively-Placement") ?? "";
    +  if (!INSTALL_ID.test(id) || !["ios", "macos", "android"].includes(platform) ||
    +      !["settings", "limit"].includes(placement) || !["assign", "received", "view", "checkout"].includes(action ?? "")) {
    +    return error(400, "invalid_paywall", "Invalid paywall request.");
    +  }
    +  const minute = Math.floor(now / 60000);
    +  const ip = await hash("ip:" + networkOf(request.headers.get("CF-Connecting-IP") ?? "local"));
    +  if (await overLimit(env, [{ key: `paywall:${ip}:${minute}`, limit: 240, resetsAt: (minute + 1) * 60000 }])) {
    +    return error(429, "rate_limited", "Try again later.", 60);
    +  }
    +  const install = await attributionHash(id);
    +  // The client asks only after the store catalog and subscription state are ready.
    +  if (action === "assign") {
    +    if (platform === "android") {
    +      const version = request.headers.get("Lively-Play-Version") ?? "";
    +      const live = (env.PAYWALL_PLAY_PRODUCTION_BUILDS ?? "").split(",").map(value => value.trim());
    +      if (!/^\d+$/.test(version) || !live.includes(version) ||
    +          await env.DB.prepare("SELECT 1 FROM paywall_play_test_installs WHERE install_hash=?").bind(install).first()) {
    +        return json(200, { experiment: null, plans: offerings.A });
    +      }

    Version gate drops sticky assignments

    Medium Severity

    <!-- DESCRIPTION START -->
    The Android production-version and license-tester checks return the control offering before the sticky cohort lookup. An already-assigned install whose version is missing from PAYWALL_PLAY_PRODUCTION_BUILDS is shown yearly/monthly with no checkout reference, while its original cohort stays in reports. That happens whenever a new production version ships before the env list is updated, or when an older version code is removed, so returning participants can see the wrong plans and conversions stop joining the experiment.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: 036157b3-2432-456c-bc56-4ac9cc48ddac -->

    <!-- LOCATIONS START
    Server/key-broker/src/paywall.ts#L39-L46
    LOCATIONS END -->
    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjYyOWIyYWJlLTRiYTUtNDljNC1hNDc5LWYyZTZkM2E1ZjViZCIsImVuY3J5cHRpb25LZXkiOiJNaDFBak1EQjZjMlVuYnF6RmtCVVdNeFNkOV84Q1h1WkhWMWM4OHo1M0xjIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjYyOWIyYWJlLTRiYTUtNDljNC1hNDc5LWYyZTZkM2E1ZjViZCIsImVuY3J5cHRpb25LZXkiOiJNaDFBak1EQjZjMlVuYnF6RmtCVVdNeFNkOV84Q1h1WkhWMWM4OHo1M0xjIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiOGVmMjRhNjNkYmE2NTEzYjFkODEyNDEzYmM1NzQ0YjY4NzlmMzBmNiIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit 8ef24a63dba6513b1d812413bc5744b6879f30f6. Configure here.</sup>

    cursor[bot] cursor[bot] commented on Nov 29, 2026 04:22 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    <!-- BUGBOT_REVIEW_STALE -->
    Stale Bugbot comment from a previous run.

    cursor[bot] cursor[bot] commented on Nov 29, 2026 04:39 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    <!-- BUGBOT_REVIEW_STALE -->
    Stale Bugbot comment from a previous run.

    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:39 UTC
    Code Review
    Server/key-broker/src/broker.ts:1
    @@ -298,26 +301,48 @@ async function issueKey(request: Request, env: Env, now: number, service: "stt"
     
       // Keys per minute count 1; minutes per day are tracked in charged seconds.
       const limits = readLimits(env);
    -  const charges = chargesFor(caller, now, service === "tts" ? "tts:" : "", limits.chargeSeconds, {
    +  const policy = plan === "free" ? await allowanceFor(caller, env) : null;
    +  const daySeconds = Math.floor((nextUTCMidnight(now) - now) / 1000);
    +  if (policy && service === "stt" && daySeconds < 2) {
    +    return error(429, "rate_limited", "Try again later.", 2);
    +  }
    +  const listening = policy && service === "stt" ? await reserveListening(env.DB, caller, Math.floor(now / 86_400_000),
    +    60 * (userHash ? policy.signed_in_minutes : policy.signed_out_minutes),
    +    Math.min(limits.chargeSeconds, limits.maxSessionSeconds, daySeconds - 1)) : null;
    +  if (listening && !listening.seconds && policy) {
    +    await observeAllowance(env.DB, caller, policy, true).catch(() => console.error("Allowance reporting failed"));
    +    return json(429, { error: "rate_limited", message: "Today's free translation time is used up.", plan, limit_scope: "listening", allowance: policy },
    +      { "Retry-After": String(secondsUntil(nextUTCMidnight(now), now)) });
    +  }
    +  const charges = chargesFor(caller, now, service === "tts" ? "tts:" : "", listening?.seconds ?? limits.chargeSeconds, {
         owner:
           plan === "pro"
             ? { perMinute: limits.proKeysPerMinute, perDay: limits.proSecondsPerDay }
    -        : { perMinute: limits.userKeysPerMinute, perDay: limits.userSecondsPerDay },
    -    install: { perMinute: limits.installKeysPerMinute, perDay: limits.installSecondsPerDay },
    +        : { perMinute: limits.userKeysPerMinute, perDay: 60 * policy!.signed_in_minutes },
    +    install: { perMinute: limits.installKeysPerMinute, perDay: policy ? 60 * policy.signed_out_minutes : limits.installSecondsPerDay },
         ip: { perMinute: limits.ipKeysPerMinute, perDay: limits.ipSecondsPerDay },
         globalPerDay: limits.globalKeysPerDay,
    -  });
    +  }).filter(c => !listening || c.window !== "day" || c.key.startsWith("ip:"));
    +  const release = async () => {
    +    if (listening) await env.DB.prepare("DELETE FROM listening_grants WHERE id=?").bind(listening.id).run();
    +  };
       const totals = await applyCharges(env, charges, now, plan, {
         free: "Today's free translation time is used up.",
         pro: "Today's translation time is used up.",
       });
    -  if (totals instanceof Response) return totals;
    +  if (totals instanceof Response) {
    +    await release();
    +    return totals;
    +  }
     
       // A session may run only as long as the day's budgets have left, counting this key.
       const remaining = charges
         .map((c, i) => (c.window === "day" ? c.limit - totals[i] + c.amount : Number.POSITIVE_INFINITY))
         .reduce((a, b) => Math.min(a, b));
    -  const maxSession = Math.max(1, Math.min(limits.maxSessionSeconds, remaining));
    +  const maxSession = Math.max(1, Math.min(listening?.seconds ?? limits.maxSessionSeconds, remaining));
    +  // A free key opened at the very end of its validity still belongs to the
    +  // day that funded it. Shorten the key validity close to the UTC reset.
    +  const keyTTL = listening ? Math.min(limits.keyTTLSeconds, daySeconds - maxSession) : limits.keyTTLSeconds;

    Free keys expire before connect

    Medium Severity

    <!-- DESCRIPTION START -->
    Near UTC midnight, free listening keys get expires_in_seconds of 1 because keyTTL is whatever remains after filling maxSession with the leftover day. Soniox starts that one-second window at mint time, before the broker even responds. The client then times the same value from the start of its HTTP request, so the key is often already expired when it arrives, and the WebSocket never opens. For about two minutes each day this burns the remaining grant on failed connects instead of usable listening, which is peak morning in Japan and China.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: 3f39a93a-3a55-4b77-a59f-f790786fe4c4 -->

    <!-- LOCATIONS START
    Server/key-broker/src/broker.ts#L344-L345
    Server/key-broker/src/broker.ts#L308-L311
    Lively/Networking/SonioxKeyProvider.swift#L169-L208
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (2)</summary>

  • Server/key-broker/src/broker.ts#L308-L311

  • Lively/Networking/SonioxKeyProvider.swift#L169-L208
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmQyZWJkYTQ2LTE3ZGMtNDRiYi05NjljLTBmZjI3YzY1M2Q1YSIsImVuY3J5cHRpb25LZXkiOiI3eFdsNG1hdDlMWk5sQlZqZjI1S3R0VU0yeWVDYTlkTXYyeFlmc1dhMFRzIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmQyZWJkYTQ2LTE3ZGMtNDRiYi05NjljLTBmZjI3YzY1M2Q1YSIsImVuY3J5cHRpb25LZXkiOiI3eFdsNG1hdDlMWk5sQlZqZjI1S3R0VU0yeWVDYTlkTXYyeFlmc1dhMFRzIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiYTIwNjA2OGNlZGIzYzNlM2MxNWQxYjQ3ZTk0MTc0M2QwY2MyNzZkNCIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit a206068cedb3c3e3c15d1b47e941743d0cc276d4. Configure here.</sup>

    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:59 UTC
    Code Review
    Server/key-broker/src/broker.ts:1
    @@ -298,26 +303,49 @@ async function issueKey(request: Request, env: Env, now: number, service: "stt"
     
       // Keys per minute count 1; minutes per day are tracked in charged seconds.
       const limits = readLimits(env);
    -  const charges = chargesFor(caller, now, service === "tts" ? "tts:" : "", limits.chargeSeconds, {
    +  const policy = service === "stt" && plan === "free" ? await allowanceFor(caller, env) : null;
    +  const daySeconds = Math.floor((nextUTCMidnight(now) - now) / 1000);
    +  const connectSeconds = Math.min(FREE_KEY_CONNECT_SECONDS, limits.keyTTLSeconds);
    +  if (policy && daySeconds <= connectSeconds + 5) {
    +    return error(429, "rate_limited", "Try again later.", secondsUntil(nextUTCMidnight(now), now));
    +  }
    +  const listening = policy ? await reserveListening(env.DB, caller, Math.floor(now / 86_400_000),
    +    60 * (userHash ? policy.signed_in_minutes : policy.signed_out_minutes),
    +    Math.min(limits.chargeSeconds, limits.maxSessionSeconds, daySeconds - connectSeconds)) : null;
    +  if (listening && !listening.seconds && policy) {
    +    await observeAllowance(env.DB, caller, policy, true).catch(() => console.error("Allowance reporting failed"));
    +    return json(429, { error: "rate_limited", message: "Today's free translation time is used up.", plan, limit_scope: "listening", allowance: policy },
    +      { "Retry-After": String(secondsUntil(nextUTCMidnight(now), now)) });
    +  }
    +  const charges = chargesFor(caller, now, service === "tts" ? "tts:" : "", listening?.seconds ?? limits.chargeSeconds, {
         owner:
           plan === "pro"
             ? { perMinute: limits.proKeysPerMinute, perDay: limits.proSecondsPerDay }
    -        : { perMinute: limits.userKeysPerMinute, perDay: limits.userSecondsPerDay },
    -    install: { perMinute: limits.installKeysPerMinute, perDay: limits.installSecondsPerDay },
    +        : { perMinute: limits.userKeysPerMinute, perDay: policy ? 60 * policy.signed_in_minutes : limits.ttsUserSecondsPerDay },
    +    install: { perMinute: limits.installKeysPerMinute, perDay: policy ? 60 * policy.signed_out_minutes : limits.ttsInstallSecondsPerDay },
         ip: { perMinute: limits.ipKeysPerMinute, perDay: limits.ipSecondsPerDay },
         globalPerDay: limits.globalKeysPerDay,
    -  });
    +  }).filter(c => !listening || c.window !== "day" || c.key.startsWith("ip:"));
    +  const release = async () => {
    +    if (listening) await env.DB.prepare("DELETE FROM listening_grants WHERE id=?").bind(listening.id).run();
    +  };

    TTS exhaustion uses listening error copy

    Medium Severity

    <!-- DESCRIPTION START -->
    Read-aloud now has its own daily budget, but exhausting it still returns Today's free translation time is used up. Clients treat that as a generic key failure on the TTS endpoint, so playback can fail while live listening still remains. The new isolation makes that message describe the wrong allowance.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: 65655877-156e-4cc7-b2b4-c52b68575c99 -->

    <!-- LOCATIONS START
    Server/key-broker/src/broker.ts#L331-L335
    Lively/Networking/SonioxKeyProvider.swift#L185-L191
    android/app/src/main/java/sh/ian/lively/net/SonioxKeyProvider.kt#L221-L228
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (2)</summary>

  • Lively/Networking/SonioxKeyProvider.swift#L185-L191

  • android/app/src/main/java/sh/ian/lively/net/SonioxKeyProvider.kt#L221-L228
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmZkNmIwNDZmLTBhNmEtNDNkNi1iMTJhLWQwOGJjZjA4MWQ0MSIsImVuY3J5cHRpb25LZXkiOiJDZi1YSTcyWWg1bUxnWlFweTMtdk4xM24teHZGeDBLakhpS2dYdTdUT1FVIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmZkNmIwNDZmLTBhNmEtNDNkNi1iMTJhLWQwOGJjZjA4MWQ0MSIsImVuY3J5cHRpb25LZXkiOiJDZi1YSTcyWWg1bUxnWlFweTMtdk4xM24teHZGeDBLakhpS2dYdTdUT1FVIiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiNzQwOThhMTM5NTk0MTcwNGMzMTk4ODI0MzlhMjlmYmY5MmU1ZDFhYSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit 74098a1395941704c319882439a29fbf92e5d1aa. Configure here.</sup>

    cursor[bot] cursor[bot] commented on code on Nov 29, 2026 04:59 UTC
    Code Review
    Lively/Model/Pro.swift:1
    @@ -23,24 +23,58 @@ final class Pro {
         /// Set when a free day's allowance runs out, so the app can offer Pro.
         var freeLimitReached = false
     
    +    private var allowance: FreeAllowance?
    +    private var allowanceToken: String?
    +    private var currentAllowance: FreeAllowance? {
    +        if Self.isDemo { return .preview }
    +        return allowanceToken == Account.shared?.token ? allowance : nil
    +    }
    +
    +    var allowanceDetail: String {
    +        currentAllowance?.detail ?? String(localized: "Daily free translation time")
    +    }
    +
    +    var paywallAllowance: String? {
    +        guard let currentAllowance else { return nil }
    +        let signedIn = Self.isDemo ? Account.shared?.isSignedIn == true : Account.shared?.token != nil
    +        let minutes = currentAllowance.minutes(signedIn: signedIn)
    +        return String(localized: "Lively Cloud includes \(minutes) min of free live translation per day.")
    +    }

    Paywall hides copy without allowance

    Low Severity

    <!-- DESCRIPTION START -->
    paywallAllowance is nil until a matching policy is cached, and ProHeader now omits the subtitle in that case. Opening Pro from Settings before /v1/allowance returns, or when that fetch fails, leaves the header blank. The old default line and the 10-hours row detail were both removed, so the paywall no longer explains free cloud time when the broker is slow or unreachable.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: 88961161-eae5-4169-9b05-ad685219cf35 -->

    <!-- LOCATIONS START
    Lively/Model/Pro.swift#L36-L42
    Lively/Views/ProView.swift#L56-L64
    android/app/src/main/java/sh/ian/lively/ui/ProScreen.kt#L161-L167
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (2)</summary>

  • Lively/Views/ProView.swift#L56-L64

  • android/app/src/main/java/sh/ian/lively/ui/ProScreen.kt#L161-L167
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmIxZmE2MTFmLTcwY2QtNDQ0Zi04MTRlLTQ1MDBmMzAyMmQ2YiIsImVuY3J5cHRpb25LZXkiOiJYLU52dHhYMGFIaE5FZHBtNmI3XzhTRG1ydmNHd1hkd09YOXRPbGVUZ1I4IiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmIxZmE2MTFmLTcwY2QtNDQ0Zi04MTRlLTQ1MDBmMzAyMmQ2YiIsImVuY3J5cHRpb25LZXkiOiJYLU52dHhYMGFIaE5FZHBtNmI3XzhTRG1ydmNHd1hkd09YOXRPbGVUZ1I4IiwiYnJhbmNoIjoiY29kZXgvcGF5d2FsbC1leHBlcmltZW50IiwicmVwb093bmVyIjoiaWFuZ2NhcnJvbGwiLCJyZXBvTmFtZSI6ImxpdmVseSIsInByTnVtYmVyIjozMSwiY29tbWl0U2hhIjoiNzQwOThhMTM5NTk0MTcwNGMzMTk4ODI0MzlhMjlmYmY5MmU1ZDFhYSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit 74098a1395941704c319882439a29fbf92e5d1aa. Configure here.</sup>

    cursor[bot] cursor[bot] commented on Nov 29, 2026 04:59 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

    <!-- BUGBOT_FIX_ALL -->
    <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTpiNGRmY2NkMy01ZDdlLTQyMzAtOGE4ZS05MWJmY2NjZmFlZDUiLCJlbmNyeXB0aW9uS2V5IjoiY1dleUVJMFdXSmh4YXppSVA5RkFibGdqaFl3SDJjWU9NS2xYdlhaYzFXQSIsImJyYW5jaCI6ImNvZGV4L3BheXdhbGwtZXhwZXJpbWVudCIsInJlcG9Pd25lciI6ImlhbmdjYXJyb2xsIiwicmVwb05hbWUiOiJsaXZlbHkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
    <!-- /BUGBOT_FIX_ALL -->

    <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
    <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.</sup>
    <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->

    <sup>Reviewed by Cursor Bugbot for commit 74098a1395941704c319882439a29fbf92e5d1aa. Configure here.</sup>

    Reviewers
    Assignees
    iangcarroll iangcarroll
    Labels
    risk: medium confidence: 62.3% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 94.7% (HIGH) · Higher = larger blast radius
    94.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 62.3% · Lower = rushed or shallow review
    62.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 35.7% · Moderate risk
    35.7%