{
  "tasks": [
    {
      "id": "1",
      "title": "Stabilize Mermaid diagram rendering across documentation vault",
      "description": "Correct Mermaid syntax/rendering issues across the documentation vault and validate all Mermaid blocks.",
      "details": "Source PRD: .taskmaster/docs/prd-mermaid-diagram-rendering-stabilization.md. Scope covered 57 Mermaid blocks and 11 failing blocks. The source PRD records that all targeted files now pass mmdc parse validation and the full vault sweep passes.",
      "testStrategy": "Run the same mmdc-based syntax validation across all Markdown Mermaid blocks and confirm zero parser failures in Obsidian/markdown previews.",
      "priority": "medium",
      "status": "done",
      "dependencies": [],
      "subtasks": [
        {
          "id": 1,
          "title": "Fix Security Architecture email/password sequence",
          "description": "Normalize parser-sensitive sequence text in 01 - Architecture/Security Architecture.md.",
          "details": "Avoid semicolons and ambiguous inline punctuation in sequence messages.",
          "status": "done",
          "priority": "medium",
          "dependencies": [],
          "testStrategy": "mmdc parse for the specific block.",
          "parentId": "undefined"
        },
        {
          "id": 2,
          "title": "Fix authentication login and refresh diagrams",
          "description": "Normalize parser-sensitive token and refresh-token sequence text in Authentication Flow.",
          "details": "Split method-like or expression-like message text into parser-safe plain text lines.",
          "status": "done",
          "priority": "medium",
          "dependencies": [],
          "testStrategy": "mmdc parse for both Authentication Flow blocks.",
          "parentId": "undefined"
        },
        {
          "id": 3,
          "title": "Fix chat, delivery, dispute, OAuth, purchase request, referral, registration, and seller-offer diagrams",
          "description": "Clean the remaining Mermaid sequence diagrams with invalid or ambiguous syntax.",
          "details": "Split multi-recipient arrows, remove parser-conflicting semicolon/expression text, and keep intent unchanged.",
          "status": "done",
          "priority": "medium",
          "dependencies": [],
          "testStrategy": "Full vault mmdc parser sweep across all Mermaid blocks.",
          "parentId": "undefined"
        }
      ]
    },
    {
      "id": "2",
      "title": "Implement platform audit remediation plan",
      "description": "Address the code-backed security and consistency issues identified in the 2026-05-24 platform audit remediation PRD.",
      "details": "Source PRD: .taskmaster/docs/prd-platform-audit-remediation-plan-2026-05-24.md. Target backend hardening first, then documentation/runtime alignment. Delivery order suggested by PRD: security/auth, rate limiting, passkeys, Web3 verification, socket hardening, dispute hold controls, docs/API alignment.",
      "testStrategy": "Add focused regression tests for route auth/ownership, passkey challenge/verification, Web3 verification semantics, socket authorization, rate limiting tiers, and payout/release dispute holds. Update API docs after behavior is implemented.",
      "priority": "high",
      "status": "pending",
      "dependencies": [],
      "subtasks": [
        {
          "id": 1,
          "title": "Secure unauthenticated endpoints and owner enforcement",
          "description": "Require authenticateToken and owner/admin checks on exposed payment, AI, and legacy notification routes.",
          "details": "Derive notification userId from authenticated principal. Protect payment history and mutation endpoints. Restrict AI calls to authenticated users with per-user budgets. Add denied-access audit logs.",
          "status": "pending",
          "priority": "high",
          "dependencies": [],
          "testStrategy": "Unauthorized callers receive 401/403; users cannot access or mutate other users' payments/notifications; admins retain authorized access.",
          "parentId": "undefined"
        },
        {
          "id": 2,
          "title": "Re-enable and scope rate limiting",
          "description": "Restore global and route-tiered rate limits for public-sensitive paths.",
          "details": "Use stricter limits for auth, financial, AI, file upload, and verification paths. Keep public reads at relaxed limits. Add observability for 429 spikes.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            1
          ],
          "testStrategy": "Exercise configured limits per tier and confirm expected 429 responses without blocking ordinary reads.",
          "parentId": "undefined"
        },
        {
          "id": 3,
          "title": "Replace stubbed passkey/WebAuthn flow",
          "description": "Implement production-grade WebAuthn registration/authentication and shared challenge storage.",
          "details": "Use real attestation/assertion verification, Redis-backed TTL challenges, refresh-token persistence/rotation, and deterministic malformed/reused/expired challenge errors.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            1
          ],
          "testStrategy": "Registration, login, replay, expired challenge, and refresh-token continuity tests pass.",
          "parentId": "undefined"
        },
        {
          "id": 4,
          "title": "Strengthen DePay/Web3 payment verification",
          "description": "Verify transaction recipient, token contract, and amount, not only receipt success.",
          "details": "Decode ERC-20 Transfer logs, compare recipient against escrow address, validate token contract and decimals-adjusted minimum amount, store verifier evidence and idempotency fingerprint.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            1
          ],
          "testStrategy": "Reject successful but wrong-recipient/wrong-token/underpaid tx hashes; accept only matching transfers.",
          "parentId": "undefined"
        },
        {
          "id": 5,
          "title": "Lock Socket.IO room joins to authenticated context",
          "description": "Remove trust in client-supplied user/buyer/seller room IDs.",
          "details": "Validate socket handshake token, derive server-side room membership, reject mismatched joins, and monitor suspicious join attempts.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            1
          ],
          "testStrategy": "A user cannot subscribe to another user's rooms; legitimate realtime notifications still arrive.",
          "parentId": "undefined"
        },
        {
          "id": 6,
          "title": "Enforce dispute hold before payout and release operations",
          "description": "Add payment hold state and central release/refund guards that block disputed funds.",
          "details": "Introduce explicit dispute hold fields or state, enforce in PaymentCoordinator and payout/release services, return clear 409/423 responses, and backfill/report blocked payments.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            1,
            4
          ],
          "testStrategy": "Open dispute blocks release/refund until resolved or explicitly overridden through authorized path.",
          "parentId": "undefined"
        },
        {
          "id": 7,
          "title": "Align documentation, API references, and runtime enums",
          "description": "Normalize disputed/payment/request status docs and implementation references after security behavior changes.",
          "details": "Resolve mismatch around absent dispute module, endpoint names, status enums, and action names across Data Models, API Reference, and Flows.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            1,
            2,
            3,
            4,
            5,
            6
          ],
          "testStrategy": "Docs match implemented routes, models, enum values, and state transitions.",
          "parentId": "undefined"
        }
      ]
    },
    {
      "id": "3",
      "title": "Migrate payment architecture toward Request Network and internal funds management",
      "description": "Plan and implement provider-neutral payment flows, Request Network pay-in support, funds ledger, webhook reconciliation, release/refund orchestration, UI migration, and SHKeeper decommissioning.",
      "details": "Source PRD: .taskmaster/docs/prd-request-network-migration-and-funds-management.md. The PRD recommends phased migration behind a provider adapter, Secure Payment Pages first, platform-controlled escrow/payee destination, and a first-class internal funds ledger before release/refund enforcement.",
      "testStrategy": "Use feature flags, provider fixture tests, webhook signature/idempotency tests, ledger invariant tests, migration dry-run reports, and limited cohort rollout before default provider switch.",
      "priority": "high",
      "status": "in-progress",
      "dependencies": [
        "2"
      ],
      "subtasks": [
        {
          "id": 1,
          "title": "Define provider-neutral payment contracts and adapter",
          "description": "Create provider-agnostic payment interface with pay-in, webhook, payout/refund instruction creation, status lookup, and search methods.",
          "details": "",
          "status": "pending",
          "dependencies": [],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 2,
          "title": "Implement provider configuration, feature flags, and safe rollback",
          "description": "Add runtime provider selection, rollout controls, env validation, and one-command kill-switch to revert to SHKeeper.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.1"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 3,
          "title": "Create internal funds and payment ledger model",
          "description": "Define FundsAccount, immutable LedgerEntry, and balance/query views for expected/held/releasable/released/refunded/disputed states.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.1"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 4,
          "title": "Build migration and indexing plan for existing SHKeeper records",
          "description": "Add DB indexes for payment/provider fields and run backfill to produce a migration report with skipped/failed/ambiguous historical entries.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.3"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 5,
          "title": "Implement Request Network pay-in intent and secure payment pages",
          "description": "Add Request Network intent/service layer, secure payment URLs, and validation of network/currency/reference/amount before setting paid state.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.2"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 6,
          "title": "Implement signed Request Network webhook intake",
          "description": "Build /api/payment/request-network/webhook with raw-body signature verification, idempotent delivery handling, and immutable event audit rows.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.2"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 7,
          "title": "Implement reconciliation and repair jobs",
          "description": "Add periodic Request Network payment search/reconciliation and manual replay support to fix missed or delayed events.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.5",
            "3.6"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 8,
          "title": "Replace checkout and payment UI with provider-neutral flows",
          "description": "Introduce provider-neutral payment components, remove SHKeeper walletAddress assumptions for RN, and keep legacy path only for existing SHKeeper records.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.5"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 9,
          "title": "Add payout/release and refund orchestration using ledger gates",
          "description": "Create release/refund instruction queue with signer, tx payloads, provider tx hash, and strict ledger invariants before action.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.3",
            "3.7"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 10,
          "title": "Update release/refund APIs and marketplace release paths",
          "description": "Refactor release routes to consume ledger state and provider-neutral contracts; deprecate direct simulation where possible.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.8",
            "3.9"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 11,
          "title": "Add comprehensive observability, runbooks, and incident controls",
          "description": "Track webhook latency, ledger imbalance, release failures, and reconciliation lag with alerts, on-call runbooks, and rollback procedures.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.6",
            "3.8",
            "3.9",
            "3.10"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        },
        {
          "id": 12,
          "title": "Add end-to-end integration, migration, and rollback test suites",
          "description": "Cover backend contract tests, provider fixture tests, UI acceptance, rollout simulation, DRYRUN migration, and release rollback rehearsals.",
          "details": "",
          "status": "pending",
          "dependencies": [
            "3.6",
            "3.10",
            "3.11"
          ],
          "parentTaskId": 3,
          "parentId": "undefined"
        }
      ],
      "updatedAt": "2026-05-24T05:52:52.473Z"
    },
    {
      "id": "4",
      "title": "Define backend security and refactor strategy from latest audit",
      "description": "Convert the backend stack security/refactor assessment into concrete architecture decisions, documentation deliverables, and developer handoff criteria.",
      "details": "Source audit: .taskmaster/docs/audit-backend-stack-security-and-refactor-assessment-2026-05-24.md. This task is advisory/architecture-focused and should run in parallel with immediate hardening. It should produce the decision artifacts needed before any backend-core rewrite or provider migration is started.",
      "testStrategy": "Review and sign off each architecture document with backend, payments, frontend, and operations stakeholders. Confirm every open question has an owner or explicit deferred decision before implementation work begins.",
      "priority": "high",
      "status": "pending",
      "dependencies": [],
      "subtasks": [
        {
          "id": 1,
          "title": "Assign security ownership and launch decision criteria",
          "description": "Define who owns security decisions and what must be true before public launch or migration work proceeds.",
          "details": "Answer ownership questions from the audit: security owner, launch safety bar, whether launch prioritizes hardening or redesign, and whether external penetration testing is required.",
          "status": "pending",
          "priority": "high",
          "dependencies": [],
          "testStrategy": "Written owner/RACI and launch gate checklist are accepted by leadership and engineering.",
          "parentId": "undefined"
        },
        {
          "id": 2,
          "title": "Produce threat model for escrow platform",
          "description": "Document protected assets, actors, trust boundaries, and abuse cases for the financial marketplace.",
          "details": "Include buyer, seller, admin, support, unauthenticated attacker, compromised user/admin, provider, malicious webhook sender, browser/backend/database/Redis/provider/wallet/Socket.IO trust boundaries, and abuse cases such as fake payment proof, replayed webhook, arbitrary room join, stolen token, double payout, dispute bypass, email abuse, and AI abuse.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            1
          ],
          "testStrategy": "Threat model maps each high-risk finding to at least one mitigation task or accepted risk.",
          "parentId": "undefined"
        },
        {
          "id": 3,
          "title": "Specify funds ledger and escrow state machine",
          "description": "Define canonical money movement and legal state transitions before refactor or provider migration.",
          "details": "Create specs for FundsAccount, LedgerEntry, FundsBalance, gross paid, provider fees, platform fees, held, disputed, releasable, released, refunded, idempotency keys, reconciliation behavior, purchase request states, payment states, escrow/funds states, dispute states, valid transitions, forbidden transitions, and release/refund/admin override preconditions.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            2
          ],
          "testStrategy": "Spec can be used to reject double-release, release-during-dispute, underfunded payout, and ambiguous provider-event scenarios.",
          "parentId": "undefined"
        },
        {
          "id": 4,
          "title": "Create authorization matrix for REST and Socket.IO",
          "description": "Map every endpoint and realtime event to access level, ownership checks, state preconditions, rate-limit tier, and audit-log requirement.",
          "details": "Include public/authenticated/owner/buyer/seller/admin/support/service-role classifications. Socket.IO rooms must be server-derived from authenticated identity, not client-supplied user IDs.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            2
          ],
          "testStrategy": "No route or socket event remains unmapped; implementation tasks can reference matrix rows directly.",
          "parentId": "undefined"
        },
        {
          "id": 5,
          "title": "Decide session, passkey, and admin step-up architecture",
          "description": "Choose browser session model and high-risk admin authentication requirements.",
          "details": "Decide localStorage versus httpOnly cookies, access/refresh token lifetimes, CSRF strategy, refresh rotation, WebAuthn requirements, OAuth requirements, device/session revocation, and whether payouts/role changes require step-up authentication or two-person approval.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            2
          ],
          "testStrategy": "Decision record lists chosen model, rejected alternatives, migration cost, and required implementation tasks.",
          "parentId": "undefined"
        },
        {
          "id": 6,
          "title": "Specify webhook security and provider adapter contracts",
          "description": "Define provider-neutral payment interface and signed webhook processing rules.",
          "details": "Document createPayInIntent, getPayInStatus, handleProviderWebhook, createHostedPaymentLink, createReleaseInstruction, createRefundInstruction, getPayoutStatus, searchProviderPayments, raw-body signature verification, replay prevention, delivery ID idempotency, duplicate/unknown event behavior, retry semantics, dead-letter/replay storage, and alert thresholds.",
          "status": "pending",
          "priority": "high",
          "dependencies": [
            3
          ],
          "testStrategy": "Contracts cover SHKeeper legacy, Request Network, manual/admin wallet, invalid signatures, duplicate deliveries, and missed webhook reconciliation.",
          "parentId": "undefined"
        },
        {
          "id": 7,
          "title": "Define secure build and supply-chain policy",
          "description": "Reduce npm/dependency compromise risk across frontend and any remaining Node services.",
          "details": "Specify package manager and lockfile policy, CI install mode, dependency update cadence, advisory monitoring, npm provenance/signature policy where available, secrets handling, reproducible production builds, and separation between frontend npm risk and backend-core risk.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            1
          ],
          "testStrategy": "Policy is actionable in CI and includes response steps for compromised package, leaked token, and vulnerable dependency alerts.",
          "parentId": "undefined"
        },
        {
          "id": 8,
          "title": "Make backend-core stack decision",
          "description": "Choose whether the security-critical backend core remains TypeScript or moves to Go/Kotlin/Rust/Python.",
          "details": "Evaluate team capability, two-year maintainability, operational footprint, rewrite cost, dual-stack complexity, auditability, supply-chain exposure, and which modules belong in a payment/auth/escrow core versus the existing marketplace/chat API.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            2,
            3,
            4,
            5,
            6,
            7
          ],
          "testStrategy": "Architecture decision record states chosen stack, scope of extraction, non-goals, migration phases, rollback criteria, and owners.",
          "parentId": "undefined"
        },
        {
          "id": 9,
          "title": "Create migration and operational runbooks",
          "description": "Document rollout, rollback, and incident response for the selected backend/funds architecture.",
          "details": "Include SHKeeper legacy read path, provider feature flag, ledger backfill, validation report before enforcement, rollback criteria, webhook cutoff, manual reconciliation, failed webhook, duplicate/missing payment, stuck release, disputed release attempt, compromised admin, leaked API key, provider outage, chain/RPC outage, suspicious payment proof, and npm/package compromise.",
          "status": "pending",
          "priority": "medium",
          "dependencies": [
            8
          ],
          "testStrategy": "Runbooks identify owner, trigger, detection signal, immediate action, recovery action, and post-incident documentation for each scenario.",
          "parentId": "undefined"
        }
      ]
    },
    {
      "id": "5",
      "title": "Deliver Telegram-native app, bot, and wallet experience",
      "description": "Create a Telegram bot plus Mini App surface so users can complete Amanat buyer, seller, escrow, chat, dispute, payment, release/refund, and support workflows from inside Telegram.",
      "details": "Source PRD: .taskmaster/docs/prd-telegram-native-app-bot-wallet.md. Keep this as a separate delivery track from security remediation and Request Network migration. Identity, bot navigation, Mini App shell, and notifications can start behind flags; wallet/payment crediting and release/refund actions must use canonical backend authorization, provider adapter, funds ledger, escrow state machine, idempotency, and dispute holds.",
      "testStrategy": "Use Telegram sandbox and production bot separation, Mini App client matrix testing, provider/wallet payment fixtures, backend authorization and ledger invariant tests, webhook/callback replay tests, and staged rollout analytics before launch.",
      "status": "pending",
      "dependencies": [],
      "priority": "high",
      "subtasks": [
        {
          "id": 1,
          "title": "Define Telegram product surface and flow map",
          "description": "Document which Amanat workflows live in bot messages, which live in the Mini App, and which remain web/admin-only for first release.",
          "details": "Map buyer, seller, admin/support, unauthenticated, linked-user, and unlinked-user journeys. Specify deep-link entry points for request details, offer review, payment, dispute, delivery evidence, and account linking. Separate first-release scope from later enhancements and map every Telegram action to backend API/state transitions.",
          "status": "pending",
          "dependencies": [],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 2,
          "title": "Build Telegram identity linking and session model",
          "description": "Implement secure account linking between Telegram users and Amanat accounts.",
          "details": "Backend must verify Telegram Mini App initData before creating a Telegram session. Store an auditable Telegram user ID to Amanat user link. Support existing users, new users, unlinking, blocked accounts, duplicate-link attempts, session expiry, replay protection, rate limits, and audit logs.",
          "status": "pending",
          "dependencies": [
            1
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 3,
          "title": "Implement bot command and notification foundation",
          "description": "Create the Telegram bot backend for commands, inline keyboards, callback queries, deep links, and outbound notifications.",
          "details": "Support start/help/link/status/request/offer/payment/dispute/settings basics. Use short opaque IDs or signed tokens for callback payloads. Process incoming updates idempotently with rate limits. Respect notification preferences, quiet/error states, failed delivery, blocked bot, and retry observability.",
          "status": "pending",
          "dependencies": [
            1,
            2
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 4,
          "title": "Build Telegram Mini App shell for marketplace workflows",
          "description": "Deliver the mobile-first Mini App that gives users the full Amanat workflow surface inside Telegram.",
          "details": "Use Telegram theme, safe-area, viewport, back button, haptics, and main/bottom button patterns. Support browsing requests, creating/editing requests, reviewing offers, payment state, evidence uploads, delivery actions, and dispute actions. Launch from bot profile, menu button, inline buttons, and direct links with startapp context. Handle unlinked accounts, expired sessions, unsupported clients, and fallback web links.",
          "status": "pending",
          "dependencies": [
            1,
            2
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 5,
          "title": "Add Telegram payment and wallet strategy",
          "description": "Evaluate and implement safe payment entry points for Telegram-native users without weakening escrow accounting.",
          "details": "Compare Bot API payments/Stars, Wallet Pay, TON Pay, TON Connect, Request Network links, and existing crypto checkout. Select a first payment path and document rejected options. Store provider, Telegram user ID, deep-link source, payment reference, invoice/order/request ID, currency, amount, expiration, and idempotency key. Wallet/TON flows must validate recipient, asset, amount, memo/reference, confirmation status, and reconciliation evidence before crediting escrow. Refund/release behavior must remain compatible with canonical ledger and dispute holds.",
          "status": "pending",
          "dependencies": [
            2,
            4
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 6,
          "title": "Expose escrow, delivery, dispute, and release actions safely",
          "description": "Make Telegram actions useful for real escrow work while preserving backend state authority.",
          "details": "Telegram users can see current escrow state, next allowed actions, and blockers. Delivery confirmation, evidence upload, refund request, dispute open/respond, and release approval must route through backend precondition checks. High-risk actions require fresh confirmation and audit logging with Telegram context. Disputed or held funds cannot be released through Telegram shortcuts.",
          "status": "pending",
          "dependencies": [
            4,
            5
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 7,
          "title": "Add admin and support surface for Telegram-originated cases",
          "description": "Give support/admin users visibility and controls for Telegram-originated users, payments, and bot events.",
          "details": "Admin UI/API should show Telegram linked identity, bot notification status, launch source, payment provider, and wallet/payment references. Support can resend links, revoke Telegram link, block bot access, and inspect Telegram-originated events. Admin overrides must use the same step-up or two-person policy as web flows when configured.",
          "status": "pending",
          "dependencies": [
            2,
            3,
            5
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 8,
          "title": "Add security, compliance, and abuse controls for Telegram",
          "description": "Threat-model the Telegram surface and add controls before launch.",
          "details": "Cover forged init data, callback replay, deep-link parameter tampering, phishing links, bot token leakage, spam, account takeover, wallet spoofing, fake payment proof, and support impersonation. Document secrets, bot webhook endpoints, Wallet Pay keys, TON Connect manifest, CORS, CSP, allowed origins, rate limits, and monitoring for update failures, abnormal callbacks, payment mismatches, blocked notifications, and suspicious wallet activity.",
          "status": "pending",
          "dependencies": [
            2,
            3,
            5,
            6
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        },
        {
          "id": 9,
          "title": "Prepare QA, rollout, analytics, and launch operations",
          "description": "Prepare the Telegram app and bot for controlled release.",
          "details": "Test Telegram iOS, Android, Desktop, Web, light/dark themes, compact/fullscreen modes, slow network, blocked bot, expired sessions, and payment cancellation. Keep sandbox/test bot and production bot environments separated. Roll out through feature flags, internal allowlist, beta cohort, and production enablement. Track activation, linked accounts, request creation, offer response, payment start/completion, dispute activity, release approval, and notification opt-outs. Add runbooks for bot outage, Telegram API outage, payment provider outage, stuck payment, duplicate callback, suspicious wallet proof, and compromised bot token.",
          "status": "pending",
          "dependencies": [
            3,
            4,
            5,
            6,
            7,
            8
          ],
          "priority": "high",
          "testStrategy": "See Telegram-native PRD acceptance criteria.",
          "parentId": "undefined"
        }
      ]
    }
  ],
  "metadata": {
    "version": "1.0.0",
    "lastModified": "2026-05-24T05:52:52.473Z",
    "taskCount": 5,
    "completedCount": 1,
    "tags": [
      "master"
    ]
  }
}
