import l from"@contractspec/lib.ui-link";import{jsx as i,jsxs as p}from"react/jsx-runtime";function o({title:d="Need the operating layer on top of OSS ContractSpec?",body:n="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:s="See what Studio adds",href:r="https://www.contractspec.studio/docs"}){return p("div",{className:"card-subtle space-y-3 p-6",children:[i("h3",{className:"font-semibold text-lg",children:d}),i("p",{className:"text-muted-foreground text-sm",children:n}),i(l,{href:r,className:"btn-primary",children:s})]})}import{CodeBlock as a}from"@contractspec/lib.design-system";import c from"@contractspec/lib.ui-link";import{ChevronRight as m}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function k(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"CI gating with deterministic diffs"}),e("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"CI workflow running ContractSpec validation and drift checks."}),e("li",{children:"Machine-readable output for PR annotations."}),e("li",{children:"Deterministic contract diffs in review."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Add the CI workflow"}),e("p",{className:"text-muted-foreground text-sm",children:"Copy the template from the CLI package."}),e(a,{language:"bash",filename:"ci-copy",code:"cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml"}),t("p",{className:"text-muted-foreground text-sm",children:["Expected output: new workflow file in ",e("code",{children:".github/workflows"}),"."]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Run CI locally"}),e(a,{language:"bash",filename:"ci-local",code:"contractspec ci --format json --check-drift"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: JSON summary including pass/fail counts and drift status (if configured)."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Add a diff check"}),e("p",{className:"text-muted-foreground text-sm",children:"Use the diff command to inspect breaking changes in PRs."}),e(a,{language:"bash",filename:"ci-diff",code:"contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: deterministic diff with breaking change hints."})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Example package"}),e("p",{className:"text-muted-foreground text-sm",children:"The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."}),e(a,{language:"bash",filename:"crm-ci",code:`cd packages/examples/crm-pipeline
bun run build
bun run validate`})]}),e(o,{title:"Need continuous checks tied to outcomes?",body:"Studio closes the loop with post-change verification and learning dividends that improve future decisions."})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(c,{href:"/docs/guides",className:"btn-primary",children:["Back to guides ",e(m,{size:16})]}),e(c,{href:"/docs",className:"btn-ghost",children:"Docs home"})]})]})}export{k as GuideCIDiffGatingPage};
