// @bun
// src/components/docs/safety/SafetyOverviewPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function SafetyOverviewPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "Safety Overview"
          }),
          /* @__PURE__ */ jsxs("p", {
            className: "text-muted-foreground",
            children: [
              "ContractSpec is designed with ",
              /* @__PURE__ */ jsx("strong", {
                children: "safety by default"
              }),
              ". Every operation is governed by policies, every change is audited, and every deployment is reversible. This section covers the core safety mechanisms that protect your application and data."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Core safety features"
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "space-y-6",
            children: [
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: /* @__PURE__ */ jsx(Link, {
                      href: "/docs/safety/signing",
                      className: "text-violet-400 hover:text-violet-300",
                      children: "Spec Signing"
                    })
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground",
                    children: "All specifications are cryptographically signed before deployment. This ensures that only authorized changes reach production and that specs cannot be tampered with in transit or at rest. Signatures are verified at runtime, and unsigned specs are rejected."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: /* @__PURE__ */ jsx(Link, {
                      href: "/docs/safety/pdp",
                      className: "text-violet-400 hover:text-violet-300",
                      children: "Policy Decision Points (PDP)"
                    })
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground",
                    children: "Every API call, UI render, and data access passes through a centralized Policy Decision Point. The PDP evaluates attribute-based access control (ABAC) rules and PII policies to determine whether the operation is allowed. This ensures consistent enforcement across your entire application."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: /* @__PURE__ */ jsx(Link, {
                      href: "/docs/safety/auditing",
                      className: "text-violet-400 hover:text-violet-300",
                      children: "Audit Logs"
                    })
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground",
                    children: "ContractSpec automatically records every operation in tamper-evident audit logs. These logs capture who did what, when, and why\u2014including policy decisions, data access, and administrative actions. Audit logs are essential for compliance, security investigations, and debugging."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: /* @__PURE__ */ jsx(Link, {
                      href: "/docs/safety/migrations",
                      className: "text-violet-400 hover:text-violet-300",
                      children: "Migrations"
                    })
                  }),
                  /* @__PURE__ */ jsxs("p", {
                    className: "text-muted-foreground",
                    children: [
                      "Schema and data migrations are managed through",
                      " ",
                      /* @__PURE__ */ jsx("strong", {
                        children: "MigrationSpecs"
                      }),
                      ". Each migration is versioned, reversible, and tested before deployment. This allows you to evolve your application safely without downtime or data loss."
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: "Dark Launch & Rollback"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground",
                    children: 'New features can be deployed in "dark launch" mode, where they run in production but are not visible to users. This allows you to test performance and correctness with real traffic before enabling the feature. If issues arise, you can instantly roll back to the previous version without redeploying.'
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "space-y-2",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "text-xl font-semibold",
                    children: "Data Classification"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground",
                    children: "Fields in your specs can be tagged with sensitivity levels (e.g., PII, PHI, confidential). The policy engine uses these tags to enforce access controls, redaction rules, and data retention policies automatically. This reduces the risk of accidental data leaks."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Why safety matters"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Modern applications handle sensitive data and critical operations. A single bug or misconfiguration can lead to data breaches, compliance violations, or service outages. ContractSpec's safety features are not optional add-ons\u2014they are built into the core platform and enforced automatically."
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "By making safety the default, ContractSpec allows you to move fast without breaking things. You can deploy new features confidently, knowing that policies are enforced, changes are audited, and rollbacks are always available."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Next steps"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Explore each safety feature in detail using the links above, or continue with the advanced topics:"
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "flex flex-wrap gap-4 pt-4",
            children: [
              /* @__PURE__ */ jsxs(Link, {
                href: "/docs/safety/signing",
                className: "btn-primary",
                children: [
                  "Spec Signing ",
                  /* @__PURE__ */ jsx(ChevronRight, {
                    size: 16,
                    className: "inline"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs(Link, {
                href: "/docs/safety/pdp",
                className: "btn-ghost",
                children: [
                  "Policy Decision Points ",
                  /* @__PURE__ */ jsx(ChevronRight, {
                    size: 16,
                    className: "inline"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs(Link, {
                href: "/docs/safety/auditing",
                className: "btn-ghost",
                children: [
                  "Audit Logs ",
                  /* @__PURE__ */ jsx(ChevronRight, {
                    size: 16,
                    className: "inline"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs(Link, {
                href: "/docs/safety/migrations",
                className: "btn-ghost",
                children: [
                  "Migrations ",
                  /* @__PURE__ */ jsx(ChevronRight, {
                    size: 16,
                    className: "inline"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs(Link, {
                href: "/docs/safety/security-trust",
                className: "btn-ghost",
                children: [
                  "Security & Trust ",
                  /* @__PURE__ */ jsx(ChevronRight, {
                    size: 16,
                    className: "inline"
                  })
                ]
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetySigningPage.tsx
import Link2 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight2 } from "lucide-react";
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function SafetySigningPage() {
  return /* @__PURE__ */ jsxs2("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-2",
        children: [
          /* @__PURE__ */ jsx2("h1", {
            className: "text-4xl font-bold",
            children: "Spec Signing"
          }),
          /* @__PURE__ */ jsx2("p", {
            className: "text-muted-foreground text-lg",
            children: "Signing ensures specs haven't been tampered with and provides an audit trail of all changes."
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-6",
        children: [
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "How it works"
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground",
                children: "Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "Signing a spec"
              }),
              /* @__PURE__ */ jsx2("div", {
                className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
                children: /* @__PURE__ */ jsx2("pre", {
                  children: `contractspec sign app.spec.ts --key ~/.contractspec/key.pem
contractspec deploy --signed app.spec.ts.signed`
                })
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "Verifying signatures"
              }),
              /* @__PURE__ */ jsx2("div", {
                className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
                children: /* @__PURE__ */ jsx2("pre", {
                  children: `contractspec verify app.spec.ts.signed
# Output: \u2713 Signature valid
# Signed by: alice@example.com
# Timestamp: 2024-11-08T10:30:00Z`
                })
              })
            ]
          }),
          /* @__PURE__ */ jsx2("div", {
            className: "flex items-center gap-4 pt-4",
            children: /* @__PURE__ */ jsxs2(Link2, {
              href: "/docs/safety/pdp",
              className: "btn-primary",
              children: [
                "Next: Policy Decision Points ",
                /* @__PURE__ */ jsx2(ChevronRight2, {
                  size: 16
                })
              ]
            })
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetyAuditingPage.tsx
import Link3 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight3 } from "lucide-react";
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
function SafetyAuditingPage() {
  return /* @__PURE__ */ jsxs3("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h1", {
            className: "text-4xl font-bold",
            children: "Audit Logs"
          }),
          /* @__PURE__ */ jsxs3("p", {
            className: "text-muted-foreground",
            children: [
              "An ",
              /* @__PURE__ */ jsx3("strong", {
                children: "audit log"
              }),
              " (also called an audit trail) is a chronological record of system activities. According to",
              " ",
              /* @__PURE__ */ jsx3("a", {
                href: "https://www.sumologic.com/glossary/audit-log/",
                target: "_blank",
                rel: "noopener noreferrer",
                className: "text-violet-400 hover:text-violet-300",
                children: "Sumo Logic"
              }),
              ', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."'
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Why audit logs matter"
          }),
          /* @__PURE__ */ jsxs3("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsxs3("div", {
                children: [
                  /* @__PURE__ */ jsx3("h3", {
                    className: "text-lg font-semibold",
                    children: "Accountability"
                  }),
                  /* @__PURE__ */ jsx3("p", {
                    className: "text-muted-foreground",
                    children: 'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'
                  })
                ]
              }),
              /* @__PURE__ */ jsxs3("div", {
                children: [
                  /* @__PURE__ */ jsx3("h3", {
                    className: "text-lg font-semibold",
                    children: "Security"
                  }),
                  /* @__PURE__ */ jsx3("p", {
                    className: "text-muted-foreground",
                    children: "Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs3("div", {
                children: [
                  /* @__PURE__ */ jsx3("h3", {
                    className: "text-lg font-semibold",
                    children: "Compliance"
                  }),
                  /* @__PURE__ */ jsx3("p", {
                    className: "text-muted-foreground",
                    children: "Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs3("div", {
                children: [
                  /* @__PURE__ */ jsx3("h3", {
                    className: "text-lg font-semibold",
                    children: "Debugging"
                  }),
                  /* @__PURE__ */ jsx3("p", {
                    className: "text-muted-foreground",
                    children: "When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "What ContractSpec logs"
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "ContractSpec automatically logs every significant operation, including:"
          }),
          /* @__PURE__ */ jsxs3("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "API calls"
                  }),
                  " \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Policy decisions"
                  }),
                  " \u2013 Every decision made by the",
                  " ",
                  /* @__PURE__ */ jsx3(Link3, {
                    href: "/docs/safety/pdp",
                    className: "text-violet-400 hover:text-violet-300",
                    children: "Policy Decision Point"
                  }),
                  ", including the rule that matched and the reason for the decision."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Data access"
                  }),
                  " \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Workflow execution"
                  }),
                  " \u2013 Every step in a workflow, including retries, compensations, and failures."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Administrative actions"
                  }),
                  " \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Authentication events"
                  }),
                  " \u2013 Login attempts, password resets, and session expirations."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Audit log format"
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "Each audit log entry is a structured JSON object containing:"
          }),
          /* @__PURE__ */ jsx3("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx3("pre", {
              children: `{
  "timestamp": "2025-11-13T14:32:15.123Z",
  "eventId": "evt_abc123",
  "eventType": "capability.invoked",
  "actor": {
    "userId": "user_xyz789",
    "role": "admin",
    "ipAddress": "203.0.113.42"
  },
  "resource": {
    "type": "capability",
    "id": "transferFunds",
    "version": "1.2.0"
  },
  "action": "execute",
  "result": "success",
  "metadata": {
    "inputs": {
      "recipient": "user_def456",
      "amount": 100.00
    },
    "outputs": {
      "transactionId": "txn_ghi789",
      "timestamp": "2025-11-13T14:32:15.456Z"
    }
  },
  "policyDecision": {
    "decision": "PERMIT",
    "ruleId": "allow-admin-transfers",
    "reason": "User has admin role"
  }
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Storage and retention"
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "Audit logs are stored in a tamper-evident append-only log. Once written, entries cannot be modified or deleted. This ensures the integrity of the audit trail."
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "ContractSpec supports multiple storage backends:"
          }),
          /* @__PURE__ */ jsxs3("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Local file system"
                  }),
                  " \u2013 For development and testing."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Cloud object storage"
                  }),
                  " \u2013 S3, GCS, or Azure Blob Storage for production."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "SIEM integration"
                  }),
                  " \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Querying audit logs"
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "ContractSpec provides a query API for searching audit logs. You can filter by:"
          }),
          /* @__PURE__ */ jsxs3("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx3("li", {
                children: "Time range"
              }),
              /* @__PURE__ */ jsx3("li", {
                children: "Event type"
              }),
              /* @__PURE__ */ jsx3("li", {
                children: "Actor (user ID, role, IP address)"
              }),
              /* @__PURE__ */ jsx3("li", {
                children: "Resource (capability, data view, workflow)"
              }),
              /* @__PURE__ */ jsx3("li", {
                children: "Result (success, failure, denied)"
              })
            ]
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: 'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs3("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Review logs regularly"
                  }),
                  " \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Protect log access"
                  }),
                  " \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Retain logs long enough"
                  }),
                  " \u2013 Check your compliance requirements and configure retention policies accordingly."
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Test log integrity"
                  }),
                  " \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx3(Link3, {
            href: "/docs/safety/pdp",
            className: "btn-ghost",
            children: "Previous: Policy Decision Points"
          }),
          /* @__PURE__ */ jsxs3(Link3, {
            href: "/docs/safety/migrations",
            className: "btn-primary",
            children: [
              "Next: Migrations ",
              /* @__PURE__ */ jsx3(ChevronRight3, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetyMigrationsPage.tsx
import Link4 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight4 } from "lucide-react";
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
function SafetyMigrationsPage() {
  return /* @__PURE__ */ jsxs4("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h1", {
            className: "text-4xl font-bold",
            children: "Migrations"
          }),
          /* @__PURE__ */ jsxs4("p", {
            className: "text-muted-foreground",
            children: [
              "A ",
              /* @__PURE__ */ jsx4("strong", {
                children: "schema migration"
              }),
              " (also called a database migration) is a set of incremental, reversible changes to a database schema. According to",
              " ",
              /* @__PURE__ */ jsx4("a", {
                href: "https://en.wikipedia.org/wiki/Schema_migration",
                target: "_blank",
                rel: "noopener noreferrer",
                className: "text-violet-400 hover:text-violet-300",
                children: "Wikipedia"
              }),
              `, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Why migrations matter"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "As your application evolves, you'll need to change your data model\u2014adding new fields, renaming tables, changing data types, or restructuring relationships. Without a disciplined approach, these changes can lead to:"
          }),
          /* @__PURE__ */ jsxs4("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx4("li", {
                children: "Data loss or corruption"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Downtime during deployments"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Inconsistencies between environments (dev, staging, production)"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Difficulty rolling back failed changes"
              })
            ]
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "How MigrationSpec works"
          }),
          /* @__PURE__ */ jsxs4("p", {
            className: "text-muted-foreground",
            children: [
              "In ContractSpec, migrations are defined using",
              " ",
              /* @__PURE__ */ jsx4("strong", {
                children: "MigrationSpec"
              }),
              ". Each migration has:"
            ]
          }),
          /* @__PURE__ */ jsxs4("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Version"
                  }),
                  ' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.'
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Up function"
                  }),
                  ` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Down function"
                  }),
                  ` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Dependencies"
                  }),
                  " \u2013 Other migrations that must run before this one."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Validation"
                  }),
                  ' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").'
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Example MigrationSpec"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "Here's a migration that adds an email verification field to the users table:"
          }),
          /* @__PURE__ */ jsx4("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx4("pre", {
              children: `migrationId: add-email-verified
version: 2025-11-13-001
dependencies: []

up:
  - sql: |
      ALTER TABLE users
      ADD COLUMN email_verified BOOLEAN DEFAULT FALSE NOT NULL;
  - sql: |
      CREATE INDEX idx_users_email_verified
      ON users(email_verified);

down:
  - sql: |
      DROP INDEX idx_users_email_verified;
  - sql: |
      ALTER TABLE users
      DROP COLUMN email_verified;

validation:
  - sql: |
      SELECT COUNT(*) FROM users
      WHERE email_verified IS NULL;
    expectZeroRows: true`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Running migrations"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "Migrations are applied automatically during deployment. The ContractSpec runtime:"
          }),
          /* @__PURE__ */ jsxs4("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-2",
            children: [
              /* @__PURE__ */ jsx4("li", {
                children: "Checks which migrations have already been applied (stored in a migrations table)."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Identifies new migrations that need to run."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Executes them in order, respecting dependencies."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Runs validation checks to ensure success."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Records the migration as applied."
              })
            ]
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "If a migration fails, the deployment is aborted, and the system remains in its previous state. You can then fix the migration and redeploy."
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Rolling back migrations"
          }),
          /* @__PURE__ */ jsxs4("p", {
            className: "text-muted-foreground",
            children: [
              "If you need to roll back a deployment, ContractSpec automatically runs the ",
              /* @__PURE__ */ jsx4("strong", {
                children: "down"
              }),
              " functions of any migrations that were applied. This restores the database to its previous state."
            ]
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "Note that rollbacks are not always possible\u2014for example, if you've deleted a column, you cannot recover the data unless you have a backup. For destructive changes, it's best to use a multi-step migration:"
          }),
          /* @__PURE__ */ jsxs4("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-2",
            children: [
              /* @__PURE__ */ jsx4("li", {
                children: "Add the new column (reversible)."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Backfill data from the old column to the new column (reversible)."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Update application code to use the new column (reversible)."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Drop the old column (irreversible\u2014only do this after confirming the new column works)."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs4("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Test migrations locally"
                  }),
                  " \u2013 Run them against a copy of production data to catch issues before deploying."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Keep migrations small"
                  }),
                  " \u2013 Each migration should do one thing. This makes them easier to understand and roll back."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Write reversible migrations"
                  }),
                  " \u2013 Always provide a down function, even if you don't plan to roll back."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Use transactions"
                  }),
                  " \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Avoid destructive changes"
                  }),
                  " \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Version your migrations"
                  }),
                  " \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Document breaking changes"
                  }),
                  " \u2013 If a migration requires application code changes, note this in the migration description."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Zero-downtime migrations"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "Some migrations can cause downtime if not handled carefully. For example, adding a NOT NULL column to a large table can lock the table for minutes. To avoid this, use a multi-step approach:"
          }),
          /* @__PURE__ */ jsxs4("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-2",
            children: [
              /* @__PURE__ */ jsx4("li", {
                children: "Add the column as nullable."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Backfill the column in batches (without locking the table)."
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Add the NOT NULL constraint once all rows are populated."
              })
            ]
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx4(Link4, {
            href: "/docs/safety/auditing",
            className: "btn-ghost",
            children: "Previous: Audit Logs"
          }),
          /* @__PURE__ */ jsxs4(Link4, {
            href: "/docs/advanced/renderers",
            className: "btn-primary",
            children: [
              "Next: Advanced Topics ",
              /* @__PURE__ */ jsx4(ChevronRight4, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetyPDPPage.tsx
import Link5 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight5 } from "lucide-react";
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
function SafetyPDPPage() {
  return /* @__PURE__ */ jsxs5("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h1", {
            className: "text-4xl font-bold",
            children: "Policy Decision Points"
          }),
          /* @__PURE__ */ jsxs5("p", {
            className: "text-muted-foreground",
            children: [
              "A ",
              /* @__PURE__ */ jsx5("strong", {
                children: "Policy Decision Point (PDP)"
              }),
              " is a centralized component that evaluates access control policies and makes authorization decisions. According to",
              " ",
              /* @__PURE__ */ jsx5("a", {
                href: "https://www.strongdm.com/blog/policy-decision-point",
                target: "_blank",
                rel: "noopener noreferrer",
                className: "text-violet-400 hover:text-violet-300",
                children: "StrongDM"
              }),
              ', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."'
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "How the PDP works in ContractSpec"
          }),
          /* @__PURE__ */ jsx5("p", {
            className: "text-muted-foreground",
            children: "In ContractSpec, the PDP is invoked on every operation\u2014whether it's rendering a UI component, executing a capability, or querying a data view. The flow is:"
          }),
          /* @__PURE__ */ jsxs5("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-3",
            children: [
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Request evaluation"
                  }),
                  " \u2013 The runtime sends a request to the PDP containing:",
                  /* @__PURE__ */ jsxs5("ul", {
                    className: "mt-2 ml-6 list-inside list-disc space-y-1",
                    children: [
                      /* @__PURE__ */ jsx5("li", {
                        children: "The user's identity and attributes (roles, groups, location, etc.)"
                      }),
                      /* @__PURE__ */ jsx5("li", {
                        children: "The resource being accessed (capability, field, workflow step)"
                      }),
                      /* @__PURE__ */ jsx5("li", {
                        children: "The action being performed (read, write, execute)"
                      }),
                      /* @__PURE__ */ jsx5("li", {
                        children: "Contextual information (time of day, device type, IP address)"
                      })
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Policy evaluation"
                  }),
                  " \u2013 The PDP evaluates the request against all applicable ",
                  /* @__PURE__ */ jsx5("strong", {
                    children: "PolicySpecs"
                  }),
                  ". These specs define rules using attribute-based access control (ABAC) and can reference:",
                  /* @__PURE__ */ jsxs5("ul", {
                    className: "mt-2 ml-6 list-inside list-disc space-y-1",
                    children: [
                      /* @__PURE__ */ jsx5("li", {
                        children: `User attributes (e.g., "role == 'admin'")`
                      }),
                      /* @__PURE__ */ jsx5("li", {
                        children: `Resource attributes (e.g., "field.sensitivity == 'PII'")`
                      }),
                      /* @__PURE__ */ jsx5("li", {
                        children: 'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'
                      })
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Decision return"
                  }),
                  " \u2013 The PDP returns one of:",
                  /* @__PURE__ */ jsxs5("ul", {
                    className: "mt-2 ml-6 list-inside list-disc space-y-1",
                    children: [
                      /* @__PURE__ */ jsxs5("li", {
                        children: [
                          /* @__PURE__ */ jsx5("code", {
                            className: "bg-background/50 rounded px-2 py-1",
                            children: "PERMIT"
                          }),
                          " ",
                          "\u2013 The operation is allowed."
                        ]
                      }),
                      /* @__PURE__ */ jsxs5("li", {
                        children: [
                          /* @__PURE__ */ jsx5("code", {
                            className: "bg-background/50 rounded px-2 py-1",
                            children: "DENY"
                          }),
                          " ",
                          "\u2013 The operation is blocked."
                        ]
                      }),
                      /* @__PURE__ */ jsxs5("li", {
                        children: [
                          /* @__PURE__ */ jsx5("code", {
                            className: "bg-background/50 rounded px-2 py-1",
                            children: "REDACT"
                          }),
                          " ",
                          "\u2013 The operation is allowed, but sensitive fields are masked."
                        ]
                      })
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Enforcement"
                  }),
                  " \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Auditing"
                  }),
                  " \u2013 Every PDP decision is logged to the",
                  " ",
                  /* @__PURE__ */ jsx5(Link5, {
                    href: "/docs/safety/auditing",
                    className: "text-violet-400 hover:text-violet-300",
                    children: "audit log"
                  }),
                  ", including the request, decision, and reasoning."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Example PolicySpec"
          }),
          /* @__PURE__ */ jsx5("p", {
            className: "text-muted-foreground",
            children: "Here's a simple policy that restricts access to PII fields:"
          }),
          /* @__PURE__ */ jsx5("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx5("pre", {
              children: `policyId: pii-access-control
version: '1.0.0'.0.0
rules:
  - id: allow-admin-full-access
    effect: PERMIT
    condition: user.role == 'admin'
    
  - id: redact-pii-for-support
    effect: REDACT
    condition: |
      user.role == 'support' AND
      field.sensitivity == 'PII'
    redactFields: ['ssn', 'creditCard', 'dateOfBirth']
    
  - id: deny-pii-for-others
    effect: DENY
    condition: |
      user.role NOT IN ['admin', 'support'] AND
      field.sensitivity == 'PII'`
            })
          }),
          /* @__PURE__ */ jsx5("p", {
            className: "text-muted-foreground",
            children: "With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Benefits of centralized decision-making"
          }),
          /* @__PURE__ */ jsxs5("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Consistency"
                  }),
                  " \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Auditability"
                  }),
                  " \u2013 Every decision is logged, making it easy to trace why access was granted or denied."
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Flexibility"
                  }),
                  " \u2013 Policies can be updated without changing application code."
                ]
              }),
              /* @__PURE__ */ jsxs5("li", {
                children: [
                  /* @__PURE__ */ jsx5("strong", {
                    children: "Security"
                  }),
                  " \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Performance considerations"
          }),
          /* @__PURE__ */ jsx5("p", {
            className: "text-muted-foreground",
            children: "Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"
          }),
          /* @__PURE__ */ jsxs5("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx5("li", {
                children: "Caching policy decisions for identical requests"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Compiling policies into efficient bytecode"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Evaluating only the minimal set of rules needed for each request"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Running the PDP in-process to avoid network latency"
              })
            ]
          }),
          /* @__PURE__ */ jsx5("p", {
            className: "text-muted-foreground",
            children: "In practice, PDP overhead is typically less than 1ms per request."
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx5(Link5, {
            href: "/docs/safety/signing",
            className: "btn-ghost",
            children: "Previous: Spec Signing"
          }),
          /* @__PURE__ */ jsxs5(Link5, {
            href: "/docs/safety/auditing",
            className: "btn-primary",
            children: [
              "Next: Audit Logs ",
              /* @__PURE__ */ jsx5(ChevronRight5, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetyTenantIsolationPage.tsx
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
function SafetyTenantIsolationPage() {
  return /* @__PURE__ */ jsxs6("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs6("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx6("h1", {
            className: "text-4xl font-bold",
            children: "Tenant Isolation"
          }),
          /* @__PURE__ */ jsx6("p", {
            className: "text-muted-foreground text-lg",
            children: 'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'
          })
        ]
      }),
      /* @__PURE__ */ jsxs6("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx6("h2", {
            className: "text-2xl font-bold",
            children: "Layer 1: RLS Middleware"
          }),
          /* @__PURE__ */ jsxs6("p", {
            children: [
              "The primary defense is the Prisma middleware that rewrites queries to include ",
              /* @__PURE__ */ jsx6("code", {
                children: "WHERE tenantId = ?"
              }),
              ". This protects against developer error (forgetting to filter)."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs6("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx6("h2", {
            className: "text-2xl font-bold",
            children: "Layer 2: Isolation Validator"
          }),
          /* @__PURE__ */ jsxs6("p", {
            children: [
              "For high-security environments, you can use the",
              " ",
              /* @__PURE__ */ jsx6("code", {
                children: "IsolationValidator"
              }),
              " in your test suite to verify that every query generated by your operations actually includes the tenant ID."
            ]
          }),
          /* @__PURE__ */ jsx6("pre", {
            className: "bg-muted rounded-lg border p-4 text-sm",
            children: `import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';

test('findUser query is isolated', () => {
  const isValid = IsolationValidator.validateQuery(
    'User',
    'findFirst',
    args,
    'tenant-123'
  );
  expect(isValid).toBe(true);
});`
          })
        ]
      }),
      /* @__PURE__ */ jsxs6("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx6("h2", {
            className: "text-2xl font-bold",
            children: "Layer 3: Policy Engine"
          }),
          /* @__PURE__ */ jsx6("p", {
            children: "The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."
          })
        ]
      })
    ]
  });
}

