// @bun
var l=Object.defineProperty;var p=(a)=>a;function m(a,i){this[a]=p.bind(null,i)}var g=(a,i)=>{for(var o in i)l(a,o,{get:i[o],enumerable:!0,configurable:!0,set:m.bind(i,o)})};var b=(a,i)=>()=>(a&&(i=a(a=0)),i);import u from"@contractspec/lib.ui-link";import{jsx as d,jsxs as f}from"react/jsx-runtime";function n({title:a="Need the operating layer on top of OSS ContractSpec?",body:i="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:o="See what Studio adds",href:r="https://www.contractspec.studio/docs"}){return f("div",{className:"card-subtle space-y-3 p-6",children:[d("h3",{className:"font-semibold text-lg",children:a}),d("p",{className:"text-muted-foreground text-sm",children:i}),d(u,{href:r,className:"btn-primary",children:o})]})}import{CodeBlock as c}from"@contractspec/lib.design-system";import s from"@contractspec/lib.ui-link";import{ChevronRight as h}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function I(){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(c,{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(c,{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(c,{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(c,{language:"bash",filename:"crm-ci",code:`cd packages/examples/crm-pipeline
bun run build
bun run validate`})]}),e(n,{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(s,{href:"/docs/guides",className:"btn-primary",children:["Back to guides ",e(h,{size:16})]}),e(s,{href:"/docs",className:"btn-ghost",children:"Docs home"})]})]})}export{I as GuideCIDiffGatingPage};
