{
  "schemaVersion": "tj-site-onboarding-2026-06-14",
  "templateName": "TJ SiteOS Commerce Flow Onboarding",
  "defaultSystem": "TJ SiteOS Commerce Flow",
  "paymentHub": "https://www.t-j.space/",
  "backupPaymentHub": "https://zf-abt.pages.dev/",
  "paymentGeoFlow": "/payment-geo-flow.html",
  "geoPublishMode": "/geo-publish.html",
  "trafficOS": "/traffic-os.html",
  "adminPlanningDomain": "admin.www.t-j.space",
  "owner": {
    "displayName": "DaLong",
    "friendlyName": "Longge",
    "telegram": "@HAHAHAHAHAJL",
    "email": "wocaoac@gmail.com",
    "privatePhoneDisplayed": false
  },
  "globalDefaults": {
    "defaultLanguage": "en",
    "homepageBaselineLanguages": [
      "en",
      "zh-CN",
      "uk"
    ],
    "enabledLanguageCandidates": [
      "en",
      "zh-CN",
      "uk",
      "fr",
      "ru",
      "pt",
      "es",
      "ar",
      "hi",
      "id",
      "ja",
      "de"
    ],
    "robotLanguageRule": "Reply in the detected user language; fall back to English.",
    "requiredPolicyPages": [
      "/privacy.html",
      "/terms.html",
      "/refund.html"
    ],
    "noRefundFriendlyRule": "Use a friendly DaLong tone, but do not promise refunds automatically."
  },
  "perSiteRequiredFields": {
    "site_id": "Auto-generate from domain and launch date when not supplied.",
    "domain": "Required for every new site.",
    "site_name": "Auto-fill from brand or product name.",
    "industry": "Auto-fill from the product brief.",
    "default_language": "en",
    "enabled_languages": "Use global defaults unless the site has a narrower market.",
    "product_catalog": "Required before payment handoff.",
    "pricing": "Required before payment handoff.",
    "success_return_path": "Default to /status.html unless the site has a custom user center.",
    "robot_script_pack_path": "Required for every site with DaLong robot.",
    "login_methods": "Default to apple_oauth, google_oauth, github_oauth, phone_code, and email_code. Apple/Google/GitHub use OAuth authorization; phone/email require buyer-entered one-time codes. Password login is not the default.",
    "oauth_redirect_uris": "Auto-fill from the domain as /api/auth/oauth/callback?provider=apple, /api/auth/oauth/callback?provider=google, and /api/auth/oauth/callback?provider=github.",
    "traffic_source_policy": "Required when SEO/IAA is enabled. Allowed values: original_owned, licensed_partner, public_facts.",
    "seo_vertical": "Auto-fill from the product brief when the site has a traffic strategy.",
    "monetization_mode": "Default to none; use IAA or affiliate only when placement rules and disclosure are defined.",
    "admin_email_list": "Required before production.",
    "support_destinations": [
      "@HAHAHAHAHAJL",
      "wocaoac@gmail.com"
    ],
    "privacy_policy_url": "/privacy.html",
    "terms_url": "/terms.html",
    "refund_policy_url": "/refund.html"
  },
  "unifiedFlow": [
    "visit",
    "language_detection",
    "register_or_login",
    "verified_identity",
    "user_center",
    "dalong_robot_or_support_ticket",
    "select_product",
    "create_order",
    "t_j_space_payment_hub_handoff",
    "payment_return",
    "update_order_ticket_notification_audit",
    "geo_ai_embedding",
    "white_hat_seo_iaa_traffic_os"
  ],
  "geoPublishFlow": {
    "mode": "post_close_geo_publish",
    "page": "/geo-publish.html",
    "productId": "geo-publish-mode",
    "defaultPrice": "399.00",
    "command": "npm run geo:publish-mode",
    "generatedArtifacts": [
      "llms.txt",
      "llms-full.txt",
      "geo-publish-index.json",
      ".well-known/geo-publish-mode.json",
      "schema-service.json",
      "robots-additions.txt",
      "sitemap-additions.xml",
      "support-robot-seed.md",
      "owner-required-inputs.md",
      "geo-publish-mode-report.json",
      "geo-publish-mode-report.md"
    ],
    "preconditions": [
      "local_project_closed",
      "public_support_route_ready",
      "payment_handoff_boundary_ready",
      "robot_script_pack_ready",
      "product_catalog_and_pricing_ready"
    ],
    "stopGates": [
      "no_dns_write_by_default",
      "no_cloudflare_production_write_by_default",
      "no_provider_webhook_activation_by_default",
      "no_secret_printing",
      "no_money_movement"
    ]
  },
  "authFlow": {
    "name": "TJ Auth OS",
    "identityKey": "unified_user_id",
    "defaultMethods": [
      "apple_oauth",
      "google_oauth",
      "github_oauth",
      "phone_code",
      "email_code"
    ],
    "passwordLoginDefault": false,
    "routes": {
      "providers": "/api/auth/providers",
      "phoneStart": "/api/auth/phone/start",
      "phoneVerify": "/api/auth/phone/verify",
      "emailStart": "/api/auth/email/start",
      "emailVerify": "/api/auth/email/verify",
      "session": "/api/auth/session",
      "logout": "/api/auth/logout",
      "oauthStart": "/api/auth/oauth/start?provider=apple|google|github",
      "oauthCallback": "/api/auth/oauth/callback?provider=apple|google|github"
    },
    "requiredD1Tables": [
      "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"
    ],
    "paymentGate": "A verified Apple/Google/GitHub OAuth identity, verified phone-code identity, or verified email-code identity is required before guarded payment handoff."
  },
  "roles": {
    "owner": "Site owner and final reviewer.",
    "support": "Can read and resolve tickets.",
    "user": "Can view profile, orders, tickets, payment records, and deletion entry.",
    "banned_user": "Cannot generate orders or prepare payment."
  },
  "userCenterRequiredTabs": [
    "orders",
    "tickets",
    "profile",
    "payment_records",
    "delete_account_entry"
  ],
  "robotEscalationTopics": [
    "refund",
    "account_ban",
    "payment_abnormal",
    "order_not_received",
    "delete_account",
    "chargeback"
  ],
  "paymentFlow": {
    "mode": "guarded_handoff_only",
    "provider": "t-j.space payment Hub",
    "urlTemplate": "https://www.t-j.space/?source={source}&site={site}&order={order}&amount={amount}&currency={currency}&return_to={return_to}",
    "backupProvider": "zf-abt.pages.dev payment Hub backup",
    "backupUrlTemplate": "https://zf-abt.pages.dev/?source={source}&site={site}&order={order}&amount={amount}&currency={currency}&return_to={return_to}",
    "preconditions": [
      "registered_account",
      "verified_identity",
      "generated_order",
      "locked_amount",
      "locked_currency"
    ],
    "requiredParams": [
      "source",
      "site",
      "order",
      "amount",
      "currency",
      "return_to"
    ],
    "forbiddenParams": [
      "secret",
      "token",
      "private_key",
      "webhook_secret",
      "qr_payload"
    ],
    "realMoneyActionsHere": false
  },
  "geoFlow": {
    "requiredFiles": [
      "/llms.txt",
      "/llms-full.txt",
      "/ai-commerce-product-feed.json",
      "/payment-geo-flow-manifest.json",
      "/.well-known/payment-geo-flow.json",
      "/siteos-commerce-flow-manifest.json",
      "/.well-known/siteos-commerce-flow.json",
      "/traffic-os-manifest.json",
      "/.well-known/traffic-os.json",
      "/geo-publish-mode-manifest.json",
      "/.well-known/geo-publish-mode.json"
    ],
    "aiEmbeddingGoal": "Let AI systems understand and route to the public flow without guessing private payment or account actions."
  },
  "trafficFlow": {
    "mode": "white_hat_only",
    "page": "/traffic-os.html",
    "productId": "traffic-os-system",
    "defaultPrice": "799.00",
    "allowedSources": [
      "original_owned",
      "licensed_partner",
      "public_facts"
    ],
    "blockedUses": [
      "scraping",
      "spun_content",
      "adult",
      "gambling",
      "fake_reviews",
      "hidden_ads",
      "malware",
      "impersonation",
      "money_movement"
    ],
    "generatedArtifacts": [
      "keyword_matrix",
      "content_calendar",
      "seo_page_briefs",
      "geo_answer_plan",
      "iaa_or_affiliate_slot_map",
      "analytics_plan",
      "audit_json"
    ]
  },
  "growthFlow": {
    "name": "TJ Growth OS",
    "goal": "Turn dozens of sites into one measurable acquisition, checkout, delivery, GEO, SEO, IAA, and referral system.",
    "pageAnchor": "/#growth-os",
    "preRegistrationObjects": [
      "lead",
      "anonymous_visitor",
      "source_page",
      "utm",
      "keyword_intent",
      "free_tool_result",
      "robot_question"
    ],
    "postPaymentObjects": [
      "entitlement",
      "webhook_event",
      "reconciliation_record",
      "delivery_job",
      "notification",
      "support_ticket",
      "audit_event",
      "referral_record"
    ],
    "defaultChannels": [
      "programmatic_seo_geo_pages",
      "free_tool_lead_magnet",
      "chatgpt_ai_search_feed",
      "google_product_structured_data",
      "merchant_feed",
      "bing_indexnow",
      "directory_submissions",
      "referral_affiliate",
      "abandoned_checkout_recovery",
      "payment_failed_recovery"
    ],
    "blockedChannels": [
      "spam_email_blast",
      "platform_rule_evasion",
      "fake_reviews",
      "scraped_spun_content",
      "hidden_ads",
      "adult_or_gambling_traffic",
      "money_movement"
    ]
  },
  "leadFlow": {
    "requiredFields": [
      "lead_id",
      "anonymous_id",
      "site_id",
      "domain",
      "page_id",
      "industry",
      "language",
      "lead_magnet",
      "email_or_contact",
      "intent",
      "score",
      "created_at"
    ],
    "capturePoints": [
      "robot_widget",
      "free_geo_checker",
      "landing_page_form",
      "checkout_start",
      "support_form",
      "directory_referral"
    ]
  },
  "attributionFlow": {
    "requiredFields": [
      "attribution_id",
      "lead_id",
      "anonymous_id",
      "user_id",
      "order_id",
      "first_touch",
      "last_touch",
      "utm_source",
      "utm_medium",
      "utm_campaign",
      "referrer",
      "keyword",
      "page_id",
      "created_at"
    ],
    "rule": "Every account, order, payment record, ticket, GEO pack, SEO/IAA job, and referral must keep source attribution."
  },
  "productSkuEntitlementFlow": {
    "requiredFields": [
      "product_id",
      "sku_id",
      "price_id",
      "currency",
      "delivery_type",
      "entitlement",
      "quota",
      "robot_pack",
      "geo_pack",
      "seo_pack",
      "iaa_pack",
      "trial_days",
      "renewal_rule",
      "refund_rule"
    ],
    "rule": "Payment success opens entitlements; it does not rely on manual guessing about what the buyer purchased."
  },
  "webhookReconciliationFlow": {
    "trustedPaymentState": "provider_webhook_or_manual_provider_verification",
    "returnPageRole": "display_and_buyer_note_only",
    "requiredFields": [
      "webhook_event_id",
      "provider",
      "event_type",
      "order_id",
      "provider_payment_id",
      "idempotency_key",
      "signature_verified",
      "reconciliation_status",
      "quarantine_reason",
      "created_at"
    ],
    "requiredStatuses": [
      "created",
      "pending",
      "paying",
      "paid",
      "payment_failed",
      "webhook_reconciled",
      "fulfilling",
      "fulfilled",
      "refunded",
      "partially_refunded",
      "chargeback",
      "cancelled",
      "expired",
      "quarantined"
    ]
  },
  "jobQueueFlow": {
    "requiredJobs": [
      "send_verification",
      "send_welcome",
      "abandoned_checkout_recovery",
      "payment_failed_recovery",
      "geo_publish",
      "seo_page_brief_generation",
      "iaa_slot_map_generation",
      "robot_pack_generation",
      "support_escalation",
      "referral_settlement_review"
    ],
    "requiredFields": [
      "job_id",
      "job_type",
      "order_id",
      "user_id",
      "entitlement_id",
      "status",
      "retry_count",
      "error_reason",
      "artifact_url",
      "created_at",
      "updated_at"
    ]
  },
  "referralAffiliateFlow": {
    "requiredFields": [
      "referral_id",
      "partner_user_id",
      "referral_code",
      "coupon_code",
      "destination_url",
      "attribution_id",
      "order_id",
      "commission_rule",
      "settlement_status",
      "created_at"
    ],
    "rule": "Referral creates indirect sales, but commission settlement requires human/finance review."
  },
  "siteFactory": {
    "page": "/siteos-console.html",
    "runbook": "/docs/siteos-onboarding-runbook.md",
    "configTemplate": "/templates/siteos-site-config.example.json",
    "configSchema": "/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"
    },
    "generatedArtifacts": [
      "site-config.json",
      "site-onboarding-summary.md",
      "robot-script-seed.md",
      "geo-publish-input.json",
      "traffic-os-input.json",
      "growth-channel-plan.json",
      "integration-snippet.html",
      "owner-production-inputs.md"
    ],
    "migrationAudit": "Read-only scan for policies, robot, SiteOS scripts, GEO files, Traffic OS, Worker API, D1 migrations, and payment boundary.",
    "growthPack": "White-hat GEO, SEO, IAA, directory, referral, checkout recovery, and safety gate artifacts.",
    "blockedAutomation": [
      "dns_write",
      "secret_printing",
      "provider_webhook_activation",
      "funds_verification",
      "refund",
      "transfer",
      "withdrawal",
      "payout",
      "scraping",
      "fake_reviews",
      "hidden_ads"
    ]
  },
  "copyIntoEveryNewSite": true
}