// src/components/docs/safety/SafetySecurityTrustPage.tsx
import Link6 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight6 } from "lucide-react";
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
function SafetySecurityTrustPage() {
  return /* @__PURE__ */ jsxs7("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs7("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx7("h1", {
            className: "text-4xl font-bold",
            children: "Security & Trust"
          }),
          /* @__PURE__ */ jsx7("p", {
            className: "text-muted-foreground",
            children: "ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."
          })
        ]
      }),
      /* @__PURE__ */ jsxs7("div", {
        className: "card-subtle space-y-4 p-6",
        children: [
          /* @__PURE__ */ jsx7("h2", {
            className: "text-2xl font-bold",
            children: "Security policy"
          }),
          /* @__PURE__ */ jsx7("p", {
            className: "text-muted-foreground text-sm",
            children: "We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."
          }),
          /* @__PURE__ */ jsxs7(Link6, {
            href: "/SECURITY.md",
            className: "btn-primary",
            children: [
              "Read the security policy ",
              /* @__PURE__ */ jsx7(ChevronRight6, {
                size: 16
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs7("div", {
        className: "grid gap-4 md:grid-cols-2",
        children: [
          /* @__PURE__ */ jsxs7("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx7("h3", {
                className: "text-lg font-semibold",
                children: "Release hygiene"
              }),
              /* @__PURE__ */ jsx7("p", {
                className: "text-muted-foreground text-sm",
                children: "We ship with deterministic CI, changesets, and contract validation so teams can trust every release."
              }),
              /* @__PURE__ */ jsxs7("ul", {
                className: "text-muted-foreground space-y-2 text-sm",
                children: [
                  /* @__PURE__ */ jsx7("li", {
                    children: "Changesets required for published packages."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "CI gate for contract validation and drift detection."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Rollback-friendly release process."
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs7("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx7("h3", {
                className: "text-lg font-semibold",
                children: "Data handling"
              }),
              /* @__PURE__ */ jsx7("p", {
                className: "text-muted-foreground text-sm",
                children: "ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."
              }),
              /* @__PURE__ */ jsxs7("ul", {
                className: "text-muted-foreground space-y-2 text-sm",
                children: [
                  /* @__PURE__ */ jsx7("li", {
                    children: "Schema-level sensitivity tags."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Policy Decision Point enforcement."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Audit logs for operational traceability."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs7("div", {
        className: "grid gap-4 md:grid-cols-2",
        children: [
          /* @__PURE__ */ jsxs7("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx7("h3", {
                className: "text-lg font-semibold",
                children: "Supply chain"
              }),
              /* @__PURE__ */ jsx7("p", {
                className: "text-muted-foreground text-sm",
                children: "We track dependency updates and keep the monorepo build reproducible."
              }),
              /* @__PURE__ */ jsxs7("ul", {
                className: "text-muted-foreground space-y-2 text-sm",
                children: [
                  /* @__PURE__ */ jsx7("li", {
                    children: "Dependabot + Renovate-style updates where available."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Signed release artifacts planned for Studio release cycles."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Transparent changelogs for every package."
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs7("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx7("h3", {
                className: "text-lg font-semibold",
                children: "Responsible disclosure"
              }),
              /* @__PURE__ */ jsx7("p", {
                className: "text-muted-foreground text-sm",
                children: "We respond quickly to security reports and coordinate fixes before public disclosure."
              }),
              /* @__PURE__ */ jsxs7("ul", {
                className: "text-muted-foreground space-y-2 text-sm",
                children: [
                  /* @__PURE__ */ jsx7("li", {
                    children: "Security response within 5 business days."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Private disclosure via security@contractspec.io."
                  }),
                  /* @__PURE__ */ jsx7("li", {
                    children: "Credit for researchers (with permission)."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs7("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx7("h2", {
            className: "text-2xl font-bold",
            children: "Next steps"
          }),
          /* @__PURE__ */ jsx7("p", {
            className: "text-muted-foreground",
            children: "Explore the broader safety controls or read the roadmap to see upcoming trust investments."
          }),
          /* @__PURE__ */ jsxs7("div", {
            className: "flex flex-wrap gap-4 pt-4",
            children: [
              /* @__PURE__ */ jsxs7(Link6, {
                href: "/docs/safety",
                className: "btn-ghost",
                children: [
                  "Safety overview ",
                  /* @__PURE__ */ jsx7(ChevronRight6, {
                    size: 16
                  })
                ]
              }),
              /* @__PURE__ */ jsxs7(Link6, {
                href: "/ROADMAP.md",
                className: "btn-ghost",
                children: [
                  "Roadmap ",
                  /* @__PURE__ */ jsx7(ChevronRight6, {
                    size: 16
                  })
                ]
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  SafetyTenantIsolationPage,
  SafetySigningPage,
  SafetySecurityTrustPage,
  SafetyPDPPage,
  SafetyOverviewPage,
  SafetyMigrationsPage,
  SafetyAuditingPage
};
