var n=Object.defineProperty;var s=(t)=>t;function p(t,a){this[t]=s.bind(null,a)}var u=(t,a)=>{for(var r in a)n(t,r,{get:a[r],enumerable:!0,configurable:!0,set:p.bind(a,r)})};var m=(t,a)=>()=>(t&&(a=t(t=0)),a);import{jsx as e,jsxs as o}from"react/jsx-runtime";function c(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Auto-Evolution Runbook"}),e("p",{className:"text-lg text-muted-foreground",children:"Configure sampling, approvals, experiments, and golden tests so your app keeps improving without regressions."})]}),o("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Pipeline overview"}),o("ol",{className:"list-decimal space-y-2 pl-6 text-muted-foreground text-sm",children:[e("li",{children:"Tracing middleware emits telemetry samples with tenant/user context."}),e("li",{children:"IntentAggregator batches samples (15m window, configurable)."}),e("li",{children:"IntentDetector raises error/latency/throughput signals."}),e("li",{children:"SpecGenerator produces proposals with confidence scores."}),e("li",{children:"ApprovalWorkflow routes low-confidence suggestions to humans."}),e("li",{children:"SpecExperimentRegistry rolls out approved variants using guardrails."}),e("li",{children:"TrafficRecorder captures new traffic and GoldenTestGenerator outputs suites."})]})]}),o("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Key environment variables"}),e("pre",{className:"rounded-lg border bg-muted 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`})]}),o("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Operations checklist"}),o("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground text-sm",children:[e("li",{children:"Review new `SpecSuggestion` records every morning (UI coming soon; Prisma view today)."}),e("li",{children:"Keep at least one reviewer per domain on-call for approvals."}),e("li",{children:"Attach `SpecExperimentAdapter.trackOutcome` to every runtime adapter."}),e("li",{children:"Schedule `contractspec test generate` nightly (or on deploy) to refresh golden suites."}),e("li",{children:"Feed `runGoldenTests` into CI to gate merges touching evolved specs."})]})]}),e("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((t)=>o("div",{className:"card-subtle space-y-2 p-4",children:[e("h3",{className:"font-semibold text-lg",children:t.title}),e("p",{className:"text-muted-foreground text-sm",children:t.description})]},t.title))})]})}import{jsx as i,jsxs as l}from"react/jsx-runtime";function d(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-4",children:[i("h1",{className:"font-bold text-4xl",children:"Distributed Tracing"}),i("p",{className:"text-lg text-muted-foreground",children:"ContractSpec uses OpenTelemetry (OTel) for distributed tracing. This guide explains how to configure exporters and collectors."})]}),l("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Configuration"}),i("p",{children:"Configure the OTel SDK via environment variables:"}),i("pre",{className:"rounded-lg border bg-muted 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`})]}),l("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Exporters"}),i("p",{children:"By default, the OTLP exporter is used. You can point it to:"}),l("ul",{className:"list-disc space-y-2 pl-6",children:[i("li",{children:"Jaeger"}),i("li",{children:"Tempo (Grafana)"}),i("li",{children:"Honeycomb"}),i("li",{children:"Datadog (via OTel Collector)"})]})]})]})}export{d as OpsDistributedTracingPage,c as OpsAutoEvolutionPage};
