// src/components/docs/ops/AutoEvolutionOpsPage.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function OpsAutoEvolutionPage() {
  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: "Auto-Evolution Runbook"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground text-lg",
            children: "Configure sampling, approvals, experiments, and golden tests so your app keeps improving without regressions."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Pipeline overview"
          }),
          /* @__PURE__ */ jsxs("ol", {
            className: "text-muted-foreground list-decimal space-y-2 pl-6 text-sm",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Tracing middleware emits telemetry samples with tenant/user context."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "IntentAggregator batches samples (15m window, configurable)."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "IntentDetector raises error/latency/throughput signals."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "SpecGenerator produces proposals with confidence scores."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "ApprovalWorkflow routes low-confidence suggestions to humans."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "SpecExperimentRegistry rolls out approved variants using guardrails."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "TrafficRecorder captures new traffic and GoldenTestGenerator outputs suites."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Key environment variables"
          }),
          /* @__PURE__ */ jsx("pre", {
            className: "bg-muted rounded-lg border p-4 text-sm",
            children: `# Telemetry sampling
AUTO_EVOLUTION_SAMPLE_RATE=0.02
AUTO_EVOLUTION_WINDOW_MS=900000

# Suggestion thresholds
AUTO_EVOLUTION_MIN_CONFIDENCE=0.55
AUTO_EVOLUTION_AUTO_APPROVE=0.2

# Guardrails (fallback defaults)
AUTO_EVOLUTION_MAX_ERROR_RATE=0.02
AUTO_EVOLUTION_MAX_P99_MS=500`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Operations checklist"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-disc space-y-2 pl-6 text-sm",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Review new `SpecSuggestion` records every morning (UI coming soon; Prisma view today)."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Keep at least one reviewer per domain on-call for approvals."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Attach `SpecExperimentAdapter.trackOutcome` to every runtime adapter."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Schedule `contractspec test generate` nightly (or on deploy) to refresh golden suites."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Feed `runGoldenTests` into CI to gate merges touching evolved specs."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsx("div", {
        className: "grid gap-4 md:grid-cols-3",
        children: [
          {
            title: "Sampling",
            description: "Start at 1–2% of traffic. Increase only after sanitization is verified."
          },
          {
            title: "Approvals",
            description: "High-risk ops (money, compliance) should never auto-approve. Use ApprovalWorkflow notes for audit."
          },
          {
            title: "On-call alerts",
            description: "Tie SpecExperimentController rollbacks into PagerDuty/Slack so engineers see guardrail trips immediately."
          }
        ].map((card) => /* @__PURE__ */ jsxs("div", {
          className: "card-subtle space-y-2 p-4",
          children: [
            /* @__PURE__ */ jsx("h3", {
              className: "text-lg font-semibold",
              children: card.title
            }),
            /* @__PURE__ */ jsx("p", {
              className: "text-muted-foreground text-sm",
              children: card.description
            })
          ]
        }, card.title))
      })
    ]
  });
}

// src/components/docs/ops/DistributedTracingOpsPage.tsx
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function OpsDistributedTracingPage() {
  return /* @__PURE__ */ jsxs2("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h1", {
            className: "text-4xl font-bold",
            children: "Distributed Tracing"
          }),
          /* @__PURE__ */ jsx2("p", {
            className: "text-muted-foreground text-lg",
            children: "ContractSpec uses OpenTelemetry (OTel) for distributed tracing. This guide explains how to configure exporters and collectors."
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "Configuration"
          }),
          /* @__PURE__ */ jsx2("p", {
            children: "Configure the OTel SDK via environment variables:"
          }),
          /* @__PURE__ */ jsx2("pre", {
            className: "bg-muted rounded-lg border p-4 text-sm",
            children: `OTEL_SERVICE_NAME=my-service
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.1`
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "Exporters"
          }),
          /* @__PURE__ */ jsx2("p", {
            children: "By default, the OTLP exporter is used. You can point it to:"
          }),
          /* @__PURE__ */ jsxs2("ul", {
            className: "list-disc space-y-2 pl-6",
            children: [
              /* @__PURE__ */ jsx2("li", {
                children: "Jaeger"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Tempo (Grafana)"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Honeycomb"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Datadog (via OTel Collector)"
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  OpsDistributedTracingPage,
  OpsAutoEvolutionPage
};
