{
  "id": "brook",
  "name": "Brook",
  "version": "0.2.0",
  "maturity": "Bounded operator-approved refund workflow verified locally (Workers/D1 and desktop/mobile browser); hosted provider sandbox and full retained contract acceptance pending.",
  "category": "support",
  "spine": {
    "id": "approved-support-action",
    "record": "a customer support request with an immutable operator-approved refund decision and provider-confirmed outcome"
  },
  "replaces": [
    {
      "name": "Freshdesk",
      "edition": null
    }
  ],
  "description": "Email-first support with recorded customer evidence and operator-approved Stripe refunds.",
  "scope": "One business, native operator sessions, shared requests.",
  "capabilities": [
    {
      "id": "owner-landing",
      "description": "Configurable, non-marketing owner identity plate with a sign-in path and an optional static product credit. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "HOME-001"
      ]
    },
    {
      "id": "operators",
      "description": "Equal operators, operator management, and server-enforced collision protection. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "OPS-001",
        "OPS-002",
        "OPS-003"
      ]
    },
    {
      "id": "email-support",
      "description": "Verified, idempotent inbound email and visible outbound delivery. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "MAIL-001",
        "MAIL-002",
        "MAIL-003",
        "MAIL-004",
        "MAIL-005",
        "MAIL-006",
        "MAIL-007",
        "MAIL-008",
        "MAIL-009",
        "MAIL-010",
        "MAIL-011",
        "MAIL-012",
        "MAIL-013",
        "MAIL-014",
        "MAIL-015",
        "MAIL-016"
      ]
    },
    {
      "id": "ticket-workspace",
      "description": "Ticket lifecycle, references, replies, notes, filtered lists, search, merge, unread state, following, and activity. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "TKT-001",
        "TKT-002",
        "TKT-003",
        "TKT-004",
        "TKT-005",
        "TKT-006",
        "TKT-007",
        "TKT-008",
        "TKT-009",
        "TKT-010",
        "TKT-011",
        "TKT-012",
        "TKT-013",
        "TKT-014",
        "TKT-015",
        "TKT-016",
        "TKT-017"
      ]
    },
    {
      "id": "customer-context",
      "description": "Unified customer records with support and optional commerce context. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "CUST-001",
        "CUST-002",
        "CUST-003",
        "CUST-004",
        "CUST-005",
        "CUST-006",
        "CUST-007",
        "CUST-008",
        "CUST-009"
      ]
    },
    {
      "id": "situation-board-and-sla",
      "description": "Situation-board metrics, business calendars, deadline tiers, breach behavior, and measured response times. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "QUEUE-001",
        "QUEUE-002",
        "QUEUE-003",
        "QUEUE-004",
        "QUEUE-005",
        "QUEUE-006",
        "QUEUE-007"
      ]
    },
    {
      "id": "resolution-guidance",
      "description": "Versioned policies and evidence-backed AI plans, triage, drafts, and summaries. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "GUIDE-001",
        "GUIDE-002",
        "GUIDE-003",
        "GUIDE-004",
        "AI-001",
        "AI-002",
        "AI-003",
        "AI-004",
        "AI-005",
        "AI-006",
        "AI-007",
        "AI-008",
        "AI-009",
        "AI-010",
        "AI-011"
      ]
    },
    {
      "id": "commerce-resolution",
      "description": "Optional order and payment evidence plus explicit, idempotent operator-approved actions. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "ACT-001",
        "ACT-002",
        "ACT-003",
        "ACT-004",
        "ACT-005",
        "ACT-006",
        "ACT-007",
        "ACT-008",
        "ACT-009",
        "ACT-010",
        "ACT-011",
        "ACT-012"
      ]
    },
    {
      "id": "operator-notifications",
      "description": "Coalesced operator email notifications with quiet hours and visible failure. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "NOTE-001",
        "NOTE-002",
        "NOTE-003",
        "NOTE-004",
        "NOTE-005",
        "NOTE-006"
      ]
    },
    {
      "id": "customer-feedback",
      "description": "Private, one-use resolution surveys, visible ratings, and satisfaction scores. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "FB-001",
        "FB-002",
        "FB-003",
        "FB-004"
      ]
    },
    {
      "id": "data-portability",
      "description": "Complete portable archives and filtered operational exports. This is retained contract scope; see IMPLEMENTATION.md for implemented boundaries.",
      "clauses": [
        "DATA-001",
        "DATA-002"
      ]
    }
  ],
  "nonGoals": [
    "multiple workspaces or tenants",
    "granular roles, groups, or private queues",
    "chat widgets, social, SMS, voice, or a public help centre",
    "outbound campaigns or a generic workflow builder",
    "automatic semantic ticket merging",
    "autonomous AI replies, state changes, or external actions",
    "external commerce mutations other than refunds",
    "a reporting module beyond the figures the situation board defines",
    "a library of operator-maintained canned replies",
    "marketing engagement signals such as email open and click rates",
    "native mobile applications",
    "arbitrary outbound webhooks",
    "a built-in payment or commerce system",
    "malware scanning"
  ],
  "externals": [
    {
      "id": "cloudflare-platform",
      "required": true,
      "why": "Cloudflare Worker, D1 and optional Email Routing host owner-controlled application data and inbound email.",
      "data": [
        "support records",
        "native session hashes",
        "email bodies and metadata"
      ],
      "adapters": []
    },
    {
      "id": "sendgrid",
      "required": false,
      "requiredWhen": "customer replies or hosted magic links are sent through SendGrid",
      "why": "Delivers operator-approved customer mail and native sign-in links.",
      "data": [
        "recipient email",
        "approved message text",
        "magic-link URL"
      ],
      "adapters": [
        "mail.sender.v1"
      ]
    },
    {
      "id": "stripe",
      "required": false,
      "requiredWhen": "Stripe payment evidence or refunds are enabled",
      "why": "Authoritative payment evidence and explicitly approved refunds.",
      "data": [
        "charge identifier",
        "approved refund amount",
        "decision identifier"
      ],
      "adapters": [
        "commerce.payments.v1"
      ]
    }
  ],
  "env": [
    {
      "name": "APP_URL",
      "secret": false,
      "required": true,
      "why": "Canonical HTTPS origin and CSRF boundary."
    },
    {
      "name": "INITIAL_OPERATOR_EMAIL",
      "secret": false,
      "required": true,
      "why": "Native initial operator allow-list and first-login bootstrap."
    },
    {
      "name": "AUTH_FROM_EMAIL",
      "secret": false,
      "required": true,
      "why": "Verified magic-link sender."
    },
    {
      "name": "APP_SIGNING_SECRET",
      "secret": true,
      "required": true,
      "why": "HMAC session and one-time token secret, at least 32 characters."
    },
    {
      "name": "SUPPORT_FROM_EMAIL",
      "secret": false,
      "required": false,
      "why": "Configured inbound destination and customer reply sender."
    },
    {
      "name": "SENDGRID_API_KEY",
      "secret": true,
      "required": false,
      "why": "Authorizes the shared single-attempt mail sender."
    },
    {
      "name": "STRIPE_SECRET_KEY",
      "secret": true,
      "required": false,
      "why": "Authorizes Stripe evidence reads and operator-approved refunds."
    },
    {
      "name": "LOCAL_DEVELOPMENT",
      "secret": false,
      "required": false,
      "why": "Local-only migration and HTTP mode; never set in production."
    },
    {
      "name": "SENDGRID_WEBHOOK_PUBLIC_KEY",
      "secret": false,
      "required": false,
      "why": "SPKI base64 ECDSA public key for authoritative SendGrid delivery callbacks."
    }
  ],
  "deploy": {
    "healthPath": "/health",
    "operatorPath": "/app",
    "publicPaths": [
      "/",
      "/signin",
      "/health",
      "/assets/",
      "/api/auth/",
      "/api/mail/events"
    ]
  },
  "customFields": [],
  "extensionPoints": {
    "contributions": [],
    "policies": [],
    "events": [],
    "slots": [],
    "adapters": [
      "mail.sender.v1",
      "commerce.payments.v1"
    ]
  },
  "limits": {
    "status": "unverified-load-capacity",
    "note": "No load capacity claim; inbound parsing refuses messages over 2 MB.",
    "inboundMessageBytes": 2000000
  },
  "accessibility": {
    "level": "WCAG 2.2 AA",
    "status": "target; desktop/mobile browser journey checks only",
    "includes": [
      "operator app",
      "sign-in flow"
    ]
  },
  "operatingCost": {
    "status": "not measured",
    "currency": "USD",
    "assumptions": "One business deployment; usage depends on traffic and email/refunds.",
    "excluded": [
      "Cloudflare",
      "SendGrid",
      "Stripe fees"
    ]
  },
  "composition": {
    "base": "base",
    "family": "support",
    "edition": "brook",
    "modules": [
      "support-intake",
      "support-email",
      "sendgrid-email"
    ]
  }
}
