@contractspec/bundle.library 3.8.10 → 3.8.12
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.
- package/.turbo/turbo-build.log +606 -594
- package/CHANGELOG.md +59 -0
- package/dist/application/context-storage/index.js +1 -28
- package/dist/application/index.js +13 -2133
- package/dist/application/mcp/cliMcp.js +4 -452
- package/dist/application/mcp/common.js +1 -193
- package/dist/application/mcp/contractsMcp.js +2 -549
- package/dist/application/mcp/contractsMcpResources.js +2 -123
- package/dist/application/mcp/contractsMcpTools.js +1 -199
- package/dist/application/mcp/docsMcp.catalog.js +3 -381
- package/dist/application/mcp/docsMcp.data.js +1 -147
- package/dist/application/mcp/docsMcp.js +6 -1039
- package/dist/application/mcp/docsMcp.prompts.js +6 -521
- package/dist/application/mcp/docsMcp.reference.js +3 -235
- package/dist/application/mcp/docsMcp.resources.js +3 -519
- package/dist/application/mcp/docsMcp.tools.js +3 -518
- package/dist/application/mcp/index.js +13 -2106
- package/dist/application/mcp/internalMcp.js +2 -410
- package/dist/application/mcp/normalizeMcpRequest.js +1 -21
- package/dist/application/mcp/providerRankingMcp.js +1 -530
- package/dist/bundles/LibraryBundle.js +1 -138
- package/dist/bundles/index.js +1 -138
- package/dist/components/docs/DocsIndexPage.js +2 -912
- package/dist/components/docs/advanced/AdvancedMCPPage.js +4 -271
- package/dist/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
- package/dist/components/docs/advanced/AdvancedRenderersPage.js +2 -118
- package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
- package/dist/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
- package/dist/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
- package/dist/components/docs/advanced/index.js +10 -1055
- package/dist/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
- package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
- package/dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
- package/dist/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
- package/dist/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
- package/dist/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
- package/dist/components/docs/architecture/index.js +20 -1340
- package/dist/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
- package/dist/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
- package/dist/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
- package/dist/components/docs/comparison/ComparisonOverviewPage.js +1 -202
- package/dist/components/docs/comparison/ComparisonWindmillPage.js +1 -254
- package/dist/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
- package/dist/components/docs/comparison/index.js +1 -1510
- package/dist/components/docs/docsManifest.js +1 -611
- package/dist/components/docs/docsManifest.test.d.ts +1 -0
- package/dist/components/docs/ecosystem/IntegrationsPage.js +2 -103
- package/dist/components/docs/ecosystem/PluginsPage.js +13 -179
- package/dist/components/docs/ecosystem/RegistryPage.js +7 -100
- package/dist/components/docs/ecosystem/TemplatesPage.js +3 -141
- package/dist/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
- package/dist/components/docs/ecosystem/index.js +23 -569
- package/dist/components/docs/examples/DocsExamplesPage.js +4 -124
- package/dist/components/docs/examples/ExampleShowcasePage.js +4 -244
- package/dist/components/docs/examples/exampleShowcaseData.js +4 -39
- package/dist/components/docs/examples/index.js +4 -330
- package/dist/components/docs/generated/docs-index.generated.js +1 -5
- package/dist/components/docs/generated/index.js +1 -74
- package/dist/components/docs/generated/loader.js +1 -74
- package/dist/components/docs/getting-started/CLIPage.js +4 -271
- package/dist/components/docs/getting-started/CompatibilityPage.js +1 -173
- package/dist/components/docs/getting-started/DataViewTutorialPage.js +4 -134
- package/dist/components/docs/getting-started/DeveloperToolsPage.js +1 -194
- package/dist/components/docs/getting-started/HelloWorldPage.js +5 -183
- package/dist/components/docs/getting-started/InstallationPage.js +3 -154
- package/dist/components/docs/getting-started/StartHerePage.js +2 -129
- package/dist/components/docs/getting-started/TroubleshootingPage.js +2 -168
- package/dist/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
- package/dist/components/docs/getting-started/getting-started.docblocks.js +4 -41
- package/dist/components/docs/getting-started/index.js +18 -1869
- package/dist/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
- package/dist/components/docs/guides/GuideConnectInRepoPage.d.ts +1 -0
- package/dist/components/docs/guides/GuideConnectInRepoPage.js +44 -0
- package/dist/components/docs/guides/GuideContractTypesPage.js +6 -541
- package/dist/components/docs/guides/GuideDocsPipelinePage.js +3 -207
- package/dist/components/docs/guides/GuideFirstModuleBundlePage.d.ts +1 -0
- package/dist/components/docs/guides/GuideFirstModuleBundlePage.js +76 -0
- package/dist/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
- package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.d.ts +1 -0
- package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +70 -0
- package/dist/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
- package/dist/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
- package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
- package/dist/components/docs/guides/GuidesIndexPage.js +2 -169
- package/dist/components/docs/guides/guides.docblocks.js +11 -75
- package/dist/components/docs/guides/index.d.ts +3 -0
- package/dist/components/docs/guides/index.js +213 -2428
- package/dist/components/docs/index.js +542 -24310
- package/dist/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
- package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
- package/dist/components/docs/integrations/IntegrationsGithubPage.js +3 -142
- package/dist/components/docs/integrations/IntegrationsGmailPage.js +3 -109
- package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
- package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
- package/dist/components/docs/integrations/IntegrationsMistralPage.js +5 -150
- package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
- package/dist/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
- package/dist/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
- package/dist/components/docs/integrations/IntegrationsPowensPage.js +4 -300
- package/dist/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
- package/dist/components/docs/integrations/IntegrationsResendPage.js +3 -102
- package/dist/components/docs/integrations/IntegrationsS3Page.js +4 -124
- package/dist/components/docs/integrations/IntegrationsSlackPage.js +3 -144
- package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
- package/dist/components/docs/integrations/IntegrationsStripePage.js +6 -327
- package/dist/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
- package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
- package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
- package/dist/components/docs/integrations/index.js +52 -3100
- package/dist/components/docs/intent/ContractFirstApiPage.js +2 -126
- package/dist/components/docs/intent/DeterministicCodegenPage.js +2 -148
- package/dist/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
- package/dist/components/docs/intent/OpenapiAlternativePage.js +3 -201
- package/dist/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
- package/dist/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
- package/dist/components/docs/intent/index.js +15 -1135
- package/dist/components/docs/intent/intent-pages.docblocks.js +1 -201
- package/dist/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
- package/dist/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
- package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
- package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
- package/dist/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
- package/dist/components/docs/knowledge/index.js +21 -1730
- package/dist/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
- package/dist/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
- package/dist/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
- package/dist/components/docs/libraries/LibrariesContentGenPage.js +2 -100
- package/dist/components/docs/libraries/LibrariesContractsPage.js +2 -284
- package/dist/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
- package/dist/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
- package/dist/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
- package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
- package/dist/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
- package/dist/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
- package/dist/components/docs/libraries/LibrariesGrowthPage.js +3 -88
- package/dist/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
- package/dist/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
- package/dist/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
- package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -170
- package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
- package/dist/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
- package/dist/components/docs/libraries/LibrariesResiliencePage.js +4 -120
- package/dist/components/docs/libraries/LibrariesRuntimePage.js +2 -200
- package/dist/components/docs/libraries/LibrariesSLOPage.js +3 -116
- package/dist/components/docs/libraries/LibrariesSchemaPage.js +3 -273
- package/dist/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
- package/dist/components/docs/libraries/LibrariesTestingPage.js +3 -133
- package/dist/components/docs/libraries/LibrariesUIKitPage.js +2 -230
- package/dist/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
- package/dist/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
- package/dist/components/docs/libraries/index.js +54 -4147
- package/dist/components/docs/manifesto/ManifestoPage.js +1 -86
- package/dist/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
- package/dist/components/docs/ops/DistributedTracingOpsPage.js +2 -71
- package/dist/components/docs/ops/index.js +3 -202
- package/dist/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
- package/dist/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
- package/dist/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
- package/dist/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
- package/dist/components/docs/ops/ops-top.docs.js +2 -17
- package/dist/components/docs/ops/ops.docs.js +10 -302
- package/dist/components/docs/product/product.docblocks.js +5 -72
- package/dist/components/docs/reference/DocsMarkdownContent.js +2 -196
- package/dist/components/docs/reference/DocsReferenceContent.js +3 -256
- package/dist/components/docs/reference/DocsReferenceIndexClient.js +2 -127
- package/dist/components/docs/reference/DocsReferenceIndexPage.js +2 -206
- package/dist/components/docs/reference/DocsReferencePage.js +3 -265
- package/dist/components/docs/reference/docsMarkdownParser.js +2 -92
- package/dist/components/docs/reference/index.js +4 -470
- package/dist/components/docs/safety/SafetyAuditingPage.js +2 -350
- package/dist/components/docs/safety/SafetyMigrationsPage.js +2 -359
- package/dist/components/docs/safety/SafetyOverviewPage.js +1 -101
- package/dist/components/docs/safety/SafetyPDPPage.js +2 -301
- package/dist/components/docs/safety/SafetySecurityTrustPage.js +1 -206
- package/dist/components/docs/safety/SafetySigningPage.js +3 -90
- package/dist/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
- package/dist/components/docs/safety/index.js +7 -1480
- package/dist/components/docs/shared/StudioPrompt.js +1 -31
- package/dist/components/docs/specs/SpecsBuilderControlPlanePage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +34 -0
- package/dist/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
- package/dist/components/docs/specs/SpecsConnectPage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsConnectPage.js +8 -0
- package/dist/components/docs/specs/SpecsDataViewsPage.js +2 -260
- package/dist/components/docs/specs/SpecsModuleBundlesPage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsModuleBundlesPage.js +67 -0
- package/dist/components/docs/specs/SpecsOverlaysPage.js +2 -372
- package/dist/components/docs/specs/SpecsOverviewPage.js +1 -186
- package/dist/components/docs/specs/SpecsPolicyPage.js +3 -420
- package/dist/components/docs/specs/SpecsWorkflowsPage.js +2 -325
- package/dist/components/docs/specs/index.d.ts +3 -0
- package/dist/components/docs/specs/index.js +109 -1715
- package/dist/components/docs/studio/StudioBYOKPage.js +1 -26
- package/dist/components/docs/studio/StudioDeploymentsPage.js +1 -26
- package/dist/components/docs/studio/StudioGettingStartedPage.js +1 -26
- package/dist/components/docs/studio/StudioIntegrationsPage.js +1 -26
- package/dist/components/docs/studio/StudioOverviewPage.js +1 -157
- package/dist/components/docs/studio/StudioVisualBuilderPage.js +1 -26
- package/dist/components/docs/studio/index.js +1 -282
- package/dist/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
- package/dist/components/integrations/index.js +2 -600
- package/dist/components/integrations/molecules/IntegrationCard.js +1 -100
- package/dist/components/integrations/organisms/IntegrationMarketplace.js +1 -214
- package/dist/components/integrations/organisms/IntegrationSettings.js +2 -284
- package/dist/components/integrations/organisms/KnowledgeSourceList.js +1 -103
- package/dist/components/legal/PrivacyTemplate.js +1 -1025
- package/dist/components/legal/TermsTemplate.js +1 -941
- package/dist/components/legal/index.js +1 -1963
- package/dist/components/shared/FeatureGateNotice.js +1 -38
- package/dist/components/shared/index.js +1 -38
- package/dist/components/shell/WorkspaceHeader.js +1 -100
- package/dist/components/shell/WorkspaceProjectShellLayout.js +1 -222
- package/dist/components/shell/WorkspaceShellRenderer.js +1 -228
- package/dist/components/shell/WorkspaceSidebar.js +1 -68
- package/dist/components/shell/index.js +1 -287
- package/dist/components/templates/engine/index.js +1 -39
- package/dist/components/templates/index.js +11 -965
- package/dist/components/templates/messaging/ConversationList.js +2 -83
- package/dist/components/templates/messaging/MessageComposer.js +4 -150
- package/dist/components/templates/messaging/MessageThread.js +3 -83
- package/dist/components/templates/messaging/MessagingWorkspace.js +5 -265
- package/dist/components/templates/messaging/index.js +5 -269
- package/dist/components/templates/recipes/LanguageSwitcher.js +1 -16
- package/dist/components/templates/recipes/RecipeCard.js +1 -80
- package/dist/components/templates/recipes/RecipeDetail.js +1 -74
- package/dist/components/templates/recipes/RecipeList.js +3 -245
- package/dist/components/templates/recipes/index.js +3 -248
- package/dist/components/templates/todos/FilterBar.js +1 -107
- package/dist/components/templates/todos/TaskForm.js +2 -158
- package/dist/components/templates/todos/TaskItem.js +1 -77
- package/dist/components/templates/todos/TaskList.js +5 -449
- package/dist/components/templates/todos/index.js +5 -452
- package/dist/config/contractspec-blueprint.js +1 -123
- package/dist/config/contractspec-branding.js +1 -44
- package/dist/config/contractspec-routes.js +1 -24
- package/dist/config/index.js +1 -126
- package/dist/features/contracts-registry.js +1 -178
- package/dist/features/docs/docs.contracts.js +1 -17
- package/dist/features/docs/index.js +1 -17
- package/dist/features/docs.feature.js +1 -33
- package/dist/features/index.js +1 -315
- package/dist/features/mcp.feature.js +1 -30
- package/dist/features/presentations.feature.js +1 -33
- package/dist/features/registry.js +1 -116
- package/dist/index.js +556 -28593
- package/dist/infrastructure/elysia/index.js +1 -35
- package/dist/infrastructure/elysia/logger.js +1 -35
- package/dist/infrastructure/index.js +1 -35
- package/dist/libs/email/client.js +1 -114
- package/dist/libs/email/contact.js +12 -165
- package/dist/libs/email/newsletter.js +6 -167
- package/dist/libs/email/types.js +0 -2
- package/dist/libs/email/utils.js +2 -8
- package/dist/libs/email/waitlist-application.js +28 -209
- package/dist/libs/email/waitlist.js +6 -167
- package/dist/libs/email.js +46 -363
- package/dist/libs/posthog/client.js +1 -63
- package/dist/libs/posthog/native.js +1 -23
- package/dist/libs/posthog/server.js +1 -13
- package/dist/libs/pricing-examples.js +1 -18
- package/dist/node/application/context-storage/index.js +1 -28
- package/dist/node/application/index.js +13 -2133
- package/dist/node/application/mcp/cliMcp.js +4 -452
- package/dist/node/application/mcp/common.js +1 -193
- package/dist/node/application/mcp/contractsMcp.js +2 -549
- package/dist/node/application/mcp/contractsMcpResources.js +2 -123
- package/dist/node/application/mcp/contractsMcpTools.js +1 -199
- package/dist/node/application/mcp/docsMcp.catalog.js +3 -381
- package/dist/node/application/mcp/docsMcp.data.js +1 -147
- package/dist/node/application/mcp/docsMcp.js +6 -1039
- package/dist/node/application/mcp/docsMcp.prompts.js +6 -521
- package/dist/node/application/mcp/docsMcp.reference.js +3 -235
- package/dist/node/application/mcp/docsMcp.resources.js +3 -519
- package/dist/node/application/mcp/docsMcp.tools.js +3 -518
- package/dist/node/application/mcp/index.js +13 -2106
- package/dist/node/application/mcp/internalMcp.js +2 -410
- package/dist/node/application/mcp/normalizeMcpRequest.js +1 -21
- package/dist/node/application/mcp/providerRankingMcp.js +1 -530
- package/dist/node/bundles/LibraryBundle.js +1 -138
- package/dist/node/bundles/index.js +1 -138
- package/dist/node/components/docs/DocsIndexPage.js +2 -912
- package/dist/node/components/docs/advanced/AdvancedMCPPage.js +4 -271
- package/dist/node/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
- package/dist/node/components/docs/advanced/AdvancedRenderersPage.js +2 -118
- package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
- package/dist/node/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
- package/dist/node/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
- package/dist/node/components/docs/advanced/index.js +10 -1055
- package/dist/node/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
- package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
- package/dist/node/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
- package/dist/node/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
- package/dist/node/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
- package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
- package/dist/node/components/docs/architecture/index.js +20 -1340
- package/dist/node/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
- package/dist/node/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
- package/dist/node/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
- package/dist/node/components/docs/comparison/ComparisonOverviewPage.js +1 -202
- package/dist/node/components/docs/comparison/ComparisonWindmillPage.js +1 -254
- package/dist/node/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
- package/dist/node/components/docs/comparison/index.js +1 -1510
- package/dist/node/components/docs/docsManifest.js +1 -611
- package/dist/node/components/docs/ecosystem/IntegrationsPage.js +2 -103
- package/dist/node/components/docs/ecosystem/PluginsPage.js +13 -179
- package/dist/node/components/docs/ecosystem/RegistryPage.js +7 -100
- package/dist/node/components/docs/ecosystem/TemplatesPage.js +3 -141
- package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
- package/dist/node/components/docs/ecosystem/index.js +23 -569
- package/dist/node/components/docs/examples/DocsExamplesPage.js +4 -124
- package/dist/node/components/docs/examples/ExampleShowcasePage.js +4 -244
- package/dist/node/components/docs/examples/exampleShowcaseData.js +4 -39
- package/dist/node/components/docs/examples/index.js +4 -330
- package/dist/node/components/docs/generated/docs-index.generated.js +1 -5
- package/dist/node/components/docs/generated/index.js +1 -74
- package/dist/node/components/docs/generated/loader.js +1 -74
- package/dist/node/components/docs/getting-started/CLIPage.js +4 -271
- package/dist/node/components/docs/getting-started/CompatibilityPage.js +1 -173
- package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +4 -134
- package/dist/node/components/docs/getting-started/DeveloperToolsPage.js +1 -194
- package/dist/node/components/docs/getting-started/HelloWorldPage.js +5 -183
- package/dist/node/components/docs/getting-started/InstallationPage.js +3 -154
- package/dist/node/components/docs/getting-started/StartHerePage.js +2 -129
- package/dist/node/components/docs/getting-started/TroubleshootingPage.js +2 -168
- package/dist/node/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
- package/dist/node/components/docs/getting-started/getting-started.docblocks.js +4 -41
- package/dist/node/components/docs/getting-started/index.js +18 -1869
- package/dist/node/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
- package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +43 -0
- package/dist/node/components/docs/guides/GuideContractTypesPage.js +6 -541
- package/dist/node/components/docs/guides/GuideDocsPipelinePage.js +3 -207
- package/dist/node/components/docs/guides/GuideFirstModuleBundlePage.js +75 -0
- package/dist/node/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
- package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +69 -0
- package/dist/node/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
- package/dist/node/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
- package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
- package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -169
- package/dist/node/components/docs/guides/guides.docblocks.js +11 -75
- package/dist/node/components/docs/guides/index.js +213 -2428
- package/dist/node/components/docs/index.js +542 -24310
- package/dist/node/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
- package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
- package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +3 -142
- package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +3 -109
- package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
- package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
- package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +5 -150
- package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
- package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
- package/dist/node/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
- package/dist/node/components/docs/integrations/IntegrationsPowensPage.js +4 -300
- package/dist/node/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
- package/dist/node/components/docs/integrations/IntegrationsResendPage.js +3 -102
- package/dist/node/components/docs/integrations/IntegrationsS3Page.js +4 -124
- package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +3 -144
- package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
- package/dist/node/components/docs/integrations/IntegrationsStripePage.js +6 -327
- package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
- package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
- package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
- package/dist/node/components/docs/integrations/index.js +52 -3100
- package/dist/node/components/docs/intent/ContractFirstApiPage.js +2 -126
- package/dist/node/components/docs/intent/DeterministicCodegenPage.js +2 -148
- package/dist/node/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
- package/dist/node/components/docs/intent/OpenapiAlternativePage.js +3 -201
- package/dist/node/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
- package/dist/node/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
- package/dist/node/components/docs/intent/index.js +15 -1135
- package/dist/node/components/docs/intent/intent-pages.docblocks.js +1 -201
- package/dist/node/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
- package/dist/node/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
- package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
- package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
- package/dist/node/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
- package/dist/node/components/docs/knowledge/index.js +21 -1730
- package/dist/node/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
- package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
- package/dist/node/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
- package/dist/node/components/docs/libraries/LibrariesContentGenPage.js +2 -100
- package/dist/node/components/docs/libraries/LibrariesContractsPage.js +2 -284
- package/dist/node/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
- package/dist/node/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
- package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
- package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
- package/dist/node/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
- package/dist/node/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
- package/dist/node/components/docs/libraries/LibrariesGrowthPage.js +3 -88
- package/dist/node/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
- package/dist/node/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
- package/dist/node/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
- package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -170
- package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
- package/dist/node/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
- package/dist/node/components/docs/libraries/LibrariesResiliencePage.js +4 -120
- package/dist/node/components/docs/libraries/LibrariesRuntimePage.js +2 -200
- package/dist/node/components/docs/libraries/LibrariesSLOPage.js +3 -116
- package/dist/node/components/docs/libraries/LibrariesSchemaPage.js +3 -273
- package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
- package/dist/node/components/docs/libraries/LibrariesTestingPage.js +3 -133
- package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +2 -230
- package/dist/node/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
- package/dist/node/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
- package/dist/node/components/docs/libraries/index.js +54 -4147
- package/dist/node/components/docs/manifesto/ManifestoPage.js +1 -86
- package/dist/node/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
- package/dist/node/components/docs/ops/DistributedTracingOpsPage.js +2 -71
- package/dist/node/components/docs/ops/index.js +3 -202
- package/dist/node/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
- package/dist/node/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
- package/dist/node/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
- package/dist/node/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
- package/dist/node/components/docs/ops/ops-top.docs.js +2 -17
- package/dist/node/components/docs/ops/ops.docs.js +10 -302
- package/dist/node/components/docs/product/product.docblocks.js +5 -72
- package/dist/node/components/docs/reference/DocsMarkdownContent.js +2 -196
- package/dist/node/components/docs/reference/DocsReferenceContent.js +3 -256
- package/dist/node/components/docs/reference/DocsReferenceIndexClient.js +2 -127
- package/dist/node/components/docs/reference/DocsReferenceIndexPage.js +2 -206
- package/dist/node/components/docs/reference/DocsReferencePage.js +3 -265
- package/dist/node/components/docs/reference/docsMarkdownParser.js +2 -92
- package/dist/node/components/docs/reference/index.js +4 -470
- package/dist/node/components/docs/safety/SafetyAuditingPage.js +2 -350
- package/dist/node/components/docs/safety/SafetyMigrationsPage.js +2 -359
- package/dist/node/components/docs/safety/SafetyOverviewPage.js +1 -101
- package/dist/node/components/docs/safety/SafetyPDPPage.js +2 -301
- package/dist/node/components/docs/safety/SafetySecurityTrustPage.js +1 -206
- package/dist/node/components/docs/safety/SafetySigningPage.js +3 -90
- package/dist/node/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
- package/dist/node/components/docs/safety/index.js +7 -1480
- package/dist/node/components/docs/shared/StudioPrompt.js +1 -31
- package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +33 -0
- package/dist/node/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
- package/dist/node/components/docs/specs/SpecsConnectPage.js +7 -0
- package/dist/node/components/docs/specs/SpecsDataViewsPage.js +2 -260
- package/dist/node/components/docs/specs/SpecsModuleBundlesPage.js +66 -0
- package/dist/node/components/docs/specs/SpecsOverlaysPage.js +2 -372
- package/dist/node/components/docs/specs/SpecsOverviewPage.js +1 -186
- package/dist/node/components/docs/specs/SpecsPolicyPage.js +3 -420
- package/dist/node/components/docs/specs/SpecsWorkflowsPage.js +2 -325
- package/dist/node/components/docs/specs/index.js +109 -1715
- package/dist/node/components/docs/studio/StudioBYOKPage.js +1 -26
- package/dist/node/components/docs/studio/StudioDeploymentsPage.js +1 -26
- package/dist/node/components/docs/studio/StudioGettingStartedPage.js +1 -26
- package/dist/node/components/docs/studio/StudioIntegrationsPage.js +1 -26
- package/dist/node/components/docs/studio/StudioOverviewPage.js +1 -157
- package/dist/node/components/docs/studio/StudioVisualBuilderPage.js +1 -26
- package/dist/node/components/docs/studio/index.js +1 -282
- package/dist/node/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
- package/dist/node/components/integrations/index.js +2 -600
- package/dist/node/components/integrations/molecules/IntegrationCard.js +1 -100
- package/dist/node/components/integrations/organisms/IntegrationMarketplace.js +1 -214
- package/dist/node/components/integrations/organisms/IntegrationSettings.js +2 -284
- package/dist/node/components/integrations/organisms/KnowledgeSourceList.js +1 -103
- package/dist/node/components/legal/PrivacyTemplate.js +1 -1025
- package/dist/node/components/legal/TermsTemplate.js +1 -941
- package/dist/node/components/legal/index.js +1 -1963
- package/dist/node/components/shared/FeatureGateNotice.js +1 -38
- package/dist/node/components/shared/index.js +1 -38
- package/dist/node/components/shell/WorkspaceHeader.js +1 -100
- package/dist/node/components/shell/WorkspaceProjectShellLayout.js +1 -222
- package/dist/node/components/shell/WorkspaceShellRenderer.js +1 -228
- package/dist/node/components/shell/WorkspaceSidebar.js +1 -68
- package/dist/node/components/shell/index.js +1 -287
- package/dist/node/components/templates/engine/index.js +1 -39
- package/dist/node/components/templates/index.js +11 -965
- package/dist/node/components/templates/messaging/ConversationList.js +2 -83
- package/dist/node/components/templates/messaging/MessageComposer.js +4 -150
- package/dist/node/components/templates/messaging/MessageThread.js +3 -83
- package/dist/node/components/templates/messaging/MessagingWorkspace.js +5 -265
- package/dist/node/components/templates/messaging/index.js +5 -269
- package/dist/node/components/templates/recipes/LanguageSwitcher.js +1 -16
- package/dist/node/components/templates/recipes/RecipeCard.js +1 -80
- package/dist/node/components/templates/recipes/RecipeDetail.js +1 -74
- package/dist/node/components/templates/recipes/RecipeList.js +3 -245
- package/dist/node/components/templates/recipes/index.js +3 -248
- package/dist/node/components/templates/todos/FilterBar.js +1 -107
- package/dist/node/components/templates/todos/TaskForm.js +2 -158
- package/dist/node/components/templates/todos/TaskItem.js +1 -77
- package/dist/node/components/templates/todos/TaskList.js +5 -449
- package/dist/node/components/templates/todos/index.js +5 -452
- package/dist/node/config/contractspec-blueprint.js +1 -123
- package/dist/node/config/contractspec-branding.js +1 -44
- package/dist/node/config/contractspec-routes.js +1 -24
- package/dist/node/config/index.js +1 -126
- package/dist/node/features/contracts-registry.js +1 -178
- package/dist/node/features/docs/docs.contracts.js +1 -17
- package/dist/node/features/docs/index.js +1 -17
- package/dist/node/features/docs.feature.js +1 -33
- package/dist/node/features/index.js +1 -315
- package/dist/node/features/mcp.feature.js +1 -30
- package/dist/node/features/presentations.feature.js +1 -33
- package/dist/node/features/registry.js +1 -116
- package/dist/node/index.js +556 -28593
- package/dist/node/infrastructure/elysia/index.js +1 -35
- package/dist/node/infrastructure/elysia/logger.js +1 -35
- package/dist/node/infrastructure/index.js +1 -35
- package/dist/node/libs/email/client.js +1 -114
- package/dist/node/libs/email/contact.js +12 -165
- package/dist/node/libs/email/newsletter.js +6 -167
- package/dist/node/libs/email/types.js +0 -2
- package/dist/node/libs/email/utils.js +2 -8
- package/dist/node/libs/email/waitlist-application.js +28 -209
- package/dist/node/libs/email/waitlist.js +6 -167
- package/dist/node/libs/email.js +46 -363
- package/dist/node/libs/posthog/client.js +1 -63
- package/dist/node/libs/posthog/native.js +1 -23
- package/dist/node/libs/posthog/server.js +1 -13
- package/dist/node/libs/pricing-examples.js +1 -18
- package/dist/node/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
- package/dist/node/presentation/features/atoms/FeatureIcon/index.js +1 -97
- package/dist/node/presentation/features/atoms/index.js +1 -97
- package/dist/node/presentation/features/hooks/index.js +1 -397
- package/dist/node/presentation/features/hooks/useContractsRegistry.js +1 -289
- package/dist/node/presentation/features/hooks/useFeatureFilters.js +1 -75
- package/dist/node/presentation/features/hooks/useFeatureRegistry.js +1 -147
- package/dist/node/presentation/features/hooks/useRelatedDocs.js +1 -28
- package/dist/node/presentation/features/index.js +1 -3063
- package/dist/node/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
- package/dist/node/presentation/features/molecules/FeatureCard/index.js +1 -366
- package/dist/node/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
- package/dist/node/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
- package/dist/node/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
- package/dist/node/presentation/features/molecules/FeatureFilters/index.js +1 -92
- package/dist/node/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
- package/dist/node/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
- package/dist/node/presentation/features/molecules/index.js +1 -505
- package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +1 -304
- package/dist/node/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
- package/dist/node/presentation/features/organisms/FeatureDetail/index.js +1 -154
- package/dist/node/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
- package/dist/node/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
- package/dist/node/presentation/features/organisms/FeatureEventsList.js +1 -302
- package/dist/node/presentation/features/organisms/FeatureFormsList.js +1 -302
- package/dist/node/presentation/features/organisms/FeatureOperationsList.js +1 -180
- package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +1 -304
- package/dist/node/presentation/features/organisms/index.js +1 -1359
- package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
- package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
- package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
- package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
- package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
- package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
- package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
- package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
- package/dist/node/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
- package/dist/node/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
- package/dist/node/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
- package/dist/node/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
- package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
- package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
- package/dist/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
- package/dist/presentation/features/atoms/FeatureIcon/index.js +1 -97
- package/dist/presentation/features/atoms/index.js +1 -97
- package/dist/presentation/features/hooks/index.js +1 -397
- package/dist/presentation/features/hooks/useContractsRegistry.js +1 -289
- package/dist/presentation/features/hooks/useFeatureFilters.js +1 -75
- package/dist/presentation/features/hooks/useFeatureRegistry.js +1 -147
- package/dist/presentation/features/hooks/useRelatedDocs.js +1 -28
- package/dist/presentation/features/index.js +1 -3063
- package/dist/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
- package/dist/presentation/features/molecules/FeatureCard/index.js +1 -366
- package/dist/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
- package/dist/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
- package/dist/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
- package/dist/presentation/features/molecules/FeatureFilters/index.js +1 -92
- package/dist/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
- package/dist/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
- package/dist/presentation/features/molecules/index.js +1 -505
- package/dist/presentation/features/organisms/FeatureDataViewsList.js +1 -304
- package/dist/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
- package/dist/presentation/features/organisms/FeatureDetail/index.js +1 -154
- package/dist/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
- package/dist/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
- package/dist/presentation/features/organisms/FeatureEventsList.js +1 -302
- package/dist/presentation/features/organisms/FeatureFormsList.js +1 -302
- package/dist/presentation/features/organisms/FeatureOperationsList.js +1 -180
- package/dist/presentation/features/organisms/FeaturePresentationsList.js +1 -304
- package/dist/presentation/features/organisms/index.js +1 -1359
- package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
- package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
- package/dist/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
- package/dist/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
- package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
- package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
- package/dist/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
- package/dist/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
- package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
- package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
- package/dist/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
- package/dist/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
- package/dist/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
- package/dist/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
- package/dist/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
- package/dist/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
- package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
- package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
- package/package.json +103 -31
- package/src/components/docs/DocsIndexPage.tsx +55 -0
- package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +19 -0
- package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +34 -0
- package/src/components/docs/docsManifest.test.ts +70 -0
- package/src/components/docs/docsManifest.ts +71 -1
- package/src/components/docs/ecosystem/PluginsPage.tsx +24 -10
- package/src/components/docs/ecosystem/RegistryPage.tsx +11 -6
- package/src/components/docs/generated/docs-index._common.json +206 -273
- package/src/components/docs/generated/docs-index.control-plane.json +18 -0
- package/src/components/docs/generated/docs-index.defineExample.json +10 -0
- package/src/components/docs/generated/docs-index.manifest.json +22 -12
- package/src/components/docs/generated/docs-index.platform-acp.json +64 -0
- package/src/components/docs/generated/docs-index.platform-agent.json +89 -1
- package/src/components/docs/generated/docs-index.platform-context.json +48 -0
- package/src/components/docs/generated/docs-index.platform-control-plane.json +72 -0
- package/src/components/docs/generated/docs-index.platform-database.json +40 -0
- package/src/components/docs/generated/docs-index.platform-docs.json +64 -0
- package/src/components/docs/generated/docs-index.platform-provider-ranking.json +89 -1
- package/src/components/docs/generated/docs-index.pocket-family-office.json +8 -0
- package/src/components/docs/generated/docs-index.unknown.json +8 -0
- package/src/components/docs/guides/GuideConnectInRepoPage.tsx +184 -0
- package/src/components/docs/guides/GuideFirstModuleBundlePage.tsx +182 -0
- package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +230 -0
- package/src/components/docs/guides/GuidesIndexPage.tsx +21 -0
- package/src/components/docs/guides/index.ts +3 -0
- package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +210 -0
- package/src/components/docs/specs/SpecsConnectPage.tsx +162 -0
- package/src/components/docs/specs/SpecsModuleBundlesPage.tsx +223 -0
- package/src/components/docs/specs/SpecsOverlaysPage.tsx +20 -0
- package/src/components/docs/specs/SpecsOverviewPage.tsx +44 -0
- package/src/components/docs/specs/index.ts +3 -0
- package/src/components/docs/studio/StudioOverviewPage.tsx +26 -0
- package/src/infrastructure/elysia/logger.ts +11 -3
|
@@ -1,190 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import Link from "@contractspec/lib.ui-link";
|
|
4
|
-
import { ChevronRight } from "lucide-react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
function SafetyAuditingPage() {
|
|
7
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
8
|
-
className: "space-y-8",
|
|
9
|
-
children: [
|
|
10
|
-
/* @__PURE__ */ jsxs("div", {
|
|
11
|
-
className: "space-y-4",
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ jsx("h1", {
|
|
14
|
-
className: "font-bold text-4xl",
|
|
15
|
-
children: "Audit Logs"
|
|
16
|
-
}),
|
|
17
|
-
/* @__PURE__ */ jsxs("p", {
|
|
18
|
-
className: "text-muted-foreground",
|
|
19
|
-
children: [
|
|
20
|
-
"An ",
|
|
21
|
-
/* @__PURE__ */ jsx("strong", {
|
|
22
|
-
children: "audit log"
|
|
23
|
-
}),
|
|
24
|
-
" (also called an audit trail) is a chronological record of system activities. According to",
|
|
25
|
-
" ",
|
|
26
|
-
/* @__PURE__ */ jsx("a", {
|
|
27
|
-
href: "https://www.sumologic.com/glossary/audit-log/",
|
|
28
|
-
target: "_blank",
|
|
29
|
-
rel: "noopener noreferrer",
|
|
30
|
-
className: "text-violet-400 hover:text-violet-300",
|
|
31
|
-
children: "Sumo Logic"
|
|
32
|
-
}),
|
|
33
|
-
', 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."'
|
|
34
|
-
]
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
}),
|
|
38
|
-
/* @__PURE__ */ jsxs("div", {
|
|
39
|
-
className: "space-y-4",
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsx("h2", {
|
|
42
|
-
className: "font-bold text-2xl",
|
|
43
|
-
children: "Why audit logs matter"
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ jsxs("div", {
|
|
46
|
-
className: "space-y-3",
|
|
47
|
-
children: [
|
|
48
|
-
/* @__PURE__ */ jsxs("div", {
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx("h3", {
|
|
51
|
-
className: "font-semibold text-lg",
|
|
52
|
-
children: "Accountability"
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ jsx("p", {
|
|
55
|
-
className: "text-muted-foreground",
|
|
56
|
-
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.'
|
|
57
|
-
})
|
|
58
|
-
]
|
|
59
|
-
}),
|
|
60
|
-
/* @__PURE__ */ jsxs("div", {
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsx("h3", {
|
|
63
|
-
className: "font-semibold text-lg",
|
|
64
|
-
children: "Security"
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ jsx("p", {
|
|
67
|
-
className: "text-muted-foreground",
|
|
68
|
-
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."
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ jsxs("div", {
|
|
73
|
-
children: [
|
|
74
|
-
/* @__PURE__ */ jsx("h3", {
|
|
75
|
-
className: "font-semibold text-lg",
|
|
76
|
-
children: "Compliance"
|
|
77
|
-
}),
|
|
78
|
-
/* @__PURE__ */ jsx("p", {
|
|
79
|
-
className: "text-muted-foreground",
|
|
80
|
-
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."
|
|
81
|
-
})
|
|
82
|
-
]
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ jsxs("div", {
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ jsx("h3", {
|
|
87
|
-
className: "font-semibold text-lg",
|
|
88
|
-
children: "Debugging"
|
|
89
|
-
}),
|
|
90
|
-
/* @__PURE__ */ jsx("p", {
|
|
91
|
-
className: "text-muted-foreground",
|
|
92
|
-
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."
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
})
|
|
96
|
-
]
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ jsxs("div", {
|
|
101
|
-
className: "space-y-4",
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ jsx("h2", {
|
|
104
|
-
className: "font-bold text-2xl",
|
|
105
|
-
children: "What ContractSpec logs"
|
|
106
|
-
}),
|
|
107
|
-
/* @__PURE__ */ jsx("p", {
|
|
108
|
-
className: "text-muted-foreground",
|
|
109
|
-
children: "ContractSpec automatically logs every significant operation, including:"
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ jsxs("ul", {
|
|
112
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
113
|
-
children: [
|
|
114
|
-
/* @__PURE__ */ jsxs("li", {
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ jsx("strong", {
|
|
117
|
-
children: "API calls"
|
|
118
|
-
}),
|
|
119
|
-
" \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."
|
|
120
|
-
]
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ jsxs("li", {
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx("strong", {
|
|
125
|
-
children: "Policy decisions"
|
|
126
|
-
}),
|
|
127
|
-
" \u2013 Every decision made by the",
|
|
128
|
-
" ",
|
|
129
|
-
/* @__PURE__ */ jsx(Link, {
|
|
130
|
-
href: "/docs/safety/pdp",
|
|
131
|
-
className: "text-violet-400 hover:text-violet-300",
|
|
132
|
-
children: "Policy Decision Point"
|
|
133
|
-
}),
|
|
134
|
-
", including the rule that matched and the reason for the decision."
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
/* @__PURE__ */ jsxs("li", {
|
|
138
|
-
children: [
|
|
139
|
-
/* @__PURE__ */ jsx("strong", {
|
|
140
|
-
children: "Data access"
|
|
141
|
-
}),
|
|
142
|
-
" \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."
|
|
143
|
-
]
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ jsxs("li", {
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsx("strong", {
|
|
148
|
-
children: "Workflow execution"
|
|
149
|
-
}),
|
|
150
|
-
" \u2013 Every step in a workflow, including retries, compensations, and failures."
|
|
151
|
-
]
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ jsxs("li", {
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ jsx("strong", {
|
|
156
|
-
children: "Administrative actions"
|
|
157
|
-
}),
|
|
158
|
-
" \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."
|
|
159
|
-
]
|
|
160
|
-
}),
|
|
161
|
-
/* @__PURE__ */ jsxs("li", {
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsx("strong", {
|
|
164
|
-
children: "Authentication events"
|
|
165
|
-
}),
|
|
166
|
-
" \u2013 Login attempts, password resets, and session expirations."
|
|
167
|
-
]
|
|
168
|
-
})
|
|
169
|
-
]
|
|
170
|
-
})
|
|
171
|
-
]
|
|
172
|
-
}),
|
|
173
|
-
/* @__PURE__ */ jsxs("div", {
|
|
174
|
-
className: "space-y-4",
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ jsx("h2", {
|
|
177
|
-
className: "font-bold text-2xl",
|
|
178
|
-
children: "Audit log format"
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ jsx("p", {
|
|
181
|
-
className: "text-muted-foreground",
|
|
182
|
-
children: "Each audit log entry is a structured JSON object containing:"
|
|
183
|
-
}),
|
|
184
|
-
/* @__PURE__ */ jsx("div", {
|
|
185
|
-
className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
|
|
186
|
-
children: /* @__PURE__ */ jsx("pre", {
|
|
187
|
-
children: `{
|
|
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:`{
|
|
188
3
|
"timestamp": "2025-11-13T14:32:15.123Z",
|
|
189
4
|
"eventId": "evt_abc123",
|
|
190
5
|
"eventType": "capability.invoked",
|
|
@@ -215,318 +30,7 @@ function SafetyAuditingPage() {
|
|
|
215
30
|
"ruleId": "allow-admin-transfers",
|
|
216
31
|
"reason": "User has admin role"
|
|
217
32
|
}
|
|
218
|
-
}`
|
|
219
|
-
})
|
|
220
|
-
})
|
|
221
|
-
]
|
|
222
|
-
}),
|
|
223
|
-
/* @__PURE__ */ jsxs("div", {
|
|
224
|
-
className: "space-y-4",
|
|
225
|
-
children: [
|
|
226
|
-
/* @__PURE__ */ jsx("h2", {
|
|
227
|
-
className: "font-bold text-2xl",
|
|
228
|
-
children: "Storage and retention"
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ jsx("p", {
|
|
231
|
-
className: "text-muted-foreground",
|
|
232
|
-
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."
|
|
233
|
-
}),
|
|
234
|
-
/* @__PURE__ */ jsx("p", {
|
|
235
|
-
className: "text-muted-foreground",
|
|
236
|
-
children: "ContractSpec supports multiple storage backends:"
|
|
237
|
-
}),
|
|
238
|
-
/* @__PURE__ */ jsxs("ul", {
|
|
239
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
240
|
-
children: [
|
|
241
|
-
/* @__PURE__ */ jsxs("li", {
|
|
242
|
-
children: [
|
|
243
|
-
/* @__PURE__ */ jsx("strong", {
|
|
244
|
-
children: "Local file system"
|
|
245
|
-
}),
|
|
246
|
-
" \u2013 For development and testing."
|
|
247
|
-
]
|
|
248
|
-
}),
|
|
249
|
-
/* @__PURE__ */ jsxs("li", {
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ jsx("strong", {
|
|
252
|
-
children: "Cloud object storage"
|
|
253
|
-
}),
|
|
254
|
-
" \u2013 S3, GCS, or Azure Blob Storage for production."
|
|
255
|
-
]
|
|
256
|
-
}),
|
|
257
|
-
/* @__PURE__ */ jsxs("li", {
|
|
258
|
-
children: [
|
|
259
|
-
/* @__PURE__ */ jsx("strong", {
|
|
260
|
-
children: "SIEM integration"
|
|
261
|
-
}),
|
|
262
|
-
" \u2013 Forward logs to Splunk, Datadog, or other security information and event management systems."
|
|
263
|
-
]
|
|
264
|
-
})
|
|
265
|
-
]
|
|
266
|
-
}),
|
|
267
|
-
/* @__PURE__ */ jsx("p", {
|
|
268
|
-
className: "text-muted-foreground",
|
|
269
|
-
children: "You can configure retention policies to automatically archive or delete old logs after a specified period (e.g., 7 years for GDPR compliance)."
|
|
270
|
-
})
|
|
271
|
-
]
|
|
272
|
-
}),
|
|
273
|
-
/* @__PURE__ */ jsxs("div", {
|
|
274
|
-
className: "space-y-4",
|
|
275
|
-
children: [
|
|
276
|
-
/* @__PURE__ */ jsx("h2", {
|
|
277
|
-
className: "font-bold text-2xl",
|
|
278
|
-
children: "Querying audit logs"
|
|
279
|
-
}),
|
|
280
|
-
/* @__PURE__ */ jsx("p", {
|
|
281
|
-
className: "text-muted-foreground",
|
|
282
|
-
children: "ContractSpec provides a query API for searching audit logs. You can filter by:"
|
|
283
|
-
}),
|
|
284
|
-
/* @__PURE__ */ jsxs("ul", {
|
|
285
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
286
|
-
children: [
|
|
287
|
-
/* @__PURE__ */ jsx("li", {
|
|
288
|
-
children: "Time range"
|
|
289
|
-
}),
|
|
290
|
-
/* @__PURE__ */ jsx("li", {
|
|
291
|
-
children: "Event type"
|
|
292
|
-
}),
|
|
293
|
-
/* @__PURE__ */ jsx("li", {
|
|
294
|
-
children: "Actor (user ID, role, IP address)"
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ jsx("li", {
|
|
297
|
-
children: "Resource (capability, data view, workflow)"
|
|
298
|
-
}),
|
|
299
|
-
/* @__PURE__ */ jsx("li", {
|
|
300
|
-
children: "Result (success, failure, denied)"
|
|
301
|
-
})
|
|
302
|
-
]
|
|
303
|
-
}),
|
|
304
|
-
/* @__PURE__ */ jsx("p", {
|
|
305
|
-
className: "text-muted-foreground",
|
|
306
|
-
children: 'Example query: "Show all failed login attempts from IP address 203.0.113.42 in the last 24 hours."'
|
|
307
|
-
})
|
|
308
|
-
]
|
|
309
|
-
}),
|
|
310
|
-
/* @__PURE__ */ jsxs("div", {
|
|
311
|
-
className: "space-y-4",
|
|
312
|
-
children: [
|
|
313
|
-
/* @__PURE__ */ jsx("h2", {
|
|
314
|
-
className: "font-bold text-2xl",
|
|
315
|
-
children: "Best practices"
|
|
316
|
-
}),
|
|
317
|
-
/* @__PURE__ */ jsxs("ul", {
|
|
318
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
319
|
-
children: [
|
|
320
|
-
/* @__PURE__ */ jsxs("li", {
|
|
321
|
-
children: [
|
|
322
|
-
/* @__PURE__ */ jsx("strong", {
|
|
323
|
-
children: "Review logs regularly"
|
|
324
|
-
}),
|
|
325
|
-
" \u2013 Set up alerts for suspicious activity (e.g., repeated failed login attempts, unauthorized access attempts)."
|
|
326
|
-
]
|
|
327
|
-
}),
|
|
328
|
-
/* @__PURE__ */ jsxs("li", {
|
|
329
|
-
children: [
|
|
330
|
-
/* @__PURE__ */ jsx("strong", {
|
|
331
|
-
children: "Protect log access"
|
|
332
|
-
}),
|
|
333
|
-
" \u2013 Only authorized personnel should be able to view audit logs. Use role-based access control to restrict access."
|
|
334
|
-
]
|
|
335
|
-
}),
|
|
336
|
-
/* @__PURE__ */ jsxs("li", {
|
|
337
|
-
children: [
|
|
338
|
-
/* @__PURE__ */ jsx("strong", {
|
|
339
|
-
children: "Retain logs long enough"
|
|
340
|
-
}),
|
|
341
|
-
" \u2013 Check your compliance requirements and configure retention policies accordingly."
|
|
342
|
-
]
|
|
343
|
-
}),
|
|
344
|
-
/* @__PURE__ */ jsxs("li", {
|
|
345
|
-
children: [
|
|
346
|
-
/* @__PURE__ */ jsx("strong", {
|
|
347
|
-
children: "Test log integrity"
|
|
348
|
-
}),
|
|
349
|
-
" \u2013 Periodically verify that logs have not been tampered with by checking cryptographic signatures."
|
|
350
|
-
]
|
|
351
|
-
})
|
|
352
|
-
]
|
|
353
|
-
})
|
|
354
|
-
]
|
|
355
|
-
}),
|
|
356
|
-
/* @__PURE__ */ jsxs("div", {
|
|
357
|
-
className: "flex items-center gap-4 pt-4",
|
|
358
|
-
children: [
|
|
359
|
-
/* @__PURE__ */ jsx(Link, {
|
|
360
|
-
href: "/docs/safety/pdp",
|
|
361
|
-
className: "btn-ghost",
|
|
362
|
-
children: "Previous: Policy Decision Points"
|
|
363
|
-
}),
|
|
364
|
-
/* @__PURE__ */ jsxs(Link, {
|
|
365
|
-
href: "/docs/safety/migrations",
|
|
366
|
-
className: "btn-primary",
|
|
367
|
-
children: [
|
|
368
|
-
"Next: Migrations ",
|
|
369
|
-
/* @__PURE__ */ jsx(ChevronRight, {
|
|
370
|
-
size: 16
|
|
371
|
-
})
|
|
372
|
-
]
|
|
373
|
-
})
|
|
374
|
-
]
|
|
375
|
-
})
|
|
376
|
-
]
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// src/components/docs/safety/SafetyMigrationsPage.tsx
|
|
381
|
-
import Link2 from "@contractspec/lib.ui-link";
|
|
382
|
-
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
383
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
384
|
-
function SafetyMigrationsPage() {
|
|
385
|
-
return /* @__PURE__ */ jsxs2("div", {
|
|
386
|
-
className: "space-y-8",
|
|
387
|
-
children: [
|
|
388
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
389
|
-
className: "space-y-4",
|
|
390
|
-
children: [
|
|
391
|
-
/* @__PURE__ */ jsx2("h1", {
|
|
392
|
-
className: "font-bold text-4xl",
|
|
393
|
-
children: "Migrations"
|
|
394
|
-
}),
|
|
395
|
-
/* @__PURE__ */ jsxs2("p", {
|
|
396
|
-
className: "text-muted-foreground",
|
|
397
|
-
children: [
|
|
398
|
-
"A ",
|
|
399
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
400
|
-
children: "schema migration"
|
|
401
|
-
}),
|
|
402
|
-
" (also called a database migration) is a set of incremental, reversible changes to a database schema. According to",
|
|
403
|
-
" ",
|
|
404
|
-
/* @__PURE__ */ jsx2("a", {
|
|
405
|
-
href: "https://en.wikipedia.org/wiki/Schema_migration",
|
|
406
|
-
target: "_blank",
|
|
407
|
-
rel: "noopener noreferrer",
|
|
408
|
-
className: "text-violet-400 hover:text-violet-300",
|
|
409
|
-
children: "Wikipedia"
|
|
410
|
-
}),
|
|
411
|
-
`, schema migrations "allow the database schema to evolve as the application's requirements change, while preserving existing data."`
|
|
412
|
-
]
|
|
413
|
-
})
|
|
414
|
-
]
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
417
|
-
className: "space-y-4",
|
|
418
|
-
children: [
|
|
419
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
420
|
-
className: "font-bold text-2xl",
|
|
421
|
-
children: "Why migrations matter"
|
|
422
|
-
}),
|
|
423
|
-
/* @__PURE__ */ jsx2("p", {
|
|
424
|
-
className: "text-muted-foreground",
|
|
425
|
-
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:"
|
|
426
|
-
}),
|
|
427
|
-
/* @__PURE__ */ jsxs2("ul", {
|
|
428
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
429
|
-
children: [
|
|
430
|
-
/* @__PURE__ */ jsx2("li", {
|
|
431
|
-
children: "Data loss or corruption"
|
|
432
|
-
}),
|
|
433
|
-
/* @__PURE__ */ jsx2("li", {
|
|
434
|
-
children: "Downtime during deployments"
|
|
435
|
-
}),
|
|
436
|
-
/* @__PURE__ */ jsx2("li", {
|
|
437
|
-
children: "Inconsistencies between environments (dev, staging, production)"
|
|
438
|
-
}),
|
|
439
|
-
/* @__PURE__ */ jsx2("li", {
|
|
440
|
-
children: "Difficulty rolling back failed changes"
|
|
441
|
-
})
|
|
442
|
-
]
|
|
443
|
-
}),
|
|
444
|
-
/* @__PURE__ */ jsx2("p", {
|
|
445
|
-
className: "text-muted-foreground",
|
|
446
|
-
children: "Migrations solve these problems by treating schema changes as versioned, tested, and reversible operations."
|
|
447
|
-
})
|
|
448
|
-
]
|
|
449
|
-
}),
|
|
450
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
451
|
-
className: "space-y-4",
|
|
452
|
-
children: [
|
|
453
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
454
|
-
className: "font-bold text-2xl",
|
|
455
|
-
children: "How MigrationSpec works"
|
|
456
|
-
}),
|
|
457
|
-
/* @__PURE__ */ jsxs2("p", {
|
|
458
|
-
className: "text-muted-foreground",
|
|
459
|
-
children: [
|
|
460
|
-
"In ContractSpec, migrations are defined using",
|
|
461
|
-
" ",
|
|
462
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
463
|
-
children: "MigrationSpec"
|
|
464
|
-
}),
|
|
465
|
-
". Each migration has:"
|
|
466
|
-
]
|
|
467
|
-
}),
|
|
468
|
-
/* @__PURE__ */ jsxs2("ul", {
|
|
469
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
470
|
-
children: [
|
|
471
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
472
|
-
children: [
|
|
473
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
474
|
-
children: "Version"
|
|
475
|
-
}),
|
|
476
|
-
' \u2013 A unique identifier (e.g., "2025-11-13-001") that determines the order of execution.'
|
|
477
|
-
]
|
|
478
|
-
}),
|
|
479
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
480
|
-
children: [
|
|
481
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
482
|
-
children: "Up function"
|
|
483
|
-
}),
|
|
484
|
-
` \u2013 The forward migration that applies the change (e.g., "add column 'email_verified'").`
|
|
485
|
-
]
|
|
486
|
-
}),
|
|
487
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
488
|
-
children: [
|
|
489
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
490
|
-
children: "Down function"
|
|
491
|
-
}),
|
|
492
|
-
` \u2013 The reverse migration that undoes the change (e.g., "drop column 'email_verified'").`
|
|
493
|
-
]
|
|
494
|
-
}),
|
|
495
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
496
|
-
children: [
|
|
497
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
498
|
-
children: "Dependencies"
|
|
499
|
-
}),
|
|
500
|
-
" \u2013 Other migrations that must run before this one."
|
|
501
|
-
]
|
|
502
|
-
}),
|
|
503
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
504
|
-
children: [
|
|
505
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
506
|
-
children: "Validation"
|
|
507
|
-
}),
|
|
508
|
-
' \u2013 Optional checks to ensure the migration succeeded (e.g., "verify all users have an email address").'
|
|
509
|
-
]
|
|
510
|
-
})
|
|
511
|
-
]
|
|
512
|
-
})
|
|
513
|
-
]
|
|
514
|
-
}),
|
|
515
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
516
|
-
className: "space-y-4",
|
|
517
|
-
children: [
|
|
518
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
519
|
-
className: "font-bold text-2xl",
|
|
520
|
-
children: "Example MigrationSpec"
|
|
521
|
-
}),
|
|
522
|
-
/* @__PURE__ */ jsx2("p", {
|
|
523
|
-
className: "text-muted-foreground",
|
|
524
|
-
children: "Here's a migration that adds an email verification field to the users table:"
|
|
525
|
-
}),
|
|
526
|
-
/* @__PURE__ */ jsx2("div", {
|
|
527
|
-
className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
|
|
528
|
-
children: /* @__PURE__ */ jsx2("pre", {
|
|
529
|
-
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(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
|
|
530
34
|
version: 2025-11-13-001
|
|
531
35
|
dependencies: []
|
|
532
36
|
|
|
@@ -549,498 +53,7 @@ validation:
|
|
|
549
53
|
- sql: |
|
|
550
54
|
SELECT COUNT(*) FROM users
|
|
551
55
|
WHERE email_verified IS NULL;
|
|
552
|
-
expectZeroRows: true`
|
|
553
|
-
})
|
|
554
|
-
})
|
|
555
|
-
]
|
|
556
|
-
}),
|
|
557
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
558
|
-
className: "space-y-4",
|
|
559
|
-
children: [
|
|
560
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
561
|
-
className: "font-bold text-2xl",
|
|
562
|
-
children: "Running migrations"
|
|
563
|
-
}),
|
|
564
|
-
/* @__PURE__ */ jsx2("p", {
|
|
565
|
-
className: "text-muted-foreground",
|
|
566
|
-
children: "Migrations are applied automatically during deployment. The ContractSpec runtime:"
|
|
567
|
-
}),
|
|
568
|
-
/* @__PURE__ */ jsxs2("ol", {
|
|
569
|
-
className: "list-inside list-decimal space-y-2 text-muted-foreground",
|
|
570
|
-
children: [
|
|
571
|
-
/* @__PURE__ */ jsx2("li", {
|
|
572
|
-
children: "Checks which migrations have already been applied (stored in a migrations table)."
|
|
573
|
-
}),
|
|
574
|
-
/* @__PURE__ */ jsx2("li", {
|
|
575
|
-
children: "Identifies new migrations that need to run."
|
|
576
|
-
}),
|
|
577
|
-
/* @__PURE__ */ jsx2("li", {
|
|
578
|
-
children: "Executes them in order, respecting dependencies."
|
|
579
|
-
}),
|
|
580
|
-
/* @__PURE__ */ jsx2("li", {
|
|
581
|
-
children: "Runs validation checks to ensure success."
|
|
582
|
-
}),
|
|
583
|
-
/* @__PURE__ */ jsx2("li", {
|
|
584
|
-
children: "Records the migration as applied."
|
|
585
|
-
})
|
|
586
|
-
]
|
|
587
|
-
}),
|
|
588
|
-
/* @__PURE__ */ jsx2("p", {
|
|
589
|
-
className: "text-muted-foreground",
|
|
590
|
-
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."
|
|
591
|
-
})
|
|
592
|
-
]
|
|
593
|
-
}),
|
|
594
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
595
|
-
className: "space-y-4",
|
|
596
|
-
children: [
|
|
597
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
598
|
-
className: "font-bold text-2xl",
|
|
599
|
-
children: "Rolling back migrations"
|
|
600
|
-
}),
|
|
601
|
-
/* @__PURE__ */ jsxs2("p", {
|
|
602
|
-
className: "text-muted-foreground",
|
|
603
|
-
children: [
|
|
604
|
-
"If you need to roll back a deployment, ContractSpec automatically runs the ",
|
|
605
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
606
|
-
children: "down"
|
|
607
|
-
}),
|
|
608
|
-
" functions of any migrations that were applied. This restores the database to its previous state."
|
|
609
|
-
]
|
|
610
|
-
}),
|
|
611
|
-
/* @__PURE__ */ jsx2("p", {
|
|
612
|
-
className: "text-muted-foreground",
|
|
613
|
-
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:"
|
|
614
|
-
}),
|
|
615
|
-
/* @__PURE__ */ jsxs2("ol", {
|
|
616
|
-
className: "list-inside list-decimal space-y-2 text-muted-foreground",
|
|
617
|
-
children: [
|
|
618
|
-
/* @__PURE__ */ jsx2("li", {
|
|
619
|
-
children: "Add the new column (reversible)."
|
|
620
|
-
}),
|
|
621
|
-
/* @__PURE__ */ jsx2("li", {
|
|
622
|
-
children: "Backfill data from the old column to the new column (reversible)."
|
|
623
|
-
}),
|
|
624
|
-
/* @__PURE__ */ jsx2("li", {
|
|
625
|
-
children: "Update application code to use the new column (reversible)."
|
|
626
|
-
}),
|
|
627
|
-
/* @__PURE__ */ jsx2("li", {
|
|
628
|
-
children: "Drop the old column (irreversible\u2014only do this after confirming the new column works)."
|
|
629
|
-
})
|
|
630
|
-
]
|
|
631
|
-
})
|
|
632
|
-
]
|
|
633
|
-
}),
|
|
634
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
635
|
-
className: "space-y-4",
|
|
636
|
-
children: [
|
|
637
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
638
|
-
className: "font-bold text-2xl",
|
|
639
|
-
children: "Best practices"
|
|
640
|
-
}),
|
|
641
|
-
/* @__PURE__ */ jsxs2("ul", {
|
|
642
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
643
|
-
children: [
|
|
644
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
645
|
-
children: [
|
|
646
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
647
|
-
children: "Test migrations locally"
|
|
648
|
-
}),
|
|
649
|
-
" \u2013 Run them against a copy of production data to catch issues before deploying."
|
|
650
|
-
]
|
|
651
|
-
}),
|
|
652
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
653
|
-
children: [
|
|
654
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
655
|
-
children: "Keep migrations small"
|
|
656
|
-
}),
|
|
657
|
-
" \u2013 Each migration should do one thing. This makes them easier to understand and roll back."
|
|
658
|
-
]
|
|
659
|
-
}),
|
|
660
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
663
|
-
children: "Write reversible migrations"
|
|
664
|
-
}),
|
|
665
|
-
" \u2013 Always provide a down function, even if you don't plan to roll back."
|
|
666
|
-
]
|
|
667
|
-
}),
|
|
668
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
669
|
-
children: [
|
|
670
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
671
|
-
children: "Use transactions"
|
|
672
|
-
}),
|
|
673
|
-
" \u2013 Wrap migrations in database transactions so they either fully succeed or fully fail."
|
|
674
|
-
]
|
|
675
|
-
}),
|
|
676
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
677
|
-
children: [
|
|
678
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
679
|
-
children: "Avoid destructive changes"
|
|
680
|
-
}),
|
|
681
|
-
" \u2013 Prefer additive changes (adding columns) over destructive ones (dropping columns). If you must delete data, archive it first."
|
|
682
|
-
]
|
|
683
|
-
}),
|
|
684
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
685
|
-
children: [
|
|
686
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
687
|
-
children: "Version your migrations"
|
|
688
|
-
}),
|
|
689
|
-
" \u2013 Use timestamps or sequential numbers to ensure migrations run in the correct order."
|
|
690
|
-
]
|
|
691
|
-
}),
|
|
692
|
-
/* @__PURE__ */ jsxs2("li", {
|
|
693
|
-
children: [
|
|
694
|
-
/* @__PURE__ */ jsx2("strong", {
|
|
695
|
-
children: "Document breaking changes"
|
|
696
|
-
}),
|
|
697
|
-
" \u2013 If a migration requires application code changes, note this in the migration description."
|
|
698
|
-
]
|
|
699
|
-
})
|
|
700
|
-
]
|
|
701
|
-
})
|
|
702
|
-
]
|
|
703
|
-
}),
|
|
704
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
705
|
-
className: "space-y-4",
|
|
706
|
-
children: [
|
|
707
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
708
|
-
className: "font-bold text-2xl",
|
|
709
|
-
children: "Zero-downtime migrations"
|
|
710
|
-
}),
|
|
711
|
-
/* @__PURE__ */ jsx2("p", {
|
|
712
|
-
className: "text-muted-foreground",
|
|
713
|
-
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:"
|
|
714
|
-
}),
|
|
715
|
-
/* @__PURE__ */ jsxs2("ol", {
|
|
716
|
-
className: "list-inside list-decimal space-y-2 text-muted-foreground",
|
|
717
|
-
children: [
|
|
718
|
-
/* @__PURE__ */ jsx2("li", {
|
|
719
|
-
children: "Add the column as nullable."
|
|
720
|
-
}),
|
|
721
|
-
/* @__PURE__ */ jsx2("li", {
|
|
722
|
-
children: "Backfill the column in batches (without locking the table)."
|
|
723
|
-
}),
|
|
724
|
-
/* @__PURE__ */ jsx2("li", {
|
|
725
|
-
children: "Add the NOT NULL constraint once all rows are populated."
|
|
726
|
-
})
|
|
727
|
-
]
|
|
728
|
-
}),
|
|
729
|
-
/* @__PURE__ */ jsx2("p", {
|
|
730
|
-
className: "text-muted-foreground",
|
|
731
|
-
children: "ContractSpec's migration system supports this pattern by allowing you to split a logical change into multiple versioned migrations."
|
|
732
|
-
})
|
|
733
|
-
]
|
|
734
|
-
}),
|
|
735
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
736
|
-
className: "flex items-center gap-4 pt-4",
|
|
737
|
-
children: [
|
|
738
|
-
/* @__PURE__ */ jsx2(Link2, {
|
|
739
|
-
href: "/docs/safety/auditing",
|
|
740
|
-
className: "btn-ghost",
|
|
741
|
-
children: "Previous: Audit Logs"
|
|
742
|
-
}),
|
|
743
|
-
/* @__PURE__ */ jsxs2(Link2, {
|
|
744
|
-
href: "/docs/advanced/renderers",
|
|
745
|
-
className: "btn-primary",
|
|
746
|
-
children: [
|
|
747
|
-
"Next: Advanced Topics ",
|
|
748
|
-
/* @__PURE__ */ jsx2(ChevronRight2, {
|
|
749
|
-
size: 16
|
|
750
|
-
})
|
|
751
|
-
]
|
|
752
|
-
})
|
|
753
|
-
]
|
|
754
|
-
})
|
|
755
|
-
]
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
// src/components/docs/safety/SafetyOverviewPage.tsx
|
|
760
|
-
import Link3 from "@contractspec/lib.ui-link";
|
|
761
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
762
|
-
var safetyPages = [
|
|
763
|
-
{
|
|
764
|
-
title: "Spec signing",
|
|
765
|
-
body: "Protect the integrity of what gets deployed and make changes verifiable.",
|
|
766
|
-
href: "/docs/safety/signing"
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
title: "Policy decision points",
|
|
770
|
-
body: "Apply governance consistently across operations, data access, and generated surfaces.",
|
|
771
|
-
href: "/docs/safety/pdp"
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
title: "Audit trails",
|
|
775
|
-
body: "Record operational and policy decisions with enough context to inspect and explain them later.",
|
|
776
|
-
href: "/docs/safety/auditing"
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
title: "Migrations",
|
|
780
|
-
body: "Evolve data and schema boundaries without losing control of the system.",
|
|
781
|
-
href: "/docs/safety/migrations"
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
title: "Tenant isolation",
|
|
785
|
-
body: "Keep configuration, access rules, and sensitive data bounded by tenant.",
|
|
786
|
-
href: "/docs/safety/tenant-isolation"
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
title: "Security and trust",
|
|
790
|
-
body: "Understand the trust model, release process, and security expectations around the OSS system.",
|
|
791
|
-
href: "/docs/safety/security-trust"
|
|
792
|
-
}
|
|
793
|
-
];
|
|
794
|
-
function SafetyOverviewPage() {
|
|
795
|
-
return /* @__PURE__ */ jsxs3("div", {
|
|
796
|
-
className: "space-y-10",
|
|
797
|
-
children: [
|
|
798
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
799
|
-
className: "space-y-3",
|
|
800
|
-
children: [
|
|
801
|
-
/* @__PURE__ */ jsx3("p", {
|
|
802
|
-
className: "editorial-kicker",
|
|
803
|
-
children: "Operate"
|
|
804
|
-
}),
|
|
805
|
-
/* @__PURE__ */ jsx3("h1", {
|
|
806
|
-
className: "font-serif text-4xl tracking-[-0.04em] md:text-5xl",
|
|
807
|
-
children: "Safety is part of the system model, not an afterthought."
|
|
808
|
-
}),
|
|
809
|
-
/* @__PURE__ */ jsx3("p", {
|
|
810
|
-
className: "max-w-3xl text-lg text-muted-foreground leading-8",
|
|
811
|
-
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."
|
|
812
|
-
})
|
|
813
|
-
]
|
|
814
|
-
}),
|
|
815
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
816
|
-
className: "editorial-proof-strip",
|
|
817
|
-
children: [
|
|
818
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
819
|
-
className: "editorial-stat",
|
|
820
|
-
children: [
|
|
821
|
-
/* @__PURE__ */ jsx3("span", {
|
|
822
|
-
className: "editorial-label",
|
|
823
|
-
children: "Operating rule"
|
|
824
|
-
}),
|
|
825
|
-
/* @__PURE__ */ jsx3("span", {
|
|
826
|
-
className: "editorial-stat-value",
|
|
827
|
-
children: "explicit change beats hidden mutation"
|
|
828
|
-
})
|
|
829
|
-
]
|
|
830
|
-
}),
|
|
831
|
-
/* @__PURE__ */ jsx3("p", {
|
|
832
|
-
className: "max-w-2xl text-muted-foreground text-sm leading-7",
|
|
833
|
-
children: "Use policies, signing, audit trails, and migrations to keep the system legible even as AI-assisted workflows accelerate change volume."
|
|
834
|
-
})
|
|
835
|
-
]
|
|
836
|
-
}),
|
|
837
|
-
/* @__PURE__ */ jsx3("div", {
|
|
838
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
839
|
-
children: safetyPages.map((page) => /* @__PURE__ */ jsxs3(Link3, {
|
|
840
|
-
href: page.href,
|
|
841
|
-
className: "editorial-panel",
|
|
842
|
-
children: [
|
|
843
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
844
|
-
className: "font-semibold text-xl",
|
|
845
|
-
children: page.title
|
|
846
|
-
}),
|
|
847
|
-
/* @__PURE__ */ jsx3("p", {
|
|
848
|
-
className: "mt-2 text-muted-foreground text-sm leading-7",
|
|
849
|
-
children: page.body
|
|
850
|
-
})
|
|
851
|
-
]
|
|
852
|
-
}, page.href))
|
|
853
|
-
})
|
|
854
|
-
]
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
// src/components/docs/safety/SafetyPDPPage.tsx
|
|
859
|
-
import Link4 from "@contractspec/lib.ui-link";
|
|
860
|
-
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
861
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
862
|
-
function SafetyPDPPage() {
|
|
863
|
-
return /* @__PURE__ */ jsxs4("div", {
|
|
864
|
-
className: "space-y-8",
|
|
865
|
-
children: [
|
|
866
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
867
|
-
className: "space-y-4",
|
|
868
|
-
children: [
|
|
869
|
-
/* @__PURE__ */ jsx4("h1", {
|
|
870
|
-
className: "font-bold text-4xl",
|
|
871
|
-
children: "Policy Decision Points"
|
|
872
|
-
}),
|
|
873
|
-
/* @__PURE__ */ jsxs4("p", {
|
|
874
|
-
className: "text-muted-foreground",
|
|
875
|
-
children: [
|
|
876
|
-
"A ",
|
|
877
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
878
|
-
children: "Policy Decision Point (PDP)"
|
|
879
|
-
}),
|
|
880
|
-
" is a centralized component that evaluates access control policies and makes authorization decisions. According to",
|
|
881
|
-
" ",
|
|
882
|
-
/* @__PURE__ */ jsx4("a", {
|
|
883
|
-
href: "https://www.strongdm.com/blog/policy-decision-point",
|
|
884
|
-
target: "_blank",
|
|
885
|
-
rel: "noopener noreferrer",
|
|
886
|
-
className: "text-violet-400 hover:text-violet-300",
|
|
887
|
-
children: "StrongDM"
|
|
888
|
-
}),
|
|
889
|
-
', the PDP "receives requests for access to resources, evaluates them against policies, and returns a decision (permit or deny)."'
|
|
890
|
-
]
|
|
891
|
-
})
|
|
892
|
-
]
|
|
893
|
-
}),
|
|
894
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
895
|
-
className: "space-y-4",
|
|
896
|
-
children: [
|
|
897
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
898
|
-
className: "font-bold text-2xl",
|
|
899
|
-
children: "How the PDP works in ContractSpec"
|
|
900
|
-
}),
|
|
901
|
-
/* @__PURE__ */ jsx4("p", {
|
|
902
|
-
className: "text-muted-foreground",
|
|
903
|
-
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:"
|
|
904
|
-
}),
|
|
905
|
-
/* @__PURE__ */ jsxs4("ol", {
|
|
906
|
-
className: "list-inside list-decimal space-y-3 text-muted-foreground",
|
|
907
|
-
children: [
|
|
908
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
909
|
-
children: [
|
|
910
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
911
|
-
children: "Request evaluation"
|
|
912
|
-
}),
|
|
913
|
-
" \u2013 The runtime sends a request to the PDP containing:",
|
|
914
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
915
|
-
className: "mt-2 ml-6 list-inside list-disc space-y-1",
|
|
916
|
-
children: [
|
|
917
|
-
/* @__PURE__ */ jsx4("li", {
|
|
918
|
-
children: "The user's identity and attributes (roles, groups, location, etc.)"
|
|
919
|
-
}),
|
|
920
|
-
/* @__PURE__ */ jsx4("li", {
|
|
921
|
-
children: "The resource being accessed (capability, field, workflow step)"
|
|
922
|
-
}),
|
|
923
|
-
/* @__PURE__ */ jsx4("li", {
|
|
924
|
-
children: "The action being performed (read, write, execute)"
|
|
925
|
-
}),
|
|
926
|
-
/* @__PURE__ */ jsx4("li", {
|
|
927
|
-
children: "Contextual information (time of day, device type, IP address)"
|
|
928
|
-
})
|
|
929
|
-
]
|
|
930
|
-
})
|
|
931
|
-
]
|
|
932
|
-
}),
|
|
933
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
934
|
-
children: [
|
|
935
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
936
|
-
children: "Policy evaluation"
|
|
937
|
-
}),
|
|
938
|
-
" \u2013 The PDP evaluates the request against all applicable ",
|
|
939
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
940
|
-
children: "PolicySpecs"
|
|
941
|
-
}),
|
|
942
|
-
". These specs define rules using attribute-based access control (ABAC) and can reference:",
|
|
943
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
944
|
-
className: "mt-2 ml-6 list-inside list-disc space-y-1",
|
|
945
|
-
children: [
|
|
946
|
-
/* @__PURE__ */ jsx4("li", {
|
|
947
|
-
children: `User attributes (e.g., "role == 'admin'")`
|
|
948
|
-
}),
|
|
949
|
-
/* @__PURE__ */ jsx4("li", {
|
|
950
|
-
children: `Resource attributes (e.g., "field.sensitivity == 'PII'")`
|
|
951
|
-
}),
|
|
952
|
-
/* @__PURE__ */ jsx4("li", {
|
|
953
|
-
children: 'Environmental attributes (e.g., "time.hour >= 9 AND time.hour < 17")'
|
|
954
|
-
})
|
|
955
|
-
]
|
|
956
|
-
})
|
|
957
|
-
]
|
|
958
|
-
}),
|
|
959
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
960
|
-
children: [
|
|
961
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
962
|
-
children: "Decision return"
|
|
963
|
-
}),
|
|
964
|
-
" \u2013 The PDP returns one of:",
|
|
965
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
966
|
-
className: "mt-2 ml-6 list-inside list-disc space-y-1",
|
|
967
|
-
children: [
|
|
968
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
969
|
-
children: [
|
|
970
|
-
/* @__PURE__ */ jsx4("code", {
|
|
971
|
-
className: "rounded bg-background/50 px-2 py-1",
|
|
972
|
-
children: "PERMIT"
|
|
973
|
-
}),
|
|
974
|
-
" ",
|
|
975
|
-
"\u2013 The operation is allowed."
|
|
976
|
-
]
|
|
977
|
-
}),
|
|
978
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
979
|
-
children: [
|
|
980
|
-
/* @__PURE__ */ jsx4("code", {
|
|
981
|
-
className: "rounded bg-background/50 px-2 py-1",
|
|
982
|
-
children: "DENY"
|
|
983
|
-
}),
|
|
984
|
-
" ",
|
|
985
|
-
"\u2013 The operation is blocked."
|
|
986
|
-
]
|
|
987
|
-
}),
|
|
988
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
989
|
-
children: [
|
|
990
|
-
/* @__PURE__ */ jsx4("code", {
|
|
991
|
-
className: "rounded bg-background/50 px-2 py-1",
|
|
992
|
-
children: "REDACT"
|
|
993
|
-
}),
|
|
994
|
-
" ",
|
|
995
|
-
"\u2013 The operation is allowed, but sensitive fields are masked."
|
|
996
|
-
]
|
|
997
|
-
})
|
|
998
|
-
]
|
|
999
|
-
})
|
|
1000
|
-
]
|
|
1001
|
-
}),
|
|
1002
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1003
|
-
children: [
|
|
1004
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1005
|
-
children: "Enforcement"
|
|
1006
|
-
}),
|
|
1007
|
-
" \u2013 The runtime enforces the decision. If denied, the operation fails with a clear error message. If redacted, sensitive fields are replaced with placeholders."
|
|
1008
|
-
]
|
|
1009
|
-
}),
|
|
1010
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1011
|
-
children: [
|
|
1012
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1013
|
-
children: "Auditing"
|
|
1014
|
-
}),
|
|
1015
|
-
" \u2013 Every PDP decision is logged to the",
|
|
1016
|
-
" ",
|
|
1017
|
-
/* @__PURE__ */ jsx4(Link4, {
|
|
1018
|
-
href: "/docs/safety/auditing",
|
|
1019
|
-
className: "text-violet-400 hover:text-violet-300",
|
|
1020
|
-
children: "audit log"
|
|
1021
|
-
}),
|
|
1022
|
-
", including the request, decision, and reasoning."
|
|
1023
|
-
]
|
|
1024
|
-
})
|
|
1025
|
-
]
|
|
1026
|
-
})
|
|
1027
|
-
]
|
|
1028
|
-
}),
|
|
1029
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1030
|
-
className: "space-y-4",
|
|
1031
|
-
children: [
|
|
1032
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
1033
|
-
className: "font-bold text-2xl",
|
|
1034
|
-
children: "Example PolicySpec"
|
|
1035
|
-
}),
|
|
1036
|
-
/* @__PURE__ */ jsx4("p", {
|
|
1037
|
-
className: "text-muted-foreground",
|
|
1038
|
-
children: "Here's a simple policy that restricts access to PII fields:"
|
|
1039
|
-
}),
|
|
1040
|
-
/* @__PURE__ */ jsx4("div", {
|
|
1041
|
-
className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
|
|
1042
|
-
children: /* @__PURE__ */ jsx4("pre", {
|
|
1043
|
-
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(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
|
|
1044
57
|
version: '1.0.0'.0.0
|
|
1045
58
|
rules:
|
|
1046
59
|
- id: allow-admin-full-access
|
|
@@ -1058,470 +71,11 @@ rules:
|
|
|
1058
71
|
effect: DENY
|
|
1059
72
|
condition: |
|
|
1060
73
|
user.role NOT IN ['admin', 'support'] AND
|
|
1061
|
-
field.sensitivity == 'PII'`
|
|
1062
|
-
|
|
1063
|
-
}),
|
|
1064
|
-
/* @__PURE__ */ jsx4("p", {
|
|
1065
|
-
className: "text-muted-foreground",
|
|
1066
|
-
children: "With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."
|
|
1067
|
-
})
|
|
1068
|
-
]
|
|
1069
|
-
}),
|
|
1070
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1071
|
-
className: "space-y-4",
|
|
1072
|
-
children: [
|
|
1073
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
1074
|
-
className: "font-bold text-2xl",
|
|
1075
|
-
children: "Benefits of centralized decision-making"
|
|
1076
|
-
}),
|
|
1077
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
1078
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
1079
|
-
children: [
|
|
1080
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1081
|
-
children: [
|
|
1082
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1083
|
-
children: "Consistency"
|
|
1084
|
-
}),
|
|
1085
|
-
" \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."
|
|
1086
|
-
]
|
|
1087
|
-
}),
|
|
1088
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1089
|
-
children: [
|
|
1090
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1091
|
-
children: "Auditability"
|
|
1092
|
-
}),
|
|
1093
|
-
" \u2013 Every decision is logged, making it easy to trace why access was granted or denied."
|
|
1094
|
-
]
|
|
1095
|
-
}),
|
|
1096
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1097
|
-
children: [
|
|
1098
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1099
|
-
children: "Flexibility"
|
|
1100
|
-
}),
|
|
1101
|
-
" \u2013 Policies can be updated without changing application code."
|
|
1102
|
-
]
|
|
1103
|
-
}),
|
|
1104
|
-
/* @__PURE__ */ jsxs4("li", {
|
|
1105
|
-
children: [
|
|
1106
|
-
/* @__PURE__ */ jsx4("strong", {
|
|
1107
|
-
children: "Security"
|
|
1108
|
-
}),
|
|
1109
|
-
" \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."
|
|
1110
|
-
]
|
|
1111
|
-
})
|
|
1112
|
-
]
|
|
1113
|
-
})
|
|
1114
|
-
]
|
|
1115
|
-
}),
|
|
1116
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1117
|
-
className: "space-y-4",
|
|
1118
|
-
children: [
|
|
1119
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
1120
|
-
className: "font-bold text-2xl",
|
|
1121
|
-
children: "Performance considerations"
|
|
1122
|
-
}),
|
|
1123
|
-
/* @__PURE__ */ jsx4("p", {
|
|
1124
|
-
className: "text-muted-foreground",
|
|
1125
|
-
children: "Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"
|
|
1126
|
-
}),
|
|
1127
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
1128
|
-
className: "list-inside list-disc space-y-2 text-muted-foreground",
|
|
1129
|
-
children: [
|
|
1130
|
-
/* @__PURE__ */ jsx4("li", {
|
|
1131
|
-
children: "Caching policy decisions for identical requests"
|
|
1132
|
-
}),
|
|
1133
|
-
/* @__PURE__ */ jsx4("li", {
|
|
1134
|
-
children: "Compiling policies into efficient bytecode"
|
|
1135
|
-
}),
|
|
1136
|
-
/* @__PURE__ */ jsx4("li", {
|
|
1137
|
-
children: "Evaluating only the minimal set of rules needed for each request"
|
|
1138
|
-
}),
|
|
1139
|
-
/* @__PURE__ */ jsx4("li", {
|
|
1140
|
-
children: "Running the PDP in-process to avoid network latency"
|
|
1141
|
-
})
|
|
1142
|
-
]
|
|
1143
|
-
}),
|
|
1144
|
-
/* @__PURE__ */ jsx4("p", {
|
|
1145
|
-
className: "text-muted-foreground",
|
|
1146
|
-
children: "In practice, PDP overhead is typically less than 1ms per request."
|
|
1147
|
-
})
|
|
1148
|
-
]
|
|
1149
|
-
}),
|
|
1150
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1151
|
-
className: "flex items-center gap-4 pt-4",
|
|
1152
|
-
children: [
|
|
1153
|
-
/* @__PURE__ */ jsx4(Link4, {
|
|
1154
|
-
href: "/docs/safety/signing",
|
|
1155
|
-
className: "btn-ghost",
|
|
1156
|
-
children: "Previous: Spec Signing"
|
|
1157
|
-
}),
|
|
1158
|
-
/* @__PURE__ */ jsxs4(Link4, {
|
|
1159
|
-
href: "/docs/safety/auditing",
|
|
1160
|
-
className: "btn-primary",
|
|
1161
|
-
children: [
|
|
1162
|
-
"Next: Audit Logs ",
|
|
1163
|
-
/* @__PURE__ */ jsx4(ChevronRight3, {
|
|
1164
|
-
size: 16
|
|
1165
|
-
})
|
|
1166
|
-
]
|
|
1167
|
-
})
|
|
1168
|
-
]
|
|
1169
|
-
})
|
|
1170
|
-
]
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
// src/components/docs/safety/SafetySecurityTrustPage.tsx
|
|
1175
|
-
import Link5 from "@contractspec/lib.ui-link";
|
|
1176
|
-
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
1177
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1178
|
-
function SafetySecurityTrustPage() {
|
|
1179
|
-
return /* @__PURE__ */ jsxs5("div", {
|
|
1180
|
-
className: "space-y-8",
|
|
1181
|
-
children: [
|
|
1182
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1183
|
-
className: "space-y-4",
|
|
1184
|
-
children: [
|
|
1185
|
-
/* @__PURE__ */ jsx5("h1", {
|
|
1186
|
-
className: "font-bold text-4xl",
|
|
1187
|
-
children: "Security & Trust"
|
|
1188
|
-
}),
|
|
1189
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1190
|
-
className: "text-muted-foreground",
|
|
1191
|
-
children: "ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."
|
|
1192
|
-
})
|
|
1193
|
-
]
|
|
1194
|
-
}),
|
|
1195
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1196
|
-
className: "card-subtle space-y-4 p-6",
|
|
1197
|
-
children: [
|
|
1198
|
-
/* @__PURE__ */ jsx5("h2", {
|
|
1199
|
-
className: "font-bold text-2xl",
|
|
1200
|
-
children: "Security policy"
|
|
1201
|
-
}),
|
|
1202
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1203
|
-
className: "text-muted-foreground text-sm",
|
|
1204
|
-
children: "We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."
|
|
1205
|
-
}),
|
|
1206
|
-
/* @__PURE__ */ jsxs5(Link5, {
|
|
1207
|
-
href: "/SECURITY.md",
|
|
1208
|
-
className: "btn-primary",
|
|
1209
|
-
children: [
|
|
1210
|
-
"Read the security policy ",
|
|
1211
|
-
/* @__PURE__ */ jsx5(ChevronRight4, {
|
|
1212
|
-
size: 16
|
|
1213
|
-
})
|
|
1214
|
-
]
|
|
1215
|
-
})
|
|
1216
|
-
]
|
|
1217
|
-
}),
|
|
1218
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1219
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
1220
|
-
children: [
|
|
1221
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1222
|
-
className: "card-subtle space-y-3 p-6",
|
|
1223
|
-
children: [
|
|
1224
|
-
/* @__PURE__ */ jsx5("h3", {
|
|
1225
|
-
className: "font-semibold text-lg",
|
|
1226
|
-
children: "Release hygiene"
|
|
1227
|
-
}),
|
|
1228
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1229
|
-
className: "text-muted-foreground text-sm",
|
|
1230
|
-
children: "We ship with deterministic CI, changesets, and contract validation so teams can trust every release."
|
|
1231
|
-
}),
|
|
1232
|
-
/* @__PURE__ */ jsxs5("ul", {
|
|
1233
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
1234
|
-
children: [
|
|
1235
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1236
|
-
children: "Changesets required for published packages."
|
|
1237
|
-
}),
|
|
1238
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1239
|
-
children: "CI gate for contract validation and drift detection."
|
|
1240
|
-
}),
|
|
1241
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1242
|
-
children: "Rollback-friendly release process."
|
|
1243
|
-
})
|
|
1244
|
-
]
|
|
1245
|
-
})
|
|
1246
|
-
]
|
|
1247
|
-
}),
|
|
1248
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1249
|
-
className: "card-subtle space-y-3 p-6",
|
|
1250
|
-
children: [
|
|
1251
|
-
/* @__PURE__ */ jsx5("h3", {
|
|
1252
|
-
className: "font-semibold text-lg",
|
|
1253
|
-
children: "Data handling"
|
|
1254
|
-
}),
|
|
1255
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1256
|
-
className: "text-muted-foreground text-sm",
|
|
1257
|
-
children: "ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."
|
|
1258
|
-
}),
|
|
1259
|
-
/* @__PURE__ */ jsxs5("ul", {
|
|
1260
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
1261
|
-
children: [
|
|
1262
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1263
|
-
children: "Schema-level sensitivity tags."
|
|
1264
|
-
}),
|
|
1265
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1266
|
-
children: "Policy Decision Point enforcement."
|
|
1267
|
-
}),
|
|
1268
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1269
|
-
children: "Audit logs for operational traceability."
|
|
1270
|
-
})
|
|
1271
|
-
]
|
|
1272
|
-
})
|
|
1273
|
-
]
|
|
1274
|
-
})
|
|
1275
|
-
]
|
|
1276
|
-
}),
|
|
1277
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1278
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
1279
|
-
children: [
|
|
1280
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1281
|
-
className: "card-subtle space-y-3 p-6",
|
|
1282
|
-
children: [
|
|
1283
|
-
/* @__PURE__ */ jsx5("h3", {
|
|
1284
|
-
className: "font-semibold text-lg",
|
|
1285
|
-
children: "Supply chain"
|
|
1286
|
-
}),
|
|
1287
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1288
|
-
className: "text-muted-foreground text-sm",
|
|
1289
|
-
children: "We track dependency updates and keep the monorepo build reproducible."
|
|
1290
|
-
}),
|
|
1291
|
-
/* @__PURE__ */ jsxs5("ul", {
|
|
1292
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
1293
|
-
children: [
|
|
1294
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1295
|
-
children: "Dependabot + Renovate-style updates where available."
|
|
1296
|
-
}),
|
|
1297
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1298
|
-
children: "Signed release artifacts planned for Studio release cycles."
|
|
1299
|
-
}),
|
|
1300
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1301
|
-
children: "Transparent changelogs for every package."
|
|
1302
|
-
})
|
|
1303
|
-
]
|
|
1304
|
-
})
|
|
1305
|
-
]
|
|
1306
|
-
}),
|
|
1307
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1308
|
-
className: "card-subtle space-y-3 p-6",
|
|
1309
|
-
children: [
|
|
1310
|
-
/* @__PURE__ */ jsx5("h3", {
|
|
1311
|
-
className: "font-semibold text-lg",
|
|
1312
|
-
children: "Responsible disclosure"
|
|
1313
|
-
}),
|
|
1314
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1315
|
-
className: "text-muted-foreground text-sm",
|
|
1316
|
-
children: "We respond quickly to security reports and coordinate fixes before public disclosure."
|
|
1317
|
-
}),
|
|
1318
|
-
/* @__PURE__ */ jsxs5("ul", {
|
|
1319
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
1320
|
-
children: [
|
|
1321
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1322
|
-
children: "Security response within 5 business days."
|
|
1323
|
-
}),
|
|
1324
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1325
|
-
children: "Private disclosure via security@contractspec.io."
|
|
1326
|
-
}),
|
|
1327
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1328
|
-
children: "Credit for researchers (with permission)."
|
|
1329
|
-
})
|
|
1330
|
-
]
|
|
1331
|
-
})
|
|
1332
|
-
]
|
|
1333
|
-
})
|
|
1334
|
-
]
|
|
1335
|
-
}),
|
|
1336
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1337
|
-
className: "space-y-4",
|
|
1338
|
-
children: [
|
|
1339
|
-
/* @__PURE__ */ jsx5("h2", {
|
|
1340
|
-
className: "font-bold text-2xl",
|
|
1341
|
-
children: "Next steps"
|
|
1342
|
-
}),
|
|
1343
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1344
|
-
className: "text-muted-foreground",
|
|
1345
|
-
children: "Explore the broader safety controls or read the roadmap to see upcoming trust investments."
|
|
1346
|
-
}),
|
|
1347
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1348
|
-
className: "flex flex-wrap gap-4 pt-4",
|
|
1349
|
-
children: [
|
|
1350
|
-
/* @__PURE__ */ jsxs5(Link5, {
|
|
1351
|
-
href: "/docs/safety",
|
|
1352
|
-
className: "btn-ghost",
|
|
1353
|
-
children: [
|
|
1354
|
-
"Safety overview ",
|
|
1355
|
-
/* @__PURE__ */ jsx5(ChevronRight4, {
|
|
1356
|
-
size: 16
|
|
1357
|
-
})
|
|
1358
|
-
]
|
|
1359
|
-
}),
|
|
1360
|
-
/* @__PURE__ */ jsxs5(Link5, {
|
|
1361
|
-
href: "/ROADMAP.md",
|
|
1362
|
-
className: "btn-ghost",
|
|
1363
|
-
children: [
|
|
1364
|
-
"Roadmap ",
|
|
1365
|
-
/* @__PURE__ */ jsx5(ChevronRight4, {
|
|
1366
|
-
size: 16
|
|
1367
|
-
})
|
|
1368
|
-
]
|
|
1369
|
-
})
|
|
1370
|
-
]
|
|
1371
|
-
})
|
|
1372
|
-
]
|
|
1373
|
-
})
|
|
1374
|
-
]
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
// src/components/docs/safety/SafetySigningPage.tsx
|
|
1379
|
-
import Link6 from "@contractspec/lib.ui-link";
|
|
1380
|
-
import { ChevronRight as ChevronRight5 } from "lucide-react";
|
|
1381
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1382
|
-
function SafetySigningPage() {
|
|
1383
|
-
return /* @__PURE__ */ jsxs6("div", {
|
|
1384
|
-
className: "space-y-8",
|
|
1385
|
-
children: [
|
|
1386
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1387
|
-
className: "space-y-2",
|
|
1388
|
-
children: [
|
|
1389
|
-
/* @__PURE__ */ jsx6("h1", {
|
|
1390
|
-
className: "font-bold text-4xl",
|
|
1391
|
-
children: "Spec Signing"
|
|
1392
|
-
}),
|
|
1393
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1394
|
-
className: "text-lg text-muted-foreground",
|
|
1395
|
-
children: "Signing ensures specs haven't been tampered with and provides an audit trail of all changes."
|
|
1396
|
-
})
|
|
1397
|
-
]
|
|
1398
|
-
}),
|
|
1399
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1400
|
-
className: "space-y-6",
|
|
1401
|
-
children: [
|
|
1402
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1403
|
-
className: "space-y-3",
|
|
1404
|
-
children: [
|
|
1405
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1406
|
-
className: "font-bold text-2xl",
|
|
1407
|
-
children: "How it works"
|
|
1408
|
-
}),
|
|
1409
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1410
|
-
className: "text-muted-foreground",
|
|
1411
|
-
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."
|
|
1412
|
-
})
|
|
1413
|
-
]
|
|
1414
|
-
}),
|
|
1415
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1416
|
-
className: "space-y-3",
|
|
1417
|
-
children: [
|
|
1418
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1419
|
-
className: "font-bold text-2xl",
|
|
1420
|
-
children: "Signing a spec"
|
|
1421
|
-
}),
|
|
1422
|
-
/* @__PURE__ */ jsx6("div", {
|
|
1423
|
-
className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
|
|
1424
|
-
children: /* @__PURE__ */ jsx6("pre", {
|
|
1425
|
-
children: `contractspec sign app.spec.ts --key ~/.contractspec/key.pem
|
|
1426
|
-
contractspec deploy --signed app.spec.ts.signed`
|
|
1427
|
-
})
|
|
1428
|
-
})
|
|
1429
|
-
]
|
|
1430
|
-
}),
|
|
1431
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1432
|
-
className: "space-y-3",
|
|
1433
|
-
children: [
|
|
1434
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1435
|
-
className: "font-bold text-2xl",
|
|
1436
|
-
children: "Verifying signatures"
|
|
1437
|
-
}),
|
|
1438
|
-
/* @__PURE__ */ jsx6("div", {
|
|
1439
|
-
className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
|
|
1440
|
-
children: /* @__PURE__ */ jsx6("pre", {
|
|
1441
|
-
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(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
|
|
1442
76
|
# Output: \u2713 Signature valid
|
|
1443
77
|
# Signed by: alice@example.com
|
|
1444
|
-
# Timestamp: 2024-11-08T10:30:00Z`
|
|
1445
|
-
})
|
|
1446
|
-
})
|
|
1447
|
-
]
|
|
1448
|
-
}),
|
|
1449
|
-
/* @__PURE__ */ jsx6("div", {
|
|
1450
|
-
className: "flex items-center gap-4 pt-4",
|
|
1451
|
-
children: /* @__PURE__ */ jsxs6(Link6, {
|
|
1452
|
-
href: "/docs/safety/pdp",
|
|
1453
|
-
className: "btn-primary",
|
|
1454
|
-
children: [
|
|
1455
|
-
"Next: Policy Decision Points ",
|
|
1456
|
-
/* @__PURE__ */ jsx6(ChevronRight5, {
|
|
1457
|
-
size: 16
|
|
1458
|
-
})
|
|
1459
|
-
]
|
|
1460
|
-
})
|
|
1461
|
-
})
|
|
1462
|
-
]
|
|
1463
|
-
})
|
|
1464
|
-
]
|
|
1465
|
-
});
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
// src/components/docs/safety/SafetyTenantIsolationPage.tsx
|
|
1469
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1470
|
-
function SafetyTenantIsolationPage() {
|
|
1471
|
-
return /* @__PURE__ */ jsxs7("div", {
|
|
1472
|
-
className: "space-y-8",
|
|
1473
|
-
children: [
|
|
1474
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
1475
|
-
className: "space-y-4",
|
|
1476
|
-
children: [
|
|
1477
|
-
/* @__PURE__ */ jsx7("h1", {
|
|
1478
|
-
className: "font-bold text-4xl",
|
|
1479
|
-
children: "Tenant Isolation"
|
|
1480
|
-
}),
|
|
1481
|
-
/* @__PURE__ */ jsx7("p", {
|
|
1482
|
-
className: "text-lg text-muted-foreground",
|
|
1483
|
-
children: 'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'
|
|
1484
|
-
})
|
|
1485
|
-
]
|
|
1486
|
-
}),
|
|
1487
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
1488
|
-
className: "space-y-4",
|
|
1489
|
-
children: [
|
|
1490
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
1491
|
-
className: "font-bold text-2xl",
|
|
1492
|
-
children: "Layer 1: RLS Middleware"
|
|
1493
|
-
}),
|
|
1494
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
1495
|
-
children: [
|
|
1496
|
-
"The primary defense is the Prisma middleware that rewrites queries to include ",
|
|
1497
|
-
/* @__PURE__ */ jsx7("code", {
|
|
1498
|
-
children: "WHERE tenantId = ?"
|
|
1499
|
-
}),
|
|
1500
|
-
". This protects against developer error (forgetting to filter)."
|
|
1501
|
-
]
|
|
1502
|
-
})
|
|
1503
|
-
]
|
|
1504
|
-
}),
|
|
1505
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
1506
|
-
className: "space-y-4",
|
|
1507
|
-
children: [
|
|
1508
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
1509
|
-
className: "font-bold text-2xl",
|
|
1510
|
-
children: "Layer 2: Isolation Validator"
|
|
1511
|
-
}),
|
|
1512
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
1513
|
-
children: [
|
|
1514
|
-
"For high-security environments, you can use the",
|
|
1515
|
-
" ",
|
|
1516
|
-
/* @__PURE__ */ jsx7("code", {
|
|
1517
|
-
children: "IsolationValidator"
|
|
1518
|
-
}),
|
|
1519
|
-
" in your test suite to verify that every query generated by your operations actually includes the tenant ID."
|
|
1520
|
-
]
|
|
1521
|
-
}),
|
|
1522
|
-
/* @__PURE__ */ jsx7("pre", {
|
|
1523
|
-
className: "rounded-lg border bg-muted p-4 text-sm",
|
|
1524
|
-
children: `import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
|
|
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';
|
|
1525
79
|
|
|
1526
80
|
test('findUser query is isolated', () => {
|
|
1527
81
|
const isValid = IsolationValidator.validateQuery(
|
|
@@ -1531,31 +85,4 @@ test('findUser query is isolated', () => {
|
|
|
1531
85
|
'tenant-123'
|
|
1532
86
|
);
|
|
1533
87
|
expect(isValid).toBe(true);
|
|
1534
|
-
});`
|
|
1535
|
-
})
|
|
1536
|
-
]
|
|
1537
|
-
}),
|
|
1538
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
1539
|
-
className: "space-y-4",
|
|
1540
|
-
children: [
|
|
1541
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
1542
|
-
className: "font-bold text-2xl",
|
|
1543
|
-
children: "Layer 3: Policy Engine"
|
|
1544
|
-
}),
|
|
1545
|
-
/* @__PURE__ */ jsx7("p", {
|
|
1546
|
-
children: "The Policy Decision Point (PDP) verifies that the authenticated user actually belongs to the requested tenant before any operation logic runs."
|
|
1547
|
-
})
|
|
1548
|
-
]
|
|
1549
|
-
})
|
|
1550
|
-
]
|
|
1551
|
-
});
|
|
1552
|
-
}
|
|
1553
|
-
export {
|
|
1554
|
-
SafetyTenantIsolationPage,
|
|
1555
|
-
SafetySigningPage,
|
|
1556
|
-
SafetySecurityTrustPage,
|
|
1557
|
-
SafetyPDPPage,
|
|
1558
|
-
SafetyOverviewPage,
|
|
1559
|
-
SafetyMigrationsPage,
|
|
1560
|
-
SafetyAuditingPage
|
|
1561
|
-
};
|
|
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};
|