// src/components/docs/architecture/ArchitectureControlPlanePage.tsx
import { CodeBlock } from "@contractspec/lib.design-system";
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function ArchitectureControlPlanePage() {
  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: "Control Plane Runtime"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "The control plane is the governance layer for agentic execution. It turns incoming intent into deterministic plans, enforces risk policy before side effects, and records replayable traces for audits."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Canonical execution loop"
          }),
          /* @__PURE__ */ jsxs("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Accept intent and create execution identity + trace context."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Compile intent into a typed, deterministic plan DAG."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Verify plan against policy and risk rules."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Route into autonomous or assist mode based on verdict."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Execute steps with idempotent keys and explicit stage events."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Persist outcomes for replay, audits, and operator visibility."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Contract surfaces (v1 baseline)"
          }),
          /* @__PURE__ */ jsxs("p", {
            className: "text-muted-foreground",
            children: [
              "The runtime is contract-first. Commands, queries, events, and capabilities are explicit and versioned under",
              /* @__PURE__ */ jsx("code", {
                children: " @contractspec/lib.contracts-spec"
              }),
              "."
            ]
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            language: "text",
            code: `Commands
- controlPlane.intent.submit
- controlPlane.plan.compile
- controlPlane.plan.verify
- controlPlane.execution.start
- controlPlane.execution.approve
- controlPlane.execution.reject
- controlPlane.execution.cancel
- controlPlane.skill.install
- controlPlane.skill.disable

Queries
- controlPlane.execution.get
- controlPlane.execution.list
- controlPlane.trace.get
- controlPlane.policy.explain
- controlPlane.skill.list
- controlPlane.skill.verify

Events
- controlPlane.intent.received
- controlPlane.plan.compiled
- controlPlane.plan.rejected
- controlPlane.execution.step.started
- controlPlane.execution.step.blocked
- controlPlane.execution.step.completed
- controlPlane.execution.completed
- controlPlane.execution.failed
- controlPlane.skill.installed
- controlPlane.skill.rejected

Capabilities
- control-plane.core
- control-plane.approval
- control-plane.audit
- control-plane.skill-registry
- control-plane.channel-runtime`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Policy and safety posture"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "No side-effect action executes unless it comes from a compiled plan."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "High-risk actions are blocked from autonomous mode in v1."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Approval commands provide explicit human-in-the-loop transitions."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Skill installation is modeled as governance-controlled operations."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Trace queries expose policy rationale and step outcomes for replay."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Implementation map"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            language: "text",
            code: `packages/libs/contracts-spec/src/control-plane/
  commands/
  queries/
  events/
  capabilities/
  contracts.ts
  contracts.test.ts

packages/apps/web-landing/src/app/docs/architecture/control-plane/page.tsx
implementation_plan_controle_plane.md`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "What comes next"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "WS1 delivers the contract fabric. Next increments add planner/executor split, policy escalation, capability-bound authorization, signed skill compatibility checks, and full replay tooling."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/architecture/integration-binding",
            className: "btn-ghost",
            children: "Previous: Integration Binding"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/safety/auditing",
            className: "btn-primary",
            children: [
              "Audit Logs ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  ArchitectureControlPlanePage
};
