AI Subscription Promotion Rollout: Technical Logic and Engineering Practices

    This article breaks down a common AI subscription promotion incident into three engineering problems: eligibility evaluation, gradual rollout, and state consistency. It shows how to model promotion rules with a declarative DSL, structure the pricing decision pipeline, apply stable bucketing for gradual releases, and keep announcements, page display, and checkout validation aligned through a single source of truth and signed quote credentials. It also covers observability, replay, and cloud-native component choices for building explainable and auditable promotion systems.

    1. Abstracting the Problem: From a Broken Promotion Promise to Three Engineering Issues

    An AI coding and large language model subscription service ran into a typical operational incident during a Black Friday promotion. The official channel first opened a limited-time discount to existing paying users and publicly stated that new customers would receive the same offer on a specific date. When that date arrived, most new users still saw the original price after refreshing the page, while a few accounts saw discounts with different expiration dates. The official response was later deleted without any explanation.

    Setting aside the specific brand and operational details, this phenomenon can be abstracted into three general engineering problems:

    1. Promotion eligibility evaluation: What conditions actually determine a discount (identity, subscription history, channel, time window, risk-control tags).
    2. Gradual rollout: Why “the same campaign at the same time” is visible to some accounts but not others.
    3. State consistency: Why the public promise, page display, and checkout validation can disagree, and why it is hard to review afterward.

    These three problems are common in e-commerce, cloud resource packages, membership benefits, and financial marketing. The following sections present a vendor-neutral modeling and implementation approach.

    2. Modeling Promotion Eligibility: Turning a Verbal Promise into Executable Rules

    2.1 Breaking Down Rule Dimensions

    It is recommended to split eligibility into orthogonal dimensions instead of hard-coding the logic into page or checkout code:

    • Identity dimension: new / existing / returning customers; individual or verified business entity.
    • Subscription dimension: currently within a valid period, previously subscribed, or in a trial.
    • Time dimension: campaign start/end, early-bird window, main-day window, time zone, and settlement day cutoff.
    • Channel dimension: source landing page, invitation code, partner channel (described only in the abstract).
    • Risk-control dimension: device / payment instrument / account behavior score (general capability only, no specific implementation).

    2.2 A Rule DSL Example

    Using declarative rules instead of scattered if-else statements makes auditing and replay easier:

    1. promotion:
    2. id: bf_new_user
    3. priority: 100
    4. match:
    5. all:
    6. - identity.type in ["new"]
    7. - subscription.has_paid == false
    8. - time.now between "2026-11-27T00:00:00Z" and "2026-12-04T23:59:59Z"
    9. - risk.score < 70 # General risk score, illustrative only
    10. benefit:
    11. type: percentage_off
    12. value: 0.5
    13. scope: ["plan_annual"]
    14. rollout:
    15. strategy: whitelist_then_percentage
    16. percentage: 5 # Initial rollout at 5%

    The key point: a promise must be encoded as a rule. If the service publicly claims that new customers get a discount on a certain date, it should generate a rule with an explicit time window and audience conditions and include it in the release process, rather than relying on temporary manual configuration.

    3. The Decision Pipeline: Three Things a Single Request Must Complete

    A request to “display a subscription page price” is best split into three stages:

    1. Identity resolution: Derive identity.type and subscription status from the session and entity information. Do not rely on frontend parameters alone.
    2. Rule matching and rollout: Match rules by priority, then apply the rollout strategy (whitelist, percentage, region/channel bucketing).
    3. Price rendering and credential issuance: If a rule is hit, render the discounted price and issue a one-time quote_id (quote credential) that must be re-validated at checkout.

    Example code (pseudo-implementation, emphasizing structure rather than specific APIs):

    1. def quote(user_id, plan, ctx):
    2. ident = identity_service.resolve(user_id) # Server-side resolution
    3. rules = rule_repo.match(ident, ctx) # Rule matching
    4. for r in rules:
    5. if rollout.hit(user_id, r.rollout): # Stable bucketing
    6. q = pricing.apply(ident, plan, r.benefit)
    7. return sign_quote(q, ttl=600) # Quote credential
    8. return sign_quote(pricing.base(plan), ttl=600)

    Stable bucketing is the core of avoiding “the price changes on every refresh”: use hash(user_id + promotion_id) % 100 < percentage to keep the result stable for the same account during the campaign; the whitelist takes priority over the percentage.

    4. Gradual Rollout: Why “Others Have It and I Don’t” Is Normal

    Gradual rollout is not a failure but a risk-control measure. Common strategies and their use cases:

    • Whitelist: internal employees, support staff, and key customers validate first.
    • Percentage rollout: 1% → 5% → 20% → 100%, watching complaint rate, checkout failure rate, and abnormal average order value.
    • Bucketing dimensions: account, payment instrument, region, channel; use the account as the primary key to avoid different prices for the same person.
    • Circuit breaking and rollback: when the checkout validation failure rate or complaints exceed a threshold, automatically drop to 0% while honoring already-issued credentials.

    It must be emphasized that rollout must be explainable to users. If a full rollout is promised externally, a low-percentage rollout should not be used; if a rollout is required, prepare unified messaging and fallback compensation rules instead of deleting the public response.

    5. State Consistency: Promise, Display, and Checkout Must Share the Same Source

    The root cause of such incidents is usually not “the campaign was never created” but that three states are not sourced from the same place:

    • Operational promise (announcement/reply)
    • Page display (price and benefits)
    • Checkout validation (whether the discount is actually applied at order time)

    Recommended practices:

    1. Single source of truth: Store campaign configuration in one place (a configuration center); announcements, pages, and checkout all read the same version number.
    2. Quote credential: Issue a credential with a version and expiration time at display; checkout accepts only the credential, preventing “see the price but cannot pay that price.”
    3. Idempotency and audit: Use user_id + promotion_id + order_id as the idempotency key; write a structured log for each decision, including the matched rule, rollout bucket, and configuration version.
    4. Reconciliation job: Periodically compare “display hits” with “checkout hits” and alert when the difference rate exceeds a threshold.

    Log example:

    1. {"ts":"...","user":"u_123","promo":"bf_new_user","rule_ver":"v17","bucket":3,"hit":true,"quote":"q_abc"}

    6. Observability and Review: Preventing “Silent Deletion”

    At least four categories of metrics are recommended:

    • Coverage: hit population / target population, observed hourly as a rollout curve.
    • Consistency: display-to-checkout difference rate, quote credential expiration rate.
    • Stability: decision API P99 latency, cache hit rate.
    • Experience: complaint rate, refund rate, number of page price fluctuations.

    During review, replay by rule_ver and bucket to quickly answer “who saw what price and when.” External communication should also be versioned: any promise generates a change record, changes require approval and synchronized announcements, avoiding silent deletion afterward.

    7. Cloud Implementation: General Component Choices

    The capabilities above can be assembled from general cloud components without relying on any proprietary API:

    • Configuration center / parameter store: stores campaign rules and versions.
    • Cache service: caches identity and rule-matching results with a short TTL and active invalidation.
    • Message queue: asynchronously writes audit logs and reconciliation events.
    • Container platform: deploys the decision service with fast scaling and gradual release support.
    • Logging and monitoring/alerting: builds coverage and difference-rate dashboards with threshold alerts.
    • Object storage: archives campaign configuration snapshots for audit traceability.

    On Baidu AI Cloud, these capabilities are available as general categories and can be implemented with the same architecture.

    8. Conclusion

    A “broken new-customer discount promise” is essentially an engineering incident of rules not encoded, rollout not explained, and state not sourced from one place. Writing promises as rules, making rollout a stable bucketing mechanism, binding display and checkout with quote credentials, and adding audit and reconciliation make a promotion system explainable, observable, and traceable. For developers, this approach also applies to any “eligibility + time limit + rollout” scenario such as membership benefits, resource packages, and trial-to-paid conversion.