@contractspec/bundle.library 3.8.12 → 3.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (683) hide show
  1. package/.turbo/turbo-build.log +614 -602
  2. package/CHANGELOG.md +97 -0
  3. package/dist/application/context-storage/index.js +1 -1
  4. package/dist/application/index.js +11 -11
  5. package/dist/application/mcp/cliMcp.js +6 -6
  6. package/dist/application/mcp/cliMcp.onboarding.d.ts +4 -0
  7. package/dist/application/mcp/cliMcp.onboarding.js +2 -0
  8. package/dist/application/mcp/cliMcp.test.d.ts +1 -0
  9. package/dist/application/mcp/common.js +1 -1
  10. package/dist/application/mcp/contractsMcp.js +2 -2
  11. package/dist/application/mcp/contractsMcp.test.d.ts +1 -0
  12. package/dist/application/mcp/contractsMcpAdoptionTools.d.ts +3 -0
  13. package/dist/application/mcp/contractsMcpAdoptionTools.js +2 -0
  14. package/dist/application/mcp/contractsMcpResources.js +2 -2
  15. package/dist/application/mcp/contractsMcpTools.js +1 -1
  16. package/dist/application/mcp/contractsMcpTypes.d.ts +16 -0
  17. package/dist/application/mcp/docsMcp.catalog.js +2 -2
  18. package/dist/application/mcp/docsMcp.data.js +1 -1
  19. package/dist/application/mcp/docsMcp.js +3 -3
  20. package/dist/application/mcp/docsMcp.prompts.js +3 -3
  21. package/dist/application/mcp/docsMcp.reference.js +2 -2
  22. package/dist/application/mcp/docsMcp.resources.js +2 -2
  23. package/dist/application/mcp/docsMcp.tools.js +2 -2
  24. package/dist/application/mcp/index.js +11 -11
  25. package/dist/application/mcp/internalMcp.js +2 -2
  26. package/dist/application/mcp/normalizeMcpRequest.js +1 -1
  27. package/dist/application/mcp/providerRankingMcp.js +1 -1
  28. package/dist/bundles/LibraryBundle.d.ts +19 -111
  29. package/dist/bundles/LibraryBundle.js +1 -1
  30. package/dist/bundles/index.js +1 -1
  31. package/dist/components/docs/DocsIndexPage.js +2 -2
  32. package/dist/components/docs/advanced/AdvancedMCPPage.js +3 -3
  33. package/dist/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -1
  34. package/dist/components/docs/advanced/AdvancedRenderersPage.js +2 -2
  35. package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -4
  36. package/dist/components/docs/advanced/AdvancedTelemetryPage.js +2 -2
  37. package/dist/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -2
  38. package/dist/components/docs/advanced/index.js +9 -9
  39. package/dist/components/docs/architecture/ArchitectureAppConfigPage.js +6 -6
  40. package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +3 -3
  41. package/dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -7
  42. package/dist/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -6
  43. package/dist/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -2
  44. package/dist/components/docs/architecture/ArchitectureOverviewPage.js +1 -1
  45. package/dist/components/docs/architecture/index.js +20 -20
  46. package/dist/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -1
  47. package/dist/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -1
  48. package/dist/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -1
  49. package/dist/components/docs/comparison/ComparisonOverviewPage.js +1 -1
  50. package/dist/components/docs/comparison/ComparisonWindmillPage.js +1 -1
  51. package/dist/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -1
  52. package/dist/components/docs/comparison/index.js +1 -1
  53. package/dist/components/docs/docsManifest.js +1 -1
  54. package/dist/components/docs/ecosystem/IntegrationsPage.js +2 -2
  55. package/dist/components/docs/ecosystem/PluginsPage.js +4 -4
  56. package/dist/components/docs/ecosystem/RegistryPage.js +4 -4
  57. package/dist/components/docs/ecosystem/TemplatesPage.js +3 -3
  58. package/dist/components/docs/ecosystem/index.js +11 -11
  59. package/dist/components/docs/examples/DocsExamplesPage.js +1 -17
  60. package/dist/components/docs/examples/ExampleShowcasePage.d.ts +1 -1
  61. package/dist/components/docs/examples/ExampleShowcasePage.js +2 -17
  62. package/dist/components/docs/examples/exampleShowcaseData.d.ts +2 -2
  63. package/dist/components/docs/examples/exampleShowcaseData.js +2 -17
  64. package/dist/components/docs/examples/exampleShowcaseData.test.d.ts +1 -0
  65. package/dist/components/docs/examples/index.js +2 -17
  66. package/dist/components/docs/generated/docs-index.generated.js +1 -1
  67. package/dist/components/docs/generated/index.d.ts +7 -1
  68. package/dist/components/docs/generated/index.js +1 -1
  69. package/dist/components/docs/generated/loader.js +1 -1
  70. package/dist/components/docs/getting-started/CLIPage.js +6 -5
  71. package/dist/components/docs/getting-started/CompatibilityPage.js +1 -1
  72. package/dist/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  73. package/dist/components/docs/getting-started/DeveloperToolsPage.js +1 -1
  74. package/dist/components/docs/getting-started/HelloWorldPage.js +5 -5
  75. package/dist/components/docs/getting-started/InstallationPage.js +3 -3
  76. package/dist/components/docs/getting-started/StartHerePage.js +4 -2
  77. package/dist/components/docs/getting-started/TroubleshootingPage.js +2 -2
  78. package/dist/components/docs/getting-started/VSCodeExtensionPage.js +1 -1
  79. package/dist/components/docs/getting-started/getting-started.docblocks.js +2 -2
  80. package/dist/components/docs/getting-started/index.js +60 -80
  81. package/dist/components/docs/guides/GuideCIDiffGatingPage.js +2 -2
  82. package/dist/components/docs/guides/GuideConnectInRepoPage.js +30 -5
  83. package/dist/components/docs/guides/GuideContractTypesPage.js +6 -6
  84. package/dist/components/docs/guides/GuideDocsPipelinePage.js +3 -3
  85. package/dist/components/docs/guides/GuideFirstModuleBundlePage.js +4 -4
  86. package/dist/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -2
  87. package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  88. package/dist/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -8
  89. package/dist/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -6
  90. package/dist/components/docs/guides/GuideReleaseCapsulesPage.d.ts +1 -0
  91. package/dist/components/docs/guides/GuideReleaseCapsulesPage.js +16 -0
  92. package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +4 -4
  93. package/dist/components/docs/guides/GuidesIndexPage.js +2 -2
  94. package/dist/components/docs/guides/index.d.ts +1 -0
  95. package/dist/components/docs/guides/index.js +93 -39
  96. package/dist/components/docs/index.js +690 -419
  97. package/dist/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -2
  98. package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -3
  99. package/dist/components/docs/integrations/IntegrationsGithubPage.js +2 -2
  100. package/dist/components/docs/integrations/IntegrationsGmailPage.js +3 -3
  101. package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -3
  102. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +2 -2
  103. package/dist/components/docs/integrations/IntegrationsMistralPage.js +2 -2
  104. package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  105. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +1 -1
  106. package/dist/components/docs/integrations/IntegrationsPostmarkPage.js +2 -2
  107. package/dist/components/docs/integrations/IntegrationsPowensPage.js +2 -2
  108. package/dist/components/docs/integrations/IntegrationsQdrantPage.js +5 -5
  109. package/dist/components/docs/integrations/IntegrationsResendPage.js +3 -3
  110. package/dist/components/docs/integrations/IntegrationsS3Page.js +4 -4
  111. package/dist/components/docs/integrations/IntegrationsSlackPage.js +2 -2
  112. package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +2 -2
  113. package/dist/components/docs/integrations/IntegrationsStripePage.js +2 -2
  114. package/dist/components/docs/integrations/IntegrationsTwilioPage.js +3 -3
  115. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -2
  116. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -2
  117. package/dist/components/docs/integrations/index.js +39 -39
  118. package/dist/components/docs/intent/ContractFirstApiPage.js +2 -2
  119. package/dist/components/docs/intent/DeterministicCodegenPage.js +2 -2
  120. package/dist/components/docs/intent/GenerateClientFromSchemaPage.js +7 -7
  121. package/dist/components/docs/intent/OpenapiAlternativePage.js +3 -3
  122. package/dist/components/docs/intent/SchemaValidationTypescriptPage.js +4 -4
  123. package/dist/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -2
  124. package/dist/components/docs/intent/index.js +15 -15
  125. package/dist/components/docs/intent/intent-pages.docblocks.js +1 -1
  126. package/dist/components/docs/knowledge/KnowledgeCategoriesPage.js +2 -2
  127. package/dist/components/docs/knowledge/KnowledgeExamplesPage.js +2 -2
  128. package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +1 -1
  129. package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +2 -2
  130. package/dist/components/docs/knowledge/KnowledgeSpacesPage.js +2 -2
  131. package/dist/components/docs/knowledge/index.js +5 -5
  132. package/dist/components/docs/libraries/LibrariesAccessibilityPage.js +3 -3
  133. package/dist/components/docs/libraries/LibrariesAiAgentPage.js +3 -3
  134. package/dist/components/docs/libraries/LibrariesAnalyticsPage.js +4 -4
  135. package/dist/components/docs/libraries/LibrariesContentGenPage.js +2 -2
  136. package/dist/components/docs/libraries/LibrariesContractsPage.js +43 -18
  137. package/dist/components/docs/libraries/LibrariesCostTrackingPage.js +3 -3
  138. package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.content.d.ts +67 -0
  139. package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.content.js +86 -0
  140. package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.d.ts +1 -0
  141. package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.js +86 -0
  142. package/dist/components/docs/libraries/LibrariesDataBackendPage.js +2 -2
  143. package/dist/components/docs/libraries/LibrariesDataViewsPage.js +3 -3
  144. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +77 -29
  145. package/dist/components/docs/libraries/LibrariesEvolutionPage.js +4 -4
  146. package/dist/components/docs/libraries/LibrariesGraphQLPage.js +2 -2
  147. package/dist/components/docs/libraries/LibrariesGrowthPage.js +3 -3
  148. package/dist/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -3
  149. package/dist/components/docs/libraries/LibrariesObservabilityPage.js +5 -5
  150. package/dist/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -4
  151. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  152. package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +4 -4
  153. package/dist/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -3
  154. package/dist/components/docs/libraries/LibrariesResiliencePage.js +4 -4
  155. package/dist/components/docs/libraries/LibrariesRuntimePage.js +2 -2
  156. package/dist/components/docs/libraries/LibrariesSLOPage.js +3 -3
  157. package/dist/components/docs/libraries/LibrariesSchemaPage.js +3 -3
  158. package/dist/components/docs/libraries/LibrariesSupportBotPage.js +3 -3
  159. package/dist/components/docs/libraries/LibrariesTestingPage.js +3 -3
  160. package/dist/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  161. package/dist/components/docs/libraries/LibrariesUIKitWebPage.d.ts +1 -0
  162. package/dist/components/docs/libraries/LibrariesUIKitWebPage.js +47 -0
  163. package/dist/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -3
  164. package/dist/components/docs/libraries/LibrariesWorkflowsPage.js +2 -2
  165. package/dist/components/docs/libraries/index.d.ts +2 -0
  166. package/dist/components/docs/libraries/index.js +338 -110
  167. package/dist/components/docs/manifesto/ManifestoPage.js +1 -1
  168. package/dist/components/docs/ops/AutoEvolutionOpsPage.js +2 -2
  169. package/dist/components/docs/ops/DistributedTracingOpsPage.js +2 -2
  170. package/dist/components/docs/ops/index.js +3 -3
  171. package/dist/components/docs/ops/ops-lifecycle.docblocks.js +2 -2
  172. package/dist/components/docs/ops/ops-runbooks-a.docblocks.js +2 -2
  173. package/dist/components/docs/ops/ops-runbooks-b.docblocks.js +2 -2
  174. package/dist/components/docs/ops/ops-slo-tenant.docblocks.js +2 -2
  175. package/dist/components/docs/ops/ops-top.docs.js +2 -2
  176. package/dist/components/docs/ops/ops.docs.js +6 -6
  177. package/dist/components/docs/product/product.docblocks.js +2 -2
  178. package/dist/components/docs/reference/DocsMarkdownContent.js +2 -2
  179. package/dist/components/docs/reference/DocsReferenceContent.js +3 -3
  180. package/dist/components/docs/reference/DocsReferenceIndexClient.js +2 -2
  181. package/dist/components/docs/reference/DocsReferenceIndexPage.js +2 -2
  182. package/dist/components/docs/reference/DocsReferencePage.js +3 -3
  183. package/dist/components/docs/reference/docsMarkdownParser.js +2 -2
  184. package/dist/components/docs/reference/index.js +4 -4
  185. package/dist/components/docs/safety/SafetyAuditingPage.js +2 -2
  186. package/dist/components/docs/safety/SafetyMigrationsPage.js +2 -2
  187. package/dist/components/docs/safety/SafetyOverviewPage.js +1 -1
  188. package/dist/components/docs/safety/SafetyPDPPage.js +2 -2
  189. package/dist/components/docs/safety/SafetySecurityTrustPage.js +1 -1
  190. package/dist/components/docs/safety/SafetySigningPage.js +3 -3
  191. package/dist/components/docs/safety/SafetyTenantIsolationPage.js +2 -2
  192. package/dist/components/docs/safety/index.js +7 -7
  193. package/dist/components/docs/shared/StudioPrompt.js +1 -1
  194. package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  195. package/dist/components/docs/specs/SpecsCapabilitiesPage.js +2 -2
  196. package/dist/components/docs/specs/SpecsConnectPage.js +4 -2
  197. package/dist/components/docs/specs/SpecsDataViewsPage.js +39 -32
  198. package/dist/components/docs/specs/SpecsModuleBundlesPage.js +3 -3
  199. package/dist/components/docs/specs/SpecsOverlaysPage.js +2 -2
  200. package/dist/components/docs/specs/SpecsOverviewPage.js +1 -1
  201. package/dist/components/docs/specs/SpecsPolicyPage.js +3 -3
  202. package/dist/components/docs/specs/SpecsWorkflowsPage.js +2 -2
  203. package/dist/components/docs/specs/index.js +66 -42
  204. package/dist/components/docs/studio/StudioBYOKPage.js +1 -1
  205. package/dist/components/docs/studio/StudioDeploymentsPage.js +1 -1
  206. package/dist/components/docs/studio/StudioGettingStartedPage.js +1 -1
  207. package/dist/components/docs/studio/StudioIntegrationsPage.js +1 -1
  208. package/dist/components/docs/studio/StudioOverviewPage.js +1 -1
  209. package/dist/components/docs/studio/StudioVisualBuilderPage.js +1 -1
  210. package/dist/components/docs/studio/index.js +1 -1
  211. package/dist/components/docs/tech/contracts/tech-docs.docblocks.js +2 -2
  212. package/dist/components/integrations/index.js +2 -2
  213. package/dist/components/integrations/molecules/IntegrationCard.js +1 -1
  214. package/dist/components/integrations/organisms/IntegrationMarketplace.js +1 -1
  215. package/dist/components/integrations/organisms/IntegrationSettings.js +2 -2
  216. package/dist/components/integrations/organisms/KnowledgeSourceList.js +1 -1
  217. package/dist/components/legal/PrivacyTemplate.js +1 -1
  218. package/dist/components/legal/TermsTemplate.js +1 -1
  219. package/dist/components/legal/index.js +1 -1
  220. package/dist/components/shared/FeatureGateNotice.js +1 -1
  221. package/dist/components/shared/index.js +1 -1
  222. package/dist/components/shell/WorkspaceHeader.js +1 -1
  223. package/dist/components/shell/WorkspaceProjectShellLayout.js +1 -1
  224. package/dist/components/shell/WorkspaceShellRenderer.js +1 -1
  225. package/dist/components/shell/WorkspaceSidebar.js +1 -1
  226. package/dist/components/shell/index.js +1 -1
  227. package/dist/components/templates/engine/index.js +1 -1
  228. package/dist/components/templates/index.js +11 -11
  229. package/dist/components/templates/messaging/ConversationList.js +2 -2
  230. package/dist/components/templates/messaging/MessageComposer.js +4 -4
  231. package/dist/components/templates/messaging/MessageThread.js +3 -3
  232. package/dist/components/templates/messaging/MessagingWorkspace.js +5 -5
  233. package/dist/components/templates/messaging/index.js +5 -5
  234. package/dist/components/templates/recipes/LanguageSwitcher.js +1 -1
  235. package/dist/components/templates/recipes/RecipeCard.js +1 -1
  236. package/dist/components/templates/recipes/RecipeDetail.js +1 -1
  237. package/dist/components/templates/recipes/RecipeList.js +3 -3
  238. package/dist/components/templates/recipes/index.js +3 -3
  239. package/dist/components/templates/todos/FilterBar.js +1 -1
  240. package/dist/components/templates/todos/TaskForm.js +2 -2
  241. package/dist/components/templates/todos/TaskItem.js +1 -1
  242. package/dist/components/templates/todos/TaskList.js +5 -5
  243. package/dist/components/templates/todos/index.js +5 -5
  244. package/dist/config/contractspec-blueprint.js +1 -1
  245. package/dist/config/contractspec-branding.js +1 -1
  246. package/dist/config/contractspec-routes.js +1 -1
  247. package/dist/config/index.js +1 -1
  248. package/dist/features/contracts-registry.js +1 -1
  249. package/dist/features/docs/docs.contracts.js +1 -1
  250. package/dist/features/docs/index.js +1 -1
  251. package/dist/features/docs.feature.js +1 -1
  252. package/dist/features/index.js +1 -1
  253. package/dist/features/mcp.feature.js +1 -1
  254. package/dist/features/presentations.feature.js +1 -1
  255. package/dist/features/registry.js +1 -1
  256. package/dist/index.d.ts +1 -0
  257. package/dist/index.js +701 -430
  258. package/dist/infrastructure/elysia/index.js +1 -1
  259. package/dist/infrastructure/elysia/logger.js +1 -1
  260. package/dist/infrastructure/index.js +1 -1
  261. package/dist/libs/email/client.js +1 -1
  262. package/dist/libs/email/contact.js +3 -3
  263. package/dist/libs/email/newsletter.js +3 -3
  264. package/dist/libs/email/utils.js +2 -2
  265. package/dist/libs/email/waitlist-application.js +3 -3
  266. package/dist/libs/email/waitlist.js +3 -3
  267. package/dist/libs/email.js +6 -6
  268. package/dist/libs/posthog/client.js +1 -1
  269. package/dist/libs/posthog/native.js +1 -1
  270. package/dist/libs/posthog/server.js +1 -1
  271. package/dist/libs/pricing-examples.js +1 -1
  272. package/dist/node/application/context-storage/index.js +1 -1
  273. package/dist/node/application/index.js +11 -11
  274. package/dist/node/application/mcp/cliMcp.js +6 -6
  275. package/dist/node/application/mcp/cliMcp.onboarding.js +1 -0
  276. package/dist/node/application/mcp/common.js +1 -1
  277. package/dist/node/application/mcp/contractsMcp.js +2 -2
  278. package/dist/node/application/mcp/contractsMcpAdoptionTools.js +1 -0
  279. package/dist/node/application/mcp/contractsMcpResources.js +2 -2
  280. package/dist/node/application/mcp/contractsMcpTools.js +1 -1
  281. package/dist/node/application/mcp/docsMcp.catalog.js +2 -2
  282. package/dist/node/application/mcp/docsMcp.data.js +1 -1
  283. package/dist/node/application/mcp/docsMcp.js +3 -3
  284. package/dist/node/application/mcp/docsMcp.prompts.js +3 -3
  285. package/dist/node/application/mcp/docsMcp.reference.js +2 -2
  286. package/dist/node/application/mcp/docsMcp.resources.js +2 -2
  287. package/dist/node/application/mcp/docsMcp.tools.js +2 -2
  288. package/dist/node/application/mcp/index.js +11 -11
  289. package/dist/node/application/mcp/internalMcp.js +2 -2
  290. package/dist/node/application/mcp/normalizeMcpRequest.js +1 -1
  291. package/dist/node/application/mcp/providerRankingMcp.js +1 -1
  292. package/dist/node/bundles/LibraryBundle.js +1 -1
  293. package/dist/node/bundles/index.js +1 -1
  294. package/dist/node/components/docs/DocsIndexPage.js +2 -2
  295. package/dist/node/components/docs/advanced/AdvancedMCPPage.js +3 -3
  296. package/dist/node/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -1
  297. package/dist/node/components/docs/advanced/AdvancedRenderersPage.js +2 -2
  298. package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -4
  299. package/dist/node/components/docs/advanced/AdvancedTelemetryPage.js +2 -2
  300. package/dist/node/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -2
  301. package/dist/node/components/docs/advanced/index.js +9 -9
  302. package/dist/node/components/docs/architecture/ArchitectureAppConfigPage.js +6 -6
  303. package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +3 -3
  304. package/dist/node/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -7
  305. package/dist/node/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -6
  306. package/dist/node/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -2
  307. package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +1 -1
  308. package/dist/node/components/docs/architecture/index.js +20 -20
  309. package/dist/node/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -1
  310. package/dist/node/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -1
  311. package/dist/node/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -1
  312. package/dist/node/components/docs/comparison/ComparisonOverviewPage.js +1 -1
  313. package/dist/node/components/docs/comparison/ComparisonWindmillPage.js +1 -1
  314. package/dist/node/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -1
  315. package/dist/node/components/docs/comparison/index.js +1 -1
  316. package/dist/node/components/docs/docsManifest.js +1 -1
  317. package/dist/node/components/docs/ecosystem/IntegrationsPage.js +2 -2
  318. package/dist/node/components/docs/ecosystem/PluginsPage.js +4 -4
  319. package/dist/node/components/docs/ecosystem/RegistryPage.js +4 -4
  320. package/dist/node/components/docs/ecosystem/TemplatesPage.js +3 -3
  321. package/dist/node/components/docs/ecosystem/index.js +11 -11
  322. package/dist/node/components/docs/examples/DocsExamplesPage.js +1 -17
  323. package/dist/node/components/docs/examples/ExampleShowcasePage.js +2 -17
  324. package/dist/node/components/docs/examples/exampleShowcaseData.js +2 -17
  325. package/dist/node/components/docs/examples/index.js +2 -17
  326. package/dist/node/components/docs/generated/docs-index.generated.js +1 -1
  327. package/dist/node/components/docs/generated/index.js +1 -1
  328. package/dist/node/components/docs/generated/loader.js +1 -1
  329. package/dist/node/components/docs/getting-started/CLIPage.js +6 -5
  330. package/dist/node/components/docs/getting-started/CompatibilityPage.js +1 -1
  331. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  332. package/dist/node/components/docs/getting-started/DeveloperToolsPage.js +1 -1
  333. package/dist/node/components/docs/getting-started/HelloWorldPage.js +5 -5
  334. package/dist/node/components/docs/getting-started/InstallationPage.js +3 -3
  335. package/dist/node/components/docs/getting-started/StartHerePage.js +4 -2
  336. package/dist/node/components/docs/getting-started/TroubleshootingPage.js +2 -2
  337. package/dist/node/components/docs/getting-started/VSCodeExtensionPage.js +1 -1
  338. package/dist/node/components/docs/getting-started/getting-started.docblocks.js +2 -2
  339. package/dist/node/components/docs/getting-started/index.js +60 -80
  340. package/dist/node/components/docs/guides/GuideCIDiffGatingPage.js +2 -2
  341. package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +30 -5
  342. package/dist/node/components/docs/guides/GuideContractTypesPage.js +6 -6
  343. package/dist/node/components/docs/guides/GuideDocsPipelinePage.js +3 -3
  344. package/dist/node/components/docs/guides/GuideFirstModuleBundlePage.js +4 -4
  345. package/dist/node/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -2
  346. package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  347. package/dist/node/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -8
  348. package/dist/node/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -6
  349. package/dist/node/components/docs/guides/GuideReleaseCapsulesPage.js +15 -0
  350. package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +4 -4
  351. package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -2
  352. package/dist/node/components/docs/guides/index.js +93 -39
  353. package/dist/node/components/docs/index.js +690 -419
  354. package/dist/node/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -2
  355. package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -3
  356. package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +2 -2
  357. package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +3 -3
  358. package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -3
  359. package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +2 -2
  360. package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +2 -2
  361. package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  362. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +1 -1
  363. package/dist/node/components/docs/integrations/IntegrationsPostmarkPage.js +2 -2
  364. package/dist/node/components/docs/integrations/IntegrationsPowensPage.js +2 -2
  365. package/dist/node/components/docs/integrations/IntegrationsQdrantPage.js +5 -5
  366. package/dist/node/components/docs/integrations/IntegrationsResendPage.js +3 -3
  367. package/dist/node/components/docs/integrations/IntegrationsS3Page.js +4 -4
  368. package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +2 -2
  369. package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +2 -2
  370. package/dist/node/components/docs/integrations/IntegrationsStripePage.js +2 -2
  371. package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +3 -3
  372. package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -2
  373. package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -2
  374. package/dist/node/components/docs/integrations/index.js +39 -39
  375. package/dist/node/components/docs/intent/ContractFirstApiPage.js +2 -2
  376. package/dist/node/components/docs/intent/DeterministicCodegenPage.js +2 -2
  377. package/dist/node/components/docs/intent/GenerateClientFromSchemaPage.js +7 -7
  378. package/dist/node/components/docs/intent/OpenapiAlternativePage.js +3 -3
  379. package/dist/node/components/docs/intent/SchemaValidationTypescriptPage.js +4 -4
  380. package/dist/node/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -2
  381. package/dist/node/components/docs/intent/index.js +15 -15
  382. package/dist/node/components/docs/intent/intent-pages.docblocks.js +1 -1
  383. package/dist/node/components/docs/knowledge/KnowledgeCategoriesPage.js +2 -2
  384. package/dist/node/components/docs/knowledge/KnowledgeExamplesPage.js +2 -2
  385. package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +1 -1
  386. package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +2 -2
  387. package/dist/node/components/docs/knowledge/KnowledgeSpacesPage.js +2 -2
  388. package/dist/node/components/docs/knowledge/index.js +5 -5
  389. package/dist/node/components/docs/libraries/LibrariesAccessibilityPage.js +3 -3
  390. package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +3 -3
  391. package/dist/node/components/docs/libraries/LibrariesAnalyticsPage.js +4 -4
  392. package/dist/node/components/docs/libraries/LibrariesContentGenPage.js +2 -2
  393. package/dist/node/components/docs/libraries/LibrariesContractsPage.js +43 -18
  394. package/dist/node/components/docs/libraries/LibrariesCostTrackingPage.js +3 -3
  395. package/dist/node/components/docs/libraries/LibrariesCrossPlatformUIPage.content.js +85 -0
  396. package/dist/node/components/docs/libraries/LibrariesCrossPlatformUIPage.js +85 -0
  397. package/dist/node/components/docs/libraries/LibrariesDataBackendPage.js +2 -2
  398. package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +3 -3
  399. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +77 -29
  400. package/dist/node/components/docs/libraries/LibrariesEvolutionPage.js +4 -4
  401. package/dist/node/components/docs/libraries/LibrariesGraphQLPage.js +2 -2
  402. package/dist/node/components/docs/libraries/LibrariesGrowthPage.js +3 -3
  403. package/dist/node/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -3
  404. package/dist/node/components/docs/libraries/LibrariesObservabilityPage.js +5 -5
  405. package/dist/node/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -4
  406. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  407. package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +4 -4
  408. package/dist/node/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -3
  409. package/dist/node/components/docs/libraries/LibrariesResiliencePage.js +4 -4
  410. package/dist/node/components/docs/libraries/LibrariesRuntimePage.js +2 -2
  411. package/dist/node/components/docs/libraries/LibrariesSLOPage.js +3 -3
  412. package/dist/node/components/docs/libraries/LibrariesSchemaPage.js +3 -3
  413. package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +3 -3
  414. package/dist/node/components/docs/libraries/LibrariesTestingPage.js +3 -3
  415. package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  416. package/dist/node/components/docs/libraries/LibrariesUIKitWebPage.js +46 -0
  417. package/dist/node/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -3
  418. package/dist/node/components/docs/libraries/LibrariesWorkflowsPage.js +2 -2
  419. package/dist/node/components/docs/libraries/index.js +338 -110
  420. package/dist/node/components/docs/manifesto/ManifestoPage.js +1 -1
  421. package/dist/node/components/docs/ops/AutoEvolutionOpsPage.js +2 -2
  422. package/dist/node/components/docs/ops/DistributedTracingOpsPage.js +2 -2
  423. package/dist/node/components/docs/ops/index.js +3 -3
  424. package/dist/node/components/docs/ops/ops-lifecycle.docblocks.js +2 -2
  425. package/dist/node/components/docs/ops/ops-runbooks-a.docblocks.js +2 -2
  426. package/dist/node/components/docs/ops/ops-runbooks-b.docblocks.js +2 -2
  427. package/dist/node/components/docs/ops/ops-slo-tenant.docblocks.js +2 -2
  428. package/dist/node/components/docs/ops/ops-top.docs.js +2 -2
  429. package/dist/node/components/docs/ops/ops.docs.js +6 -6
  430. package/dist/node/components/docs/product/product.docblocks.js +2 -2
  431. package/dist/node/components/docs/reference/DocsMarkdownContent.js +2 -2
  432. package/dist/node/components/docs/reference/DocsReferenceContent.js +3 -3
  433. package/dist/node/components/docs/reference/DocsReferenceIndexClient.js +2 -2
  434. package/dist/node/components/docs/reference/DocsReferenceIndexPage.js +2 -2
  435. package/dist/node/components/docs/reference/DocsReferencePage.js +3 -3
  436. package/dist/node/components/docs/reference/docsMarkdownParser.js +2 -2
  437. package/dist/node/components/docs/reference/index.js +4 -4
  438. package/dist/node/components/docs/safety/SafetyAuditingPage.js +2 -2
  439. package/dist/node/components/docs/safety/SafetyMigrationsPage.js +2 -2
  440. package/dist/node/components/docs/safety/SafetyOverviewPage.js +1 -1
  441. package/dist/node/components/docs/safety/SafetyPDPPage.js +2 -2
  442. package/dist/node/components/docs/safety/SafetySecurityTrustPage.js +1 -1
  443. package/dist/node/components/docs/safety/SafetySigningPage.js +3 -3
  444. package/dist/node/components/docs/safety/SafetyTenantIsolationPage.js +2 -2
  445. package/dist/node/components/docs/safety/index.js +7 -7
  446. package/dist/node/components/docs/shared/StudioPrompt.js +1 -1
  447. package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  448. package/dist/node/components/docs/specs/SpecsCapabilitiesPage.js +2 -2
  449. package/dist/node/components/docs/specs/SpecsConnectPage.js +4 -2
  450. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +39 -32
  451. package/dist/node/components/docs/specs/SpecsModuleBundlesPage.js +3 -3
  452. package/dist/node/components/docs/specs/SpecsOverlaysPage.js +2 -2
  453. package/dist/node/components/docs/specs/SpecsOverviewPage.js +1 -1
  454. package/dist/node/components/docs/specs/SpecsPolicyPage.js +3 -3
  455. package/dist/node/components/docs/specs/SpecsWorkflowsPage.js +2 -2
  456. package/dist/node/components/docs/specs/index.js +66 -42
  457. package/dist/node/components/docs/studio/StudioBYOKPage.js +1 -1
  458. package/dist/node/components/docs/studio/StudioDeploymentsPage.js +1 -1
  459. package/dist/node/components/docs/studio/StudioGettingStartedPage.js +1 -1
  460. package/dist/node/components/docs/studio/StudioIntegrationsPage.js +1 -1
  461. package/dist/node/components/docs/studio/StudioOverviewPage.js +1 -1
  462. package/dist/node/components/docs/studio/StudioVisualBuilderPage.js +1 -1
  463. package/dist/node/components/docs/studio/index.js +1 -1
  464. package/dist/node/components/docs/tech/contracts/tech-docs.docblocks.js +2 -2
  465. package/dist/node/components/integrations/index.js +2 -2
  466. package/dist/node/components/integrations/molecules/IntegrationCard.js +1 -1
  467. package/dist/node/components/integrations/organisms/IntegrationMarketplace.js +1 -1
  468. package/dist/node/components/integrations/organisms/IntegrationSettings.js +2 -2
  469. package/dist/node/components/integrations/organisms/KnowledgeSourceList.js +1 -1
  470. package/dist/node/components/legal/PrivacyTemplate.js +1 -1
  471. package/dist/node/components/legal/TermsTemplate.js +1 -1
  472. package/dist/node/components/legal/index.js +1 -1
  473. package/dist/node/components/shared/FeatureGateNotice.js +1 -1
  474. package/dist/node/components/shared/index.js +1 -1
  475. package/dist/node/components/shell/WorkspaceHeader.js +1 -1
  476. package/dist/node/components/shell/WorkspaceProjectShellLayout.js +1 -1
  477. package/dist/node/components/shell/WorkspaceShellRenderer.js +1 -1
  478. package/dist/node/components/shell/WorkspaceSidebar.js +1 -1
  479. package/dist/node/components/shell/index.js +1 -1
  480. package/dist/node/components/templates/engine/index.js +1 -1
  481. package/dist/node/components/templates/index.js +11 -11
  482. package/dist/node/components/templates/messaging/ConversationList.js +2 -2
  483. package/dist/node/components/templates/messaging/MessageComposer.js +4 -4
  484. package/dist/node/components/templates/messaging/MessageThread.js +3 -3
  485. package/dist/node/components/templates/messaging/MessagingWorkspace.js +5 -5
  486. package/dist/node/components/templates/messaging/index.js +5 -5
  487. package/dist/node/components/templates/recipes/LanguageSwitcher.js +1 -1
  488. package/dist/node/components/templates/recipes/RecipeCard.js +1 -1
  489. package/dist/node/components/templates/recipes/RecipeDetail.js +1 -1
  490. package/dist/node/components/templates/recipes/RecipeList.js +3 -3
  491. package/dist/node/components/templates/recipes/index.js +3 -3
  492. package/dist/node/components/templates/todos/FilterBar.js +1 -1
  493. package/dist/node/components/templates/todos/TaskForm.js +2 -2
  494. package/dist/node/components/templates/todos/TaskItem.js +1 -1
  495. package/dist/node/components/templates/todos/TaskList.js +5 -5
  496. package/dist/node/components/templates/todos/index.js +5 -5
  497. package/dist/node/config/contractspec-blueprint.js +1 -1
  498. package/dist/node/config/contractspec-branding.js +1 -1
  499. package/dist/node/config/contractspec-routes.js +1 -1
  500. package/dist/node/config/index.js +1 -1
  501. package/dist/node/features/contracts-registry.js +1 -1
  502. package/dist/node/features/docs/docs.contracts.js +1 -1
  503. package/dist/node/features/docs/index.js +1 -1
  504. package/dist/node/features/docs.feature.js +1 -1
  505. package/dist/node/features/index.js +1 -1
  506. package/dist/node/features/mcp.feature.js +1 -1
  507. package/dist/node/features/presentations.feature.js +1 -1
  508. package/dist/node/features/registry.js +1 -1
  509. package/dist/node/index.js +701 -430
  510. package/dist/node/infrastructure/elysia/index.js +1 -1
  511. package/dist/node/infrastructure/elysia/logger.js +1 -1
  512. package/dist/node/infrastructure/index.js +1 -1
  513. package/dist/node/libs/email/client.js +1 -1
  514. package/dist/node/libs/email/contact.js +3 -3
  515. package/dist/node/libs/email/newsletter.js +3 -3
  516. package/dist/node/libs/email/utils.js +2 -2
  517. package/dist/node/libs/email/waitlist-application.js +3 -3
  518. package/dist/node/libs/email/waitlist.js +3 -3
  519. package/dist/node/libs/email.js +6 -6
  520. package/dist/node/libs/posthog/client.js +1 -1
  521. package/dist/node/libs/posthog/native.js +1 -1
  522. package/dist/node/libs/posthog/server.js +1 -1
  523. package/dist/node/libs/pricing-examples.js +1 -1
  524. package/dist/node/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -1
  525. package/dist/node/presentation/features/atoms/FeatureIcon/index.js +1 -1
  526. package/dist/node/presentation/features/atoms/index.js +1 -1
  527. package/dist/node/presentation/features/hooks/index.js +1 -1
  528. package/dist/node/presentation/features/hooks/useContractsRegistry.js +1 -1
  529. package/dist/node/presentation/features/hooks/useFeatureFilters.js +1 -1
  530. package/dist/node/presentation/features/hooks/useFeatureRegistry.js +1 -1
  531. package/dist/node/presentation/features/hooks/useRelatedDocs.js +1 -1
  532. package/dist/node/presentation/features/index.js +1 -1
  533. package/dist/node/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -1
  534. package/dist/node/presentation/features/molecules/FeatureCard/index.js +1 -1
  535. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -1
  536. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -1
  537. package/dist/node/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -1
  538. package/dist/node/presentation/features/molecules/FeatureFilters/index.js +1 -1
  539. package/dist/node/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -1
  540. package/dist/node/presentation/features/molecules/FeatureHoverPreview/index.js +1 -1
  541. package/dist/node/presentation/features/molecules/index.js +1 -1
  542. package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +1 -1
  543. package/dist/node/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -1
  544. package/dist/node/presentation/features/organisms/FeatureDetail/index.js +1 -1
  545. package/dist/node/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -1
  546. package/dist/node/presentation/features/organisms/FeatureDiscovery/index.js +1 -1
  547. package/dist/node/presentation/features/organisms/FeatureEventsList.js +1 -1
  548. package/dist/node/presentation/features/organisms/FeatureFormsList.js +1 -1
  549. package/dist/node/presentation/features/organisms/FeatureOperationsList.js +1 -1
  550. package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +1 -1
  551. package/dist/node/presentation/features/organisms/index.js +1 -1
  552. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -1
  553. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -1
  554. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -1
  555. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -1
  556. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -1
  557. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -1
  558. package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -1
  559. package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +1 -1
  560. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -1
  561. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -1
  562. package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -1
  563. package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +1 -1
  564. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -1
  565. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -1
  566. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -1
  567. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -1
  568. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -1
  569. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -1
  570. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -1
  571. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -1
  572. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -1
  573. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -1
  574. package/dist/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -1
  575. package/dist/presentation/features/atoms/FeatureIcon/index.js +1 -1
  576. package/dist/presentation/features/atoms/index.js +1 -1
  577. package/dist/presentation/features/hooks/index.js +1 -1
  578. package/dist/presentation/features/hooks/useContractsRegistry.js +1 -1
  579. package/dist/presentation/features/hooks/useFeatureFilters.js +1 -1
  580. package/dist/presentation/features/hooks/useFeatureRegistry.js +1 -1
  581. package/dist/presentation/features/hooks/useRelatedDocs.js +1 -1
  582. package/dist/presentation/features/index.js +1 -1
  583. package/dist/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -1
  584. package/dist/presentation/features/molecules/FeatureCard/index.js +1 -1
  585. package/dist/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -1
  586. package/dist/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -1
  587. package/dist/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -1
  588. package/dist/presentation/features/molecules/FeatureFilters/index.js +1 -1
  589. package/dist/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -1
  590. package/dist/presentation/features/molecules/FeatureHoverPreview/index.js +1 -1
  591. package/dist/presentation/features/molecules/index.js +1 -1
  592. package/dist/presentation/features/organisms/FeatureDataViewsList.js +1 -1
  593. package/dist/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -1
  594. package/dist/presentation/features/organisms/FeatureDetail/index.js +1 -1
  595. package/dist/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -1
  596. package/dist/presentation/features/organisms/FeatureDiscovery/index.js +1 -1
  597. package/dist/presentation/features/organisms/FeatureEventsList.js +1 -1
  598. package/dist/presentation/features/organisms/FeatureFormsList.js +1 -1
  599. package/dist/presentation/features/organisms/FeatureOperationsList.js +1 -1
  600. package/dist/presentation/features/organisms/FeaturePresentationsList.js +1 -1
  601. package/dist/presentation/features/organisms/index.js +1 -1
  602. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -1
  603. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -1
  604. package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -1
  605. package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -1
  606. package/dist/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -1
  607. package/dist/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -1
  608. package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -1
  609. package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +1 -1
  610. package/dist/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -1
  611. package/dist/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -1
  612. package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -1
  613. package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +1 -1
  614. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -1
  615. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -1
  616. package/dist/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -1
  617. package/dist/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -1
  618. package/dist/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -1
  619. package/dist/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -1
  620. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -1
  621. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -1
  622. package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -1
  623. package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -1
  624. package/package.json +96 -23
  625. package/src/application/mcp/cliMcp.onboarding.ts +297 -0
  626. package/src/application/mcp/cliMcp.test.ts +99 -0
  627. package/src/application/mcp/cliMcp.ts +30 -3
  628. package/src/application/mcp/contractsMcp.test.ts +65 -0
  629. package/src/application/mcp/contractsMcpAdoptionTools.ts +131 -0
  630. package/src/application/mcp/contractsMcpResources.ts +49 -0
  631. package/src/application/mcp/contractsMcpTools.ts +2 -0
  632. package/src/application/mcp/contractsMcpTypes.ts +16 -0
  633. package/src/bundles/LibraryBundle.ts +19 -130
  634. package/src/components/docs/docsManifest.test.ts +14 -0
  635. package/src/components/docs/docsManifest.ts +22 -0
  636. package/src/components/docs/examples/DocsExamplesPage.tsx +6 -14
  637. package/src/components/docs/examples/ExampleShowcasePage.tsx +22 -18
  638. package/src/components/docs/examples/exampleShowcaseData.test.ts +22 -0
  639. package/src/components/docs/examples/exampleShowcaseData.ts +75 -50
  640. package/src/components/docs/generated/docs-index._common.json +9 -1
  641. package/src/components/docs/generated/docs-index.ai-chat.json +1 -1
  642. package/src/components/docs/generated/docs-index.app-config.json +4 -4
  643. package/src/components/docs/generated/docs-index.data-grid-showcase.json +9 -1
  644. package/src/components/docs/generated/docs-index.jobs.json +1 -1
  645. package/src/components/docs/generated/docs-index.kb-update-pipeline.json +5 -5
  646. package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +1 -1
  647. package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +1 -1
  648. package/src/components/docs/generated/docs-index.learning-journey-registry.json +1 -1
  649. package/src/components/docs/generated/docs-index.learning-journey.json +27 -3
  650. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +8 -0
  651. package/src/components/docs/generated/docs-index.manifest.json +13 -13
  652. package/src/components/docs/generated/docs-index.mobile-demo-landing.json +42 -0
  653. package/src/components/docs/generated/docs-index.platform-agent.json +18 -2
  654. package/src/components/docs/generated/docs-index.platform-context.json +16 -0
  655. package/src/components/docs/generated/docs-index.platform-docs.json +9 -1
  656. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +32 -0
  657. package/src/components/docs/generated/docs-index.wealth-snapshot.json +4 -4
  658. package/src/components/docs/generated/index.ts +20 -5
  659. package/src/components/docs/generated/loader.ts +15 -8
  660. package/src/components/docs/getting-started/CLIPage.tsx +10 -2
  661. package/src/components/docs/getting-started/CompatibilityPage.tsx +14 -0
  662. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +63 -70
  663. package/src/components/docs/getting-started/StartHerePage.tsx +10 -9
  664. package/src/components/docs/guides/GuideConnectInRepoPage.tsx +52 -3
  665. package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +55 -6
  666. package/src/components/docs/guides/GuideReleaseCapsulesPage.tsx +147 -0
  667. package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
  668. package/src/components/docs/guides/index.ts +1 -0
  669. package/src/components/docs/libraries/LibrariesContractsPage.tsx +72 -27
  670. package/src/components/docs/libraries/LibrariesCrossPlatformUIPage.content.ts +252 -0
  671. package/src/components/docs/libraries/LibrariesCrossPlatformUIPage.tsx +232 -0
  672. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +140 -55
  673. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +13 -1
  674. package/src/components/docs/libraries/LibrariesRuntimePage.tsx +15 -0
  675. package/src/components/docs/libraries/LibrariesUIKitPage.tsx +78 -25
  676. package/src/components/docs/libraries/LibrariesUIKitWebPage.tsx +129 -0
  677. package/src/components/docs/libraries/index.ts +2 -0
  678. package/src/components/docs/reference/DocsReferenceIndexPage.tsx +1 -1
  679. package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +58 -3
  680. package/src/components/docs/specs/SpecsConnectPage.tsx +30 -0
  681. package/src/components/docs/specs/SpecsDataViewsPage.tsx +63 -42
  682. package/src/index.ts +1 -1
  683. package/src/components/docs/generated/docs-index.mobile-demo-tasks.json +0 -34
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import A from"@contractspec/lib.ui-link";import{ChevronRight as B}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function F(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),z("p",{className:"text-muted-foreground",children:["An ",q("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",q("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),z("div",{className:"space-y-3",children:[z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Accountability"}),q("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Security"}),q("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Compliance"}),q("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Debugging"}),q("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),q("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),z("li",{children:[q("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",q(A,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),z("li",{children:[q("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),z("li",{children:[q("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),z("li",{children:[q("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),z("li",{children:[q("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Audit log format"}),q("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`{
2
+ var F=Object.defineProperty;var G=(A)=>A;function H(A,B){this[A]=G.bind(null,B)}var J=(A,B)=>{for(var D in B)F(A,D,{get:B[D],enumerable:!0,configurable:!0,set:H.bind(B,D)})};var K=(A,B)=>()=>(A&&(B=A(A=0)),B);import E from"@contractspec/lib.ui-link";import{ChevronRight as I}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function P(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),z("p",{className:"text-muted-foreground",children:["An ",q("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",q("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),z("div",{className:"space-y-3",children:[z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Accountability"}),q("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Security"}),q("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Compliance"}),q("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),z("div",{children:[q("h3",{className:"font-semibold text-lg",children:"Debugging"}),q("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),q("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),z("li",{children:[q("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",q(E,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),z("li",{children:[q("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),z("li",{children:[q("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),z("li",{children:[q("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),z("li",{children:[q("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Audit log format"}),q("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`{
3
3
  "timestamp": "2025-11-13T14:32:15.123Z",
4
4
  "eventId": "evt_abc123",
5
5
  "eventType": "capability.invoked",
@@ -30,4 +30,4 @@ import A from"@contractspec/lib.ui-link";import{ChevronRight as B}from"lucide-re
30
30
  "ruleId": "allow-admin-transfers",
31
31
  "reason": "User has admin role"
32
32
  }
33
- }`})})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Storage and retention"}),q("p",{className:"text-muted-foreground",children:"Audit logs are stored in a tamper-evident append-only log. Once written, entries cannot be modified or deleted. This ensures the integrity of the audit trail."}),q("p",{className:"text-muted-foreground",children:"ContractSpec supports multiple storage backends:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Local file system"})," \u2013 For development and testing."]}),z("li",{children:[q("strong",{children:"Cloud object storage"})," \u2013 S3, GCS, or Azure Blob Storage for production."]}),z("li",{children:[q("strong",{children:"SIEM integration"})," \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."]})]}),q("p",{className:"text-muted-foreground",children:"You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Querying audit logs"}),q("p",{className:"text-muted-foreground",children:"ContractSpec provides a query API for searching audit logs. You can filter by:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Time range"}),q("li",{children:"Event type"}),q("li",{children:"Actor (user ID, role, IP address)"}),q("li",{children:"Resource (capability, data view, workflow)"}),q("li",{children:"Result (success, failure, denied)"})]}),q("p",{className:"text-muted-foreground",children:'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Best practices"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Review logs regularly"})," \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."]}),z("li",{children:[q("strong",{children:"Protect log access"})," \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."]}),z("li",{children:[q("strong",{children:"Retain logs long enough"})," \u2013 Check your compliance requirements and configure retention policies accordingly."]}),z("li",{children:[q("strong",{children:"Test log integrity"})," \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."]})]})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(A,{href:"/docs/safety/pdp",className:"btn-ghost",children:"Previous: Policy Decision Points"}),z(A,{href:"/docs/safety/migrations",className:"btn-primary",children:["Next: Migrations ",q(B,{size:16})]})]})]})}export{F as SafetyAuditingPage};
33
+ }`})})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Storage and retention"}),q("p",{className:"text-muted-foreground",children:"Audit logs are stored in a tamper-evident append-only log. Once written, entries cannot be modified or deleted. This ensures the integrity of the audit trail."}),q("p",{className:"text-muted-foreground",children:"ContractSpec supports multiple storage backends:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Local file system"})," \u2013 For development and testing."]}),z("li",{children:[q("strong",{children:"Cloud object storage"})," \u2013 S3, GCS, or Azure Blob Storage for production."]}),z("li",{children:[q("strong",{children:"SIEM integration"})," \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."]})]}),q("p",{className:"text-muted-foreground",children:"You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Querying audit logs"}),q("p",{className:"text-muted-foreground",children:"ContractSpec provides a query API for searching audit logs. You can filter by:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Time range"}),q("li",{children:"Event type"}),q("li",{children:"Actor (user ID, role, IP address)"}),q("li",{children:"Resource (capability, data view, workflow)"}),q("li",{children:"Result (success, failure, denied)"})]}),q("p",{className:"text-muted-foreground",children:'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Best practices"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Review logs regularly"})," \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."]}),z("li",{children:[q("strong",{children:"Protect log access"})," \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."]}),z("li",{children:[q("strong",{children:"Retain logs long enough"})," \u2013 Check your compliance requirements and configure retention policies accordingly."]}),z("li",{children:[q("strong",{children:"Test log integrity"})," \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."]})]})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(E,{href:"/docs/safety/pdp",className:"btn-ghost",children:"Previous: Policy Decision Points"}),z(E,{href:"/docs/safety/migrations",className:"btn-primary",children:["Next: Migrations ",q(I,{size:16})]})]})]})}export{P as SafetyAuditingPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import A from"@contractspec/lib.ui-link";import{ChevronRight as B}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function F(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Migrations"}),z("p",{className:"text-muted-foreground",children:["A ",q("strong",{children:"schema migration"})," (also called a database migration) is a set of incremental, reversible changes to a database schema. According to"," ",q("a",{href:"https://en.wikipedia.org/wiki/Schema_migration",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Wikipedia"}),`, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Why migrations matter"}),q("p",{className:"text-muted-foreground",children:"As your application evolves, you'll need to change your data model\u2014adding new fields, renaming tables, changing data types, or restructuring relationships. Without a disciplined approach, these changes can lead to:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Data loss or corruption"}),q("li",{children:"Downtime during deployments"}),q("li",{children:"Inconsistencies between environments (dev, staging, production)"}),q("li",{children:"Difficulty rolling back failed changes"})]}),q("p",{className:"text-muted-foreground",children:"Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"How MigrationSpec works"}),z("p",{className:"text-muted-foreground",children:["In ContractSpec, migrations are defined using"," ",q("strong",{children:"MigrationSpec"}),". Each migration has:"]}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Version"}),' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.']}),z("li",{children:[q("strong",{children:"Up function"}),` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`]}),z("li",{children:[q("strong",{children:"Down function"}),` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`]}),z("li",{children:[q("strong",{children:"Dependencies"})," \u2013 Other migrations that must run before this one."]}),z("li",{children:[q("strong",{children:"Validation"}),' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").']})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Example MigrationSpec"}),q("p",{className:"text-muted-foreground",children:"Here's a migration that adds an email verification field to the users table:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`migrationId: add-email-verified
2
+ var F=Object.defineProperty;var G=(A)=>A;function H(A,B){this[A]=G.bind(null,B)}var J=(A,B)=>{for(var D in B)F(A,D,{get:B[D],enumerable:!0,configurable:!0,set:H.bind(B,D)})};var K=(A,B)=>()=>(A&&(B=A(A=0)),B);import E from"@contractspec/lib.ui-link";import{ChevronRight as I}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function Q(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Migrations"}),z("p",{className:"text-muted-foreground",children:["A ",q("strong",{children:"schema migration"})," (also called a database migration) is a set of incremental, reversible changes to a database schema. According to"," ",q("a",{href:"https://en.wikipedia.org/wiki/Schema_migration",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Wikipedia"}),`, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Why migrations matter"}),q("p",{className:"text-muted-foreground",children:"As your application evolves, you'll need to change your data model\u2014adding new fields, renaming tables, changing data types, or restructuring relationships. Without a disciplined approach, these changes can lead to:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Data loss or corruption"}),q("li",{children:"Downtime during deployments"}),q("li",{children:"Inconsistencies between environments (dev, staging, production)"}),q("li",{children:"Difficulty rolling back failed changes"})]}),q("p",{className:"text-muted-foreground",children:"Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"How MigrationSpec works"}),z("p",{className:"text-muted-foreground",children:["In ContractSpec, migrations are defined using"," ",q("strong",{children:"MigrationSpec"}),". Each migration has:"]}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Version"}),' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.']}),z("li",{children:[q("strong",{children:"Up function"}),` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`]}),z("li",{children:[q("strong",{children:"Down function"}),` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`]}),z("li",{children:[q("strong",{children:"Dependencies"})," \u2013 Other migrations that must run before this one."]}),z("li",{children:[q("strong",{children:"Validation"}),' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").']})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Example MigrationSpec"}),q("p",{className:"text-muted-foreground",children:"Here's a migration that adds an email verification field to the users table:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`migrationId: add-email-verified
3
3
  version: 2025-11-13-001
4
4
  dependencies: []
5
5
 
@@ -22,4 +22,4 @@ validation:
22
22
  - sql: |
23
23
  SELECT COUNT(*) FROM users
24
24
  WHERE email_verified IS NULL;
25
- expectZeroRows: true`})})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Running migrations"}),q("p",{className:"text-muted-foreground",children:"Migrations are applied automatically during deployment. The ContractSpec runtime:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Checks which migrations have already been applied (stored in a migrations table)."}),q("li",{children:"Identifies new migrations that need to run."}),q("li",{children:"Executes them in order, respecting dependencies."}),q("li",{children:"Runs validation checks to ensure success."}),q("li",{children:"Records the migration as applied."})]}),q("p",{className:"text-muted-foreground",children:"If a migration fails, the deployment is aborted, and the system remains in its previous state. You can then fix the migration and redeploy."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Rolling back migrations"}),z("p",{className:"text-muted-foreground",children:["If you need to roll back a deployment, ContractSpec automatically runs the ",q("strong",{children:"down"})," functions of any migrations that were applied. This restores the database to its previous state."]}),q("p",{className:"text-muted-foreground",children:"Note that rollbacks are not always possible\u2014for example, if you've deleted a column, you cannot recover the data unless you have a backup. For destructive changes, it's best to use a multi-step migration:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Add the new column (reversible)."}),q("li",{children:"Backfill data from the old column to the new column (reversible)."}),q("li",{children:"Update application code to use the new column (reversible)."}),q("li",{children:"Drop the old column (irreversible\u2014only do this after confirming the new column works)."})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Best practices"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Test migrations locally"})," \u2013 Run them against a copy of production data to catch issues before deploying."]}),z("li",{children:[q("strong",{children:"Keep migrations small"})," \u2013 Each migration should do one thing. This makes them easier to understand and roll back."]}),z("li",{children:[q("strong",{children:"Write reversible migrations"})," \u2013 Always provide a down function, even if you don't plan to roll back."]}),z("li",{children:[q("strong",{children:"Use transactions"})," \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."]}),z("li",{children:[q("strong",{children:"Avoid destructive changes"})," \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."]}),z("li",{children:[q("strong",{children:"Version your migrations"})," \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."]}),z("li",{children:[q("strong",{children:"Document breaking changes"})," \u2013 If a migration requires application code changes, note this in the migration description."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Zero-downtime migrations"}),q("p",{className:"text-muted-foreground",children:"Some migrations can cause downtime if not handled carefully. For example, adding a NOT NULL column to a large table can lock the table for minutes. To avoid this, use a multi-step approach:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Add the column as nullable."}),q("li",{children:"Backfill the column in batches (without locking the table)."}),q("li",{children:"Add the NOT NULL constraint once all rows are populated."})]}),q("p",{className:"text-muted-foreground",children:"ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(A,{href:"/docs/safety/auditing",className:"btn-ghost",children:"Previous: Audit Logs"}),z(A,{href:"/docs/advanced/renderers",className:"btn-primary",children:["Next: Advanced Topics ",q(B,{size:16})]})]})]})}export{F as SafetyMigrationsPage};
25
+ expectZeroRows: true`})})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Running migrations"}),q("p",{className:"text-muted-foreground",children:"Migrations are applied automatically during deployment. The ContractSpec runtime:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Checks which migrations have already been applied (stored in a migrations table)."}),q("li",{children:"Identifies new migrations that need to run."}),q("li",{children:"Executes them in order, respecting dependencies."}),q("li",{children:"Runs validation checks to ensure success."}),q("li",{children:"Records the migration as applied."})]}),q("p",{className:"text-muted-foreground",children:"If a migration fails, the deployment is aborted, and the system remains in its previous state. You can then fix the migration and redeploy."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Rolling back migrations"}),z("p",{className:"text-muted-foreground",children:["If you need to roll back a deployment, ContractSpec automatically runs the ",q("strong",{children:"down"})," functions of any migrations that were applied. This restores the database to its previous state."]}),q("p",{className:"text-muted-foreground",children:"Note that rollbacks are not always possible\u2014for example, if you've deleted a column, you cannot recover the data unless you have a backup. For destructive changes, it's best to use a multi-step migration:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Add the new column (reversible)."}),q("li",{children:"Backfill data from the old column to the new column (reversible)."}),q("li",{children:"Update application code to use the new column (reversible)."}),q("li",{children:"Drop the old column (irreversible\u2014only do this after confirming the new column works)."})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Best practices"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Test migrations locally"})," \u2013 Run them against a copy of production data to catch issues before deploying."]}),z("li",{children:[q("strong",{children:"Keep migrations small"})," \u2013 Each migration should do one thing. This makes them easier to understand and roll back."]}),z("li",{children:[q("strong",{children:"Write reversible migrations"})," \u2013 Always provide a down function, even if you don't plan to roll back."]}),z("li",{children:[q("strong",{children:"Use transactions"})," \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."]}),z("li",{children:[q("strong",{children:"Avoid destructive changes"})," \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."]}),z("li",{children:[q("strong",{children:"Version your migrations"})," \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."]}),z("li",{children:[q("strong",{children:"Document breaking changes"})," \u2013 If a migration requires application code changes, note this in the migration description."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Zero-downtime migrations"}),q("p",{className:"text-muted-foreground",children:"Some migrations can cause downtime if not handled carefully. For example, adding a NOT NULL column to a large table can lock the table for minutes. To avoid this, use a multi-step approach:"}),z("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[q("li",{children:"Add the column as nullable."}),q("li",{children:"Backfill the column in batches (without locking the table)."}),q("li",{children:"Add the NOT NULL constraint once all rows are populated."})]}),q("p",{className:"text-muted-foreground",children:"ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(E,{href:"/docs/safety/auditing",className:"btn-ghost",children:"Previous: Audit Logs"}),z(E,{href:"/docs/advanced/renderers",className:"btn-primary",children:["Next: Advanced Topics ",q(I,{size:16})]})]})]})}export{Q as SafetyMigrationsPage};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import i from"@contractspec/lib.ui-link";import{jsx as e,jsxs as t}from"react/jsx-runtime";var s=[{title:"Spec signing",body:"Protect the integrity of what gets deployed and make changes verifiable.",href:"/docs/safety/signing"},{title:"Policy decision points",body:"Apply governance consistently across operations, data access, and generated surfaces.",href:"/docs/safety/pdp"},{title:"Audit trails",body:"Record operational and policy decisions with enough context to inspect and explain them later.",href:"/docs/safety/auditing"},{title:"Migrations",body:"Evolve data and schema boundaries without losing control of the system.",href:"/docs/safety/migrations"},{title:"Tenant isolation",body:"Keep configuration, access rules, and sensitive data bounded by tenant.",href:"/docs/safety/tenant-isolation"},{title:"Security and trust",body:"Understand the trust model, release process, and security expectations around the OSS system.",href:"/docs/safety/security-trust"}];function o(){return t("div",{className:"space-y-10",children:[t("div",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Operate"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Safety is part of the system model, not an afterthought."}),e("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is meant to survive real change: new generated surfaces, policy updates, migrations, integration churn, and operator handoffs. The safety layer makes those changes inspectable, reversible, and governed."})]}),t("div",{className:"editorial-proof-strip",children:[t("div",{className:"editorial-stat",children:[e("span",{className:"editorial-label",children:"Operating rule"}),e("span",{className:"editorial-stat-value",children:"explicit change beats hidden mutation"})]}),e("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use policies, signing, audit trails, and migrations to keep the system legible even as AI-assisted workflows accelerate change volume."})]}),e("div",{className:"grid gap-4 md:grid-cols-2",children:s.map((a)=>t(i,{href:a.href,className:"editorial-panel",children:[e("h2",{className:"font-semibold text-xl",children:a.title}),e("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.href))})]})}export{o as SafetyOverviewPage};
2
+ var n=Object.defineProperty;var o=(e)=>e;function r(e,a){this[e]=o.bind(null,a)}var c=(e,a)=>{for(var s in a)n(e,s,{get:a[s],enumerable:!0,configurable:!0,set:r.bind(a,s)})};var m=(e,a)=>()=>(e&&(a=e(e=0)),a);import d from"@contractspec/lib.ui-link";import{jsx as t,jsxs as i}from"react/jsx-runtime";var l=[{title:"Spec signing",body:"Protect the integrity of what gets deployed and make changes verifiable.",href:"/docs/safety/signing"},{title:"Policy decision points",body:"Apply governance consistently across operations, data access, and generated surfaces.",href:"/docs/safety/pdp"},{title:"Audit trails",body:"Record operational and policy decisions with enough context to inspect and explain them later.",href:"/docs/safety/auditing"},{title:"Migrations",body:"Evolve data and schema boundaries without losing control of the system.",href:"/docs/safety/migrations"},{title:"Tenant isolation",body:"Keep configuration, access rules, and sensitive data bounded by tenant.",href:"/docs/safety/tenant-isolation"},{title:"Security and trust",body:"Understand the trust model, release process, and security expectations around the OSS system.",href:"/docs/safety/security-trust"}];function g(){return i("div",{className:"space-y-10",children:[i("div",{className:"space-y-3",children:[t("p",{className:"editorial-kicker",children:"Operate"}),t("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Safety is part of the system model, not an afterthought."}),t("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is meant to survive real change: new generated surfaces, policy updates, migrations, integration churn, and operator handoffs. The safety layer makes those changes inspectable, reversible, and governed."})]}),i("div",{className:"editorial-proof-strip",children:[i("div",{className:"editorial-stat",children:[t("span",{className:"editorial-label",children:"Operating rule"}),t("span",{className:"editorial-stat-value",children:"explicit change beats hidden mutation"})]}),t("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use policies, signing, audit trails, and migrations to keep the system legible even as AI-assisted workflows accelerate change volume."})]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:l.map((e)=>i(d,{href:e.href,className:"editorial-panel",children:[t("h2",{className:"font-semibold text-xl",children:e.title}),t("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.href))})]})}export{g as SafetyOverviewPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import A from"@contractspec/lib.ui-link";import{ChevronRight as B}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function G(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Policy Decision Points"}),z("p",{className:"text-muted-foreground",children:["A ",q("strong",{children:"Policy Decision Point (PDP)"})," is a centralized component that evaluates access control policies and makes authorization decisions. According to"," ",q("a",{href:"https://www.strongdm.com/blog/policy-decision-point",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"StrongDM"}),', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."']})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"How the PDP works in ContractSpec"}),q("p",{className:"text-muted-foreground",children:"In ContractSpec, the PDP is invoked on every operation\u2014whether it's rendering a UI component, executing a capability, or querying a data view. The flow is:"}),z("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Request evaluation"})," \u2013 The runtime sends a request to the PDP containing:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[q("li",{children:"The user's identity and attributes (roles, groups, location, etc.)"}),q("li",{children:"The resource being accessed (capability, field, workflow step)"}),q("li",{children:"The action being performed (read, write, execute)"}),q("li",{children:"Contextual information (time of day, device type, IP address)"})]})]}),z("li",{children:[q("strong",{children:"Policy evaluation"})," \u2013 The PDP evaluates the request against all applicable ",q("strong",{children:"PolicySpecs"}),". These specs define rules using attribute-based access control (ABAC) and can reference:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[q("li",{children:`User attributes (e.g., "role == 'admin'")`}),q("li",{children:`Resource attributes (e.g., "field.sensitivity == 'PII'")`}),q("li",{children:'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'})]})]}),z("li",{children:[q("strong",{children:"Decision return"})," \u2013 The PDP returns one of:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"PERMIT"})," ","\u2013 The operation is allowed."]}),z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"DENY"})," ","\u2013 The operation is blocked."]}),z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"REDACT"})," ","\u2013 The operation is allowed, but sensitive fields are masked."]})]})]}),z("li",{children:[q("strong",{children:"Enforcement"})," \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."]}),z("li",{children:[q("strong",{children:"Auditing"})," \u2013 Every PDP decision is logged to the"," ",q(A,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),", including the request, decision, and reasoning."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),q("p",{className:"text-muted-foreground",children:"Here's a simple policy that restricts access to PII fields:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`policyId: pii-access-control
2
+ var G=Object.defineProperty;var H=(A)=>A;function I(A,B){this[A]=H.bind(null,B)}var K=(A,B)=>{for(var E in B)G(A,E,{get:B[E],enumerable:!0,configurable:!0,set:I.bind(B,E)})};var M=(A,B)=>()=>(A&&(B=A(A=0)),B);import F from"@contractspec/lib.ui-link";import{ChevronRight as J}from"lucide-react";import{jsx as q,jsxs as z}from"react/jsx-runtime";function T(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Policy Decision Points"}),z("p",{className:"text-muted-foreground",children:["A ",q("strong",{children:"Policy Decision Point (PDP)"})," is a centralized component that evaluates access control policies and makes authorization decisions. According to"," ",q("a",{href:"https://www.strongdm.com/blog/policy-decision-point",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"StrongDM"}),', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."']})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"How the PDP works in ContractSpec"}),q("p",{className:"text-muted-foreground",children:"In ContractSpec, the PDP is invoked on every operation\u2014whether it's rendering a UI component, executing a capability, or querying a data view. The flow is:"}),z("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Request evaluation"})," \u2013 The runtime sends a request to the PDP containing:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[q("li",{children:"The user's identity and attributes (roles, groups, location, etc.)"}),q("li",{children:"The resource being accessed (capability, field, workflow step)"}),q("li",{children:"The action being performed (read, write, execute)"}),q("li",{children:"Contextual information (time of day, device type, IP address)"})]})]}),z("li",{children:[q("strong",{children:"Policy evaluation"})," \u2013 The PDP evaluates the request against all applicable ",q("strong",{children:"PolicySpecs"}),". These specs define rules using attribute-based access control (ABAC) and can reference:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[q("li",{children:`User attributes (e.g., "role == 'admin'")`}),q("li",{children:`Resource attributes (e.g., "field.sensitivity == 'PII'")`}),q("li",{children:'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'})]})]}),z("li",{children:[q("strong",{children:"Decision return"})," \u2013 The PDP returns one of:",z("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"PERMIT"})," ","\u2013 The operation is allowed."]}),z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"DENY"})," ","\u2013 The operation is blocked."]}),z("li",{children:[q("code",{className:"rounded bg-background/50 px-2 py-1",children:"REDACT"})," ","\u2013 The operation is allowed, but sensitive fields are masked."]})]})]}),z("li",{children:[q("strong",{children:"Enforcement"})," \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."]}),z("li",{children:[q("strong",{children:"Auditing"})," \u2013 Every PDP decision is logged to the"," ",q(F,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),", including the request, decision, and reasoning."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),q("p",{className:"text-muted-foreground",children:"Here's a simple policy that restricts access to PII fields:"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`policyId: pii-access-control
3
3
  version: '1.0.0'.0.0
4
4
  rules:
5
5
  - id: allow-admin-full-access
@@ -17,4 +17,4 @@ rules:
17
17
  effect: DENY
18
18
  condition: |
19
19
  user.role NOT IN ['admin', 'support'] AND
20
- field.sensitivity == 'PII'`})}),q("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),z("li",{children:[q("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),z("li",{children:[q("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),z("li",{children:[q("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),q("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Caching policy decisions for identical requests"}),q("li",{children:"Compiling policies into efficient bytecode"}),q("li",{children:"Evaluating only the minimal set of rules needed for each request"}),q("li",{children:"Running the PDP in-process to avoid network latency"})]}),q("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(A,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),z(A,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",q(B,{size:16})]})]})]})}export{G as SafetyPDPPage};
20
+ field.sensitivity == 'PII'`})}),q("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:[q("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),z("li",{children:[q("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),z("li",{children:[q("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),z("li",{children:[q("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),z("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),q("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),z("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:"Caching policy decisions for identical requests"}),q("li",{children:"Compiling policies into efficient bytecode"}),q("li",{children:"Evaluating only the minimal set of rules needed for each request"}),q("li",{children:"Running the PDP in-process to avoid network latency"})]}),q("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[q(F,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),z(F,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",q(J,{size:16})]})]})]})}export{T as SafetyPDPPage};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import a from"@contractspec/lib.ui-link";import{ChevronRight as i}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function s(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),e("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"Security policy"}),e("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),t(a,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",e(i,{size:16})]})]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:[t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),e("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Changesets required for published packages."}),e("li",{children:"CI gate for contract validation and drift detection."}),e("li",{children:"Rollback-friendly release process."})]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Data handling"}),e("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Schema-level sensitivity tags."}),e("li",{children:"Policy Decision Point enforcement."}),e("li",{children:"Audit logs for operational traceability."})]})]})]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:[t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Supply chain"}),e("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Dependabot + Renovate-style updates where available."}),e("li",{children:"Signed release artifacts planned for Studio release cycles."}),e("li",{children:"Transparent changelogs for every package."})]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),e("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Security response within 5 business days."}),e("li",{children:"Private disclosure via security@contractspec.io."}),e("li",{children:"Credit for researchers (with permission)."})]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Next steps"}),e("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),t("div",{className:"flex flex-wrap gap-4 pt-4",children:[t(a,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",e(i,{size:16})]}),t(a,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",e(i,{size:16})]})]})]})]})}export{s as SafetySecurityTrustPage};
2
+ var o=Object.defineProperty;var c=(a)=>a;function d(a,i){this[a]=c.bind(null,i)}var n=(a,i)=>{for(var l in i)o(a,l,{get:i[l],enumerable:!0,configurable:!0,set:d.bind(i,l)})};var p=(a,i)=>()=>(a&&(i=a(a=0)),i);import r from"@contractspec/lib.ui-link";import{ChevronRight as s}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function h(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),e("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"Security policy"}),e("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),t(r,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",e(s,{size:16})]})]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:[t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),e("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Changesets required for published packages."}),e("li",{children:"CI gate for contract validation and drift detection."}),e("li",{children:"Rollback-friendly release process."})]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Data handling"}),e("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Schema-level sensitivity tags."}),e("li",{children:"Policy Decision Point enforcement."}),e("li",{children:"Audit logs for operational traceability."})]})]})]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:[t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Supply chain"}),e("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Dependabot + Renovate-style updates where available."}),e("li",{children:"Signed release artifacts planned for Studio release cycles."}),e("li",{children:"Transparent changelogs for every package."})]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),e("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Security response within 5 business days."}),e("li",{children:"Private disclosure via security@contractspec.io."}),e("li",{children:"Credit for researchers (with permission)."})]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Next steps"}),e("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),t("div",{className:"flex flex-wrap gap-4 pt-4",children:[t(r,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",e(s,{size:16})]}),t(r,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",e(s,{size:16})]})]})]})]})}export{h as SafetySecurityTrustPage};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import z from"@contractspec/lib.ui-link";import{ChevronRight as A}from"lucide-react";import{jsx as f,jsxs as q}from"react/jsx-runtime";function E(){return q("div",{className:"space-y-8",children:[q("div",{className:"space-y-2",children:[f("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),f("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),q("div",{className:"space-y-6",children:[q("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"How it works"}),f("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),q("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
3
- contractspec deploy --signed app.spec.ts.signed`})})]}),q("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`contractspec verify app.spec.ts.signed
2
+ var D=Object.defineProperty;var E=(q)=>q;function F(q,z){this[q]=E.bind(null,z)}var I=(q,z)=>{for(var B in z)D(q,B,{get:z[B],enumerable:!0,configurable:!0,set:F.bind(z,B)})};var J=(q,z)=>()=>(q&&(z=q(q=0)),z);import G from"@contractspec/lib.ui-link";import{ChevronRight as H}from"lucide-react";import{jsx as f,jsxs as A}from"react/jsx-runtime";function O(){return A("div",{className:"space-y-8",children:[A("div",{className:"space-y-2",children:[f("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),f("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),A("div",{className:"space-y-6",children:[A("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"How it works"}),f("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),A("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
3
+ contractspec deploy --signed app.spec.ts.signed`})})]}),A("div",{className:"space-y-3",children:[f("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`contractspec verify app.spec.ts.signed
4
4
  # Output: \u2713 Signature valid
5
5
  # Signed by: alice@example.com
6
- # Timestamp: 2024-11-08T10:30:00Z`})})]}),f("div",{className:"flex items-center gap-4 pt-4",children:q(z,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",f(A,{size:16})]})})]})]})}export{E as SafetySigningPage};
6
+ # Timestamp: 2024-11-08T10:30:00Z`})})]}),f("div",{className:"flex items-center gap-4 pt-4",children:A(G,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",f(H,{size:16})]})})]})]})}export{O as SafetySigningPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";function a(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),e("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),t("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",e("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),t("p",{children:["For high-security environments, you can use the"," ",e("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),e("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
2
+ var n=Object.defineProperty;var r=(e)=>e;function s(e,a){this[e]=r.bind(null,a)}var l=(e,a)=>{for(var i in a)n(e,i,{get:a[i],enumerable:!0,configurable:!0,set:s.bind(a,i)})};var d=(e,a)=>()=>(e&&(a=e(e=0)),a);import{jsx as t,jsxs as o}from"react/jsx-runtime";function p(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),t("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),o("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",t("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),o("p",{children:["For high-security environments, you can use the"," ",t("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),t("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
3
3
 
4
4
  test('findUser query is isolated', () => {
5
5
  const isValid = IsolationValidator.validateQuery(
@@ -9,4 +9,4 @@ test('findUser query is isolated', () => {
9
9
  'tenant-123'
10
10
  );
11
11
  expect(isValid).toBe(true);
12
- });`})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Layer 3: Policy Engine"}),e("p",{children:"The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."})]})]})}export{a as SafetyTenantIsolationPage};
12
+ });`})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Layer 3: Policy Engine"}),t("p",{children:"The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."})]})]})}export{p as SafetyTenantIsolationPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import g from"@contractspec/lib.ui-link";import{ChevronRight as S}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),i("p",{className:"text-muted-foreground",children:["An ",t("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",t("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),i("div",{className:"space-y-3",children:[i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Accountability"}),t("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Security"}),t("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Compliance"}),t("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Debugging"}),t("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),t("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),i("li",{children:[t("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",t(g,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),i("li",{children:[t("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),i("li",{children:[t("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),i("li",{children:[t("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),i("li",{children:[t("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Audit log format"}),t("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
2
+ var w=Object.defineProperty;var T=(n)=>n;function I(n,f){this[n]=T.bind(null,f)}var H=(n,f)=>{for(var h in f)w(n,h,{get:f[h],enumerable:!0,configurable:!0,set:I.bind(f,h)})};var B=(n,f)=>()=>(n&&(f=n(n=0)),f);import v from"@contractspec/lib.ui-link";import{ChevronRight as k}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function D(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),i("p",{className:"text-muted-foreground",children:["An ",t("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",t("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),i("div",{className:"space-y-3",children:[i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Accountability"}),t("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Security"}),t("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Compliance"}),t("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),i("div",{children:[t("h3",{className:"font-semibold text-lg",children:"Debugging"}),t("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),t("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),i("li",{children:[t("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",t(v,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),i("li",{children:[t("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),i("li",{children:[t("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),i("li",{children:[t("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),i("li",{children:[t("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Audit log format"}),t("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
3
3
  "timestamp": "2025-11-13T14:32:15.123Z",
4
4
  "eventId": "evt_abc123",
5
5
  "eventType": "capability.invoked",
@@ -30,7 +30,7 @@ import g from"@contractspec/lib.ui-link";import{ChevronRight as S}from"lucide-re
30
30
  "ruleId": "allow-admin-transfers",
31
31
  "reason": "User has admin role"
32
32
  }
33
- }`})})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Storage and retention"}),t("p",{className:"text-muted-foreground",children:"Audit logs are stored in a tamper-evident append-only log. Once written, entries cannot be modified or deleted. This ensures the integrity of the audit trail."}),t("p",{className:"text-muted-foreground",children:"ContractSpec supports multiple storage backends:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"Local file system"})," \u2013 For development and testing."]}),i("li",{children:[t("strong",{children:"Cloud object storage"})," \u2013 S3, GCS, or Azure Blob Storage for production."]}),i("li",{children:[t("strong",{children:"SIEM integration"})," \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."]})]}),t("p",{className:"text-muted-foreground",children:"You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Querying audit logs"}),t("p",{className:"text-muted-foreground",children:"ContractSpec provides a query API for searching audit logs. You can filter by:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:"Time range"}),t("li",{children:"Event type"}),t("li",{children:"Actor (user ID, role, IP address)"}),t("li",{children:"Resource (capability, data view, workflow)"}),t("li",{children:"Result (success, failure, denied)"})]}),t("p",{className:"text-muted-foreground",children:'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Best practices"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"Review logs regularly"})," \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."]}),i("li",{children:[t("strong",{children:"Protect log access"})," \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."]}),i("li",{children:[t("strong",{children:"Retain logs long enough"})," \u2013 Check your compliance requirements and configure retention policies accordingly."]}),i("li",{children:[t("strong",{children:"Test log integrity"})," \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."]})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[t(g,{href:"/docs/safety/pdp",className:"btn-ghost",children:"Previous: Policy Decision Points"}),i(g,{href:"/docs/safety/migrations",className:"btn-primary",children:["Next: Migrations ",t(S,{size:16})]})]})]})}import b from"@contractspec/lib.ui-link";import{ChevronRight as w}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function T(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Migrations"}),o("p",{className:"text-muted-foreground",children:["A ",e("strong",{children:"schema migration"})," (also called a database migration) is a set of incremental, reversible changes to a database schema. According to"," ",e("a",{href:"https://en.wikipedia.org/wiki/Schema_migration",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Wikipedia"}),`, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Why migrations matter"}),e("p",{className:"text-muted-foreground",children:"As your application evolves, you'll need to change your data model\u2014adding new fields, renaming tables, changing data types, or restructuring relationships. Without a disciplined approach, these changes can lead to:"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Data loss or corruption"}),e("li",{children:"Downtime during deployments"}),e("li",{children:"Inconsistencies between environments (dev, staging, production)"}),e("li",{children:"Difficulty rolling back failed changes"})]}),e("p",{className:"text-muted-foreground",children:"Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"How MigrationSpec works"}),o("p",{className:"text-muted-foreground",children:["In ContractSpec, migrations are defined using"," ",e("strong",{children:"MigrationSpec"}),". Each migration has:"]}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[e("strong",{children:"Version"}),' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.']}),o("li",{children:[e("strong",{children:"Up function"}),` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`]}),o("li",{children:[e("strong",{children:"Down function"}),` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`]}),o("li",{children:[e("strong",{children:"Dependencies"})," \u2013 Other migrations that must run before this one."]}),o("li",{children:[e("strong",{children:"Validation"}),' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").']})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Example MigrationSpec"}),e("p",{className:"text-muted-foreground",children:"Here's a migration that adds an email verification field to the users table:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`migrationId: add-email-verified
33
+ }`})})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Storage and retention"}),t("p",{className:"text-muted-foreground",children:"Audit logs are stored in a tamper-evident append-only log. Once written, entries cannot be modified or deleted. This ensures the integrity of the audit trail."}),t("p",{className:"text-muted-foreground",children:"ContractSpec supports multiple storage backends:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"Local file system"})," \u2013 For development and testing."]}),i("li",{children:[t("strong",{children:"Cloud object storage"})," \u2013 S3, GCS, or Azure Blob Storage for production."]}),i("li",{children:[t("strong",{children:"SIEM integration"})," \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."]})]}),t("p",{className:"text-muted-foreground",children:"You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Querying audit logs"}),t("p",{className:"text-muted-foreground",children:"ContractSpec provides a query API for searching audit logs. You can filter by:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:"Time range"}),t("li",{children:"Event type"}),t("li",{children:"Actor (user ID, role, IP address)"}),t("li",{children:"Resource (capability, data view, workflow)"}),t("li",{children:"Result (success, failure, denied)"})]}),t("p",{className:"text-muted-foreground",children:'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'})]}),i("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Best practices"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[t("strong",{children:"Review logs regularly"})," \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."]}),i("li",{children:[t("strong",{children:"Protect log access"})," \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."]}),i("li",{children:[t("strong",{children:"Retain logs long enough"})," \u2013 Check your compliance requirements and configure retention policies accordingly."]}),i("li",{children:[t("strong",{children:"Test log integrity"})," \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."]})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[t(v,{href:"/docs/safety/pdp",className:"btn-ghost",children:"Previous: Policy Decision Points"}),i(v,{href:"/docs/safety/migrations",className:"btn-primary",children:["Next: Migrations ",t(k,{size:16})]})]})]})}import P from"@contractspec/lib.ui-link";import{ChevronRight as R}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function A(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Migrations"}),o("p",{className:"text-muted-foreground",children:["A ",e("strong",{children:"schema migration"})," (also called a database migration) is a set of incremental, reversible changes to a database schema. According to"," ",e("a",{href:"https://en.wikipedia.org/wiki/Schema_migration",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Wikipedia"}),`, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Why migrations matter"}),e("p",{className:"text-muted-foreground",children:"As your application evolves, you'll need to change your data model\u2014adding new fields, renaming tables, changing data types, or restructuring relationships. Without a disciplined approach, these changes can lead to:"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Data loss or corruption"}),e("li",{children:"Downtime during deployments"}),e("li",{children:"Inconsistencies between environments (dev, staging, production)"}),e("li",{children:"Difficulty rolling back failed changes"})]}),e("p",{className:"text-muted-foreground",children:"Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"How MigrationSpec works"}),o("p",{className:"text-muted-foreground",children:["In ContractSpec, migrations are defined using"," ",e("strong",{children:"MigrationSpec"}),". Each migration has:"]}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[e("strong",{children:"Version"}),' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.']}),o("li",{children:[e("strong",{children:"Up function"}),` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`]}),o("li",{children:[e("strong",{children:"Down function"}),` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`]}),o("li",{children:[e("strong",{children:"Dependencies"})," \u2013 Other migrations that must run before this one."]}),o("li",{children:[e("strong",{children:"Validation"}),' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").']})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Example MigrationSpec"}),e("p",{className:"text-muted-foreground",children:"Here's a migration that adds an email verification field to the users table:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`migrationId: add-email-verified
34
34
  version: 2025-11-13-001
35
35
  dependencies: []
36
36
 
@@ -53,7 +53,7 @@ validation:
53
53
  - sql: |
54
54
  SELECT COUNT(*) FROM users
55
55
  WHERE email_verified IS NULL;
56
- expectZeroRows: true`})})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Running migrations"}),e("p",{className:"text-muted-foreground",children:"Migrations are applied automatically during deployment. The ContractSpec runtime:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Checks which migrations have already been applied (stored in a migrations table)."}),e("li",{children:"Identifies new migrations that need to run."}),e("li",{children:"Executes them in order, respecting dependencies."}),e("li",{children:"Runs validation checks to ensure success."}),e("li",{children:"Records the migration as applied."})]}),e("p",{className:"text-muted-foreground",children:"If a migration fails, the deployment is aborted, and the system remains in its previous state. You can then fix the migration and redeploy."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Rolling back migrations"}),o("p",{className:"text-muted-foreground",children:["If you need to roll back a deployment, ContractSpec automatically runs the ",e("strong",{children:"down"})," functions of any migrations that were applied. This restores the database to its previous state."]}),e("p",{className:"text-muted-foreground",children:"Note that rollbacks are not always possible\u2014for example, if you've deleted a column, you cannot recover the data unless you have a backup. For destructive changes, it's best to use a multi-step migration:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Add the new column (reversible)."}),e("li",{children:"Backfill data from the old column to the new column (reversible)."}),e("li",{children:"Update application code to use the new column (reversible)."}),e("li",{children:"Drop the old column (irreversible\u2014only do this after confirming the new column works)."})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[e("strong",{children:"Test migrations locally"})," \u2013 Run them against a copy of production data to catch issues before deploying."]}),o("li",{children:[e("strong",{children:"Keep migrations small"})," \u2013 Each migration should do one thing. This makes them easier to understand and roll back."]}),o("li",{children:[e("strong",{children:"Write reversible migrations"})," \u2013 Always provide a down function, even if you don't plan to roll back."]}),o("li",{children:[e("strong",{children:"Use transactions"})," \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."]}),o("li",{children:[e("strong",{children:"Avoid destructive changes"})," \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."]}),o("li",{children:[e("strong",{children:"Version your migrations"})," \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."]}),o("li",{children:[e("strong",{children:"Document breaking changes"})," \u2013 If a migration requires application code changes, note this in the migration description."]})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Zero-downtime migrations"}),e("p",{className:"text-muted-foreground",children:"Some migrations can cause downtime if not handled carefully. For example, adding a NOT NULL column to a large table can lock the table for minutes. To avoid this, use a multi-step approach:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Add the column as nullable."}),e("li",{children:"Backfill the column in batches (without locking the table)."}),e("li",{children:"Add the NOT NULL constraint once all rows are populated."})]}),e("p",{className:"text-muted-foreground",children:"ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."})]}),o("div",{className:"flex items-center gap-4 pt-4",children:[e(b,{href:"/docs/safety/auditing",className:"btn-ghost",children:"Previous: Audit Logs"}),o(b,{href:"/docs/advanced/renderers",className:"btn-primary",children:["Next: Advanced Topics ",e(w,{size:16})]})]})]})}import I from"@contractspec/lib.ui-link";import{jsx as c,jsxs as u}from"react/jsx-runtime";var k=[{title:"Spec signing",body:"Protect the integrity of what gets deployed and make changes verifiable.",href:"/docs/safety/signing"},{title:"Policy decision points",body:"Apply governance consistently across operations, data access, and generated surfaces.",href:"/docs/safety/pdp"},{title:"Audit trails",body:"Record operational and policy decisions with enough context to inspect and explain them later.",href:"/docs/safety/auditing"},{title:"Migrations",body:"Evolve data and schema boundaries without losing control of the system.",href:"/docs/safety/migrations"},{title:"Tenant isolation",body:"Keep configuration, access rules, and sensitive data bounded by tenant.",href:"/docs/safety/tenant-isolation"},{title:"Security and trust",body:"Understand the trust model, release process, and security expectations around the OSS system.",href:"/docs/safety/security-trust"}];function D(){return u("div",{className:"space-y-10",children:[u("div",{className:"space-y-3",children:[c("p",{className:"editorial-kicker",children:"Operate"}),c("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Safety is part of the system model, not an afterthought."}),c("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is meant to survive real change: new generated surfaces, policy updates, migrations, integration churn, and operator handoffs. The safety layer makes those changes inspectable, reversible, and governed."})]}),u("div",{className:"editorial-proof-strip",children:[u("div",{className:"editorial-stat",children:[c("span",{className:"editorial-label",children:"Operating rule"}),c("span",{className:"editorial-stat-value",children:"explicit change beats hidden mutation"})]}),c("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use policies, signing, audit trails, and migrations to keep the system legible even as AI-assisted workflows accelerate change volume."})]}),c("div",{className:"grid gap-4 md:grid-cols-2",children:k.map((y)=>u(I,{href:y.href,className:"editorial-panel",children:[c("h2",{className:"font-semibold text-xl",children:y.title}),c("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:y.body})]},y.href))})]})}import h from"@contractspec/lib.ui-link";import{ChevronRight as R}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function A(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"Policy Decision Points"}),l("p",{className:"text-muted-foreground",children:["A ",a("strong",{children:"Policy Decision Point (PDP)"})," is a centralized component that evaluates access control policies and makes authorization decisions. According to"," ",a("a",{href:"https://www.strongdm.com/blog/policy-decision-point",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"StrongDM"}),', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."']})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"How the PDP works in ContractSpec"}),a("p",{className:"text-muted-foreground",children:"In ContractSpec, the PDP is invoked on every operation\u2014whether it's rendering a UI component, executing a capability, or querying a data view. The flow is:"}),l("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[l("li",{children:[a("strong",{children:"Request evaluation"})," \u2013 The runtime sends a request to the PDP containing:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[a("li",{children:"The user's identity and attributes (roles, groups, location, etc.)"}),a("li",{children:"The resource being accessed (capability, field, workflow step)"}),a("li",{children:"The action being performed (read, write, execute)"}),a("li",{children:"Contextual information (time of day, device type, IP address)"})]})]}),l("li",{children:[a("strong",{children:"Policy evaluation"})," \u2013 The PDP evaluates the request against all applicable ",a("strong",{children:"PolicySpecs"}),". These specs define rules using attribute-based access control (ABAC) and can reference:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[a("li",{children:`User attributes (e.g., "role == 'admin'")`}),a("li",{children:`Resource attributes (e.g., "field.sensitivity == 'PII'")`}),a("li",{children:'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'})]})]}),l("li",{children:[a("strong",{children:"Decision return"})," \u2013 The PDP returns one of:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"PERMIT"})," ","\u2013 The operation is allowed."]}),l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"DENY"})," ","\u2013 The operation is blocked."]}),l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"REDACT"})," ","\u2013 The operation is allowed, but sensitive fields are masked."]})]})]}),l("li",{children:[a("strong",{children:"Enforcement"})," \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."]}),l("li",{children:[a("strong",{children:"Auditing"})," \u2013 Every PDP decision is logged to the"," ",a(h,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),", including the request, decision, and reasoning."]})]})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),a("p",{className:"text-muted-foreground",children:"Here's a simple policy that restricts access to PII fields:"}),a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:a("pre",{children:`policyId: pii-access-control
56
+ expectZeroRows: true`})})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Running migrations"}),e("p",{className:"text-muted-foreground",children:"Migrations are applied automatically during deployment. The ContractSpec runtime:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Checks which migrations have already been applied (stored in a migrations table)."}),e("li",{children:"Identifies new migrations that need to run."}),e("li",{children:"Executes them in order, respecting dependencies."}),e("li",{children:"Runs validation checks to ensure success."}),e("li",{children:"Records the migration as applied."})]}),e("p",{className:"text-muted-foreground",children:"If a migration fails, the deployment is aborted, and the system remains in its previous state. You can then fix the migration and redeploy."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Rolling back migrations"}),o("p",{className:"text-muted-foreground",children:["If you need to roll back a deployment, ContractSpec automatically runs the ",e("strong",{children:"down"})," functions of any migrations that were applied. This restores the database to its previous state."]}),e("p",{className:"text-muted-foreground",children:"Note that rollbacks are not always possible\u2014for example, if you've deleted a column, you cannot recover the data unless you have a backup. For destructive changes, it's best to use a multi-step migration:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Add the new column (reversible)."}),e("li",{children:"Backfill data from the old column to the new column (reversible)."}),e("li",{children:"Update application code to use the new column (reversible)."}),e("li",{children:"Drop the old column (irreversible\u2014only do this after confirming the new column works)."})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[e("strong",{children:"Test migrations locally"})," \u2013 Run them against a copy of production data to catch issues before deploying."]}),o("li",{children:[e("strong",{children:"Keep migrations small"})," \u2013 Each migration should do one thing. This makes them easier to understand and roll back."]}),o("li",{children:[e("strong",{children:"Write reversible migrations"})," \u2013 Always provide a down function, even if you don't plan to roll back."]}),o("li",{children:[e("strong",{children:"Use transactions"})," \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."]}),o("li",{children:[e("strong",{children:"Avoid destructive changes"})," \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."]}),o("li",{children:[e("strong",{children:"Version your migrations"})," \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."]}),o("li",{children:[e("strong",{children:"Document breaking changes"})," \u2013 If a migration requires application code changes, note this in the migration description."]})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Zero-downtime migrations"}),e("p",{className:"text-muted-foreground",children:"Some migrations can cause downtime if not handled carefully. For example, adding a NOT NULL column to a large table can lock the table for minutes. To avoid this, use a multi-step approach:"}),o("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Add the column as nullable."}),e("li",{children:"Backfill the column in batches (without locking the table)."}),e("li",{children:"Add the NOT NULL constraint once all rows are populated."})]}),e("p",{className:"text-muted-foreground",children:"ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."})]}),o("div",{className:"flex items-center gap-4 pt-4",children:[e(P,{href:"/docs/safety/auditing",className:"btn-ghost",children:"Previous: Audit Logs"}),o(P,{href:"/docs/advanced/renderers",className:"btn-primary",children:["Next: Advanced Topics ",e(R,{size:16})]})]})]})}import q from"@contractspec/lib.ui-link";import{jsx as p,jsxs as g}from"react/jsx-runtime";var E=[{title:"Spec signing",body:"Protect the integrity of what gets deployed and make changes verifiable.",href:"/docs/safety/signing"},{title:"Policy decision points",body:"Apply governance consistently across operations, data access, and generated surfaces.",href:"/docs/safety/pdp"},{title:"Audit trails",body:"Record operational and policy decisions with enough context to inspect and explain them later.",href:"/docs/safety/auditing"},{title:"Migrations",body:"Evolve data and schema boundaries without losing control of the system.",href:"/docs/safety/migrations"},{title:"Tenant isolation",body:"Keep configuration, access rules, and sensitive data bounded by tenant.",href:"/docs/safety/tenant-isolation"},{title:"Security and trust",body:"Understand the trust model, release process, and security expectations around the OSS system.",href:"/docs/safety/security-trust"}];function O(){return g("div",{className:"space-y-10",children:[g("div",{className:"space-y-3",children:[p("p",{className:"editorial-kicker",children:"Operate"}),p("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Safety is part of the system model, not an afterthought."}),p("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is meant to survive real change: new generated surfaces, policy updates, migrations, integration churn, and operator handoffs. The safety layer makes those changes inspectable, reversible, and governed."})]}),g("div",{className:"editorial-proof-strip",children:[g("div",{className:"editorial-stat",children:[p("span",{className:"editorial-label",children:"Operating rule"}),p("span",{className:"editorial-stat-value",children:"explicit change beats hidden mutation"})]}),p("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use policies, signing, audit trails, and migrations to keep the system legible even as AI-assisted workflows accelerate change volume."})]}),p("div",{className:"grid gap-4 md:grid-cols-2",children:E.map((n)=>g(q,{href:n.href,className:"editorial-panel",children:[p("h2",{className:"font-semibold text-xl",children:n.title}),p("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:n.body})]},n.href))})]})}import N from"@contractspec/lib.ui-link";import{ChevronRight as V}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function U(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"Policy Decision Points"}),l("p",{className:"text-muted-foreground",children:["A ",a("strong",{children:"Policy Decision Point (PDP)"})," is a centralized component that evaluates access control policies and makes authorization decisions. According to"," ",a("a",{href:"https://www.strongdm.com/blog/policy-decision-point",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"StrongDM"}),', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."']})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"How the PDP works in ContractSpec"}),a("p",{className:"text-muted-foreground",children:"In ContractSpec, the PDP is invoked on every operation\u2014whether it's rendering a UI component, executing a capability, or querying a data view. The flow is:"}),l("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[l("li",{children:[a("strong",{children:"Request evaluation"})," \u2013 The runtime sends a request to the PDP containing:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[a("li",{children:"The user's identity and attributes (roles, groups, location, etc.)"}),a("li",{children:"The resource being accessed (capability, field, workflow step)"}),a("li",{children:"The action being performed (read, write, execute)"}),a("li",{children:"Contextual information (time of day, device type, IP address)"})]})]}),l("li",{children:[a("strong",{children:"Policy evaluation"})," \u2013 The PDP evaluates the request against all applicable ",a("strong",{children:"PolicySpecs"}),". These specs define rules using attribute-based access control (ABAC) and can reference:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[a("li",{children:`User attributes (e.g., "role == 'admin'")`}),a("li",{children:`Resource attributes (e.g., "field.sensitivity == 'PII'")`}),a("li",{children:'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'})]})]}),l("li",{children:[a("strong",{children:"Decision return"})," \u2013 The PDP returns one of:",l("ul",{className:"mt-2 ml-6 list-inside list-disc space-y-1",children:[l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"PERMIT"})," ","\u2013 The operation is allowed."]}),l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"DENY"})," ","\u2013 The operation is blocked."]}),l("li",{children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"REDACT"})," ","\u2013 The operation is allowed, but sensitive fields are masked."]})]})]}),l("li",{children:[a("strong",{children:"Enforcement"})," \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."]}),l("li",{children:[a("strong",{children:"Auditing"})," \u2013 Every PDP decision is logged to the"," ",a(N,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),", including the request, decision, and reasoning."]})]})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),a("p",{className:"text-muted-foreground",children:"Here's a simple policy that restricts access to PII fields:"}),a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:a("pre",{children:`policyId: pii-access-control
57
57
  version: '1.0.0'.0.0
58
58
  rules:
59
59
  - id: allow-admin-full-access
@@ -71,11 +71,11 @@ rules:
71
71
  effect: DENY
72
72
  condition: |
73
73
  user.role NOT IN ['admin', 'support'] AND
74
- field.sensitivity == 'PII'`})}),a("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:[a("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),l("li",{children:[a("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),l("li",{children:[a("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),l("li",{children:[a("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),a("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Caching policy decisions for identical requests"}),a("li",{children:"Compiling policies into efficient bytecode"}),a("li",{children:"Evaluating only the minimal set of rules needed for each request"}),a("li",{children:"Running the PDP in-process to avoid network latency"})]}),a("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[a(h,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),l(h,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",a(R,{size:16})]})]})]})}import v from"@contractspec/lib.ui-link";import{ChevronRight as N}from"lucide-react";import{jsx as r,jsxs as d}from"react/jsx-runtime";function q(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),r("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),d("div",{className:"card-subtle space-y-4 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Security policy"}),r("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),d(v,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",r(N,{size:16})]})]}),d("div",{className:"grid gap-4 md:grid-cols-2",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),r("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Changesets required for published packages."}),r("li",{children:"CI gate for contract validation and drift detection."}),r("li",{children:"Rollback-friendly release process."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Data handling"}),r("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Schema-level sensitivity tags."}),r("li",{children:"Policy Decision Point enforcement."}),r("li",{children:"Audit logs for operational traceability."})]})]})]}),d("div",{className:"grid gap-4 md:grid-cols-2",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Supply chain"}),r("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Dependabot + Renovate-style updates where available."}),r("li",{children:"Signed release artifacts planned for Studio release cycles."}),r("li",{children:"Transparent changelogs for every package."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),r("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Security response within 5 business days."}),r("li",{children:"Private disclosure via security@contractspec.io."}),r("li",{children:"Credit for researchers (with permission)."})]})]})]}),d("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Next steps"}),r("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),d("div",{className:"flex flex-wrap gap-4 pt-4",children:[d(v,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",r(N,{size:16})]}),d(v,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",r(N,{size:16})]})]})]})]})}import E from"@contractspec/lib.ui-link";import{ChevronRight as O}from"lucide-react";import{jsx as n,jsxs as m}from"react/jsx-runtime";function V(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-2",children:[n("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),n("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),m("div",{className:"space-y-6",children:[m("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"How it works"}),n("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),m("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
75
- contractspec deploy --signed app.spec.ts.signed`})})]}),m("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:`contractspec verify app.spec.ts.signed
74
+ field.sensitivity == 'PII'`})}),a("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:[a("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),l("li",{children:[a("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),l("li",{children:[a("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),l("li",{children:[a("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),a("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Caching policy decisions for identical requests"}),a("li",{children:"Compiling policies into efficient bytecode"}),a("li",{children:"Evaluating only the minimal set of rules needed for each request"}),a("li",{children:"Running the PDP in-process to avoid network latency"})]}),a("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[a(N,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),l(N,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",a(V,{size:16})]})]})]})}import b from"@contractspec/lib.ui-link";import{ChevronRight as S}from"lucide-react";import{jsx as r,jsxs as d}from"react/jsx-runtime";function W(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),r("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),d("div",{className:"card-subtle space-y-4 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Security policy"}),r("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),d(b,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",r(S,{size:16})]})]}),d("div",{className:"grid gap-4 md:grid-cols-2",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),r("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Changesets required for published packages."}),r("li",{children:"CI gate for contract validation and drift detection."}),r("li",{children:"Rollback-friendly release process."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Data handling"}),r("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Schema-level sensitivity tags."}),r("li",{children:"Policy Decision Point enforcement."}),r("li",{children:"Audit logs for operational traceability."})]})]})]}),d("div",{className:"grid gap-4 md:grid-cols-2",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Supply chain"}),r("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Dependabot + Renovate-style updates where available."}),r("li",{children:"Signed release artifacts planned for Studio release cycles."}),r("li",{children:"Transparent changelogs for every package."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),r("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),d("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Security response within 5 business days."}),r("li",{children:"Private disclosure via security@contractspec.io."}),r("li",{children:"Credit for researchers (with permission)."})]})]})]}),d("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Next steps"}),r("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),d("div",{className:"flex flex-wrap gap-4 pt-4",children:[d(b,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",r(S,{size:16})]}),d(b,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",r(S,{size:16})]})]})]})]})}import z from"@contractspec/lib.ui-link";import{ChevronRight as C}from"lucide-react";import{jsx as c,jsxs as u}from"react/jsx-runtime";function M(){return u("div",{className:"space-y-8",children:[u("div",{className:"space-y-2",children:[c("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),c("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),u("div",{className:"space-y-6",children:[u("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"How it works"}),c("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),u("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
75
+ contractspec deploy --signed app.spec.ts.signed`})})]}),u("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`contractspec verify app.spec.ts.signed
76
76
  # Output: \u2713 Signature valid
77
77
  # Signed by: alice@example.com
78
- # Timestamp: 2024-11-08T10:30:00Z`})})]}),n("div",{className:"flex items-center gap-4 pt-4",children:m(E,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",n(O,{size:16})]})})]})]})}import{jsx as p,jsxs as f}from"react/jsx-runtime";function U(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-4",children:[p("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),p("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),f("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),f("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",p("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),f("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),f("p",{children:["For high-security environments, you can use the"," ",p("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),p("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
78
+ # Timestamp: 2024-11-08T10:30:00Z`})})]}),c("div",{className:"flex items-center gap-4 pt-4",children:u(z,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",c(C,{size:16})]})})]})]})}import{jsx as m,jsxs as y}from"react/jsx-runtime";function F(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-4",children:[m("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),m("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),y("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),y("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",m("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),y("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),y("p",{children:["For high-security environments, you can use the"," ",m("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),m("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
79
79
 
80
80
  test('findUser query is isolated', () => {
81
81
  const isValid = IsolationValidator.validateQuery(
@@ -85,4 +85,4 @@ test('findUser query is isolated', () => {
85
85
  'tenant-123'
86
86
  );
87
87
  expect(isValid).toBe(true);
88
- });`})]}),f("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Layer 3: Policy Engine"}),p("p",{children:"The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."})]})]})}export{U as SafetyTenantIsolationPage,V as SafetySigningPage,q as SafetySecurityTrustPage,A as SafetyPDPPage,D as SafetyOverviewPage,T as SafetyMigrationsPage,P as SafetyAuditingPage};
88
+ });`})]}),y("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Layer 3: Policy Engine"}),m("p",{children:"The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."})]})]})}export{F as SafetyTenantIsolationPage,M as SafetySigningPage,W as SafetySecurityTrustPage,U as SafetyPDPPage,O as SafetyOverviewPage,A as SafetyMigrationsPage,D as SafetyAuditingPage};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import a from"@contractspec/lib.ui-link";import{jsx as t,jsxs as n}from"react/jsx-runtime";function p({title:e="Need the operating layer on top of OSS ContractSpec?",body:o="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:r="See what Studio adds",href:s="https://www.contractspec.studio/docs"}){return n("div",{className:"card-subtle space-y-3 p-6",children:[t("h3",{className:"font-semibold text-lg",children:e}),t("p",{className:"text-muted-foreground text-sm",children:o}),t(a,{href:s,className:"btn-primary",children:r})]})}export{p as StudioPrompt};
2
+ var a=Object.defineProperty;var n=(t)=>t;function i(t,e){this[t]=n.bind(null,e)}var d=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0,configurable:!0,set:i.bind(e,o)})};var l=(t,e)=>()=>(t&&(e=t(t=0)),e);import p from"@contractspec/lib.ui-link";import{jsx as r,jsxs as c}from"react/jsx-runtime";function h({title:t="Need the operating layer on top of OSS ContractSpec?",body:e="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:s="https://www.contractspec.studio/docs"}){return c("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:t}),r("p",{className:"text-muted-foreground text-sm",children:e}),r(p,{href:s,className:"btn-primary",children:o})]})}export{h as StudioPrompt};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{CodeBlock as o}from"@contractspec/lib.design-system";import r from"@contractspec/lib.ui-link";import{jsx as e,jsxs as t}from"react/jsx-runtime";var i=[{title:"Managed",body:"Best when the team wants the platform to own setup, routing, readiness, and mobile-safe defaults."},{title:"Local",body:"Best for power users who want tenant-local execution providers and tighter data-locality control."},{title:"Hybrid",body:"Best when some work should stay local while preview, review, or export flows still use managed coordination."}],n=["Capture prompts, files, voice, and other inbound sources into a typed workspace instead of relying on a single chat transcript.","Fuse the sources into decisions, assumptions, and blueprint updates with provenance and approval memory.","Compile authoring work into execution lanes, then route the work to explicit provider profiles and runtime targets.","Create previews, run readiness gates, and record receipts before export becomes an operator action.","Keep mobile review parity so approvals, incidents, and patch proposals can be inspected away from the desktop workbench."];function c(){return t("div",{className:"space-y-10",children:[t("section",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Spec pack"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Builder is a governed authoring control plane, not a frontier coding agent."}),t("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented Builder stack sits across"," ",e("code",{children:"@contractspec/lib.builder-spec"}),","," ",e("code",{children:"@contractspec/lib.builder-runtime"}),","," ",e("code",{children:"@contractspec/lib.provider-spec"}),", and the reusable workbench/mobile modules. It orchestrates inputs, provider routing, readiness, and export decisions on top of the OSS ContractSpec foundation and the Studio operating layer."]})]}),t("section",{className:"editorial-proof-strip",children:[t("div",{className:"editorial-stat",children:[e("span",{className:"editorial-label",children:"What Builder owns"}),e("span",{className:"editorial-stat-value",children:"fusion, routing, readiness, export"})]}),e("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Builder delegates synthesis and coding to external execution providers. Its job is to keep those runs policy-aware, provenance-rich, and usable from both desktop and mobile operator surfaces."})]}),t("section",{className:"editorial-panel space-y-5",children:[t("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented stack and entrypoints"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"You can use the type surfaces directly in code, or start from the already wired workbench and mobile review routes in the public app shell."})]}),e(o,{language:"text",filename:"builder-stack",code:`Packages
2
+ var s=Object.defineProperty;var l=(t)=>t;function c(t,o){this[t]=l.bind(null,o)}var u=(t,o)=>{for(var r in o)s(t,r,{get:o[r],enumerable:!0,configurable:!0,set:c.bind(o,r)})};var h=(t,o)=>()=>(t&&(o=t(t=0)),o);import{CodeBlock as i}from"@contractspec/lib.design-system";import n from"@contractspec/lib.ui-link";import{jsx as e,jsxs as a}from"react/jsx-runtime";var p=[{title:"Managed",body:"Best when the team wants the platform to own setup, routing, readiness, API defaults, and mobile-safe operator flows."},{title:"Local",body:"Best for power users who want local-daemon registration, tenant-local execution providers, and tighter data-locality control."},{title:"Hybrid",body:"Best when some work should stay local while preview, review, export, or mobile operator flows still use managed coordination."}],d=["Bootstrap managed, local-daemon, or hybrid presets explicitly instead of inventing provider posture ad hoc per host.","Capture prompts, files, voice, and other inbound sources into a typed workspace instead of relying on a single chat transcript.","Fuse the sources into decisions, assumptions, and blueprint updates with provenance and approval memory.","Compile authoring work into execution lanes, then route the work to explicit provider profiles and runtime targets.","Create previews, run readiness gates, and record receipts before export becomes an operator action.","Keep mobile review parity so approvals, incidents, and patch proposals can be inspected away from the desktop workbench."],m=["local trust and lease posture for registered local runtimes","channel-action and comparison posture data in the shared Builder snapshot","preview, readiness, export, and mobile-review state derived from the same workspace snapshot"];function w(){return a("div",{className:"space-y-10",children:[a("section",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Spec pack"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Builder is a governed authoring control plane, not a frontier coding agent."}),a("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented Builder stack sits across"," ",e("code",{children:"@contractspec/lib.builder-spec"}),","," ",e("code",{children:"@contractspec/lib.builder-runtime"}),","," ",e("code",{children:"@contractspec/lib.provider-spec"}),", and the reusable workbench/mobile modules. It orchestrates inputs, provider routing, readiness, and export decisions on top of the OSS ContractSpec foundation and the Studio operating layer."]})]}),a("section",{className:"editorial-proof-strip",children:[a("div",{className:"editorial-stat",children:[e("span",{className:"editorial-label",children:"What Builder owns"}),e("span",{className:"editorial-stat-value",children:"fusion, routing, readiness, export"})]}),e("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Builder delegates synthesis and coding to external execution providers. Its job is to keep those runs policy-aware, provenance-rich, and usable from both desktop and mobile operator surfaces."})]}),a("section",{className:"editorial-panel space-y-5",children:[a("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented stack and entrypoints"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"You can use the type surfaces directly in code, or start from the already wired workbench and mobile review routes in the public app shell."})]}),e(i,{language:"text",filename:"builder-stack",code:`Packages
3
3
  - @contractspec/lib.builder-spec
4
4
  - @contractspec/lib.builder-runtime
5
5
  - @contractspec/lib.provider-spec
@@ -13,7 +13,22 @@ Web app routes
13
13
  Operate API proxy
14
14
  - /api/operate/builder/queries/builder.workspace.snapshot
15
15
  - /api/operate/builder/commands/builder.blueprint.patch
16
- - /api/operate/builder/commands/builder.export.execute`})]}),e("section",{className:"grid gap-4 md:grid-cols-3",children:i.map((a)=>t("article",{className:"editorial-panel space-y-3",children:[e("h2",{className:"font-semibold text-xl",children:a.title}),e("p",{className:"text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),t("section",{className:"grid gap-5 lg:grid-cols-2",children:[t("article",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Typical Builder loop"}),e("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:n.map((a)=>e("li",{children:a},a))})]}),t("article",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What Builder should not become"}),t("ul",{className:"editorial-list",children:[t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a competitor to specialized coding agents such as Codex or Claude Code."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a managed-only product that traps teams away from OSS-local runtime paths."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a hidden routing layer that obscures provider provenance, receipts, or runtime mode."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a desktop-only surface. Mobile review parity is part of the control-plane contract."})]})]})]})]}),t("section",{className:"editorial-panel space-y-5",children:[t("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Use the workbench UI as the host surface"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"The reusable module already exposes the desktop workbench shell. Your host app keeps control of action wiring, runtime mode selection, and approval flows."})]}),e(o,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import { BuilderWorkbench, useBuilderWorkbenchState } from "@contractspec/module.builder-workbench";
16
+ - /api/operate/builder/commands/builder.export.execute`})]}),e("section",{className:"grid gap-4 md:grid-cols-3",children:p.map((t)=>a("article",{className:"editorial-panel space-y-3",children:[e("h2",{className:"font-semibold text-xl",children:t.title}),e("p",{className:"text-muted-foreground text-sm leading-7",children:t.body})]},t.title))}),a("section",{className:"grid gap-5 lg:grid-cols-2",children:[a("article",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Typical Builder loop"}),e("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:d.map((t)=>e("li",{children:t},t))})]}),a("article",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What Builder should not become"}),a("ul",{className:"editorial-list",children:[a("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a competitor to specialized coding agents such as Codex or Claude Code."})]}),a("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a managed-only product that traps teams away from OSS-local runtime paths."})]}),a("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a hidden routing layer that obscures provider provenance, receipts, or runtime mode."})]}),a("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Not a desktop-only surface. Mobile review parity is part of the control-plane contract."})]})]})]})]}),a("section",{className:"editorial-panel space-y-5",children:[a("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Workspace config carries the current Builder defaults"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder setup is no longer just an app-shell concern. The shared workspace config now carries runtime mode, bootstrap preset, control plane API defaults, and local runtime registration metadata so the CLI, editors, and web shells resolve the same posture."})]}),e(i,{language:"json",filename:".contractsrc.json",code:`{
17
+ "builder": {
18
+ "enabled": true,
19
+ "runtimeMode": "local",
20
+ "bootstrapPreset": "local_daemon_mvp",
21
+ "api": {
22
+ "baseUrl": "https://api.contractspec.io",
23
+ "controlPlaneTokenEnvVar": "CONTROL_PLANE_API_TOKEN"
24
+ },
25
+ "localRuntime": {
26
+ "runtimeId": "rt_local_daemon",
27
+ "grantedTo": "local:operator",
28
+ "providerIds": ["provider.codex", "provider.local.model"]
29
+ }
30
+ }
31
+ }`})]}),a("section",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Operator posture stays visible"}),e("ul",{className:"editorial-list",children:m.map((t)=>a("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:t})]},t))})]}),a("section",{className:"editorial-panel space-y-5",children:[a("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Use the workbench UI as the host surface"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"The reusable module already exposes the desktop workbench shell. Your host app keeps control of action wiring, runtime mode selection, and approval flows."})]}),e(i,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import { BuilderWorkbench, useBuilderWorkbenchState } from "@contractspec/module.builder-workbench";
17
32
 
18
33
  const state = useBuilderWorkbenchState({
19
34
  workspace: initialSnapshot.workspace,
@@ -31,4 +46,4 @@ const state = useBuilderWorkbenchState({
31
46
  onRunReadiness={runReadiness}
32
47
  onExecuteExport={executeExport}
33
48
  selectedExportRuntimeMode="hybrid"
34
- />;`})]}),t("section",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Read this with the Studio bridge in mind"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder is where the OSS foundation meets the richer operating layer. Use the Studio overview when you want the higher-level product posture and team workflows on top of these contracts."}),t("div",{className:"flex flex-wrap gap-3",children:[e(r,{href:"/docs/studio",className:"btn-primary",children:"Studio overview"}),e(r,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})]})}export{c as SpecsBuilderControlPlanePage};
49
+ />;`})]}),a("section",{className:"editorial-panel space-y-4",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Read this with the Studio bridge in mind"}),e("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder is where the OSS foundation meets the richer operating layer. Use the Studio overview when you want the higher-level product posture and team workflows on top of these contracts."}),a("div",{className:"flex flex-wrap gap-3",children:[e(n,{href:"/docs/studio",className:"btn-primary",children:"Studio overview"}),e(n,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})]})}export{w as SpecsBuilderControlPlanePage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import z from"@contractspec/lib.ui-link";import{ChevronRight as A}from"lucide-react";import{jsx as q,jsxs as y}from"react/jsx-runtime";function E(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-2",children:[q("h1",{className:"font-bold text-4xl",children:"Capabilities"}),q("p",{className:"text-lg text-muted-foreground",children:"Capabilities are the core building block of ContractSpec. They define what your app can do."})]}),y("div",{className:"space-y-6",children:[y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Overview"}),q("p",{className:"text-muted-foreground",children:"A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."})]}),y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Defining a Command (Write)"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`import { defineCommand } from '@contractspec/lib.contracts-spec';
2
+ var D=Object.defineProperty;var E=(z)=>z;function F(z,A){this[z]=E.bind(null,A)}var I=(z,A)=>{for(var B in A)D(z,B,{get:A[B],enumerable:!0,configurable:!0,set:F.bind(A,B)})};var J=(z,A)=>()=>(z&&(A=z(z=0)),A);import G from"@contractspec/lib.ui-link";import{ChevronRight as H}from"lucide-react";import{jsx as q,jsxs as y}from"react/jsx-runtime";function O(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-2",children:[q("h1",{className:"font-bold text-4xl",children:"Capabilities"}),q("p",{className:"text-lg text-muted-foreground",children:"Capabilities are the core building block of ContractSpec. They define what your app can do."})]}),y("div",{className:"space-y-6",children:[y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Overview"}),q("p",{className:"text-muted-foreground",children:"A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."})]}),y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Defining a Command (Write)"}),q("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:q("pre",{children:`import { defineCommand } from '@contractspec/lib.contracts-spec';
3
3
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
4
4
 
5
5
  const TransferFundsInput = new SchemaModel({
@@ -37,4 +37,4 @@ export const TransferFunds = defineCommand({
37
37
  auth: 'user',
38
38
  flags: ['payments_enabled'],
39
39
  },
40
- });`})})]}),y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Schema Types"}),y("p",{className:"text-muted-foreground",children:["ContractSpec uses ",q("code",{children:"@contractspec/lib.schema"})," for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."]}),y("ul",{className:"space-y-2 text-muted-foreground",children:[y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.NonEmptyString()"})," ","- Non-empty text"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.PositiveNumber()"})," ","- Positive numbers"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.DateTime()"})," ","- ISO 8601 timestamps"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.Email()"})," ","- Valid email addresses"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum(...)"})," ","- Type-safe enums"]})]})]}),q("div",{className:"flex items-center gap-4 pt-4",children:y(z,{href:"/docs/specs/dataviews",className:"btn-primary",children:["Next: DataViews ",q(A,{size:16})]})})]})]})}export{E as SpecsCapabilitiesPage};
40
+ });`})})]}),y("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Schema Types"}),y("p",{className:"text-muted-foreground",children:["ContractSpec uses ",q("code",{children:"@contractspec/lib.schema"})," for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."]}),y("ul",{className:"space-y-2 text-muted-foreground",children:[y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.NonEmptyString()"})," ","- Non-empty text"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.PositiveNumber()"})," ","- Positive numbers"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.DateTime()"})," ","- ISO 8601 timestamps"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.Email()"})," ","- Valid email addresses"]}),y("li",{children:["\u2022"," ",q("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum(...)"})," ","- Type-safe enums"]})]})]}),q("div",{className:"flex items-center gap-4 pt-4",children:y(G,{href:"/docs/specs/dataviews",className:"btn-primary",children:["Next: DataViews ",q(H,{size:16})]})})]})]})}export{O as SpecsCapabilitiesPage};