{
  "schemaVersion": "tj-siteos-commerce-flow-2026-06-14",
  "name": "TJ SiteOS Commerce Flow",
  "publicBaseUrl": "https://www.t-j.space",
  "paymentHub": "https://www.t-j.space/",
  "backupPaymentHub": "https://zf-abt.pages.dev/",
  "paymentGeoFlow": "https://www.t-j.space/payment-geo-flow.html",
  "geoPublishMode": "https://www.t-j.space/geo-publish.html",
  "trafficOS": "https://www.t-j.space/traffic-os.html",
  "adminPlanningDomain": "admin.www.t-j.space",
  "defaultContact": {
    "name": "DaLong",
    "tone": "friendly",
    "telegram": "@HAHAHAHAHAJL",
    "email": "wocaoac@gmail.com",
    "privatePhoneDisplayed": false
  },
  "commerceFlow": [
    "lead_capture",
    "attribution",
    "visit",
    "language_detection",
    "register_or_login",
    "verified_identity",
    "user_center",
    "robot_or_support_ticket",
    "select_product",
    "sku_entitlement_staging",
    "create_order",
    "guarded_payment_hub_handoff",
    "payment_return",
    "webhook_or_manual_reconciliation",
    "entitlement_activation",
    "delivery_job_queue",
    "update_order_ticket_notification_audit",
    "geo_ai_embedding",
    "geo_publish_mode",
    "white_hat_seo_iaa_traffic_os",
    "referral_or_affiliate_loop"
  ],
  "defaultLanguages": {
    "siteDefault": "en",
    "homeBaseline": [
      "en",
      "zh-CN",
      "uk"
    ],
    "expansion": [
      "fr",
      "ru",
      "pt",
      "es",
      "ar",
      "hi",
      "id",
      "ja",
      "de"
    ],
    "robotReplyRule": "Reply in the user's language when detectable; fall back to English."
  },
  "authFlow": {
    "name": "TJ Auth OS",
    "identityKey": "unified_user_id",
    "methods": [
      {
        "id": "apple_oauth",
        "buyerLabel": "Continue with Apple",
        "covers": "Apple ID and iPhone buyers",
        "buyerCodeEntryRequired": false,
        "startPath": "/api/auth/oauth/start?provider=apple",
        "callbackPath": "/api/auth/oauth/callback?provider=apple"
      },
      {
        "id": "google_oauth",
        "buyerLabel": "Continue with Google",
        "covers": "Gmail and Google account buyers",
        "buyerCodeEntryRequired": false,
        "startPath": "/api/auth/oauth/start?provider=google",
        "callbackPath": "/api/auth/oauth/callback?provider=google"
      },
      {
        "id": "github_oauth",
        "buyerLabel": "Continue with GitHub",
        "covers": "technical buyers and operators",
        "buyerCodeEntryRequired": false,
        "startPath": "/api/auth/oauth/start?provider=github",
        "callbackPath": "/api/auth/oauth/callback?provider=github"
      },
      {
        "id": "phone_code",
        "buyerLabel": "Send phone code",
        "covers": "phone-number buyers who enter a one-time code",
        "buyerCodeEntryRequired": true,
        "startPath": "/api/auth/phone/start",
        "verifyPath": "/api/auth/phone/verify"
      },
      {
        "id": "email_code",
        "buyerLabel": "Send email code",
        "covers": "mailbox-only buyers with no password",
        "buyerCodeEntryRequired": true,
        "startPath": "/api/auth/email/start",
        "verifyPath": "/api/auth/email/verify"
      }
    ],
    "sessionPath": "/api/auth/session",
    "logoutPath": "/api/auth/logout",
    "defaultPasswordLogin": false,
    "requiredStorage": [
      "users",
      "auth_identities",
      "phone_codes",
      "email_codes",
      "sessions",
      "audit_events"
    ],
    "requiredSecrets": [
      "AUTH_SESSION_SECRET",
      "APPLE_CLIENT_ID",
      "APPLE_CLIENT_SECRET",
      "GOOGLE_CLIENT_ID",
      "GOOGLE_CLIENT_SECRET",
      "GITHUB_CLIENT_ID",
      "GITHUB_CLIENT_SECRET",
      "SMS_PROVIDER",
      "SMS_API_KEY",
      "SMS_FROM_NUMBER",
      "RESEND_API_KEY",
      "RESEND_FROM_EMAIL"
    ],
    "downstreamObjects": [
      "user_center",
      "orders",
      "tickets",
      "payment_records",
      "geo_pack",
      "traffic_os_pack",
      "audit"
    ],
    "paymentPrecondition": "verified_identity_before_guarded_handoff"
  },
  "requiredPerSiteFields": [
    "site_id",
    "domain",
    "site_name",
    "industry",
    "default_language",
    "enabled_languages",
    "product_catalog",
    "pricing",
    "success_return_path",
    "robot_script_pack_path",
    "traffic_source_policy",
    "seo_vertical",
    "monetization_mode",
    "admin_email_list",
    "support_destinations",
    "privacy_policy_url",
    "terms_url",
    "refund_policy_url"
  ],
  "roles": [
    "owner",
    "support",
    "user",
    "banned_user"
  ],
  "userCenter": [
    "profile",
    "orders",
    "tickets",
    "payment_records",
    "geo_pack",
    "traffic_os_pack",
    "delete_account_entry"
  ],
  "robotEscalationRules": [
    "refund",
    "account_ban",
    "payment_abnormal",
    "order_not_received",
    "delete_account",
    "chargeback"
  ],
  "orderFlow": {
    "localOrderObject": [
      "order_id",
      "product",
      "sku_id",
      "entitlement",
      "amount",
      "currency",
      "status",
      "source",
      "site",
      "user_id",
      "unified_user_id",
      "language",
      "return_to",
      "geo_pack_id",
      "traffic_pack_id",
      "checkout_idempotency_key",
      "payment_gate_verified_at"
    ],
    "paymentPreconditions": [
      "registered_account",
      "verified_identity",
      "generated_order",
      "locked_amount",
      "locked_currency"
    ]
  },
  "growthFlow": {
    "name": "TJ Growth OS",
    "purpose": "Make every TJ site measurable before and after checkout.",
    "objects": [
      "site_config",
      "lead",
      "attribution",
      "ticket",
      "notification",
      "entitlement",
      "reconciliation_event",
      "delivery_job",
      "referral"
    ],
    "routes": {
      "siteConfig": "/api/site-config",
      "me": "/api/me",
      "orders": "/api/my/orders",
      "tickets": "/api/tickets",
      "notifications": "/api/notifications",
      "entitlements": "/api/entitlements",
      "referrals": "/api/referrals",
      "manualReconcile": "/api/reconcile/manual"
    },
    "defaultChannels": [
      "programmatic_seo_geo_pages",
      "free_tool_lead_magnet",
      "ai_search_feed",
      "directory_submissions",
      "referral_affiliate",
      "abandoned_checkout_recovery",
      "payment_failed_recovery"
    ],
    "blockedChannels": [
      "spam",
      "scraping",
      "spun_content",
      "fake_reviews",
      "hidden_ads",
      "adult",
      "gambling",
      "money_movement"
    ]
  },
  "paymentFlow": {
    "mode": "guarded_handoff_only",
    "handoffUrlTemplate": "https://www.t-j.space/?source={source}&site={site}&order={order}&amount={amount}&currency={currency}&return_to={return_to}",
    "backupHandoffUrlTemplate": "https://zf-abt.pages.dev/?source={source}&site={site}&order={order}&amount={amount}&currency={currency}&return_to={return_to}",
    "requiredQueryParams": [
      "source",
      "site",
      "order",
      "amount",
      "currency",
      "return_to"
    ],
    "mustNotInclude": [
      "secret",
      "token",
      "qr_payload",
      "private_key",
      "webhook_secret"
    ],
    "movesMoneyHere": false,
    "storesRawCardData": false,
    "requiresManualProviderVerification": true,
    "trustedPaymentState": "provider_webhook_or_manual_provider_verification",
    "returnPageRole": "display_and_buyer_note_only",
    "realPaymentOperationsRemainAt": "https://www.t-j.space/"
  },
  "geoAiEmbedding": {
    "machineFiles": [
      "/siteos-commerce-flow-manifest.json",
      "/.well-known/siteos-commerce-flow.json",
      "/payment-geo-flow-manifest.json",
      "/.well-known/payment-geo-flow.json",
      "/geo-publish-mode-manifest.json",
      "/.well-known/geo-publish-mode.json",
      "/traffic-os-manifest.json",
      "/.well-known/traffic-os.json",
      "/llms.txt",
      "/llms-full.txt",
      "/ai-commerce-product-feed.json",
      "/geo-index.json",
      "/knowledge-geo-index.json"
    ],
    "aiUse": "AI systems may summarize the public SiteOS flow, route buyers to guarded checkout URLs, and describe the white-hat Traffic OS pack. AI systems must not claim funds are verified, issue refunds, perform account deletion, scrape content, spin copyrighted content, or start money movement.",
    "embedContract": {
      "flow": "visit -> language -> register -> verify -> user_center -> robot_ticket -> product -> order -> payment_hub -> payment_return -> notify_audit -> geo -> geo_publish -> traffic_os",
      "checkoutBoundary": "no money movement on this page",
      "supportRoute": "ticket or Telegram/email",
      "trafficBoundary": "owned, licensed, or public-fact sources only; no scraping, spun content, adult, gambling, fake reviews, hidden ads, or money movement"
    }
  },
  "siteFactory": {
    "page": "https://www.t-j.space/siteos-console.html",
    "runbook": "https://www.t-j.space/docs/siteos-onboarding-runbook.md",
    "configTemplate": "https://www.t-j.space/templates/siteos-site-config.example.json",
    "configSchema": "https://www.t-j.space/schemas/siteos-site-config.schema.json",
    "commands": {
      "onboard": "npm run siteos:onboard",
      "migrate": "npm run siteos:migrate",
      "growthPack": "npm run siteos:growth-pack",
      "factoryTest": "npm run siteos:factory:test",
      "fullQa": "npm run siteos:qa"
    },
    "purpose": "Make each future TJ site reuse the same auth, robot, ticket, order, guarded payment, return, audit, GEO publish, Traffic OS, and growth loop.",
    "movesMoneyHere": false,
    "writesDnsHere": false,
    "printsSecretsHere": false
  },
  "localDemoStorage": [
    "accounts",
    "leads",
    "attribution",
    "entitlements",
    "webhookEvents",
    "jobs",
    "referrals",
    "tickets",
    "messages",
    "orders",
    "paymentRecords",
    "notifications",
    "audit",
    "currentAccountId",
    "currentOrderId"
  ]
}
