arkgate 4.8.23 → 4.8.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +7 -5
  3. package/bin/ark-check-runtime.mjs +41 -91
  4. package/bin/ark-dashboard.mjs +56 -53
  5. package/bin/ark-layer-match.mjs +707 -121
  6. package/bin/ark-mcp-runtime.mjs +448 -169
  7. package/bin/ark-mcp.mjs +68 -4
  8. package/bin/ark-shared.mjs +42 -22
  9. package/bin/ark.mjs +65 -97
  10. package/bin/lib/adapter-contract-types.mjs +5 -0
  11. package/bin/lib/adapter-contract.mjs +15 -0
  12. package/bin/lib/adoption-stance.mjs +2 -2
  13. package/bin/lib/adr-path.mjs +3 -3
  14. package/bin/lib/agent-gates.mjs +0 -61
  15. package/bin/lib/agent-homes.mjs +12 -21
  16. package/bin/lib/agent-projection-command.mjs +9 -5
  17. package/bin/lib/ambient-state.mjs +9 -30
  18. package/bin/lib/analysis-engine.mjs +15 -11
  19. package/bin/lib/architecture-scan.mjs +61 -15
  20. package/bin/lib/ark-order-doctor.mjs +4 -29
  21. package/bin/lib/ark-order-facts.mjs +319 -17
  22. package/bin/lib/ark-order-sensors.mjs +28 -101
  23. package/bin/lib/ark-order-types.mjs +3 -2
  24. package/bin/lib/ark-run-doctor.mjs +17 -28
  25. package/bin/lib/ark-run-facts.mjs +461 -48
  26. package/bin/lib/ark-run-sensors.mjs +6 -4
  27. package/bin/lib/arkgate-pins.mjs +91 -0
  28. package/bin/lib/arkrule-file-hints.mjs +2 -47
  29. package/bin/lib/arkrules-contract.mjs +124 -133
  30. package/bin/lib/arkrules-sensors.mjs +55 -252
  31. package/bin/lib/check-args.mjs +85 -1
  32. package/bin/lib/ci-and-commands.mjs +24 -78
  33. package/bin/lib/ci-merge-boundary.mjs +1 -1
  34. package/bin/lib/class-source-scan.mjs +479 -0
  35. package/bin/lib/clone-detection.mjs +474 -0
  36. package/bin/lib/codex-home.mjs +5 -3
  37. package/bin/lib/config-contract-slices.mjs +739 -0
  38. package/bin/lib/config-contract.mjs +42 -607
  39. package/bin/lib/config-extras.mjs +16 -22
  40. package/bin/lib/config-warnings.mjs +32 -0
  41. package/bin/lib/contract-smells.mjs +33 -15
  42. package/bin/lib/core-ratchet.mjs +0 -2
  43. package/bin/lib/dashboard-cli.mjs +62 -0
  44. package/bin/lib/deep-module-coach.mjs +2 -4
  45. package/bin/lib/deploy-path.mjs +13 -38
  46. package/bin/lib/design-delta.mjs +1 -1
  47. package/bin/lib/design-smells.mjs +2 -2
  48. package/bin/lib/diagnostic-catalog.mjs +23 -9
  49. package/bin/lib/doctor-advisories.mjs +78 -8
  50. package/bin/lib/doctor-green-cite.mjs +1 -1
  51. package/bin/lib/doctor-human.mjs +1 -1
  52. package/bin/lib/doctor-next-actions.mjs +19 -4
  53. package/bin/lib/doctor-plan.mjs +9 -13
  54. package/bin/lib/duplication-io.mjs +572 -0
  55. package/bin/lib/effective-contract-load.mjs +282 -83
  56. package/bin/lib/enforcement-profiles.mjs +40 -4
  57. package/bin/lib/entry-points-io.mjs +424 -0
  58. package/bin/lib/extra-merge-teeth.mjs +36 -0
  59. package/bin/lib/field-install.mjs +38 -14
  60. package/bin/lib/first-run-help.mjs +10 -5
  61. package/bin/lib/flat-parent-importers.mjs +139 -0
  62. package/bin/lib/flat-parent-pilot.mjs +40 -100
  63. package/bin/lib/gate-files.mjs +58 -90
  64. package/bin/lib/git-change-scope.mjs +109 -0
  65. package/bin/lib/github-enforcement.mjs +166 -29
  66. package/bin/lib/golden-pattern.mjs +1 -1
  67. package/bin/lib/hook-templates.mjs +17 -15
  68. package/bin/lib/host-support-matrix.mjs +3 -1
  69. package/bin/lib/html-report-advisories.mjs +4 -0
  70. package/bin/lib/html-report-depth.mjs +2 -2
  71. package/bin/lib/html-report.mjs +2 -2
  72. package/bin/lib/import-graph-projection.mjs +112 -0
  73. package/bin/lib/import-resolve.mjs +13 -1
  74. package/bin/lib/improvement-compass-doctor.mjs +1 -24
  75. package/bin/lib/install-migrate.mjs +50 -73
  76. package/bin/lib/invariant-coverage-io.mjs +4 -3
  77. package/bin/lib/invariant-coverage.mjs +85 -11
  78. package/bin/lib/invariant-probe-cli.mjs +347 -0
  79. package/bin/lib/invariant-probe-io.mjs +165 -0
  80. package/bin/lib/invariant-probe-runner.mjs +268 -0
  81. package/bin/lib/invariant-probe-sites.mjs +174 -0
  82. package/bin/lib/invariant-probe-workspace.mjs +183 -0
  83. package/bin/lib/invariant-probe.mjs +461 -0
  84. package/bin/lib/invariant-tests-path.mjs +16 -22
  85. package/bin/lib/literal-path-drift.mjs +4 -2
  86. package/bin/lib/managed-upgrade.mjs +2 -8
  87. package/bin/lib/mcp-adoption.mjs +13 -6
  88. package/bin/lib/mcp-hook-payload.mjs +403 -63
  89. package/bin/lib/orphan-modules-io.mjs +458 -0
  90. package/bin/lib/orphan-modules.mjs +251 -0
  91. package/bin/lib/outside-importers.mjs +197 -0
  92. package/bin/lib/package-manager.mjs +60 -2
  93. package/bin/lib/parse-health.mjs +1 -1
  94. package/bin/lib/passthrough-commands.mjs +83 -0
  95. package/bin/lib/persistence-write-hint.mjs +106 -0
  96. package/bin/lib/pin-dependent-gates.mjs +117 -0
  97. package/bin/lib/policy-delta-io.mjs +219 -14
  98. package/bin/lib/post-green-path.mjs +1 -1
  99. package/bin/lib/prepare-change.mjs +115 -7
  100. package/bin/lib/prepare-write.mjs +2 -2
  101. package/bin/lib/presets.mjs +59 -73
  102. package/bin/lib/product-copy.mjs +1 -6
  103. package/bin/lib/project-root.mjs +31 -62
  104. package/bin/lib/remediation.mjs +23 -4
  105. package/bin/lib/resolved-candidate-facts.mjs +405 -117
  106. package/bin/lib/rules-inventory.mjs +22 -3
  107. package/bin/lib/rules-under-contract.mjs +247 -9
  108. package/bin/lib/scan-files.mjs +36 -4
  109. package/bin/lib/schema-validation.mjs +130 -0
  110. package/bin/lib/sensor-promote-cli.mjs +2 -11
  111. package/bin/lib/sensor-promote-io.mjs +33 -22
  112. package/bin/lib/sensor-promotion.mjs +1 -1
  113. package/bin/lib/skill-catalog-apply.mjs +1 -1
  114. package/bin/lib/skill-install.mjs +42 -38
  115. package/bin/lib/snippet-analysis.mjs +140 -6
  116. package/bin/lib/source-policy.mjs +34 -0
  117. package/bin/lib/start-install-recovery.mjs +72 -2
  118. package/bin/lib/start-preview.mjs +31 -1
  119. package/bin/lib/states-transitions-presence.mjs +3 -3
  120. package/bin/lib/status-command.mjs +35 -22
  121. package/bin/lib/status-manifest.mjs +50 -30
  122. package/bin/lib/status-transition-catalog.mjs +0 -6
  123. package/bin/lib/suggestions.mjs +3 -3
  124. package/bin/lib/team-parliament-io.mjs +76 -88
  125. package/bin/lib/team-parliament.mjs +21 -10
  126. package/bin/lib/upgrade-behavior-changes.mjs +2 -2
  127. package/bin/lib/upgrade-command.mjs +2 -24
  128. package/bin/lib/upgrade-outcome.mjs +1 -1
  129. package/bin/lib/upstream-report.mjs +21 -10
  130. package/bin/lib/violations.mjs +10 -9
  131. package/bin/lib/weakest-link.mjs +13 -0
  132. package/bin/lib/write-path-capabilities.mjs +6 -4
  133. package/dist/chunk-A5EIY3HI.cjs +5 -0
  134. package/dist/chunk-AHACEKSV.js +16 -0
  135. package/dist/chunk-SVSQVGFJ.js +5 -0
  136. package/dist/chunk-UN5EH4QV.cjs +16 -0
  137. package/dist/{configTypes-Bbf_MFGe.d.ts → configTypes-GPvvdleM.d.cts} +30 -4
  138. package/dist/configTypes-GPvvdleM.d.ts +257 -0
  139. package/dist/eslint/index.cjs +18 -5
  140. package/dist/eslint/index.d.cts +368 -0
  141. package/dist/eslint/index.d.ts +139 -156
  142. package/dist/eslint/index.js +11 -5
  143. package/dist/index.cjs +36 -35
  144. package/dist/index.d.cts +5547 -0
  145. package/dist/index.d.ts +3283 -198
  146. package/dist/index.js +36 -35
  147. package/dist/inspectorListen-6DQVJ4DC.js +1 -0
  148. package/dist/inspectorListen-KGMIQ2TF.cjs +1 -0
  149. package/dist/nestjs/index.cjs +1 -18
  150. package/dist/nestjs/index.d.cts +22 -0
  151. package/dist/nestjs/index.d.ts +1 -3
  152. package/dist/nestjs/index.js +1 -18
  153. package/dist/order/index.cjs +1 -1
  154. package/dist/order/index.d.cts +155 -0
  155. package/dist/order/index.d.ts +15 -3
  156. package/dist/order/index.js +1 -1
  157. package/dist/runtime/index.cjs +13 -30
  158. package/dist/{diagnosticCatalog-35mrwAHe.d.ts → runtime/index.d.cts} +828 -276
  159. package/dist/runtime/index.d.ts +2741 -133
  160. package/dist/runtime/index.js +13 -30
  161. package/dist/{types-Bdj32QwA.d.ts → types-CnauMQQL.d.cts} +607 -163
  162. package/dist/types-CnauMQQL.d.ts +1800 -0
  163. package/docs/README.md +3 -1
  164. package/docs/agent-guide.md +217 -16
  165. package/docs/ai-gates.md +174 -26
  166. package/docs/arkorder.md +32 -15
  167. package/docs/brownfield-adoption.md +5 -1
  168. package/docs/configuration.md +230 -31
  169. package/docs/develop.md +2 -1
  170. package/docs/diagnostics.md +212 -19
  171. package/docs/package-surface.md +35 -9
  172. package/docs/product-voice.md +7 -1
  173. package/package.json +69 -19
  174. package/schemas/ark.analysis-result.schema.json +15 -0
  175. package/schemas/ark.config.schema.json +77 -12
  176. package/schemas/ark.invariant-probe.schema.json +368 -0
  177. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  178. package/schemas/ark.status-manifest.schema.json +22 -0
  179. package/server.json +3 -9
  180. package/templates/agent-skills/README.md +1 -1
  181. package/templates/agent-skills/ark-adopt/SKILL.md +5 -1
  182. package/templates/agent-skills/ark-contract/SKILL.md +17 -0
  183. package/templates/agent-skills/ark-coverage/SKILL.md +2 -0
  184. package/templates/agent-skills/ark-explore/SKILL.md +7 -0
  185. package/templates/agent-skills/ark-fix/SKILL.md +20 -0
  186. package/templates/agent-skills/ark-order/SKILL.md +4 -2
  187. package/templates/agent-skills/ark-place/SKILL.md +8 -0
  188. package/templates/agent-skills/ark-runtime/SKILL.md +6 -1
  189. package/templates/arkrules/PersistenceAdapters.json +1 -1
  190. package/templates/arkrules/PresentationAdapters.json +1 -1
  191. package/templates/skills/ark-adopt.md +5 -1
  192. package/templates/skills/ark-contract.md +17 -0
  193. package/templates/skills/ark-coverage.md +2 -0
  194. package/templates/skills/ark-explore.md +7 -0
  195. package/templates/skills/ark-fix.md +20 -0
  196. package/templates/skills/ark-order.md +4 -2
  197. package/templates/skills/ark-place.md +8 -0
  198. package/templates/skills/ark-runtime.md +6 -1
  199. package/bin/lib/ark-order-error.mjs +0 -18
  200. package/bin/lib/ark-order-invariants.mjs +0 -346
  201. package/dist/types-Ik_OakcI.d.ts +0 -183
@@ -1,58 +1,66 @@
1
- export { n as AICodeGate, o as AICodeGateContext, p as AICodeGateOptions, q as AICodeGateResult, r as AICodeGateViolation, s as AIGateExtension, t as ANALYSIS_IR_SCHEMA_VERSION, u as ARK_ANALYSIS_RESULT_SCHEMA, v as ARK_ANALYSIS_RESULT_SCHEMA_VERSION, w as ARK_DESIGN_DELTA_SCHEMA_VERSION, x as ARK_ENFORCEMENT_STATE_SCHEMA_VERSION, y as AdapterCompletenessReason, z as AdapterDiagnostic, B as AdapterResult, C as AdapterSeverity, A as AdapterViolationInput, D as AnalysisCapabilityUse, F as AnalysisCompilerOptions, G as AnalysisCompleteness, H as AnalysisContract, I as AnalysisEvidence, J as AnalysisFile, K as AnalysisFileChange, L as AnalysisFileInput, M as AnalysisImportEdge, N as AnalysisIr, O as AnalysisMode, P as AnalysisResult, Q as AnalysisViolation, S as AnalyzeArchitectureConvergenceInput, T as AnalyzeChangeInput, U as AnalyzePolicyDeltaInput, V as AnalyzeProjectInput, W as AnalyzeResolvedProjectInput, X as ArchitectureActualChange, Y as ArchitectureChangeMap, Z as ArchitectureChangeMapContract, _ as ArchitectureChangeMapDependency, $ as ArchitectureChangeMapFile, a0 as ArchitectureChangeOperation, a1 as ArchitectureConvergenceClassification, a2 as ArchitectureConvergenceFinding, a3 as ArchitectureConvergenceResult, a4 as ArchitectureDependency, a5 as ArchitectureEngineEdge, a6 as ArchitectureEngineResult, a7 as ArchitectureEngineViolation, a8 as ArkDesignDeltaResult, a9 as ArkEnforcementHost, aa as ArkEnforcementState, ac as ChangePreflightResult, ae as CollectAnalysisConfigWarningsInput, ai as DIAGNOSTIC_CATALOG, aj as DIAGNOSTIC_CATALOG_SCHEMA_VERSION, ak as DIAGNOSTIC_DOCS_RELATIVE_PATH, al as DIAGNOSTIC_RULE_IDS, an as DesignDeltaChange, ao as DesignDeltaEnforcementScope, ap as DesignDeltaIdentity, aq as DesignSmellEvidence, ar as DesignSmellFinding, as as DesignSmellId, at as DiagnosticCatalogEntry, au as DiagnosticCategory, av as EnforcementBoundaryState, aw as EnforcementEvidence, ax as EnforcementEvidenceField, ay as EnforcementVerification, az as EvaluateArchitectureGraphInput, aA as ForbiddenCapabilityUse, aD as POLICY_DELTA_SCHEMA_VERSION, aE as PolicyDelta, aF as PolicyDeltaAcknowledgement, aG as PolicyDeltaAnalysis, aH as PolicyDeltaClassification, aI as PolicyDeltaFinding, aJ as PreflightResolvedChangeInput, aK as PreparedChangeFile, aL as RESOLVED_CANDIDATE_FACTS_SCHEMA, aM as RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION, aN as ResolvedAmbientFact, aO as ResolvedAnalysisFile, aP as ResolvedAnalysisIr, aQ as ResolvedAnalysisResult, f as ResolvedArkRunCompositionRootHitFact, b as ResolvedArkRunDeclarationFact, c as ResolvedArkRunKernelCallFact, R as ResolvedArkRunKernelCallKind, d as ResolvedArkRunManagedNewFact, aR as ResolvedCandidateFacts, aS as ResolvedCandidateFactsInput, aT as ResolvedCapability, aU as ResolvedCapabilityFact, aV as ResolvedChangePreflightResult, e as ResolvedDependencyFact, aW as ResolvedDependencyKind, aX as ResolvedDependencyState, aY as ResolvedFactsCompleteness, g as ResolvedFactsReason, aZ as ResolvedFileFact, a_ as ResolvedIntentReferenceFact, a$ as ResolvedPublishFact, b0 as ResolvedSafetyFact, b1 as ResolvedSafetyKind, b2 as ResolvedSafetyReport, b3 as SemanticDependency, b4 as SemanticDependencyKind, b5 as analyzeArchitectureConvergence, b6 as analyzeChange, b7 as analyzePolicyDelta, b8 as analyzeProject, b9 as analyzeResolvedProject, bc as catalogFixForRuleId, bd as catalogWhyForRuleId, be as classifyArkPolicyDelta, bg as collectAnalysisConfigWarnings, bi as collectForbiddenCapabilityUses, bk as createAICodeGate, bl as createAdapterResult, bm as createArchitectureProfile, bn as createArchitectureProfileFromArkConfig, bo as createElevenLayerArkConfig, bp as createResolvedCandidateFacts, bs as detectArchitectureCycles, bt as deterministicHash, bu as diagnosticDocsFragment, bv as diagnosticDocsPath, bw as elevenLayerProfile, bx as evaluateArchitectureGraph, bA as explainViolation, bC as extractSemanticDependencies, bD as getDiagnosticCatalogEntry, bE as isCataloguedOrArkRuleFamily, bF as isKnownDiagnosticCode, bG as loadContract, bH as loadResolvedCandidateFacts, bI as policyDeltaAcknowledgementMatches, bJ as preflightChange, bK as preflightResolvedChange, bL as resolvedFactsEvidenceRequirementsHash, bM as serializeDiagnosticCatalog, bN as stableSerialize, bO as toAdapterDiagnostic, bP as version } from '../diagnosticCatalog-35mrwAHe.js';
2
- import { P as PolicyViolation, g as PolicySeverity, h as PolicyEnforcementMode, i as Policy, I as IntentName, j as IntentCreator, k as IntentRelationship, b as ArchitectureProfile, D as DomainEvent } from '../types-Ik_OakcI.js';
3
- export { A as ArchitectureLayer, a as ArchitectureLayerConfig, c as ArchitectureRule, d as ArkCheckConfig, l as CorrelationId, C as CreateArchitectureProfileFromArkConfigOptions, e as CreateArchitectureProfileOptions, f as CreateElevenLayerArkConfigOptions, E as EventMetadata, m as IntentRelationshipKind } from '../types-Ik_OakcI.js';
4
- import { I as IntentRegistry, D as DefineIntentOptions, a as DependencyGraph, G as GraphEdge, b as AuditStore, c as AuditRecord, d as AuditQuery, e as CreateAuditTrailOptions, f as AuditTrail, E as EventContractRegistry, g as EventContract, h as EventContractValidationResult, M as MetadataRegistry, R as ReadModelStore, i as CreateProjectionRegistryOptions, P as ProjectionRegistry, j as EventBufferStore, k as EventBufferRecord, l as EventBufferStatus, m as EventBusOptions, n as EventBus, o as CreateObservabilityReporterOptions, O as ObservabilityReporter, p as PolicyEngine, q as ArkManifest, W as WorkflowStore, S as SagaContext, r as WorkflowSnapshot, s as SagaDefinition, t as CreateWorkflowEngineOptions, u as SagaInstance, v as WorkflowEngine, w as DependencyInformationPackage, C as CreateArkKernelOptions, A as ArkKernel, x as ArkKernelConfig, y as CreateArkKernelFromConfigOptions, T as TraceRecordType, z as TraceRecord, B as OutboxStatus, F as OutboxRecord, H as ObservabilityDriftReport } from '../types-Bdj32QwA.js';
5
- export { J as ARK_RUN_COMPONENT_LIFETIMES, K as ARK_RUN_EPHEMERAL_DEFAULT, L as ARK_RUN_GRAPH_DEFAULT_SLICE, N as ARK_RUN_GRAPH_NODE_KINDS, Q as ARK_RUN_GRAPH_PROCESS_EDGE_KINDS, U as ARK_RUN_GRAPH_SCHEMA_VERSION, V as ARK_RUN_GRAPH_SLICES, X as ARK_RUN_GRAPH_TECHNICAL_EDGE_KINDS, Y as ARK_RUN_INFORMATION_PACKAGE_SCHEMA_VERSION, Z as ARK_RUN_INSPECTOR_DEFAULT_HOST, _ as ARK_RUN_INSPECTOR_DEFAULT_PORT, $ as ARK_RUN_INSPECTOR_EVENTS_PATH, a0 as ARK_RUN_INSPECTOR_GRAPH_PATH, a1 as ARK_RUN_INSPECTOR_MONITOR_SAMPLE_LIMIT, a2 as ARK_RUN_INSPECTOR_OUTBOX_PATH, a3 as ARK_RUN_INSPECTOR_SCHEMA_VERSION, a4 as ARK_RUN_INSPECTOR_SNAPSHOT_PATH, a5 as ARK_RUN_INSPECTOR_SSE_EVENT, a6 as ARK_RUN_INSPECTOR_TRANSPORT_FALLBACK, a7 as ARK_RUN_INSPECTOR_WORKFLOWS_PATH, a8 as ARK_RUN_TRANSPORT_KINDS, a9 as ArkManifestArchitecture, aa as ArkManifestData, ab as ArkManifestEntityLink, ac as ArkManifestGraph, ad as ArkManifestIntent, ae as ArkManifestPolicy, af as ArkManifestProjection, ag as ArkRunBrokerAdapter, ah as ArkRunComponentLifetime, ai as ArkRunDeliveredVia, aj as ArkRunExtendedInfo, ak as ArkRunGraph, al as ArkRunGraphEdge, am as ArkRunGraphEdgeKind, an as ArkRunGraphMatch, ao as ArkRunGraphMatchInput, ap as ArkRunGraphNode, aq as ArkRunGraphNodeKind, ar as ArkRunGraphProcessEdgeKind, as as ArkRunGraphQuery, at as ArkRunGraphResolvedQuery, au as ArkRunGraphSlice, av as ArkRunGraphTechnicalEdgeKind, aw as ArkRunInformationPackageComponent, ax as ArkRunInspectorBind, ay as ArkRunInspectorBindError, az as ArkRunInspectorBindInput, aA as ArkRunInspectorHandle, aB as ArkRunInspectorHardening, aC as ArkRunInspectorHardeningDurability, aD as ArkRunInspectorMonitorBuildOptions, aE as ArkRunInspectorOutboxMonitor, aF as ArkRunInspectorOutboxRecordSummary, aG as ArkRunInspectorProductionError, aH as ArkRunInspectorSnapshot, aI as ArkRunInspectorSnapshotInput, aJ as ArkRunInspectorSource, aK as ArkRunInspectorStoreDurability, aL as ArkRunInspectorStoreDurabilityKind, aM as ArkRunInspectorStoreRole, aN as ArkRunInspectorTransportFacts, aO as ArkRunInspectorWorkflowSummary, aP as ArkRunInspectorWorkflowsMonitor, aQ as ArkRunPublisher, aR as ArkRunRegisterOptions, aS as ArkRunRegistrationHandle, aT as ArkRunSendOptions, aU as ArkRunSendPlan, aV as ArkRunSendPlanInput, aW as ArkRunSendResult, aX as ArkRunTransportKind, aY as AuditRecordInput, aZ as AuditRecordType, a_ as EntityMeta, a$ as EventContractIssue, b0 as EventHandler, b1 as EventInterceptionInfo, b2 as EventInterceptor, b3 as EventInterceptorContext, b4 as EventPayloadPatch, b5 as EventPayloadSchema, b6 as EventPublisher, b7 as EventSchemaField, b8 as EventSchemaFieldType, b9 as FieldMeta, ba as GraphNode, bb as InvalidArkRunGraphQueryError, bc as InvalidArkRunSendOptionError, bd as ObservabilityFlow, be as ObservedLayerFlowMode, bf as OutboxStore, bg as PolicyEvaluationResult, bh as ProjectionCheckpoint, bi as ProjectionDefinition, bj as PublishedEventRecord, bk as RetryPolicy, bl as SagaStatus, bm as SagaStep, bn as StartArkRunInspectorOptions, bo as TraceSink, bp as Unsubscribe, bq as WorkflowDefinition, br as WorkflowStatus, bs as WorkflowStep, bt as appendDecisionTape, bu as arkRunGraphQueryFromSearchParams, bv as arkRunInspectorUrl, bw as buildArkRunInspectorHardening, bx as buildArkRunInspectorOutboxMonitor, by as buildArkRunInspectorSnapshot, bz as buildArkRunInspectorWorkflowsMonitor, bA as buildDependencyInformationPackage, bB as classifyArkRunInspectorStoreDurability, bC as closeArkRunGraphQuery, bD as closedArkRunEphemeral, bE as closedArkRunTransportKind, bF as formatArkRunGraphMermaid, bG as formatArkRunInspectorSseEvent, bH as isArkRunInspectorLoopbackHost, bI as isArkRunInspectorProductionEnv, bJ as requestArkRunGraph, bK as resolveArkRunInspectorBind, bL as resolveArkRunSendPlan, bM as startArkRunInspector, bN as unavailableArkRunInspectorOutboxMonitor, bO as unavailableArkRunInspectorWorkflowsMonitor } from '../types-Bdj32QwA.js';
6
- import '../configTypes-Bbf_MFGe.js';
1
+ import { a as AuditStore, b as AuditRecord, c as AuditQuery, d as CreateAuditTrailOptions, e as AuditTrail, f as CreateArchitectureProfileOptions, g as ArchitectureProfile, h as ArkCheckConfig, i as CreateArchitectureProfileFromArkConfigOptions, j as CreateElevenLayerArkConfigOptions, D as DependencyGraph, I as IntentRegistry, E as EventContractRegistry, k as EventContract, l as DomainEvent, m as EventContractValidationResult, n as IntentName, o as DefineIntentOptions, p as IntentCreator, M as MetadataRegistry, R as ReadModelStore, q as CreateProjectionRegistryOptions, P as ProjectionRegistry, r as PolicyViolation, s as PolicySeverity, t as PolicyEnforcementMode, u as Policy, G as GraphEdge, v as IntentRelationship, w as EventBufferStore, x as EventBufferRecord, y as EventBufferStatus, z as EventBusOptions, B as EventBus, F as CreateObservabilityReporterOptions, O as ObservabilityReporter, H as PolicyEngine, J as ArkManifest, W as WorkflowStore, S as SagaContext, K as WorkflowSnapshot, L as SagaDefinition, N as CreateWorkflowEngineOptions, Q as SagaInstance, T as WorkflowEngine, U as ArkConfig, V as ArkConfigLoadResult, X as DependencyInformationPackage, C as CreateArkKernelOptions, A as ArkKernel, Y as ArkKernelConfig, Z as CreateArkKernelFromConfigOptions, _ as TraceRecordType, $ as TraceRecord, a0 as OutboxStatus, a1 as OutboxRecord, a2 as ObservabilityDriftReport } from '../types-CnauMQQL.js';
2
+ export { a3 as ARK_RUN_COMPONENT_LIFETIMES, a4 as ARK_RUN_EPHEMERAL_DEFAULT, a5 as ARK_RUN_GRAPH_DEFAULT_SLICE, a6 as ARK_RUN_GRAPH_NODE_KINDS, a7 as ARK_RUN_GRAPH_PROCESS_EDGE_KINDS, a8 as ARK_RUN_GRAPH_SCHEMA_VERSION, a9 as ARK_RUN_GRAPH_SLICES, aa as ARK_RUN_GRAPH_TECHNICAL_EDGE_KINDS, ab as ARK_RUN_INFORMATION_PACKAGE_SCHEMA_VERSION, ac as ARK_RUN_INSPECTOR_DEFAULT_HOST, ad as ARK_RUN_INSPECTOR_DEFAULT_PORT, ae as ARK_RUN_INSPECTOR_EVENTS_PATH, af as ARK_RUN_INSPECTOR_GRAPH_PATH, ag as ARK_RUN_INSPECTOR_MONITOR_SAMPLE_LIMIT, ah as ARK_RUN_INSPECTOR_OUTBOX_PATH, ai as ARK_RUN_INSPECTOR_SCHEMA_VERSION, aj as ARK_RUN_INSPECTOR_SNAPSHOT_PATH, ak as ARK_RUN_INSPECTOR_SSE_EVENT, al as ARK_RUN_INSPECTOR_TRANSPORT_FALLBACK, am as ARK_RUN_INSPECTOR_WORKFLOWS_PATH, an as ARK_RUN_TRANSPORT_KINDS, ao as ArchitectureLayer, ap as ArchitectureLayerConfig, aq as ArchitectureRule, ar as ArkManifestArchitecture, as as ArkManifestData, at as ArkManifestEntityLink, au as ArkManifestGraph, av as ArkManifestIntent, aw as ArkManifestPolicy, ax as ArkManifestProjection, ay as ArkRunBrokerAdapter, az as ArkRunComponentLifetime, aA as ArkRunDeliveredVia, aB as ArkRunExtendedInfo, aC as ArkRunGraph, aD as ArkRunGraphEdge, aE as ArkRunGraphEdgeKind, aF as ArkRunGraphMatch, aG as ArkRunGraphMatchInput, aH as ArkRunGraphNode, aI as ArkRunGraphNodeKind, aJ as ArkRunGraphProcessEdgeKind, aK as ArkRunGraphQuery, aL as ArkRunGraphResolvedQuery, aM as ArkRunGraphSlice, aN as ArkRunGraphTechnicalEdgeKind, aO as ArkRunInformationPackageComponent, aP as ArkRunInspectorBind, aQ as ArkRunInspectorBindError, aR as ArkRunInspectorBindInput, aS as ArkRunInspectorHandle, aT as ArkRunInspectorHardening, aU as ArkRunInspectorHardeningDurability, aV as ArkRunInspectorMonitorBuildOptions, aW as ArkRunInspectorOutboxMonitor, aX as ArkRunInspectorOutboxRecordSummary, aY as ArkRunInspectorProductionError, aZ as ArkRunInspectorSnapshot, a_ as ArkRunInspectorSnapshotInput, a$ as ArkRunInspectorSource, b0 as ArkRunInspectorStoreDurability, b1 as ArkRunInspectorStoreDurabilityKind, b2 as ArkRunInspectorStoreRole, b3 as ArkRunInspectorTransportFacts, b4 as ArkRunInspectorWorkflowSummary, b5 as ArkRunInspectorWorkflowsMonitor, b6 as ArkRunPublisher, b7 as ArkRunRegisterOptions, b8 as ArkRunRegistrationHandle, b9 as ArkRunSendOptions, ba as ArkRunSendPlan, bb as ArkRunSendPlanInput, bc as ArkRunSendResult, bd as ArkRunTransportKind, be as AuditRecordInput, bf as AuditRecordType, bg as CorrelationId, bh as EntityMeta, bi as EventContractIssue, bj as EventHandler, bk as EventInterceptionInfo, bl as EventInterceptor, bm as EventInterceptorContext, bn as EventMetadata, bo as EventPayloadPatch, bp as EventPayloadSchema, bq as EventPublisher, br as EventSchemaField, bs as EventSchemaFieldType, bt as FieldMeta, bu as GraphNode, bv as IntentRelationshipKind, bw as InvalidArkRunGraphQueryError, bx as InvalidArkRunSendOptionError, by as ObservabilityFlow, bz as ObservedLayerFlowMode, bA as OutboxStore, bB as PolicyEvaluationResult, bC as ProjectionCheckpoint, bD as ProjectionDefinition, bE as PublishedEventRecord, bF as RetryPolicy, bG as SagaStatus, bH as SagaStep, bI as StartArkRunInspectorOptions, bJ as TraceSink, bK as Unsubscribe, bL as WorkflowDefinition, bM as WorkflowStatus, bN as WorkflowStep, bO as appendDecisionTape, bP as arkRunGraphQueryFromSearchParams, bQ as arkRunInspectorUrl, bR as buildArkRunInspectorHardening, bS as buildArkRunInspectorOutboxMonitor, bT as buildArkRunInspectorSnapshot, bU as buildArkRunInspectorWorkflowsMonitor, bV as buildDependencyInformationPackage, bW as classifyArkRunInspectorStoreDurability, bX as closeArkRunGraphQuery, bY as closedArkRunEphemeral, bZ as closedArkRunTransportKind, b_ as formatArkRunGraphMermaid, b$ as formatArkRunInspectorSseEvent, c0 as isArkRunInspectorLoopbackHost, c1 as isArkRunInspectorProductionEnv, c2 as requestArkRunGraph, c3 as resolveArkRunInspectorBind, c4 as resolveArkRunSendPlan, c5 as startArkRunInspector, c6 as unavailableArkRunInspectorOutboxMonitor, c7 as unavailableArkRunInspectorWorkflowsMonitor } from '../types-CnauMQQL.js';
7
3
 
8
4
  /**
9
- * Typed error thrown when hard policies are violated.
5
+ * Reference in-process audit store. **Not production durability** — records do not
6
+ * survive process restarts. For production, inject an `AuditStore` that writes to your
7
+ * durable log/DB (see `docs/production-hardening.md`).
10
8
  */
11
-
12
- declare class PolicyViolationError extends Error {
13
- readonly violations: PolicyViolation[];
14
- constructor(violations: PolicyViolation[]);
9
+ declare class InMemoryAuditStore implements AuditStore {
10
+ private readonly maxRecords?;
11
+ private readonly records;
12
+ constructor(maxRecords?: number | undefined);
13
+ append(record: AuditRecord): void;
14
+ query(query?: AuditQuery): AuditRecord[];
15
+ clear(): void;
15
16
  }
17
+ /**
18
+ * Create an audit trail. Defaults to `InMemoryAuditStore` (**not** production durability).
19
+ * Pass `options.store` for a durable backend.
20
+ */
21
+ declare function createAuditTrail(options?: CreateAuditTrailOptions): AuditTrail;
22
+
23
+ declare function createArchitectureProfile(options: CreateArchitectureProfileOptions): ArchitectureProfile;
24
+ declare function createArchitectureProfileFromArkConfig(config: ArkCheckConfig, options?: CreateArchitectureProfileFromArkConfigOptions): ArchitectureProfile;
25
+ declare const elevenLayerProfile: ArchitectureProfile;
26
+ declare function createElevenLayerArkConfig(options?: CreateElevenLayerArkConfigOptions): ArkCheckConfig;
16
27
 
17
28
  /**
18
- * definePolicy
29
+ * DependencyGraph implementation.
19
30
  *
20
- * Factory function to create architectural policies in a declarative way.
31
+ * Collects declared and observed relationships.
32
+ * Generates Mermaid diagrams and JSON.
33
+ * Supports simple violation detection via rule functions.
21
34
  */
22
35
 
23
- interface DefinePolicyOptions<Context = unknown> {
24
- name: string;
25
- severity?: PolicySeverity;
26
- tags?: readonly string[];
27
- owner?: string;
28
- version?: string;
29
- rationale?: string;
30
- enforcementMode?: PolicyEnforcementMode;
31
- deprecated?: boolean | string;
32
- replacedBy?: string;
33
- check: (context: Context) => boolean | PolicyViolation | PolicyViolation[];
36
+ declare function createDependencyGraph(): DependencyGraph;
37
+
38
+ /**
39
+ * Bridge IntentRegistry relationships into a DependencyGraph.
40
+ */
41
+
42
+ interface SyncRegistryOptions {
43
+ /** Skip edges whose target intent is not registered (default: false). */
44
+ requireRegisteredTargets?: boolean;
34
45
  }
35
46
  /**
36
- * Creates a Policy from a declarative configuration.
37
- *
38
- * The provided `check` function is called as-is. The PolicyEngine is responsible
39
- * for normalizing results (booleans, single violations, arrays) into a consistent
40
- * set of PolicyViolation objects.
47
+ * Sync declared intent relationships from a registry into a dependency graph.
41
48
  *
42
- * @example
43
- * ```ts
44
- * const noDomainToInfra = definePolicy({
45
- * name: 'Domain must not depend on infrastructure',
46
- * severity: 'hard',
47
- * check: (ctx) => {
48
- * const violations: PolicyViolation[] = [];
49
- * // ... logic using ctx.registry.getAllRelationships()
50
- * return violations.length > 0 ? violations : true;
51
- * }
52
- * });
53
- * ```
49
+ * - `dependsOn` → `declared` edges
50
+ * - `produces` → `produces` edges
54
51
  */
55
- declare function definePolicy<Context = unknown>(options: DefinePolicyOptions<Context>): Policy<Context>;
52
+ declare function syncRegistryToGraph(registry: IntentRegistry, graph: DependencyGraph, options?: SyncRegistryOptions): void;
53
+
54
+ declare class EventContractRegistryImpl implements EventContractRegistry {
55
+ private readonly contracts;
56
+ register(contract: EventContract): void;
57
+ get(intent: string, version?: string): EventContract | undefined;
58
+ list(intent?: string): EventContract[];
59
+ validate(event: DomainEvent): EventContractValidationResult;
60
+ clear(): void;
61
+ private key;
62
+ }
63
+ declare function createEventContractRegistry(): EventContractRegistry;
56
64
 
57
65
  /**
58
66
  * defineIntent
@@ -121,30 +129,71 @@ interface IntentNameValidation {
121
129
  declare function validateIntentName(name: string): IntentNameValidation;
122
130
 
123
131
  /**
124
- * DependencyGraph implementation.
125
- *
126
- * Collects declared and observed relationships.
127
- * Generates Mermaid diagrams and JSON.
128
- * Supports simple violation detection via rule functions.
132
+ * Basic MetadataRegistry implementation.
129
133
  */
130
134
 
131
- declare function createDependencyGraph(): DependencyGraph;
135
+ declare function createMetadataRegistry(): MetadataRegistry;
132
136
 
133
137
  /**
134
- * Bridge IntentRegistry relationships into a DependencyGraph.
138
+ * Reference in-process read-model store. **Not production durability.**
139
+ * See `docs/production-hardening.md`.
140
+ */
141
+ declare class InMemoryReadModelStore implements ReadModelStore {
142
+ private readonly states;
143
+ load<State = unknown>(name: string): State | undefined;
144
+ save<State = unknown>(name: string, state: State): void;
145
+ clear(name?: string): void;
146
+ }
147
+ declare function createProjectionRegistry(options?: CreateProjectionRegistryOptions): ProjectionRegistry;
148
+
149
+ /**
150
+ * Typed error thrown when hard policies are violated.
135
151
  */
136
152
 
137
- interface SyncRegistryOptions {
138
- /** Skip edges whose target intent is not registered (default: false). */
139
- requireRegisteredTargets?: boolean;
153
+ declare class PolicyViolationError extends Error {
154
+ readonly violations: PolicyViolation[];
155
+ constructor(violations: PolicyViolation[]);
140
156
  }
157
+
141
158
  /**
142
- * Sync declared intent relationships from a registry into a dependency graph.
159
+ * definePolicy
143
160
  *
144
- * - `dependsOn` → `declared` edges
145
- * - `produces` → `produces` edges
161
+ * Factory function to create architectural policies in a declarative way.
146
162
  */
147
- declare function syncRegistryToGraph(registry: IntentRegistry, graph: DependencyGraph, options?: SyncRegistryOptions): void;
163
+
164
+ interface DefinePolicyOptions<Context = unknown> {
165
+ name: string;
166
+ severity?: PolicySeverity;
167
+ tags?: readonly string[];
168
+ owner?: string;
169
+ version?: string;
170
+ rationale?: string;
171
+ enforcementMode?: PolicyEnforcementMode;
172
+ deprecated?: boolean | string;
173
+ replacedBy?: string;
174
+ check: (context: Context) => boolean | PolicyViolation | PolicyViolation[];
175
+ }
176
+ /**
177
+ * Creates a Policy from a declarative configuration.
178
+ *
179
+ * The provided `check` function is called as-is. The PolicyEngine is responsible
180
+ * for normalizing results (booleans, single violations, arrays) into a consistent
181
+ * set of PolicyViolation objects.
182
+ *
183
+ * @example
184
+ * ```ts
185
+ * const noDomainToInfra = definePolicy({
186
+ * name: 'Domain must not depend on infrastructure',
187
+ * severity: 'hard',
188
+ * check: (ctx) => {
189
+ * const violations: PolicyViolation[] = [];
190
+ * // ... logic using ctx.registry.getAllRelationships()
191
+ * return violations.length > 0 ? violations : true;
192
+ * }
193
+ * });
194
+ * ```
195
+ */
196
+ declare function definePolicy<Context = unknown>(options: DefinePolicyOptions<Context>): Policy<Context>;
148
197
 
149
198
  /**
150
199
  * Built-in architectural policy helpers.
@@ -196,68 +245,55 @@ declare function defineArchitectureProfilePolicy<Context extends {
196
245
  relationships?: IntentRelationship[];
197
246
  }>(profile: ArchitectureProfile, options?: Omit<LayerPolicyOptions, 'rules' | 'resolveLayer'>): Policy<Context>;
198
247
 
199
- /**
200
- * Reference in-process audit store. **Not production durability** — records do not
201
- * survive process restarts. For production, inject an `AuditStore` that writes to your
202
- * durable log/DB (see `docs/production-hardening.md`).
203
- */
204
- declare class InMemoryAuditStore implements AuditStore {
205
- private readonly maxRecords?;
206
- private readonly records;
207
- constructor(maxRecords?: number | undefined);
208
- append(record: AuditRecord): void;
209
- query(query?: AuditQuery): AuditRecord[];
210
- clear(): void;
211
- }
212
- /**
213
- * Create an audit trail. Defaults to `InMemoryAuditStore` (**not** production durability).
214
- * Pass `options.store` for a durable backend.
215
- */
216
- declare function createAuditTrail(options?: CreateAuditTrailOptions): AuditTrail;
217
-
218
- declare class EventContractRegistryImpl implements EventContractRegistry {
219
- private readonly contracts;
220
- register(contract: EventContract): void;
221
- get(intent: string, version?: string): EventContract | undefined;
222
- list(intent?: string): EventContract[];
223
- validate(event: DomainEvent): EventContractValidationResult;
224
- clear(): void;
225
- private key;
226
- }
227
- declare function createEventContractRegistry(): EventContractRegistry;
228
-
229
- /**
230
- * Basic MetadataRegistry implementation.
231
- */
232
-
233
- declare function createMetadataRegistry(): MetadataRegistry;
234
-
235
- /**
236
- * Reference in-process read-model store. **Not production durability.**
237
- * See `docs/production-hardening.md`.
238
- */
239
- declare class InMemoryReadModelStore implements ReadModelStore {
240
- private readonly states;
241
- load<State = unknown>(name: string): State | undefined;
242
- save<State = unknown>(name: string, state: State): void;
243
- clear(name?: string): void;
248
+ interface InMemoryEventBufferOptions {
249
+ /**
250
+ * Maximum records retained. When exceeded, the oldest settled record
251
+ * (`dispatched` / `failed`) is evicted first; only when every record is still
252
+ * `pending` is the oldest pending record evicted, and `evictedPending` counts
253
+ * it so the loss is visible. A record evicted while still in flight that is
254
+ * settled afterwards (`markDispatched` / `markFailed`) was delivered, not lost,
255
+ * so it leaves the count. Default: unbounded (`Infinity`). Kernels built by
256
+ * `createArkKernel` pass `maxHistorySize` (default 1000).
257
+ */
258
+ maxRecords?: number;
244
259
  }
245
- declare function createProjectionRegistry(options?: CreateProjectionRegistryOptions): ProjectionRegistry;
246
-
247
260
  /**
248
261
  * Reference in-process event buffer. **Not production durability** — state is lost on
249
262
  * process exit. Use only for tests/demos/local single-process work; inject a durable
250
- * This is not an atomic outbox (see `docs/production-hardening.md`).
263
+ * store for production. This is not an atomic outbox (see `docs/production-hardening.md`).
251
264
  */
252
265
  declare class InMemoryEventBuffer implements EventBufferStore {
253
266
  private readonly records;
267
+ private readonly maxRecords;
268
+ /**
269
+ * Ids evicted while `pending`, oldest first. A later settle removes the id (the
270
+ * record was in flight, not lost). Bounded to {@link EVICTED_PENDING_TRACK_LIMIT}
271
+ * ids so the tracker itself cannot grow without limit; ids that fall off stay counted.
272
+ */
273
+ private readonly evictedPendingIds;
274
+ private evictedPendingCount;
275
+ constructor(options?: InMemoryEventBufferOptions);
276
+ /**
277
+ * Pending records dropped because the cap was reached with nothing settled to
278
+ * evict, and never settled afterwards. Records still in flight when evicted
279
+ * (e.g. fire-and-forget local handlers) leave the count once the kernel
280
+ * settles them.
281
+ */
282
+ get evictedPending(): number;
283
+ private trackEvictedPending;
284
+ /** A settle for an evicted in-flight record: delivered, so not a loss. */
285
+ private settleEvicted;
286
+ private evictOverflow;
254
287
  enqueue(event: DomainEvent): Promise<EventBufferRecord>;
255
288
  markDispatched(id: string): Promise<void>;
256
289
  markFailed(id: string, error: unknown): Promise<void>;
257
290
  list(status?: EventBufferStatus): Promise<EventBufferRecord[]>;
258
291
  clear(): Promise<void>;
259
292
  }
260
- /** @deprecated Use InMemoryEventBuffer. */
293
+ /**
294
+ * @deprecated Use InMemoryEventBuffer.
295
+ * @alias Kept as a public alias of `arkgate/runtime` until its removal.
296
+ */
261
297
  declare const InMemoryOutboxStore: typeof InMemoryEventBuffer;
262
298
 
263
299
  /**
@@ -349,6 +385,20 @@ declare class ObservedLayerFlowViolationError extends Error {
349
385
  readonly toLayer: string;
350
386
  constructor(source: string, intentName: string, fromLayer: string, toLayer: string, message?: string);
351
387
  }
388
+ /**
389
+ * A kernel built from an `ark.config.json` was explicitly asked for hard
390
+ * observed-layer-flow enforcement (`enforceObservedLayerFlow: 'hard'`), but some
391
+ * deny-rule layers declare no `intentPrefixes` and are not canonical 11-layer
392
+ * names (which get built-in prefixes), so no intent maps to them and the rule
393
+ * would be a silent no-op. With the strict default (hard implied, not passed),
394
+ * the kernel builds and records a `layer.observedFlowUnresolvable` audit record
395
+ * instead. Fix: add `intentPrefixes`, or pass `'soft' | 'off'`.
396
+ */
397
+ declare class ArkKernelConfigError extends Error {
398
+ readonly code: 'ARKRUN_LAYER_FLOW_UNRESOLVABLE';
399
+ readonly layers: string[];
400
+ constructor(layers: string[]);
401
+ }
352
402
 
353
403
  declare function createObservabilityReporter(options: CreateObservabilityReporterOptions): ObservabilityReporter;
354
404
 
@@ -396,42 +446,2600 @@ declare function createSaga<P extends SagaContext = SagaContext>(def: SagaDefini
396
446
  id?: string;
397
447
  }): SagaInstance<P>;
398
448
 
449
+ /** ArkGate library version — single source of truth. */
450
+ declare const version = "4.8.25";
451
+
452
+ /** Versioned public result contract types + JSON Schema (adapter envelope). */
399
453
  /**
400
- * In-memory shadow / replay / compare for ArkRun information packages (XP07 / ADR 0033).
401
- * Not durable. Not a second bus. Stripped snapshots only.
454
+ * 1.5 adds stable finding refs on every factory-emitted diagnostic (ACS06):
455
+ * `findingRef`, `targetKey` (baseline-compatible), `docsCodePath`.
456
+ * 1.4 added optional evidence.arkruleId + evidence.arkruleSource (ADR 0012 / AR03).
402
457
  */
403
-
404
- type InformationPackageDiff = {
405
- readonly path: string;
406
- readonly left: unknown;
407
- readonly right: unknown;
458
+ declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.5";
459
+ type AdapterSeverity = 'error' | 'warning';
460
+ type AnalysisCompleteness = 'complete' | 'partial' | 'unavailable';
461
+ type AnalysisMode = 'lexical-compatibility' | 'resolved-candidate-facts';
462
+ type AdapterCompletenessReason = {
463
+ code: string;
464
+ message: string;
465
+ file?: string;
408
466
  };
409
- type InformationPackageCompare = {
410
- readonly equal: boolean;
411
- readonly diffs: readonly InformationPackageDiff[];
467
+ type AdapterViolationInput = {
468
+ ruleId?: unknown;
469
+ code?: unknown;
470
+ message?: unknown;
471
+ file?: unknown;
472
+ line?: unknown;
473
+ column?: unknown;
474
+ target?: unknown;
475
+ fromLayer?: unknown;
476
+ toLayer?: unknown;
477
+ typeOnly?: unknown;
478
+ targetTypeOnlyExports?: unknown;
479
+ sourcePureTypeModule?: unknown;
480
+ namedBindingsTypeOnly?: unknown;
481
+ portProofEligible?: unknown;
482
+ peerIsolation?: unknown;
483
+ edgeKind?: unknown;
484
+ severity?: unknown;
485
+ /** When false, finding is non-blocking (e.g. type-only placement debt). */
486
+ failsStrict?: unknown;
487
+ /** Nested-wall reason. The ruleId stays LAYER_IMPORT_VIOLATION. Not part of the baseline key. */
488
+ reasonId?: unknown;
489
+ /** Last segment of the importer universe id, when the finding has a reasonId. */
490
+ universeFrom?: unknown;
491
+ /** Last segment of the importee universe id, when the finding has a reasonId. */
492
+ universeTo?: unknown;
493
+ nextAction?: unknown;
494
+ /** U04: the denied capability id on CAPABILITY_VIOLATION. */
495
+ capability?: unknown;
496
+ /** AR03: ArkRule identity for structure/invariant diagnostics. */
497
+ arkruleId?: unknown;
498
+ /** AR03: project-relative ArkRules source file that declared the rule. */
499
+ arkruleSource?: unknown;
500
+ };
501
+ type AdapterDiagnostic = {
502
+ ruleId: string;
503
+ severity: AdapterSeverity;
504
+ message: string;
505
+ location: {
506
+ file: string;
507
+ line: number;
508
+ column: number;
509
+ };
510
+ evidence: {
511
+ target?: string;
512
+ fromLayer?: string;
513
+ toLayer?: string;
514
+ typeOnly?: boolean;
515
+ targetTypeOnlyExports?: boolean;
516
+ sourcePureTypeModule?: boolean;
517
+ namedBindingsTypeOnly?: boolean;
518
+ portProofEligible?: boolean;
519
+ peerIsolation?: boolean;
520
+ capability?: string;
521
+ edgeKind?: string;
522
+ /** AR03 — ArkRule id (structure or invariant). */
523
+ arkruleId?: string;
524
+ /** AR03 — ArkRules source file path. */
525
+ arkruleSource?: string;
526
+ /** Nested-wall reason. Not part of the baseline key. */
527
+ reasonId?: 'CROSS_PARENT_SLICE' | 'CROSS_SIBLING_SLICE' | 'CROSS_PARENT_VIA_SHARED';
528
+ /** Last segment of the importer universe id, with a reasonId. */
529
+ universeFrom?: string;
530
+ /** Last segment of the importee universe id, with a reasonId. */
531
+ universeTo?: string;
532
+ };
533
+ /** Added in schema 1.1; optional in TypeScript so 1.0 consumer-owned values remain valid. */
534
+ nextAction?: string;
535
+ /**
536
+ * ACS06 / schema 1.5 — compact stable id for multi-turn re-address
537
+ * (`fnv1a-` + hex). Always derived from `targetKey`. Optional so 1.0–1.4
538
+ * consumer-owned diagnostics remain assignable.
539
+ */
540
+ findingRef?: string;
541
+ /**
542
+ * ACS06 / schema 1.5 — baseline-compatible freeze identity
543
+ * (`ruleId|file|fromLayer|toLayer|target`, with occurrence `#N` suffixes in lists).
544
+ * Must match `baselineKey` / `baselineOccurrenceKeys` so refs never orphan baselines.
545
+ */
546
+ targetKey?: string;
547
+ /**
548
+ * ACS06 / schema 1.5 — package-relative docs path with rule anchor
549
+ * (`docs/diagnostics.md#RULE_ID`). Optional for legacy consumer-owned values.
550
+ */
551
+ docsCodePath?: string;
552
+ };
553
+ type LegacyAdapterResult = {
554
+ schemaVersion: '1.0' | '1.1';
555
+ valid: boolean;
556
+ diagnostics: AdapterDiagnostic[];
557
+ completeness?: never;
558
+ mode?: never;
559
+ };
560
+ type Version12AdapterResultBase = {
561
+ schemaVersion: '1.2';
562
+ diagnostics: AdapterDiagnostic[];
563
+ mode?: never;
564
+ };
565
+ type Version12AdapterResult = (Version12AdapterResultBase & {
566
+ completeness: 'complete';
567
+ valid: boolean;
568
+ }) | (Version12AdapterResultBase & {
569
+ completeness: 'partial' | 'unavailable';
570
+ valid: false;
571
+ });
572
+ type CurrentAdapterResultBase = {
573
+ schemaVersion: typeof ARK_ANALYSIS_RESULT_SCHEMA_VERSION;
574
+ completenessReasons: AdapterCompletenessReason[];
575
+ diagnostics: AdapterDiagnostic[];
576
+ };
577
+ type ResolvedAdapterEvidence = {
578
+ policyHash: string;
579
+ resolverIdentity: string;
580
+ factsHash: string;
581
+ candidateTreeHash: string;
582
+ };
583
+ type CurrentAdapterResult = (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
584
+ mode: 'lexical-compatibility';
585
+ valid: boolean;
586
+ completeness: 'complete';
587
+ }) | (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
588
+ mode: 'lexical-compatibility';
589
+ valid: false;
590
+ completeness: 'partial' | 'unavailable';
591
+ }) | (CurrentAdapterResultBase & ResolvedAdapterEvidence & {
592
+ mode: 'resolved-candidate-facts';
593
+ valid: boolean;
594
+ completeness: 'complete';
595
+ }) | (CurrentAdapterResultBase & ResolvedAdapterEvidence & {
596
+ mode: 'resolved-candidate-facts';
597
+ valid: false;
598
+ completeness: 'partial';
599
+ }) | (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
600
+ mode: 'resolved-candidate-facts';
601
+ valid: false;
602
+ completeness: 'unavailable';
603
+ });
604
+ type AdapterResult = LegacyAdapterResult | Version12AdapterResult | CurrentAdapterResult;
605
+ declare const ARK_ANALYSIS_RESULT_SCHEMA: {
606
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
607
+ readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.analysis-result.schema.json";
608
+ readonly title: "ArkGate analysis result";
609
+ readonly type: "object";
610
+ readonly additionalProperties: false;
611
+ readonly required: readonly ["schemaVersion", "mode", "valid", "completeness", "completenessReasons", "diagnostics"];
612
+ readonly allOf: readonly [{
613
+ readonly if: {
614
+ readonly properties: {
615
+ readonly completeness: {
616
+ readonly enum: readonly ["partial", "unavailable"];
617
+ };
618
+ };
619
+ readonly required: readonly ["completeness"];
620
+ };
621
+ readonly then: {
622
+ readonly properties: {
623
+ readonly valid: {
624
+ readonly const: false;
625
+ };
626
+ };
627
+ };
628
+ }, {
629
+ readonly if: {
630
+ readonly properties: {
631
+ readonly mode: {
632
+ readonly const: "resolved-candidate-facts";
633
+ };
634
+ readonly completeness: {
635
+ readonly enum: readonly ["complete", "partial"];
636
+ };
637
+ };
638
+ readonly required: readonly ["mode", "completeness"];
639
+ };
640
+ readonly then: {
641
+ readonly required: readonly ["policyHash", "resolverIdentity", "factsHash", "candidateTreeHash"];
642
+ };
643
+ }, {
644
+ readonly if: {
645
+ readonly properties: {
646
+ readonly completeness: {
647
+ readonly const: "complete";
648
+ };
649
+ };
650
+ readonly required: readonly ["completeness"];
651
+ };
652
+ readonly then: {
653
+ readonly properties: {
654
+ readonly completenessReasons: {
655
+ readonly maxItems: 0;
656
+ };
657
+ };
658
+ };
659
+ readonly else: {
660
+ readonly properties: {
661
+ readonly completenessReasons: {
662
+ readonly minItems: 1;
663
+ };
664
+ };
665
+ };
666
+ }];
667
+ readonly properties: {
668
+ readonly schemaVersion: {
669
+ readonly const: "1.5";
670
+ };
671
+ readonly mode: {
672
+ readonly enum: readonly ["lexical-compatibility", "resolved-candidate-facts"];
673
+ };
674
+ readonly valid: {
675
+ readonly type: "boolean";
676
+ };
677
+ readonly completeness: {
678
+ readonly enum: readonly ["complete", "partial", "unavailable"];
679
+ };
680
+ readonly completenessReasons: {
681
+ readonly type: "array";
682
+ readonly items: {
683
+ readonly type: "object";
684
+ readonly additionalProperties: false;
685
+ readonly required: readonly ["code", "message"];
686
+ readonly properties: {
687
+ readonly code: {
688
+ readonly type: "string";
689
+ readonly minLength: 1;
690
+ };
691
+ readonly message: {
692
+ readonly type: "string";
693
+ readonly minLength: 1;
694
+ };
695
+ readonly file: {
696
+ readonly type: "string";
697
+ readonly minLength: 1;
698
+ };
699
+ };
700
+ };
701
+ };
702
+ readonly policyHash: {
703
+ readonly type: "string";
704
+ readonly minLength: 1;
705
+ };
706
+ readonly resolverIdentity: {
707
+ readonly type: "string";
708
+ readonly minLength: 1;
709
+ };
710
+ readonly factsHash: {
711
+ readonly type: "string";
712
+ readonly minLength: 1;
713
+ };
714
+ readonly candidateTreeHash: {
715
+ readonly type: "string";
716
+ readonly minLength: 1;
717
+ };
718
+ readonly diagnostics: {
719
+ readonly type: "array";
720
+ readonly items: {
721
+ readonly type: "object";
722
+ readonly additionalProperties: false;
723
+ readonly required: readonly ["ruleId", "severity", "message", "location", "evidence"];
724
+ readonly properties: {
725
+ readonly ruleId: {
726
+ readonly type: "string";
727
+ readonly minLength: 1;
728
+ };
729
+ readonly severity: {
730
+ readonly enum: readonly ["error", "warning"];
731
+ };
732
+ readonly message: {
733
+ readonly type: "string";
734
+ readonly minLength: 1;
735
+ };
736
+ readonly location: {
737
+ readonly type: "object";
738
+ readonly additionalProperties: false;
739
+ readonly required: readonly ["file", "line", "column"];
740
+ readonly properties: {
741
+ readonly file: {
742
+ readonly type: "string";
743
+ readonly minLength: 1;
744
+ };
745
+ readonly line: {
746
+ readonly type: "integer";
747
+ readonly minimum: 1;
748
+ };
749
+ readonly column: {
750
+ readonly type: "integer";
751
+ readonly minimum: 1;
752
+ };
753
+ };
754
+ };
755
+ readonly evidence: {
756
+ readonly type: "object";
757
+ readonly additionalProperties: false;
758
+ readonly properties: {
759
+ readonly target: {
760
+ readonly type: "string";
761
+ };
762
+ readonly fromLayer: {
763
+ readonly type: "string";
764
+ };
765
+ readonly toLayer: {
766
+ readonly type: "string";
767
+ };
768
+ readonly typeOnly: {
769
+ readonly type: "boolean";
770
+ };
771
+ readonly targetTypeOnlyExports: {
772
+ readonly type: "boolean";
773
+ };
774
+ readonly sourcePureTypeModule: {
775
+ readonly type: "boolean";
776
+ };
777
+ readonly namedBindingsTypeOnly: {
778
+ readonly type: "boolean";
779
+ };
780
+ readonly portProofEligible: {
781
+ readonly type: "boolean";
782
+ };
783
+ readonly peerIsolation: {
784
+ readonly type: "boolean";
785
+ };
786
+ readonly capability: {
787
+ readonly type: "string";
788
+ readonly minLength: 1;
789
+ };
790
+ readonly edgeKind: {
791
+ readonly type: "string";
792
+ readonly minLength: 1;
793
+ };
794
+ readonly arkruleId: {
795
+ readonly type: "string";
796
+ readonly minLength: 1;
797
+ };
798
+ readonly arkruleSource: {
799
+ readonly type: "string";
800
+ readonly minLength: 1;
801
+ };
802
+ readonly reasonId: {
803
+ readonly enum: readonly ["CROSS_PARENT_SLICE", "CROSS_SIBLING_SLICE", "CROSS_PARENT_VIA_SHARED"];
804
+ };
805
+ readonly universeFrom: {
806
+ readonly type: "string";
807
+ readonly minLength: 1;
808
+ };
809
+ readonly universeTo: {
810
+ readonly type: "string";
811
+ readonly minLength: 1;
812
+ };
813
+ };
814
+ };
815
+ readonly nextAction: {
816
+ readonly type: "string";
817
+ readonly minLength: 1;
818
+ };
819
+ /** ACS06 — compact multi-turn id; always derived from targetKey when emitted. */
820
+ readonly findingRef: {
821
+ readonly type: "string";
822
+ readonly minLength: 1;
823
+ readonly pattern: "^fnv1a-[0-9a-f]{8}$";
824
+ };
825
+ /**
826
+ * ACS06 — baseline-compatible freeze identity
827
+ * (`ruleId|file|from|to|target` with optional `#N` occurrence suffix).
828
+ */
829
+ readonly targetKey: {
830
+ readonly type: "string";
831
+ readonly minLength: 1;
832
+ };
833
+ /** ACS06 — package-relative diagnostics anchor path. */
834
+ readonly docsCodePath: {
835
+ readonly type: "string";
836
+ readonly minLength: 1;
837
+ };
838
+ };
839
+ };
840
+ };
841
+ };
412
842
  };
413
- /** Shadow: identity snapshot. The live kernel is not copied. */
414
- declare function shadowInformationPackage(pack: DependencyInformationPackage): DependencyInformationPackage;
415
- declare function compareInformationPackages(left: DependencyInformationPackage, right: DependencyInformationPackage): InformationPackageCompare;
416
- /**
417
- * Replay: apply sequential snapshots as the "tape". Each step is compared to
418
- * the previous shadow. No bus, no store, no time travel across processes.
419
- */
420
- declare function replayInformationPackages(tape: readonly DependencyInformationPackage[]): InformationPackageCompare[];
421
843
 
844
+ declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity,
422
845
  /**
423
- * Default cap for in-memory history, trace, and audit records. Without a cap a
424
- * long-running process grows without bound on every publish. Pass
425
- * `maxHistorySize: Infinity` to explicitly opt back into unbounded retention.
846
+ * Optional precomputed baseline-compatible targetKey (e.g. occurrence-aware from
847
+ * `adapterFindingOccurrenceTargetKeys`). When omitted, uses the first-occurrence key.
426
848
  */
427
- declare const DEFAULT_MAX_HISTORY_SIZE = 1000;
428
- declare function createArkKernel(options?: CreateArkKernelOptions): ArkKernel;
849
+ targetKeyOverride?: string): AdapterDiagnostic;
850
+ declare function createAdapterResult(input: {
851
+ valid: boolean;
852
+ completeness?: AnalysisCompleteness;
853
+ mode?: AnalysisMode;
854
+ policyHash?: unknown;
855
+ resolverIdentity?: unknown;
856
+ factsHash?: unknown;
857
+ candidateTreeHash?: unknown;
858
+ completenessReasons?: readonly AdapterCompletenessReason[];
859
+ violations?: readonly AdapterViolationInput[];
860
+ warnings?: readonly AdapterViolationInput[];
861
+ }): CurrentAdapterResult;
862
+
429
863
  /**
430
- * Preferred ArkRun factory. Each call is a new isolated instance — there is no
431
- * process-wide singleton.
864
+ * AI Code Gate (basic).
865
+ *
866
+ * Allows validation of generated source code against the defined architecture.
867
+ */
868
+ interface AICodeGateViolation {
869
+ /** Stable rule identifier for agents and CI pipelines. */
870
+ ruleId: string;
871
+ /** @deprecated Use ruleId — kept for backward compatibility. */
872
+ code: string;
873
+ message: string;
874
+ line?: number;
875
+ suggestion?: string;
876
+ source?: string;
877
+ filePath?: string;
878
+ target?: string;
879
+ fromLayer?: string;
880
+ toLayer?: string;
881
+ /** Nested-wall reason. Absent on a classic layer deny and on a child-only parent import. */
882
+ reasonId?: string;
883
+ /** Last segment of the importer universe id, with a reasonId. */
884
+ universeFrom?: string;
885
+ /** Last segment of the importee universe id, with a reasonId. */
886
+ universeTo?: string;
887
+ /** True when a peerIsolation rule produced this finding (also mirrored in details). */
888
+ peerIsolation?: boolean;
889
+ /** False for an advisory sibling crossing. Omitted findings still block the snippet. */
890
+ failsStrict?: boolean;
891
+ details?: unknown;
892
+ }
893
+ /** Extension point for external analyzers (AST, semantic, etc.). */
894
+ interface AIGateExtension<Context = unknown> {
895
+ readonly name: string;
896
+ analyze(source: string, context?: Context): AICodeGateViolation[];
897
+ }
898
+ interface AICodeGateContext {
899
+ filePath?: string;
900
+ agentId?: string;
901
+ layer?: string;
902
+ [key: string]: unknown;
903
+ }
904
+ interface AICodeGateResult {
905
+ /** Single-source snippets do not carry project-wide resolver evidence. */
906
+ mode: 'lexical-compatibility';
907
+ /** A snippet result is intentionally never an authoritative complete verdict. */
908
+ completeness: 'partial';
909
+ completenessReasons: string[];
910
+ /** Authoritative verdict. Always false until the complete candidate is resolved. */
911
+ valid: boolean;
912
+ /** Compatibility signal for the bounded lexical checks performed here. */
913
+ lexicalValid: boolean;
914
+ violations: AICodeGateViolation[];
915
+ }
916
+ interface AICodeGate<Context = AICodeGateContext> {
917
+ validate(source: string, context?: Context): AICodeGateResult;
918
+ }
919
+
920
+ /**
921
+ * Basic AI Code Gate implementation.
922
+ *
923
+ * Uses simple string heuristics + registered intent names to detect obvious
924
+ * architectural violations in generated code (e.g. direct infra imports from domain).
925
+ * Not a full static analyzer — documented limitation.
926
+ */
927
+
928
+ interface AICodeGatePolicyContext<Context = AICodeGateContext> {
929
+ source: string;
930
+ context?: Context;
931
+ }
932
+ interface AICodeGateOptions<Context = AICodeGateContext> {
933
+ policies?: Policy<AICodeGatePolicyContext<Context>>[];
934
+ intents?: Array<string | Pick<IntentCreator<IntentName, unknown>, 'name'>>;
935
+ /**
936
+ * Additional forbidden patterns (regex or strings).
937
+ */
938
+ forbiddenPatterns?: Array<string | RegExp>;
939
+ /**
940
+ * External analyzer extensions (type-only contract; plug in AST tools later).
941
+ */
942
+ extensions?: AIGateExtension<Context>[];
943
+ /**
944
+ * Optional architecture profile for layer-aware generated-code checks.
945
+ * When context.layer is provided, intent references are checked against it.
946
+ */
947
+ architectureProfile?: ArchitectureProfile;
948
+ /**
949
+ * When true, flag string literals that look like intent names but are not registered.
950
+ */
951
+ enforceIntentAllowlist?: boolean;
952
+ /**
953
+ * Optional TypeScript module object. When provided, AICodeGate adds AST-backed checks
954
+ * for publish misuse without taking a runtime dependency on TypeScript.
955
+ */
956
+ typescript?: unknown;
957
+ /**
958
+ * Ambient globals forbidden per layer (layer name → entries such as "fetch" or
959
+ * "Date.now"). Checked only when `typescript` is provided and context.layer resolves
960
+ * to a listed layer — mirrors ark-check's FORBIDDEN_GLOBAL rule.
961
+ */
962
+ forbiddenGlobals?: Record<string, string[]>;
963
+ /**
964
+ * Layer → effective capability deny set (U04 walls; ADR 0009). Enforced like
965
+ * forbiddenGlobals when the target file's layer is known. An ambient use
966
+ * already covered by the layer's forbiddenGlobals reports only
967
+ * FORBIDDEN_GLOBAL (D7 — one violation, one voice).
968
+ */
969
+ capabilityWalls?: Record<string, string[]>;
970
+ /**
971
+ * Layer names whose role is infrastructure and may therefore import infrastructure
972
+ * (a persistence adapter importing the DB is correct, not a violation). The built-in
973
+ * infra-import heuristics are suppressed for these layers and for any layer whose
974
+ * name matches the conventional infra tokens. Populate from ark.config.json layers
975
+ * flagged `mayImportInfrastructure: true`, so unconventionally-named infra layers
976
+ * opt in explicitly. User-supplied `forbiddenPatterns` still apply everywhere.
977
+ */
978
+ infrastructureLayers?: string[];
979
+ /**
980
+ * Preferred single resolve step: import specifier or absolute source file →
981
+ * `{ layer, relPath }` for contract + peerIsolation. Prefer this over the
982
+ * legacy layer-only callback.
983
+ */
984
+ resolveImportTarget?: (specifierOrFilePath: string, fromFilePath?: string) => {
985
+ layer?: string;
986
+ relPath?: string;
987
+ } | undefined;
988
+ /**
989
+ * @deprecated Prefer resolveImportTarget. Layer-only resolve for governed imports.
990
+ */
991
+ resolveImportLayer?: (specifier: string, fromFilePath?: string) => string | undefined;
992
+ /**
993
+ * Layer configs (patterns) used to infer sliceFolders when a peerIsolation rule
994
+ * omits an explicit list.
995
+ */
996
+ architectureLayers?: Array<{
997
+ name: string;
998
+ patterns?: string[];
999
+ }>;
1000
+ /** Explicit file-level escape hatch for reviewed non-literal import()/require() calls. */
1001
+ allowNonLiteralDynamicImport?: (filePath?: string) => boolean;
1002
+ }
1003
+ declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
1004
+
1005
+ /**
1006
+ * Portable identity/fingerprint primitives for pure Domain contracts.
1007
+ *
1008
+ * FNV-1a is intentional: no Node crypto dependency for CLI/MCP/browserless consumers.
1009
+ */
1010
+ /** Stable FNV-1a hash. Identity/fingerprint only — not a security primitive. */
1011
+ declare function deterministicHash(value: string): string;
1012
+ /** Serialize JSON-like values with sorted object keys for reproducible hashes. */
1013
+ declare function stableSerialize(value: unknown): string;
1014
+
1015
+ /**
1016
+ * ArkOrder resolver-fact extraction (ADR 0029). Syntax only — no verdicts.
1017
+ */
1018
+
1019
+ type ResolvedArkOrderPlaneCallFact = {
1020
+ file: string;
1021
+ line: number;
1022
+ callee: string;
1023
+ };
1024
+ type ResolvedArkOrderGenericUpdateFact = {
1025
+ file: string;
1026
+ line: number;
1027
+ method: string;
1028
+ };
1029
+ type ResolvedArkOrderRootHitFact = {
1030
+ file: string;
1031
+ matchedRoot: string;
1032
+ hasPlaneFactory: boolean;
1033
+ };
1034
+ type ResolvedArkOrderXiFieldWriteFact = {
1035
+ file: string;
1036
+ line: number;
1037
+ key: string;
1038
+ };
1039
+ type ResolvedArkOrderIngestWriteFact = {
1040
+ file: string;
1041
+ line: number;
1042
+ };
1043
+ type ResolvedArkOrderReleaseKeyCountFact = {
1044
+ file: string;
1045
+ line: number;
1046
+ keyCount: number;
1047
+ };
1048
+ /** A freshness key (ttl/freshUntil/maxAge) inside the ξ literal of plane.release / proposeRelease. */
1049
+ type ResolvedArkOrderXiTtlFact = {
1050
+ file: string;
1051
+ line: number;
1052
+ key: string;
1053
+ };
1054
+ /** A literal `allowedKinds` entry that a literal `informationBudget.cannotObserve` denies. */
1055
+ type ResolvedArkOrderBudgetLeakFact = {
1056
+ file: string;
1057
+ line: number;
1058
+ kind: string;
1059
+ };
1060
+
1061
+ /**
1062
+ * Versioned type vocabulary for resolved candidate facts (schema 1.0).
1063
+ *
1064
+ * Pure declarations + schema version identity. Create/load live in
1065
+ * resolvedCandidateFacts.ts; JSON Schema lives in resolvedCandidateFactsSchema.ts.
1066
+ */
1067
+
1068
+ /** 1.1 adds optional classShapes[] (ADR 0013). 1.2 adds optional ArkRun facts (ADR 0022). 1.0/1.1 remain loadable. */
1069
+ declare const RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION: "1.2";
1070
+ type ResolvedFactsCompleteness = 'complete' | 'partial' | 'unavailable';
1071
+ type ResolvedDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
1072
+ type ResolvedDependencyState = 'resolved-project' | 'resolved-external' | 'unresolved' | 'dynamic';
1073
+ type ResolvedCapability = 'network' | 'filesystem' | 'clock' | 'randomness' | 'environment' | 'process' | 'persistence';
1074
+ type ResolvedFactsReason = {
1075
+ code: string;
1076
+ message: string;
1077
+ file?: string;
1078
+ };
1079
+ type ResolvedFileFact = {
1080
+ path: string;
1081
+ contentHash: string;
1082
+ parseStatus: 'parsed' | 'invalid';
1083
+ parseDiagnosticCount: number;
1084
+ exportsOnlyTypes: boolean;
1085
+ typeOnlyExportNames: string[];
1086
+ hasTopLevelSideEffects: boolean;
1087
+ };
1088
+ /** ADR 0022 kernel API call-site evidence. Sensors consume this in RN04. */
1089
+ type ResolvedArkRunKernelCallKind = 'factory' | 'publisher' | 'publish' | 'raise' | 'send' | 'subscribe' | 'register-handler' | 'resolve' | 'resolve-singleton';
1090
+ type ResolvedArkRunKernelCallFact = {
1091
+ file: string;
1092
+ line: number;
1093
+ kind: ResolvedArkRunKernelCallKind;
1094
+ callee: string;
1095
+ viaImport: boolean;
1096
+ receiver?: string;
1097
+ nameLiteral?: string;
1098
+ };
1099
+ /** `new` of a class admitted for kernel creation (classShapes name or kernel import). */
1100
+ type ResolvedArkRunManagedNewFact = {
1101
+ file: string;
1102
+ line: number;
1103
+ typeName: string;
1104
+ importedFrom?: string;
1105
+ };
1106
+ /** Governed file that matched an `arkRun.compositionRoots` glob. */
1107
+ type ResolvedArkRunCompositionRootHitFact = {
1108
+ file: string;
1109
+ matchedRoot: string;
1110
+ hasKernelFactory: boolean;
1111
+ };
1112
+ /** File-scoped interaction declaration lists (ADR 0023). Sensors consume this in RN04. */
1113
+ type ResolvedArkRunDeclarationFact = {
1114
+ file: string;
1115
+ line: number;
1116
+ uses: string[];
1117
+ reactsTo: string[];
1118
+ raises: string[];
1119
+ sends: string[];
1120
+ };
1121
+ /** ADR 0013 class-shape evidence for ArkRules structure sensors. */
1122
+ type ResolvedClassShapeFact = {
1123
+ file: string;
1124
+ className: string;
1125
+ exported: boolean;
1126
+ hasPublicMutableFields: boolean;
1127
+ hasPublicSetters: boolean;
1128
+ hasPublicConstructor: boolean;
1129
+ hasStaticFactory: boolean;
1130
+ mutatingMethods: readonly {
1131
+ name: string;
1132
+ referencesGuardOrPublish: boolean;
1133
+ }[];
1134
+ dataOnly?: boolean;
1135
+ /** Source offset where the class-shape scan stopped (unwalkable body/header). */
1136
+ truncatedUntil?: number;
1137
+ };
1138
+ type ResolvedDependencyFact = {
1139
+ from: string;
1140
+ specifier?: string;
1141
+ kind: ResolvedDependencyKind;
1142
+ typeOnly: boolean;
1143
+ line: number;
1144
+ resolution: ResolvedDependencyState;
1145
+ target?: string;
1146
+ namedBindings?: string[];
1147
+ targetTypeOnlyExports?: boolean;
1148
+ sourcePureTypeModule?: boolean;
1149
+ namedBindingsTypeOnly?: boolean;
1150
+ portProofEligible?: boolean;
1151
+ };
1152
+ type ResolvedCapabilityFact = {
1153
+ file: string;
1154
+ line: number;
1155
+ symbol: string;
1156
+ capability: ResolvedCapability;
1157
+ source: 'ambient-global' | 'import-based';
1158
+ };
1159
+ type ResolvedAmbientFact = {
1160
+ file: string;
1161
+ line: number;
1162
+ symbol: string;
1163
+ };
1164
+ type ResolvedPublishFact = {
1165
+ file: string;
1166
+ line: number;
1167
+ rawIntentName?: string;
1168
+ objectHasIntent: boolean;
1169
+ arkPublishCandidate: boolean;
1170
+ hasSource: boolean;
1171
+ sourceIntent?: string;
1172
+ };
1173
+ type ResolvedIntentReferenceFact = {
1174
+ file: string;
1175
+ line: number;
1176
+ intent: string;
1177
+ };
1178
+ type ResolvedSafetyKind = 'ts-suppression' | 'any-cast' | 'dynamic-import' | 'dynamic-require' | 'in-memory-store';
1179
+ /** Neutral syntax evidence for policy-controlled safety diagnostics. */
1180
+ type ResolvedSafetyFact = {
1181
+ file: string;
1182
+ line: number;
1183
+ kind: ResolvedSafetyKind;
1184
+ symbol?: string;
1185
+ };
1186
+ type ResolvedCandidateFactsInput = {
1187
+ schemaVersion: '1.0' | '1.1' | typeof RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION;
1188
+ completeness: ResolvedFactsCompleteness;
1189
+ completenessReasons: readonly ResolvedFactsReason[];
1190
+ resolverIdentity: string;
1191
+ compilerIdentity: string;
1192
+ compilerOptionsHash: string;
1193
+ tsconfigHash: string;
1194
+ evidenceRequirementsHash: string;
1195
+ projectPackageName?: string;
1196
+ files: readonly ResolvedFileFact[];
1197
+ dependencies: readonly ResolvedDependencyFact[];
1198
+ capabilityUses: readonly ResolvedCapabilityFact[];
1199
+ ambientUses: readonly ResolvedAmbientFact[];
1200
+ publishCalls: readonly ResolvedPublishFact[];
1201
+ intentReferences: readonly ResolvedIntentReferenceFact[];
1202
+ safetyUses: readonly ResolvedSafetyFact[];
1203
+ /** ADR 0013 — optional on 1.0; default [] on load. */
1204
+ classShapes?: readonly ResolvedClassShapeFact[];
1205
+ /** ADR 0022 / RN03 — optional on 1.0/1.1; default [] on load. */
1206
+ arkRunKernelCalls?: readonly ResolvedArkRunKernelCallFact[];
1207
+ arkRunManagedNews?: readonly ResolvedArkRunManagedNewFact[];
1208
+ arkRunCompositionRootHits?: readonly ResolvedArkRunCompositionRootHitFact[];
1209
+ arkRunDeclarations?: readonly ResolvedArkRunDeclarationFact[];
1210
+ arkOrderPlaneCalls?: readonly ResolvedArkOrderPlaneCallFact[];
1211
+ arkOrderGenericUpdates?: readonly ResolvedArkOrderGenericUpdateFact[];
1212
+ arkOrderRootHits?: readonly ResolvedArkOrderRootHitFact[];
1213
+ arkOrderXiFieldWrites?: readonly ResolvedArkOrderXiFieldWriteFact[];
1214
+ arkOrderIngestWritesXi?: readonly ResolvedArkOrderIngestWriteFact[];
1215
+ arkOrderReleaseKeyCounts?: readonly ResolvedArkOrderReleaseKeyCountFact[];
1216
+ arkOrderXiTtlKeys?: readonly ResolvedArkOrderXiTtlFact[];
1217
+ arkOrderBudgetLeaks?: readonly ResolvedArkOrderBudgetLeakFact[];
1218
+ };
1219
+ type ResolvedCandidateFacts = Omit<ResolvedCandidateFactsInput, 'candidateTreeHash' | 'classShapes' | 'arkRunKernelCalls' | 'arkOrderPlaneCalls' | 'arkOrderGenericUpdates' | 'arkOrderXiFieldWrites' | 'arkOrderIngestWritesXi' | 'arkOrderReleaseKeyCounts' | 'arkOrderXiTtlKeys' | 'arkOrderBudgetLeaks' | 'arkOrderRootHits' | 'arkRunManagedNews' | 'arkRunCompositionRootHits' | 'arkRunDeclarations'> & {
1220
+ schemaVersion: typeof RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION;
1221
+ completenessReasons: ResolvedFactsReason[];
1222
+ candidateTreeHash: string;
1223
+ files: ResolvedFileFact[];
1224
+ dependencies: ResolvedDependencyFact[];
1225
+ capabilityUses: ResolvedCapabilityFact[];
1226
+ ambientUses: ResolvedAmbientFact[];
1227
+ publishCalls: ResolvedPublishFact[];
1228
+ intentReferences: ResolvedIntentReferenceFact[];
1229
+ safetyUses: ResolvedSafetyFact[];
1230
+ classShapes: ResolvedClassShapeFact[];
1231
+ arkRunKernelCalls: ResolvedArkRunKernelCallFact[];
1232
+ arkRunManagedNews: ResolvedArkRunManagedNewFact[];
1233
+ arkRunCompositionRootHits: ResolvedArkRunCompositionRootHitFact[];
1234
+ arkRunDeclarations: ResolvedArkRunDeclarationFact[];
1235
+ arkOrderPlaneCalls: ResolvedArkOrderPlaneCallFact[];
1236
+ arkOrderGenericUpdates: ResolvedArkOrderGenericUpdateFact[];
1237
+ arkOrderRootHits: ResolvedArkOrderRootHitFact[];
1238
+ arkOrderXiFieldWrites: ResolvedArkOrderXiFieldWriteFact[];
1239
+ arkOrderIngestWritesXi: ResolvedArkOrderIngestWriteFact[];
1240
+ arkOrderReleaseKeyCounts: ResolvedArkOrderReleaseKeyCountFact[];
1241
+ arkOrderXiTtlKeys: ResolvedArkOrderXiTtlFact[];
1242
+ arkOrderBudgetLeaks: ResolvedArkOrderBudgetLeakFact[];
1243
+ factsHash: string;
1244
+ };
1245
+
1246
+ /**
1247
+ * Canonical create/load for versioned resolved candidate facts.
1248
+ *
1249
+ * Types: resolvedCandidateFactsTypes.ts · Schema: resolvedCandidateFactsSchema.ts ·
1250
+ * Hash: stableHash.ts. Plan-B god-module pilot cluster (pattern-b:god-module).
1251
+ */
1252
+
1253
+ /** Identity of the policy-controlled evidence a resolver must attempt to collect. */
1254
+ declare function resolvedFactsEvidenceRequirementsHash(config: ArkConfig): string;
1255
+ declare function createResolvedCandidateFacts(input: ResolvedCandidateFactsInput): ResolvedCandidateFacts;
1256
+ declare function loadResolvedCandidateFacts(input: unknown): ResolvedCandidateFacts;
1257
+
1258
+ declare const RESOLVED_CANDIDATE_FACTS_SCHEMA: {
1259
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1260
+ readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json";
1261
+ readonly title: "ArkGate resolved candidate facts";
1262
+ readonly type: "object";
1263
+ readonly additionalProperties: false;
1264
+ readonly required: readonly ["schemaVersion", "completeness", "completenessReasons", "resolverIdentity", "compilerIdentity", "compilerOptionsHash", "tsconfigHash", "candidateTreeHash", "evidenceRequirementsHash", "files", "dependencies", "capabilityUses", "ambientUses", "publishCalls", "intentReferences", "safetyUses", "factsHash"];
1265
+ readonly properties: {
1266
+ readonly schemaVersion: {
1267
+ readonly enum: readonly ["1.0", "1.1", "1.2"];
1268
+ };
1269
+ readonly completeness: {
1270
+ readonly enum: readonly ["complete", "partial", "unavailable"];
1271
+ };
1272
+ readonly completenessReasons: {
1273
+ readonly type: "array";
1274
+ readonly items: {
1275
+ readonly type: "object";
1276
+ readonly additionalProperties: false;
1277
+ readonly required: readonly ["code", "message"];
1278
+ readonly properties: {
1279
+ readonly code: {
1280
+ readonly type: "string";
1281
+ readonly minLength: 1;
1282
+ };
1283
+ readonly message: {
1284
+ readonly type: "string";
1285
+ readonly minLength: 1;
1286
+ };
1287
+ readonly file: {
1288
+ readonly type: "string";
1289
+ readonly minLength: 1;
1290
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1291
+ };
1292
+ };
1293
+ };
1294
+ };
1295
+ readonly resolverIdentity: {
1296
+ readonly type: "string";
1297
+ readonly minLength: 1;
1298
+ };
1299
+ readonly compilerIdentity: {
1300
+ readonly type: "string";
1301
+ readonly minLength: 1;
1302
+ };
1303
+ readonly compilerOptionsHash: {
1304
+ readonly type: "string";
1305
+ readonly minLength: 1;
1306
+ };
1307
+ readonly tsconfigHash: {
1308
+ readonly type: "string";
1309
+ readonly minLength: 1;
1310
+ };
1311
+ readonly candidateTreeHash: {
1312
+ readonly type: "string";
1313
+ readonly minLength: 1;
1314
+ };
1315
+ readonly evidenceRequirementsHash: {
1316
+ readonly type: "string";
1317
+ readonly minLength: 1;
1318
+ };
1319
+ readonly projectPackageName: {
1320
+ readonly type: "string";
1321
+ readonly minLength: 1;
1322
+ };
1323
+ readonly files: {
1324
+ readonly type: "array";
1325
+ readonly uniqueItems: true;
1326
+ readonly items: {
1327
+ readonly type: "object";
1328
+ readonly additionalProperties: false;
1329
+ readonly required: readonly ["path", "contentHash", "parseStatus", "parseDiagnosticCount", "exportsOnlyTypes", "typeOnlyExportNames", "hasTopLevelSideEffects"];
1330
+ readonly properties: {
1331
+ readonly path: {
1332
+ readonly type: "string";
1333
+ readonly minLength: 1;
1334
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1335
+ };
1336
+ readonly contentHash: {
1337
+ readonly type: "string";
1338
+ readonly minLength: 1;
1339
+ };
1340
+ readonly parseStatus: {
1341
+ readonly enum: readonly ["parsed", "invalid"];
1342
+ };
1343
+ readonly parseDiagnosticCount: {
1344
+ readonly type: "integer";
1345
+ readonly minimum: 0;
1346
+ };
1347
+ readonly exportsOnlyTypes: {
1348
+ readonly type: "boolean";
1349
+ };
1350
+ readonly typeOnlyExportNames: {
1351
+ readonly type: "array";
1352
+ readonly items: {
1353
+ readonly type: "string";
1354
+ readonly minLength: 1;
1355
+ };
1356
+ };
1357
+ readonly hasTopLevelSideEffects: {
1358
+ readonly type: "boolean";
1359
+ };
1360
+ };
1361
+ readonly allOf: readonly [{
1362
+ readonly if: {
1363
+ readonly properties: {
1364
+ readonly parseStatus: {
1365
+ readonly const: "parsed";
1366
+ };
1367
+ };
1368
+ };
1369
+ readonly then: {
1370
+ readonly properties: {
1371
+ readonly parseDiagnosticCount: {
1372
+ readonly const: 0;
1373
+ };
1374
+ };
1375
+ };
1376
+ }, {
1377
+ readonly if: {
1378
+ readonly properties: {
1379
+ readonly parseStatus: {
1380
+ readonly const: "invalid";
1381
+ };
1382
+ };
1383
+ };
1384
+ readonly then: {
1385
+ readonly properties: {
1386
+ readonly parseDiagnosticCount: {
1387
+ readonly minimum: 1;
1388
+ };
1389
+ };
1390
+ };
1391
+ }];
1392
+ };
1393
+ };
1394
+ readonly dependencies: {
1395
+ readonly type: "array";
1396
+ readonly items: {
1397
+ readonly type: "object";
1398
+ readonly additionalProperties: false;
1399
+ readonly required: readonly ["from", "kind", "typeOnly", "line", "resolution"];
1400
+ readonly properties: {
1401
+ readonly from: {
1402
+ readonly type: "string";
1403
+ readonly minLength: 1;
1404
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1405
+ };
1406
+ readonly specifier: {
1407
+ readonly type: "string";
1408
+ readonly minLength: 1;
1409
+ };
1410
+ readonly kind: {
1411
+ readonly enum: readonly ["import", "export", "dynamic-import", "require"];
1412
+ };
1413
+ readonly typeOnly: {
1414
+ readonly type: "boolean";
1415
+ };
1416
+ readonly line: {
1417
+ readonly type: "integer";
1418
+ readonly minimum: 1;
1419
+ };
1420
+ readonly resolution: {
1421
+ readonly enum: readonly ["resolved-project", "resolved-external", "unresolved", "dynamic"];
1422
+ };
1423
+ readonly target: {
1424
+ readonly type: "string";
1425
+ readonly minLength: 1;
1426
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1427
+ };
1428
+ readonly namedBindings: {
1429
+ readonly type: "array";
1430
+ readonly items: {
1431
+ readonly type: "string";
1432
+ readonly minLength: 1;
1433
+ };
1434
+ };
1435
+ readonly targetTypeOnlyExports: {
1436
+ readonly type: "boolean";
1437
+ };
1438
+ readonly sourcePureTypeModule: {
1439
+ readonly type: "boolean";
1440
+ };
1441
+ readonly namedBindingsTypeOnly: {
1442
+ readonly type: "boolean";
1443
+ };
1444
+ readonly portProofEligible: {
1445
+ readonly type: "boolean";
1446
+ };
1447
+ };
1448
+ readonly allOf: readonly [{
1449
+ readonly if: {
1450
+ readonly properties: {
1451
+ readonly resolution: {
1452
+ readonly const: "resolved-project";
1453
+ };
1454
+ };
1455
+ };
1456
+ readonly then: {
1457
+ readonly required: readonly ["target"];
1458
+ };
1459
+ readonly else: {
1460
+ readonly not: {
1461
+ readonly required: readonly ["target"];
1462
+ };
1463
+ };
1464
+ }, {
1465
+ readonly if: {
1466
+ readonly properties: {
1467
+ readonly resolution: {
1468
+ readonly const: "dynamic";
1469
+ };
1470
+ };
1471
+ };
1472
+ readonly else: {
1473
+ readonly required: readonly ["specifier"];
1474
+ };
1475
+ }];
1476
+ };
1477
+ };
1478
+ readonly capabilityUses: {
1479
+ readonly type: "array";
1480
+ readonly items: {
1481
+ readonly type: "object";
1482
+ readonly additionalProperties: false;
1483
+ readonly required: readonly ["file", "line", "symbol", "capability", "source"];
1484
+ readonly properties: {
1485
+ readonly file: {
1486
+ readonly type: "string";
1487
+ readonly minLength: 1;
1488
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1489
+ };
1490
+ readonly line: {
1491
+ readonly type: "integer";
1492
+ readonly minimum: 1;
1493
+ };
1494
+ readonly symbol: {
1495
+ readonly type: "string";
1496
+ readonly minLength: 1;
1497
+ };
1498
+ readonly capability: {
1499
+ readonly enum: readonly ["network", "filesystem", "clock", "randomness", "environment", "process", "persistence"];
1500
+ };
1501
+ readonly source: {
1502
+ readonly enum: readonly ["ambient-global", "import-based"];
1503
+ };
1504
+ };
1505
+ };
1506
+ };
1507
+ readonly ambientUses: {
1508
+ readonly type: "array";
1509
+ readonly items: {
1510
+ readonly type: "object";
1511
+ readonly additionalProperties: false;
1512
+ readonly required: readonly ["file", "line", "symbol"];
1513
+ readonly properties: {
1514
+ readonly file: {
1515
+ readonly type: "string";
1516
+ readonly minLength: 1;
1517
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1518
+ };
1519
+ readonly line: {
1520
+ readonly type: "integer";
1521
+ readonly minimum: 1;
1522
+ };
1523
+ readonly symbol: {
1524
+ readonly type: "string";
1525
+ readonly minLength: 1;
1526
+ };
1527
+ };
1528
+ };
1529
+ };
1530
+ readonly publishCalls: {
1531
+ readonly type: "array";
1532
+ readonly items: {
1533
+ readonly type: "object";
1534
+ readonly additionalProperties: false;
1535
+ readonly required: readonly ["file", "line", "objectHasIntent", "arkPublishCandidate", "hasSource"];
1536
+ readonly properties: {
1537
+ readonly file: {
1538
+ readonly type: "string";
1539
+ readonly minLength: 1;
1540
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1541
+ };
1542
+ readonly line: {
1543
+ readonly type: "integer";
1544
+ readonly minimum: 1;
1545
+ };
1546
+ readonly rawIntentName: {
1547
+ readonly type: "string";
1548
+ readonly minLength: 1;
1549
+ };
1550
+ readonly objectHasIntent: {
1551
+ readonly type: "boolean";
1552
+ };
1553
+ readonly arkPublishCandidate: {
1554
+ readonly type: "boolean";
1555
+ };
1556
+ readonly hasSource: {
1557
+ readonly type: "boolean";
1558
+ };
1559
+ readonly sourceIntent: {
1560
+ readonly type: "string";
1561
+ readonly minLength: 1;
1562
+ };
1563
+ };
1564
+ };
1565
+ };
1566
+ readonly intentReferences: {
1567
+ readonly type: "array";
1568
+ readonly items: {
1569
+ readonly type: "object";
1570
+ readonly additionalProperties: false;
1571
+ readonly required: readonly ["file", "line", "intent"];
1572
+ readonly properties: {
1573
+ readonly file: {
1574
+ readonly type: "string";
1575
+ readonly minLength: 1;
1576
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1577
+ };
1578
+ readonly line: {
1579
+ readonly type: "integer";
1580
+ readonly minimum: 1;
1581
+ };
1582
+ readonly intent: {
1583
+ readonly type: "string";
1584
+ readonly minLength: 1;
1585
+ };
1586
+ };
1587
+ };
1588
+ };
1589
+ readonly safetyUses: {
1590
+ readonly type: "array";
1591
+ readonly items: {
1592
+ readonly type: "object";
1593
+ readonly additionalProperties: false;
1594
+ readonly required: readonly ["file", "line", "kind"];
1595
+ readonly properties: {
1596
+ readonly file: {
1597
+ readonly type: "string";
1598
+ readonly minLength: 1;
1599
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1600
+ };
1601
+ readonly line: {
1602
+ readonly type: "integer";
1603
+ readonly minimum: 1;
1604
+ };
1605
+ readonly kind: {
1606
+ readonly enum: readonly ["ts-suppression", "any-cast", "dynamic-import", "dynamic-require", "in-memory-store"];
1607
+ };
1608
+ readonly symbol: {
1609
+ readonly type: "string";
1610
+ readonly minLength: 1;
1611
+ };
1612
+ };
1613
+ readonly allOf: readonly [{
1614
+ readonly if: {
1615
+ readonly properties: {
1616
+ readonly kind: {
1617
+ readonly const: "in-memory-store";
1618
+ };
1619
+ };
1620
+ };
1621
+ readonly then: {
1622
+ readonly required: readonly ["symbol"];
1623
+ };
1624
+ readonly else: {
1625
+ readonly not: {
1626
+ readonly required: readonly ["symbol"];
1627
+ };
1628
+ };
1629
+ }];
1630
+ };
1631
+ };
1632
+ readonly classShapes: {
1633
+ readonly type: "array";
1634
+ readonly items: {
1635
+ readonly type: "object";
1636
+ readonly additionalProperties: false;
1637
+ readonly required: readonly ["file", "className", "exported", "hasPublicMutableFields", "hasPublicSetters", "hasPublicConstructor", "hasStaticFactory", "mutatingMethods"];
1638
+ readonly properties: {
1639
+ readonly file: {
1640
+ readonly type: "string";
1641
+ readonly minLength: 1;
1642
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1643
+ };
1644
+ readonly className: {
1645
+ readonly type: "string";
1646
+ readonly minLength: 1;
1647
+ };
1648
+ readonly exported: {
1649
+ readonly type: "boolean";
1650
+ };
1651
+ readonly hasPublicMutableFields: {
1652
+ readonly type: "boolean";
1653
+ };
1654
+ readonly hasPublicSetters: {
1655
+ readonly type: "boolean";
1656
+ };
1657
+ readonly hasPublicConstructor: {
1658
+ readonly type: "boolean";
1659
+ };
1660
+ readonly hasStaticFactory: {
1661
+ readonly type: "boolean";
1662
+ };
1663
+ readonly dataOnly: {
1664
+ readonly type: "boolean";
1665
+ };
1666
+ readonly truncatedUntil: {
1667
+ readonly type: "integer";
1668
+ readonly minimum: 0;
1669
+ };
1670
+ readonly mutatingMethods: {
1671
+ readonly type: "array";
1672
+ readonly items: {
1673
+ readonly type: "object";
1674
+ readonly additionalProperties: false;
1675
+ readonly required: readonly ["name", "referencesGuardOrPublish"];
1676
+ readonly properties: {
1677
+ readonly name: {
1678
+ readonly type: "string";
1679
+ readonly minLength: 1;
1680
+ };
1681
+ readonly referencesGuardOrPublish: {
1682
+ readonly type: "boolean";
1683
+ };
1684
+ };
1685
+ };
1686
+ };
1687
+ };
1688
+ };
1689
+ };
1690
+ readonly arkRunKernelCalls: {
1691
+ readonly type: "array";
1692
+ readonly items: {
1693
+ readonly type: "object";
1694
+ readonly additionalProperties: false;
1695
+ readonly required: readonly ["file", "line", "kind", "callee", "viaImport"];
1696
+ readonly properties: {
1697
+ readonly file: {
1698
+ readonly type: "string";
1699
+ readonly minLength: 1;
1700
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1701
+ };
1702
+ readonly line: {
1703
+ readonly type: "integer";
1704
+ readonly minimum: 1;
1705
+ };
1706
+ readonly kind: {
1707
+ readonly enum: readonly ["factory", "publisher", "publish", "raise", "send", "subscribe", "register-handler", "resolve", "resolve-singleton"];
1708
+ };
1709
+ readonly callee: {
1710
+ readonly type: "string";
1711
+ readonly minLength: 1;
1712
+ };
1713
+ readonly viaImport: {
1714
+ readonly type: "boolean";
1715
+ };
1716
+ readonly receiver: {
1717
+ readonly type: "string";
1718
+ readonly minLength: 1;
1719
+ };
1720
+ readonly nameLiteral: {
1721
+ readonly type: "string";
1722
+ readonly minLength: 1;
1723
+ };
1724
+ };
1725
+ };
1726
+ };
1727
+ readonly arkRunManagedNews: {
1728
+ readonly type: "array";
1729
+ readonly items: {
1730
+ readonly type: "object";
1731
+ readonly additionalProperties: false;
1732
+ readonly required: readonly ["file", "line", "typeName"];
1733
+ readonly properties: {
1734
+ readonly file: {
1735
+ readonly type: "string";
1736
+ readonly minLength: 1;
1737
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1738
+ };
1739
+ readonly line: {
1740
+ readonly type: "integer";
1741
+ readonly minimum: 1;
1742
+ };
1743
+ readonly typeName: {
1744
+ readonly type: "string";
1745
+ readonly minLength: 1;
1746
+ };
1747
+ readonly importedFrom: {
1748
+ readonly type: "string";
1749
+ readonly minLength: 1;
1750
+ };
1751
+ };
1752
+ };
1753
+ };
1754
+ readonly arkRunCompositionRootHits: {
1755
+ readonly type: "array";
1756
+ readonly items: {
1757
+ readonly type: "object";
1758
+ readonly additionalProperties: false;
1759
+ readonly required: readonly ["file", "matchedRoot", "hasKernelFactory"];
1760
+ readonly properties: {
1761
+ readonly file: {
1762
+ readonly type: "string";
1763
+ readonly minLength: 1;
1764
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1765
+ };
1766
+ readonly matchedRoot: {
1767
+ readonly type: "string";
1768
+ readonly minLength: 1;
1769
+ };
1770
+ readonly hasKernelFactory: {
1771
+ readonly type: "boolean";
1772
+ };
1773
+ };
1774
+ };
1775
+ };
1776
+ readonly arkRunDeclarations: {
1777
+ readonly type: "array";
1778
+ readonly items: {
1779
+ readonly type: "object";
1780
+ readonly additionalProperties: false;
1781
+ readonly required: readonly ["file", "line", "uses", "reactsTo", "raises", "sends"];
1782
+ readonly properties: {
1783
+ readonly file: {
1784
+ readonly type: "string";
1785
+ readonly minLength: 1;
1786
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1787
+ };
1788
+ readonly line: {
1789
+ readonly type: "integer";
1790
+ readonly minimum: 1;
1791
+ };
1792
+ readonly uses: {
1793
+ readonly type: "array";
1794
+ readonly items: {
1795
+ readonly type: "string";
1796
+ readonly minLength: 1;
1797
+ };
1798
+ };
1799
+ readonly reactsTo: {
1800
+ readonly type: "array";
1801
+ readonly items: {
1802
+ readonly type: "string";
1803
+ readonly minLength: 1;
1804
+ };
1805
+ };
1806
+ readonly raises: {
1807
+ readonly type: "array";
1808
+ readonly items: {
1809
+ readonly type: "string";
1810
+ readonly minLength: 1;
1811
+ };
1812
+ };
1813
+ readonly sends: {
1814
+ readonly type: "array";
1815
+ readonly items: {
1816
+ readonly type: "string";
1817
+ readonly minLength: 1;
1818
+ };
1819
+ };
1820
+ };
1821
+ };
1822
+ };
1823
+ readonly arkOrderPlaneCalls: {
1824
+ readonly type: "array";
1825
+ readonly items: {
1826
+ readonly type: "object";
1827
+ readonly additionalProperties: false;
1828
+ readonly required: readonly ["file", "line", "callee"];
1829
+ readonly properties: {
1830
+ readonly file: {
1831
+ readonly type: "string";
1832
+ readonly minLength: 1;
1833
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1834
+ };
1835
+ readonly line: {
1836
+ readonly type: "integer";
1837
+ readonly minimum: 1;
1838
+ };
1839
+ readonly callee: {
1840
+ readonly type: "string";
1841
+ readonly minLength: 1;
1842
+ };
1843
+ };
1844
+ };
1845
+ };
1846
+ readonly arkOrderGenericUpdates: {
1847
+ readonly type: "array";
1848
+ readonly items: {
1849
+ readonly type: "object";
1850
+ readonly additionalProperties: false;
1851
+ readonly required: readonly ["file", "line", "method"];
1852
+ readonly properties: {
1853
+ readonly file: {
1854
+ readonly type: "string";
1855
+ readonly minLength: 1;
1856
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1857
+ };
1858
+ readonly line: {
1859
+ readonly type: "integer";
1860
+ readonly minimum: 1;
1861
+ };
1862
+ readonly method: {
1863
+ readonly type: "string";
1864
+ readonly minLength: 1;
1865
+ };
1866
+ };
1867
+ };
1868
+ };
1869
+ readonly arkOrderRootHits: {
1870
+ readonly type: "array";
1871
+ readonly items: {
1872
+ readonly type: "object";
1873
+ readonly additionalProperties: false;
1874
+ readonly required: readonly ["file", "matchedRoot", "hasPlaneFactory"];
1875
+ readonly properties: {
1876
+ readonly file: {
1877
+ readonly type: "string";
1878
+ readonly minLength: 1;
1879
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1880
+ };
1881
+ readonly matchedRoot: {
1882
+ readonly type: "string";
1883
+ readonly minLength: 1;
1884
+ };
1885
+ readonly hasPlaneFactory: {
1886
+ readonly type: "boolean";
1887
+ };
1888
+ };
1889
+ };
1890
+ };
1891
+ readonly arkOrderXiFieldWrites: {
1892
+ readonly type: "array";
1893
+ readonly items: {
1894
+ readonly type: "object";
1895
+ readonly additionalProperties: false;
1896
+ readonly required: readonly ["file", "line", "key"];
1897
+ readonly properties: {
1898
+ readonly file: {
1899
+ readonly type: "string";
1900
+ readonly minLength: 1;
1901
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1902
+ };
1903
+ readonly line: {
1904
+ readonly type: "integer";
1905
+ readonly minimum: 1;
1906
+ };
1907
+ readonly key: {
1908
+ readonly type: "string";
1909
+ readonly minLength: 1;
1910
+ };
1911
+ };
1912
+ };
1913
+ };
1914
+ readonly arkOrderIngestWritesXi: {
1915
+ readonly type: "array";
1916
+ readonly items: {
1917
+ readonly type: "object";
1918
+ readonly additionalProperties: false;
1919
+ readonly required: readonly ["file", "line"];
1920
+ readonly properties: {
1921
+ readonly file: {
1922
+ readonly type: "string";
1923
+ readonly minLength: 1;
1924
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1925
+ };
1926
+ readonly line: {
1927
+ readonly type: "integer";
1928
+ readonly minimum: 1;
1929
+ };
1930
+ };
1931
+ };
1932
+ };
1933
+ readonly arkOrderReleaseKeyCounts: {
1934
+ readonly type: "array";
1935
+ readonly items: {
1936
+ readonly type: "object";
1937
+ readonly additionalProperties: false;
1938
+ readonly required: readonly ["file", "line", "keyCount"];
1939
+ readonly properties: {
1940
+ readonly file: {
1941
+ readonly type: "string";
1942
+ readonly minLength: 1;
1943
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1944
+ };
1945
+ readonly line: {
1946
+ readonly type: "integer";
1947
+ readonly minimum: 1;
1948
+ };
1949
+ readonly keyCount: {
1950
+ readonly type: "integer";
1951
+ readonly minimum: 1;
1952
+ };
1953
+ };
1954
+ };
1955
+ };
1956
+ readonly arkOrderXiTtlKeys: {
1957
+ readonly type: "array";
1958
+ readonly items: {
1959
+ readonly type: "object";
1960
+ readonly additionalProperties: false;
1961
+ readonly required: readonly ["file", "line", "key"];
1962
+ readonly properties: {
1963
+ readonly file: {
1964
+ readonly type: "string";
1965
+ readonly minLength: 1;
1966
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1967
+ };
1968
+ readonly line: {
1969
+ readonly type: "integer";
1970
+ readonly minimum: 1;
1971
+ };
1972
+ readonly key: {
1973
+ readonly type: "string";
1974
+ readonly minLength: 1;
1975
+ };
1976
+ };
1977
+ };
1978
+ };
1979
+ readonly arkOrderBudgetLeaks: {
1980
+ readonly type: "array";
1981
+ readonly items: {
1982
+ readonly type: "object";
1983
+ readonly additionalProperties: false;
1984
+ readonly required: readonly ["file", "line", "kind"];
1985
+ readonly properties: {
1986
+ readonly file: {
1987
+ readonly type: "string";
1988
+ readonly minLength: 1;
1989
+ readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
1990
+ };
1991
+ readonly line: {
1992
+ readonly type: "integer";
1993
+ readonly minimum: 1;
1994
+ };
1995
+ readonly kind: {
1996
+ readonly type: "string";
1997
+ readonly minLength: 1;
1998
+ };
1999
+ };
2000
+ };
2001
+ };
2002
+ readonly factsHash: {
2003
+ readonly type: "string";
2004
+ readonly minLength: 1;
2005
+ };
2006
+ };
2007
+ readonly allOf: readonly [{
2008
+ readonly if: {
2009
+ readonly properties: {
2010
+ readonly completeness: {
2011
+ readonly const: "complete";
2012
+ };
2013
+ };
2014
+ };
2015
+ readonly then: {
2016
+ readonly properties: {
2017
+ readonly completenessReasons: {
2018
+ readonly maxItems: 0;
2019
+ };
2020
+ readonly files: {
2021
+ readonly items: {
2022
+ readonly properties: {
2023
+ readonly parseStatus: {
2024
+ readonly const: "parsed";
2025
+ };
2026
+ };
2027
+ };
2028
+ };
2029
+ };
2030
+ };
2031
+ }, {
2032
+ readonly if: {
2033
+ readonly properties: {
2034
+ readonly completeness: {
2035
+ readonly enum: readonly ["partial", "unavailable"];
2036
+ };
2037
+ };
2038
+ };
2039
+ readonly then: {
2040
+ readonly properties: {
2041
+ readonly completenessReasons: {
2042
+ readonly minItems: 1;
2043
+ };
2044
+ };
2045
+ };
2046
+ }];
2047
+ };
2048
+
2049
+ /**
2050
+ * Stable, pure vocabulary for ArkGate's importable analysis engine.
2051
+ *
2052
+ * This module owns the Analysis IR types and re-exports the resolved-candidate-facts
2053
+ * pilot cluster (plan-B / pattern-b:god-module). Parsing and filesystem discovery
2054
+ * belong to adapters.
2055
+ *
2056
+ * Cluster:
2057
+ * - `stableHash` — identity/fingerprint primitives
2058
+ * - `resolvedCandidateFactsTypes` — versioned fact types
2059
+ * - `resolvedCandidateFacts` — create/load/canonicalize
2060
+ * - `resolvedCandidateFactsSchema` — published JSON Schema
2061
+ *
2062
+ * Consumer import paths through this facade remain stable (same pattern as Kernel
2063
+ * `analysis.ts` after U02).
2064
+ */
2065
+
2066
+ declare const ANALYSIS_IR_SCHEMA_VERSION: "1.0";
2067
+ type AnalysisFileInput = {
2068
+ path: string;
2069
+ content: string;
2070
+ };
2071
+ type AnalysisFileChange = {
2072
+ path: string;
2073
+ content: string;
2074
+ } | {
2075
+ path: string;
2076
+ delete: true;
2077
+ };
2078
+ type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
2079
+ type AnalysisFile = AnalysisFileInput & {
2080
+ contentHash: string;
2081
+ layer: string | null;
2082
+ };
2083
+ type AnalysisImportEdge = {
2084
+ from: string;
2085
+ specifier: string;
2086
+ to: string | null;
2087
+ resolution: 'resolved' | 'unresolved';
2088
+ fromLayer: string | null;
2089
+ toLayer: string | null;
2090
+ evidence: AnalysisEvidence;
2091
+ };
2092
+ /** A capability use is reserved for C04's symbol-aware implementation. */
2093
+ type AnalysisCapabilityUse = {
2094
+ file: string;
2095
+ symbol: string;
2096
+ capability: string;
2097
+ evidence: AnalysisEvidence;
2098
+ };
2099
+ type AnalysisEvidence = {
2100
+ kind: 'import' | 'policy';
2101
+ file: string;
2102
+ line: number;
2103
+ excerpt: string;
2104
+ };
2105
+ type AnalysisViolation = {
2106
+ ruleId: string;
2107
+ message: string;
2108
+ edge?: AnalysisImportEdge;
2109
+ /** U04 (additive): present on CAPABILITY_VIOLATION — the denied capability id. */
2110
+ capability?: string;
2111
+ /** U04 (additive): the matched module specifier or ambient path. */
2112
+ symbol?: string;
2113
+ evidence: AnalysisEvidence;
2114
+ };
2115
+ type AnalysisIr = {
2116
+ schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
2117
+ policyHash: string;
2118
+ compilerOptionsHash: string;
2119
+ files: AnalysisFile[];
2120
+ layers: string[];
2121
+ edges: AnalysisImportEdge[];
2122
+ capabilityUses: AnalysisCapabilityUse[];
2123
+ violations: AnalysisViolation[];
2124
+ };
2125
+
2126
+ declare const ARK_CHANGE_MAP_SCHEMA_VERSION: "1.0";
2127
+ type ArchitectureChangeOperation = 'create' | 'update' | 'delete';
2128
+ type ArchitectureChangeMapFile = {
2129
+ path: string;
2130
+ operation: ArchitectureChangeOperation;
2131
+ layer: string;
2132
+ };
2133
+ type ArchitectureChangeMapDependency = {
2134
+ from: string;
2135
+ to: string;
2136
+ };
2137
+ type ArchitectureChangeMap = {
2138
+ $schema: string;
2139
+ schemaVersion: typeof ARK_CHANGE_MAP_SCHEMA_VERSION;
2140
+ files: ArchitectureChangeMapFile[];
2141
+ dependencies: ArchitectureChangeMapDependency[];
2142
+ };
2143
+ type ArchitectureChangeMapContract = {
2144
+ map: ArchitectureChangeMap;
2145
+ hash: string;
2146
+ };
2147
+
2148
+ type ArchitectureDependency = {
2149
+ from: string;
2150
+ to: string;
2151
+ };
2152
+ type ArchitectureActualChange = {
2153
+ path: string;
2154
+ operation: ArchitectureChangeOperation;
2155
+ };
2156
+ type ArchitectureConvergenceClassification = 'satisfied' | 'missing' | 'contradictory' | 'unplanned';
2157
+ type ArchitectureConvergenceFinding = {
2158
+ id: string;
2159
+ classification: ArchitectureConvergenceClassification;
2160
+ subject: 'file' | 'dependency';
2161
+ message: string;
2162
+ nextAction?: string;
2163
+ path?: string;
2164
+ from?: string;
2165
+ to?: string;
2166
+ expectedOperation?: ArchitectureChangeOperation;
2167
+ actualOperation?: ArchitectureChangeOperation | 'added' | 'removed';
2168
+ };
2169
+ type ArchitectureConvergenceResult = {
2170
+ schemaVersion: '1.0';
2171
+ readOnly: true;
2172
+ changeMapHash: string;
2173
+ structurallyConverged: boolean;
2174
+ behavioralCompletion: 'not-evaluated';
2175
+ summary: Record<ArchitectureConvergenceClassification, number>;
2176
+ findings: ArchitectureConvergenceFinding[];
2177
+ };
2178
+ type AnalyzeArchitectureConvergenceInput = {
2179
+ changeMap: ArchitectureChangeMapContract;
2180
+ changes: readonly ArchitectureActualChange[];
2181
+ baseDependencies: readonly ArchitectureDependency[];
2182
+ candidateDependencies: readonly ArchitectureDependency[];
2183
+ };
2184
+ declare function analyzeArchitectureConvergence(input: AnalyzeArchitectureConvergenceInput): ArchitectureConvergenceResult;
2185
+
2186
+ type SemanticDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
2187
+ type SemanticDependency = {
2188
+ specifier?: string;
2189
+ kind: SemanticDependencyKind;
2190
+ line: number;
2191
+ typeOnly: boolean;
2192
+ unresolved: boolean;
2193
+ node: unknown;
2194
+ };
2195
+ type ForbiddenCapabilityUse = {
2196
+ name: string;
2197
+ line: number;
2198
+ node: unknown;
2199
+ };
2200
+ /** Extract every dependency form whose specifier is statically knowable, plus unresolved calls. */
2201
+ declare function extractSemanticDependencies(ts: any, sourceFile: any): SemanticDependency[];
2202
+ /** Resolve forbidden ambient capabilities through symbols, aliases, globalThis, and static keys. */
2203
+ declare function collectForbiddenCapabilityUses(ts: any, sourceFile: any, forbidden: readonly string[]): ForbiddenCapabilityUse[];
2204
+
2205
+ /**
2206
+ * Type vocabulary for ArkRules files (ADR 0012).
2207
+ *
2208
+ * Pure declarations only — runtime validation and the published JSON Schema live in
2209
+ * ./arkRulesContract.ts so generate:cli-pure can emit a self-contained artifact.
2210
+ */
2211
+ /** Closed sensor vocabulary (ADR 0013). Unknown sensors fail closed at load time. */
2212
+ declare const ARK_RULE_SENSOR_IDS: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "writes-via-aggregate", "no-anemic-model", "invariant-coverage"];
2213
+ type ArkRuleSensorId = (typeof ARK_RULE_SENSOR_IDS)[number];
2214
+ type ArkRuleMode = 'advisory' | 'enforced';
2215
+ type ArkRuleStructureEntry = {
2216
+ id: string;
2217
+ sensor: ArkRuleSensorId;
2218
+ mode?: ArkRuleMode;
2219
+ appliesTo?: string[];
2220
+ description?: string;
2221
+ };
2222
+ type ArkRuleInvariantCoverage = {
2223
+ test?: boolean;
2224
+ symbol?: string;
2225
+ };
2226
+ type ArkRuleInvariantEntry = {
2227
+ id: string;
2228
+ description: string;
2229
+ aggregate?: string;
2230
+ coverage?: ArkRuleInvariantCoverage;
2231
+ mode?: ArkRuleMode;
2232
+ appliesTo?: string[];
2233
+ };
2234
+ type ArkRuleProvenance = {
2235
+ sourceFile: string;
2236
+ ruleId: string;
2237
+ layer: string;
2238
+ /** Set when the rule was read from a child-slice file. Absent on central files. */
2239
+ childId?: string;
2240
+ };
2241
+ type EffectiveStructureRule = ArkRuleStructureEntry & {
2242
+ mode: ArkRuleMode;
2243
+ provenance: ArkRuleProvenance;
2244
+ };
2245
+ type EffectiveInvariantRule = ArkRuleInvariantEntry & {
2246
+ mode: ArkRuleMode;
2247
+ provenance: ArkRuleProvenance;
2248
+ };
2249
+ type EffectiveArkRules = {
2250
+ schemaVersion: '1.0';
2251
+ byLayer: Record<string, {
2252
+ sourceFile: string;
2253
+ /** Every file merged into this layer, central paths first. Absent on older catalogs. */
2254
+ sourceFiles?: string[];
2255
+ structure: EffectiveStructureRule[];
2256
+ invariants: EffectiveInvariantRule[];
2257
+ }>;
2258
+ structure: EffectiveStructureRule[];
2259
+ invariants: EffectiveInvariantRule[];
2260
+ };
2261
+
2262
+ /** Priority order: guard-family operators first, constants last. */
2263
+ declare const INVARIANT_PROBE_OPERATORS: readonly ["negate-guard", "drop-throw", "flip-comparison", "boundary-shift", "const-shift"];
2264
+ type ProbeOperator = (typeof INVARIANT_PROBE_OPERATORS)[number];
2265
+ declare const INVARIANT_PROBE_VERDICTS: readonly ["killed", "survived", "not-reached", "inconclusive", "unprobeable"];
2266
+ type ProbeVerdict = (typeof INVARIANT_PROBE_VERDICTS)[number];
2267
+ declare const INVARIANT_PROBE_REASONS: readonly ["all-killed", "mutant-survived", "reach-canary-survived", "baseline-red", "baseline-timeout", "runner-error", "file-not-loaded", "mutant-runtime-error", "no-symbol", "declaration-only", "symbol-not-found", "no-covering-test", "no-site"];
2268
+ type ProbeReason = (typeof INVARIANT_PROBE_REASONS)[number];
2269
+ /** What promotion and status read from one row. */
2270
+ type InvariantProbeSummary = {
2271
+ verdict: ProbeVerdict;
2272
+ reason: ProbeReason;
2273
+ /** False when a hashed input changed since the run; a stale row changes nothing. */
2274
+ fresh: boolean;
2275
+ survivors: Array<{
2276
+ operator: ProbeOperator;
2277
+ line: number;
2278
+ original: string;
2279
+ replacement: string;
2280
+ }>;
2281
+ staleBecause?: string[];
2282
+ symbolFile?: string;
2283
+ probedOn?: string;
2284
+ };
2285
+
2286
+ /**
2287
+ * Pure invariant coverage evidence (ADR 0014 / AR09–AR10).
2288
+ *
2289
+ * Mines test titles and symbol declarations against the Effective ArkRules catalog.
2290
+ * `classifyCoverage` returns one verdict; `countsAsCoverage` is the policy;
2291
+ * `describeCoverage` is the sentence. A bare mention is never coverage.
2292
+ * No filesystem — Tooling supplies file contents and test globs.
2293
+ */
2294
+
2295
+ /**
2296
+ * How a `coverage.symbol` identifier is declared. `type`, `interface`, and
2297
+ * `enum` are declarations — the same witness as function, class, const, and
2298
+ * method.
2299
+ */
2300
+ type DeclarationShape = 'function' | 'class' | 'const' | 'method' | 'type' | 'interface' | 'enum';
2301
+ type InvariantCoverageEvidence = {
2302
+ invariantId: string;
2303
+ layer: string;
2304
+ sourceFile: string;
2305
+ mode: 'advisory' | 'enforced';
2306
+ covered: boolean;
2307
+ evidence: Array<'test-title' | 'symbol'>;
2308
+ /** When no test globs were supplied, coverage cannot be proven. */
2309
+ partial: boolean;
2310
+ description: string;
2311
+ /** Test file that supplied the `test-title` evidence, when there was one. */
2312
+ testEvidenceFile?: string;
2313
+ /**
2314
+ * Non-test file that declares `coverage.symbol`. Absent when the name only
2315
+ * appears in an import or a call. ArkGate never runs tests; this path is the
2316
+ * declaration text, not a passing suite.
2317
+ */
2318
+ symbolEvidenceFile?: string;
2319
+ /**
2320
+ * Declaration shape when `evidence` includes `symbol`. Additive: readers that
2321
+ * only know `test-title` | `symbol` ignore it.
2322
+ */
2323
+ shape?: DeclarationShape;
2324
+ /**
2325
+ * The only covering test found sits outside `coverage.coverageRoots` — the
2326
+ * places the project declares its runner executes. ArkGate never runs tests,
2327
+ * so a title match outside those roots is a test that exists, not a test that
2328
+ * runs. Absent (undefined) when no roots were declared: without a declaration
2329
+ * there is nothing to compare against, and silence is honest.
2330
+ */
2331
+ outsideDeclaredRoots?: boolean;
2332
+ /**
2333
+ * True when `coverage.coverageRoots` was non-empty for this evaluation.
2334
+ * `false` when the project declared nothing. Omitted on hand-built evidence
2335
+ * so existing promote fixtures stay valid; the evaluator always sets it.
2336
+ */
2337
+ coverageRootsDeclared?: boolean;
2338
+ /**
2339
+ * Committed mutation-probe evidence for this invariant (ADR 0039), attached
2340
+ * by Tooling when `.ark/invariant-probe.json` has a row. Additive: absent on
2341
+ * every evaluation that has no artifact. Only a fresh `survived` /
2342
+ * `not-reached` changes promotion; every other state changes nothing.
2343
+ */
2344
+ probe?: InvariantProbeSummary;
2345
+ };
2346
+ /**
2347
+ * What the Tooling scan actually saw. Every discard has a counted reason —
2348
+ * a silent drop would make an uncovered verdict unexplainable.
2349
+ */
2350
+ type InvariantCoverageStats = {
2351
+ /**
2352
+ * Files actually opened and read. Always >= filesLoaded: a test is read
2353
+ * before it can be judged for naming an invariant, so the file budget bounds
2354
+ * RETENTION, not I/O. Reporting only the retained count made
2355
+ * `coverage.maxFiles` read as a knob on how much the scan opens.
2356
+ */
2357
+ filesRead?: number;
2358
+ /** Files retained as coverage evidence (tests + production). */
2359
+ filesLoaded: number;
2360
+ /** Test files retained (subset of filesLoaded). */
2361
+ testFilesRetained: number;
2362
+ /** The file budget in force for this scan (config `coverage.maxFiles` or the default). */
2363
+ maxFiles: number;
2364
+ discarded: {
2365
+ /** Reached the file budget. */
2366
+ budget: number;
2367
+ /** Test file naming no catalogued invariant (scanned, then dropped). */
2368
+ noInvariantMention: number;
2369
+ /** Larger than the per-file byte cap. */
2370
+ oversize: number;
2371
+ /**
2372
+ * stat/read failed on a file or a directory: permissions, a broken symlink,
2373
+ * or something that moved mid-scan. Files and directories share one counter.
2374
+ */
2375
+ unreadable: number;
2376
+ /** Directory deeper than the walk depth limit — its files were never seen. */
2377
+ depthLimited: number;
2378
+ /**
2379
+ * Symlink inside the tree whose target resolves outside the project root.
2380
+ * Refused as evidence: a file that is not in this repo must not prove an
2381
+ * invariant covered.
2382
+ */
2383
+ outOfRoot: number;
2384
+ };
2385
+ };
2386
+
2387
+ /**
2388
+ * Pure ArkRules structure sensor evaluation (ADR 0013).
2389
+ *
2390
+ * Consumes closed class-shape / file facts + Effective ArkRules. Emits violations with
2391
+ * arkrule provenance. No filesystem, no TypeScript compiler.
2392
+ */
2393
+
2394
+ type ClassShapeFact = {
2395
+ file: string;
2396
+ className: string;
2397
+ exported: boolean;
2398
+ hasPublicMutableFields: boolean;
2399
+ hasPublicSetters: boolean;
2400
+ hasPublicConstructor: boolean;
2401
+ hasStaticFactory: boolean;
2402
+ mutatingMethods: readonly {
2403
+ name: string;
2404
+ referencesGuardOrPublish: boolean;
2405
+ }[];
2406
+ /** Heuristic: data-only class (fields, no methods beyond accessors). */
2407
+ dataOnly?: boolean;
2408
+ /**
2409
+ * Set when the scanner could not walk the class to its end: the character
2410
+ * offset (in the source file) where analysis stopped. Enumerable on purpose so
2411
+ * it survives fact canonicalisation and serialisation; enforced structure
2412
+ * sensors report it instead of passing in silence.
2413
+ */
2414
+ truncatedUntil?: number;
2415
+ };
2416
+
2417
+ /**
2418
+ * Config-key version floors plus pin evidence (#338).
2419
+ *
2420
+ * A slice key such as `childSlices` is rejected at config load by an older
2421
+ * arkgate (the rule schema sets `additionalProperties: false`). ArkGate warns
2422
+ * about that only with evidence that this repo pins such an older arkgate: an
2423
+ * exact package.json dependency, the installed copy, the lockfile, a hook
2424
+ * script, or a CI workflow. Without evidence it stays silent.
2425
+ *
2426
+ * Pure: Tooling reads the files and passes their text here.
2427
+ */
2428
+ /** Where a pin was found. */
2429
+ type ArkgatePinSource = 'package-json' | 'package-lock' | 'installed' | 'hook' | 'ci';
2430
+ type ArkgatePinEvidence = {
2431
+ /** Repo-relative file that pins arkgate. */
2432
+ file: string;
2433
+ /** 1-based line of the pin. */
2434
+ line: number;
2435
+ /** Pinned version, without a leading `v`. */
2436
+ version: string;
2437
+ source: ArkgatePinSource;
2438
+ };
2439
+
2440
+ declare const POLICY_DELTA_SCHEMA_VERSION: "1.0";
2441
+ type PolicyDeltaClassification = 'strengthening' | 'neutral' | 'judgment-required' | 'weakening';
2442
+ type PolicyDeltaFinding = {
2443
+ id: string;
2444
+ path: string;
2445
+ classification: Exclude<PolicyDeltaClassification, 'neutral'>;
2446
+ message: string;
2447
+ nextAction?: string;
2448
+ before?: unknown;
2449
+ after?: unknown;
2450
+ };
2451
+ type PolicyDelta = {
2452
+ schemaVersion: typeof POLICY_DELTA_SCHEMA_VERSION;
2453
+ classification: PolicyDeltaClassification;
2454
+ findings: PolicyDeltaFinding[];
2455
+ };
2456
+ type PolicyDeltaAcknowledgement = {
2457
+ schemaVersion: typeof POLICY_DELTA_SCHEMA_VERSION;
2458
+ basePolicyHash: string;
2459
+ candidatePolicyHash: string;
2460
+ findingIds: readonly string[];
2461
+ reason: string;
2462
+ /**
2463
+ * Relative decision-note path under a conventional home (`docs/adr/`,
2464
+ * `docs/decisions/`, or the AP01 single-file homes). Tooling checks the file.
2465
+ * Hash matching does not require it.
2466
+ */
2467
+ adrPath?: string;
2468
+ };
2469
+ type ClassifyArkPolicyDeltaOptions = {
2470
+ baseArkRules?: EffectiveArkRules;
2471
+ candidateArkRules?: EffectiveArkRules;
2472
+ /**
2473
+ * AR11 — coverage evidence for candidate invariants. Required to auto-allow
2474
+ * advisory→enforced promotion; without it (or when uncovered), promotion is
2475
+ * judgment-required / refused.
2476
+ */
2477
+ candidateInvariantCoverage?: readonly InvariantCoverageEvidence[];
2478
+ };
2479
+ declare function classifyArkPolicyDelta(base: ArkConfig, candidate: ArkConfig, options?: ClassifyArkPolicyDeltaOptions): PolicyDelta;
2480
+ declare function policyDeltaAcknowledgementMatches(acknowledgement: PolicyDeltaAcknowledgement | undefined, expected: {
2481
+ basePolicyHash: string;
2482
+ candidatePolicyHash: string;
2483
+ findingIds: readonly string[];
2484
+ }): boolean;
2485
+
2486
+ type AnalysisContract = ArkConfigLoadResult & {
2487
+ policyHash: string;
2488
+ /**
2489
+ * ADR 0012 Effective ArkRules (empty when arkRules is absent).
2490
+ * Included in policyHash when non-empty so arkrules edits invalidate identity.
2491
+ */
2492
+ arkRules?: EffectiveArkRules;
2493
+ /**
2494
+ * ADR 0013 class-shape facts for ArkRules sensors (Tooling-supplied).
2495
+ * Empty / absent when ArkRules are not active.
2496
+ */
2497
+ classShapes?: ClassShapeFact[];
2498
+ };
2499
+ type AnalyzeProjectInput = {
2500
+ contract: AnalysisContract;
2501
+ files: readonly AnalysisFileInput[];
2502
+ compilerOptions?: AnalysisCompilerOptions;
2503
+ };
2504
+ type AnalyzeChangeInput = AnalyzeProjectInput & {
2505
+ changes: readonly AnalysisFileChange[];
2506
+ changeMap?: ArchitectureChangeMapContract;
2507
+ };
2508
+ type AnalysisResult = {
2509
+ mode: 'lexical-compatibility';
2510
+ completeness: ResolvedFactsCompleteness;
2511
+ completenessReasons: ResolvedFactsReason[];
2512
+ valid: boolean;
2513
+ ir: AnalysisIr;
2514
+ };
2515
+ type AnalyzeResolvedProjectInput = {
2516
+ contract: AnalysisContract;
2517
+ facts: unknown;
2518
+ /** Tooling FS evidence of arkgate pins. Omitted: version-floor warnings stay silent. */
2519
+ arkgatePins?: readonly ArkgatePinEvidence[];
2520
+ /** The running arkgate version, for the version-floor nextAction. */
2521
+ runningArkgateVersion?: string;
2522
+ /**
2523
+ * D0 adopted or --require-gates / --strict-merge. When true, a missing
2524
+ * domain-invariant tests path fails closed. Omitted stays silent.
2525
+ */
2526
+ adopted?: boolean;
2527
+ /**
2528
+ * Tooling FS check for the declared tests path. `false` means empty on disk.
2529
+ * Omitted: a non-empty config declaration is enough.
2530
+ */
2531
+ invariantTestsPathPresent?: boolean;
2532
+ /**
2533
+ * Tooling FS check for declared `coverage.coverageRoots`. `false` means
2534
+ * missing or empty on disk. Omitted: a non-empty config declaration is enough.
2535
+ */
2536
+ coverageRootsPresent?: boolean;
2537
+ /**
2538
+ * AR10 — Tooling-supplied contents for invariant coverage evidence.
2539
+ * When omitted and the Effective Contract has invariants, coverage is partial
2540
+ * (never false green covered).
2541
+ */
2542
+ coverageInputs?: {
2543
+ fileContents: Readonly<Record<string, string>>;
2544
+ testFiles?: readonly string[];
2545
+ testGlobsMissing?: boolean;
2546
+ coverageBudgetExhausted?: boolean;
2547
+ /** Declared `coverage.coverageRoots`: where the project says its runner runs. */
2548
+ coverageRoots?: readonly string[];
2549
+ /** Counted scan facts: files loaded, tests retained, discards by reason. */
2550
+ stats?: InvariantCoverageStats;
2551
+ };
2552
+ /**
2553
+ * AR07 — Tooling-supplied orchestration/thin-adapter heuristics per file.
2554
+ * Prefer deriveArkRuleFileHints / buildArkRuleFileHints (Domain pure).
2555
+ * When omitted, orchestration-only, thin-adapter, and writes-via-aggregate
2556
+ * sensors stay silent.
2557
+ */
2558
+ fileHints?: Readonly<Record<string, {
2559
+ orchestrationHeavy?: boolean;
2560
+ adapterThick?: boolean;
2561
+ persistenceWrite?: boolean;
2562
+ }>>;
2563
+ };
2564
+ /** Tooling-supplied analysis evidence for one side (base or candidate) of a preflight. */
2565
+ type ResolvedAnalysisSideInputs = Pick<AnalyzeResolvedProjectInput, 'adopted' | 'invariantTestsPathPresent' | 'coverageRootsPresent' | 'coverageInputs' | 'fileHints'>;
2566
+ type PreflightResolvedChangeInput = {
2567
+ contract: AnalysisContract;
2568
+ baseFacts: unknown;
2569
+ candidateFacts: unknown;
2570
+ changes: readonly AnalysisFileChange[];
2571
+ changeMap?: ArchitectureChangeMapContract;
2572
+ /**
2573
+ * ArkRules evidence (coverage contents, structural hints) for the on-disk base and
2574
+ * the in-memory candidate, so preflight runs the same engine inputs as ark-check.
2575
+ */
2576
+ baseAnalysisInputs?: ResolvedAnalysisSideInputs;
2577
+ candidateAnalysisInputs?: ResolvedAnalysisSideInputs;
2578
+ };
2579
+ type ResolvedAnalysisFile = ResolvedFileFact & {
2580
+ layer: string | null;
2581
+ };
2582
+ type ResolvedAnalysisIr = {
2583
+ schemaVersion: '1.0';
2584
+ policyHash: string;
2585
+ compilerOptionsHash: string;
2586
+ files: ResolvedAnalysisFile[];
2587
+ layers: string[];
2588
+ edges: ArchitectureEngineEdge[];
2589
+ capabilityUses: ResolvedCapabilityFact[];
2590
+ violations: ArchitectureEngineViolation[];
2591
+ warnings: ArchitectureEngineViolation[];
2592
+ };
2593
+ type ResolvedSafetyReport = {
2594
+ tsSuppressions: {
2595
+ file: string;
2596
+ line: number;
2597
+ }[];
2598
+ anyCasts: {
2599
+ file: string;
2600
+ line: number;
2601
+ }[];
2602
+ nonLiteralDynamicImports: {
2603
+ file: string;
2604
+ line: number;
2605
+ kind: 'import' | 'require';
2606
+ }[];
2607
+ inMemoryProductionStores: {
2608
+ file: string;
2609
+ line: number;
2610
+ store: string;
2611
+ }[];
2612
+ disabledPeerIsolationRules: {
2613
+ from: string;
2614
+ to: string;
2615
+ }[];
2616
+ thresholds: {
2617
+ maxTsSuppressions: number;
2618
+ maxAnyCasts: number;
2619
+ };
2620
+ };
2621
+ type ResolvedAnalysisResult = {
2622
+ mode: 'resolved-candidate-facts';
2623
+ completeness: ResolvedFactsCompleteness;
2624
+ completenessReasons: ResolvedFactsReason[];
2625
+ valid: boolean;
2626
+ strictValid: boolean;
2627
+ policyHash: string;
2628
+ factsHash: ResolvedCandidateFacts['factsHash'];
2629
+ resolverIdentity: ResolvedCandidateFacts['resolverIdentity'];
2630
+ candidateTreeHash: ResolvedCandidateFacts['candidateTreeHash'];
2631
+ safety: ResolvedSafetyReport;
2632
+ ir: ResolvedAnalysisIr;
2633
+ };
2634
+ type ResolvedChangePreflightResult = {
2635
+ schemaVersion: '1.0';
2636
+ mode: 'resolved-candidate-facts';
2637
+ valid: boolean;
2638
+ readOnly: true;
2639
+ policyHash: string;
2640
+ resolverIdentity: string;
2641
+ compilerIdentity: string;
2642
+ compilerOptionsHash: string;
2643
+ tsconfigHash: string;
2644
+ baseCompilerOptionsHash: string;
2645
+ candidateCompilerOptionsHash: string;
2646
+ baseTsconfigHash: string;
2647
+ candidateTsconfigHash: string;
2648
+ evidenceRequirementsHash: string;
2649
+ baseFactsHash: string;
2650
+ candidateFactsHash: string;
2651
+ baseTreeHash: string;
2652
+ candidateTreeHash: string;
2653
+ baseCompleteness: ResolvedFactsCompleteness;
2654
+ candidateCompleteness: ResolvedFactsCompleteness;
2655
+ baseCompletenessReasons: ResolvedFactsReason[];
2656
+ candidateCompletenessReasons: ResolvedFactsReason[];
2657
+ changeMapHash?: string;
2658
+ convergence?: ArchitectureConvergenceResult;
2659
+ changes: PreparedChangeFile[];
2660
+ violations: ArchitectureEngineViolation[];
2661
+ warnings: ArchitectureEngineViolation[];
2662
+ };
2663
+ type AnalyzePolicyDeltaInput = {
2664
+ baseConfig: unknown;
2665
+ candidateConfig: unknown;
2666
+ acknowledgement?: PolicyDeltaAcknowledgement;
2667
+ baseSource?: string;
2668
+ candidateSource?: string;
2669
+ /** Optional pre-resolved Effective ArkRules for each side (ADR 0012 / AR02). */
2670
+ baseArkRules?: EffectiveArkRules;
2671
+ candidateArkRules?: EffectiveArkRules;
2672
+ /**
2673
+ * AR11 — optional coverage evidence for candidate invariants.
2674
+ * When omitted, advisory→enforced promotion is judgment-required (refuse auto-allow).
2675
+ */
2676
+ candidateInvariantCoverage?: readonly InvariantCoverageEvidence[];
2677
+ };
2678
+ type PolicyDeltaAnalysis = {
2679
+ schemaVersion: '1.0';
2680
+ basePolicyHash: string;
2681
+ candidatePolicyHash: string;
2682
+ classification: PolicyDeltaClassification;
2683
+ findings: PolicyDeltaFinding[];
2684
+ blockingFindingIds: string[];
2685
+ requiresAcknowledgement: boolean;
2686
+ acknowledged: boolean;
2687
+ valid: boolean;
2688
+ };
2689
+ type ArchitectureEngineViolation = {
2690
+ ruleId: string;
2691
+ message: string;
2692
+ file?: string;
2693
+ line?: number;
2694
+ target?: string;
2695
+ fromLayer?: string;
2696
+ toLayer?: string;
2697
+ nextAction?: string;
2698
+ [key: string]: unknown;
2699
+ };
2700
+ type ArchitectureEngineEdge = {
2701
+ from: string;
2702
+ fromLayer: string | null;
2703
+ to?: string;
2704
+ toLayer?: string;
2705
+ line: number;
2706
+ kind: string;
2707
+ typeOnly?: boolean;
2708
+ targetTypeOnlyExports?: boolean;
2709
+ sourcePureTypeModule?: boolean;
2710
+ namedBindingsTypeOnly?: boolean;
2711
+ portProofEligible?: boolean;
2712
+ };
2713
+ type EvaluateArchitectureGraphInput = {
2714
+ config: ArkConfig;
2715
+ rules: ArkConfig['rules'];
2716
+ files: readonly string[];
2717
+ contentViolations: readonly ArchitectureEngineViolation[];
2718
+ edges: readonly ArchitectureEngineEdge[];
2719
+ warnings?: readonly ArchitectureEngineViolation[];
2720
+ safety?: unknown;
2721
+ };
2722
+ type ArchitectureEngineResult = {
2723
+ violations: ArchitectureEngineViolation[];
2724
+ warnings: ArchitectureEngineViolation[];
2725
+ safety?: unknown;
2726
+ };
2727
+ type PreparedChangeFile = {
2728
+ path: string;
2729
+ operation: 'create' | 'update' | 'delete';
2730
+ beforeContentHash?: string;
2731
+ candidateContentHash?: string;
2732
+ };
2733
+ type ChangePreflightResult = {
2734
+ schemaVersion: '1.0';
2735
+ mode: 'lexical-compatibility';
2736
+ valid: boolean;
2737
+ readOnly: true;
2738
+ policyHash: string;
2739
+ compilerOptionsHash: string;
2740
+ baseTreeHash: string;
2741
+ candidateTreeHash: string;
2742
+ baseCompleteness: ResolvedFactsCompleteness;
2743
+ candidateCompleteness: ResolvedFactsCompleteness;
2744
+ baseCompletenessReasons: ResolvedFactsReason[];
2745
+ candidateCompletenessReasons: ResolvedFactsReason[];
2746
+ changeMapHash?: string;
2747
+ convergence?: ArchitectureConvergenceResult;
2748
+ changes: PreparedChangeFile[];
2749
+ violations: ArchitectureEngineViolation[];
2750
+ warnings: ArchitectureEngineViolation[];
2751
+ };
2752
+ type CollectAnalysisConfigWarningsInput = {
2753
+ config: ArkConfig;
2754
+ rules: ArkConfig['rules'];
2755
+ files: readonly string[];
2756
+ /**
2757
+ * Tooling FS evidence of arkgate pins in this repo (package.json, lockfile,
2758
+ * installed copy, hook scripts, CI). Omitted: version-floor warnings stay silent.
2759
+ */
2760
+ arkgatePins?: readonly ArkgatePinEvidence[];
2761
+ /** The running arkgate version. The version-floor nextAction targets it when newer. */
2762
+ runningArkgateVersion?: string;
2763
+ manifest?: {
2764
+ architecture?: {
2765
+ layers?: readonly {
2766
+ name?: string;
2767
+ prefixes?: readonly string[];
2768
+ }[];
2769
+ };
2770
+ };
2771
+ };
2772
+
2773
+ /**
2774
+ * Contract loading, project/change analysis, and policy-delta analysis
2775
+ * (U02 pilot 2). Reached through the src/kernel/analysis.ts facade; consumer
2776
+ * import paths never change.
2777
+ */
2778
+
2779
+ type LoadContractOptions = {
2780
+ /** Pre-resolved Effective ArkRules (from resolveEffectiveContract). */
2781
+ arkRules?: EffectiveArkRules;
2782
+ };
2783
+ declare function loadContract(input: unknown, source?: string, options?: LoadContractOptions): AnalysisContract;
2784
+ declare function analyzePolicyDelta(input: AnalyzePolicyDeltaInput): PolicyDeltaAnalysis;
2785
+ declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
2786
+ declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
2787
+ declare function explainViolation(violation: AnalysisViolation): string;
2788
+
2789
+ declare function detectArchitectureCycles(graph: ReadonlyMap<string, ReadonlySet<string>>): ArchitectureEngineViolation[];
2790
+ /** Canonical graph and layer-policy evaluator shared by library, CLI, and MCP adapters. */
2791
+ declare function evaluateArchitectureGraph(input: EvaluateArchitectureGraphInput): ArchitectureEngineResult;
2792
+
2793
+ /**
2794
+ * Pure evaluation of validated, resolver-supplied candidate facts (ADR 0011).
2795
+ *
2796
+ * Filesystem discovery and TypeScript resolution remain Tooling concerns. This
2797
+ * module only classifies canonical paths against the supplied contract and
2798
+ * produces the one architecture verdict consumed by every resolved adapter.
2799
+ */
2800
+
2801
+ /** Validate supplied facts and evaluate their graph without host effects. */
2802
+ declare function analyzeResolvedProject(input: AnalyzeResolvedProjectInput): ResolvedAnalysisResult;
2803
+
2804
+ /**
2805
+ * Evaluate one create/update/delete set as a single in-memory candidate.
2806
+ * The function never writes and returns hashes that bind a later host commit to
2807
+ * the exact base, policy, compiler options, and candidate contents it checked.
2808
+ */
2809
+ declare function preflightChange(input: AnalyzeChangeInput): ChangePreflightResult;
2810
+
2811
+ /** Atomic preflight over one validated base/candidate facts pair (ADR 0011). */
2812
+
2813
+ /**
2814
+ * Validate that the supplied candidate is exactly the declared in-memory
2815
+ * overlay, then return its canonical resolved verdict. No project file is read
2816
+ * or written here.
2817
+ */
2818
+ declare function preflightResolvedChange(input: PreflightResolvedChangeInput): ResolvedChangePreflightResult;
2819
+
2820
+ /** Canonical config diagnostics over repo-relative file paths. */
2821
+ declare function collectAnalysisConfigWarnings(input: CollectAnalysisConfigWarningsInput): ArchitectureEngineViolation[];
2822
+
2823
+ /**
2824
+ * Public diagnostic code catalog (ACS02).
2825
+ *
2826
+ * Closed vocabulary of stable `ruleId` values emitted by ArkGate adapters with
2827
+ * human/agent `why` / `fix` anchors and docs fragment ids. Cataloguing only —
2828
+ * no new rule semantics, no LLM verdict, no enforcement from prose.
2829
+ *
2830
+ * **Canonical** for docs, agent projection (ACS04), and finding refs (ACS06).
2831
+ * Runtime remediation remains in `remediation.ts`; parity tests bind the two.
2832
+ *
2833
+ * Zero Node I/O. Optional CLI surface: generated `bin/lib/diagnostic-catalog.mjs`.
2834
+ *
2835
+ * @see docs/diagnostics.md
2836
+ * @see docs/plans/agent-contract-surface-4.3/README.md
2837
+ */
2838
+ /** Product-relative docs path (shipped in the npm tarball when listed in package files). */
2839
+ declare const DIAGNOSTIC_DOCS_RELATIVE_PATH: "docs/diagnostics.md";
2840
+ /** Schema id for serializing the catalog snapshot (agents / install projection). */
2841
+ declare const DIAGNOSTIC_CATALOG_SCHEMA_VERSION: "1.0";
2842
+ type DiagnosticCategory = 'layer' | 'capability' | 'publish' | 'safety' | 'arkrules' | 'arkrun' | 'arkorder' | 'preflight' | 'analysis' | 'drift' | 'snippet-policy' | 'config' | 'adapter' | 'meta';
2843
+ type DiagnosticCatalogEntry = {
2844
+ /** Stable public violation / diagnostic id. */
2845
+ ruleId: string;
2846
+ /** Short title for indexes and agent projection. */
2847
+ title: string;
2848
+ /** Why this finding exists (contract intent). */
2849
+ why: string;
2850
+ /**
2851
+ * Canonical fix guidance (agent + human). Contextual nextAction on live
2852
+ * findings may specialize this (e.g. type-only vs value layer import).
2853
+ */
2854
+ fix: string;
2855
+ /** Markdown fragment id for docs/diagnostics.md (without leading #). */
2856
+ docsAnchor: string;
2857
+ category: DiagnosticCategory;
2858
+ /**
2859
+ * When true, finding is commonly advisory / non-blocking in default profiles
2860
+ * (doctor/config warnings, type-only placement debt, empty ArkRule scope).
2861
+ * Not a severity bit for the engine — documentation only.
2862
+ */
2863
+ oftenAdvisory?: boolean;
2864
+ };
2865
+ /**
2866
+ * Closed public catalog. Order is stable (category groups, then ruleId) for
2867
+ * deterministic serialization and docs generation.
2868
+ *
2869
+ * Every production-emitted `ruleId` must appear here. Remediation switch cases
2870
+ * and adapter nextAction branches are parity-tested against this list.
2871
+ */
2872
+ declare const DIAGNOSTIC_CATALOG: readonly DiagnosticCatalogEntry[];
2873
+ /** All public ruleIds in catalog order. */
2874
+ declare const DIAGNOSTIC_RULE_IDS: readonly string[];
2875
+ declare function isKnownDiagnosticCode(ruleId: string | null | undefined): boolean;
2876
+ /**
2877
+ * True when the code is catalogued or is an ArkRule-family id handled by the
2878
+ * ARKRULE_* prefix fallback in remediation (structure sensors may add members later
2879
+ * only via catalog + ROADMAP — prefix alone is not a license for free-form ids).
2880
+ */
2881
+ declare function isCataloguedOrArkRuleFamily(ruleId: string | null | undefined): boolean;
2882
+ declare function getDiagnosticCatalogEntry(ruleId: string | null | undefined): DiagnosticCatalogEntry | undefined;
2883
+ /** Fragment for docs links, e.g. `#LAYER_IMPORT_VIOLATION`. */
2884
+ declare function diagnosticDocsFragment(ruleId: string): string;
2885
+ /**
2886
+ * Repo-relative docs path with fragment (for agents and JSON).
2887
+ * Package consumers resolve against the installed package root or GitHub tree.
2888
+ */
2889
+ declare function diagnosticDocsPath(ruleId: string): string;
2890
+ /** Catalog snapshot for JSON export / agent projection (stable field order). */
2891
+ declare function serializeDiagnosticCatalog(): {
2892
+ schemaVersion: typeof DIAGNOSTIC_CATALOG_SCHEMA_VERSION;
2893
+ docsPath: typeof DIAGNOSTIC_DOCS_RELATIVE_PATH;
2894
+ codes: readonly DiagnosticCatalogEntry[];
2895
+ };
2896
+ /**
2897
+ * Static catalog fix for a ruleId when no live violation context is available.
2898
+ * Live adapters should still use deterministicNextAction for specialized edges.
2899
+ */
2900
+ declare function catalogFixForRuleId(ruleId: string | null | undefined): string | undefined;
2901
+ /**
2902
+ * Static catalog why for a ruleId (agent “why” surface).
2903
+ */
2904
+ declare function catalogWhyForRuleId(ruleId: string | null | undefined): string | undefined;
2905
+
2906
+ /** Public, evidence-backed enforcement state shared by doctor adapters. */
2907
+ declare const ARK_ENFORCEMENT_STATE_SCHEMA_VERSION: "1.1";
2908
+ type EnforcementVerification = boolean | 'unverified';
2909
+ type EnforcementEvidenceField = 'configured' | 'installed' | 'active' | 'runtimeObserved' | 'operationCoverage' | 'bypassable' | 'required' | 'hard';
2910
+ type EnforcementEvidence = {
2911
+ field: 'configured' | 'installed' | 'runtimeObserved' | 'hard';
2912
+ source: string;
2913
+ value: boolean;
2914
+ } | {
2915
+ field: 'active' | 'operationCoverage' | 'bypassable' | 'required';
2916
+ source: string;
2917
+ value: EnforcementVerification;
2918
+ };
2919
+ /**
2920
+ * State for one enforcement boundary.
2921
+ *
2922
+ * `configured` records valid wiring, while `installed` requires the referenced
2923
+ * package or executable to resolve. Runtime/provider facts remain
2924
+ * `unverified` until observed; local files never prove `required: true`.
2925
+ */
2926
+ type EnforcementBoundaryState = {
2927
+ supported: boolean;
2928
+ analyzed: boolean;
2929
+ configured: boolean;
2930
+ installed: boolean;
2931
+ active: EnforcementVerification;
2932
+ runtimeObserved: boolean;
2933
+ operation: string | null;
2934
+ operationCoverage: EnforcementVerification;
2935
+ bypassable: EnforcementVerification;
2936
+ required: EnforcementVerification;
2937
+ hard: boolean;
2938
+ evidence: readonly EnforcementEvidence[];
2939
+ };
2940
+ type ArkEnforcementHost = 'claude' | 'grok' | 'cursor' | 'codex' | 'unknown';
2941
+ type ArkEnforcementState = {
2942
+ schemaVersion: typeof ARK_ENFORCEMENT_STATE_SCHEMA_VERSION;
2943
+ activeHost: ArkEnforcementHost;
2944
+ localWrite: EnforcementBoundaryState;
2945
+ advisoryMcp: EnforcementBoundaryState;
2946
+ ciMerge: EnforcementBoundaryState;
2947
+ };
2948
+
2949
+ /** Public neutral contract for the opt-in new-code design-fitness ratchet. */
2950
+ declare const ARK_DESIGN_DELTA_SCHEMA_VERSION: "1.0";
2951
+ type DesignSmellId = 'io-under-application' | 'handler-in-persistence' | 'god-module' | 'domain-logic-in-ui' | 'facade-sql-in-routes' | 'mixed-pattern-cluster' | 'soft-contract';
2952
+ type DesignDeltaIdentity = {
2953
+ kind: 'git-tree' | 'candidate-tree';
2954
+ value: string;
2955
+ commit?: string;
2956
+ };
2957
+ type DesignSmellEvidence = {
2958
+ kind: string;
2959
+ path: string;
2960
+ line?: number;
2961
+ symbol?: string;
2962
+ detail?: string;
2963
+ magnitude: number;
2964
+ };
2965
+ type DesignSmellFinding = {
2966
+ smellId: DesignSmellId;
2967
+ fingerprint: string;
2968
+ identity: string;
2969
+ evidence: DesignSmellEvidence;
2970
+ repairHint: string;
2971
+ };
2972
+ type DesignDeltaChange = DesignSmellFinding & {
2973
+ classification: 'new' | 'worsened';
2974
+ baseMagnitude: number;
2975
+ candidateMagnitude: number;
2976
+ };
2977
+ /** Created-path merge vs full new+worsened ratchet (Z10). Omitted on older producers. */
2978
+ type DesignDeltaEnforcementScope = 'created-paths' | 'touched-new-or-worsened';
2979
+ type ArkDesignDeltaResult = {
2980
+ schemaVersion: typeof ARK_DESIGN_DELTA_SCHEMA_VERSION;
2981
+ mode: 'git-base' | 'write-candidate';
2982
+ complete: boolean;
2983
+ valid: boolean;
2984
+ base: DesignDeltaIdentity;
2985
+ candidate: DesignDeltaIdentity;
2986
+ supportedSmellIds: readonly DesignSmellId[];
2987
+ touchedPaths: readonly string[];
2988
+ changes: readonly DesignDeltaChange[];
2989
+ baseFindingCount: number;
2990
+ candidateFindingCount: number;
2991
+ historicalResidualCount: number;
2992
+ enforcementScope?: DesignDeltaEnforcementScope;
2993
+ error?: string;
2994
+ };
2995
+
2996
+ /**
2997
+ * In-memory shadow / replay / compare for ArkRun information packages (XP07 / ADR 0033).
2998
+ * Not durable. Not a second bus. Stripped snapshots only.
2999
+ */
3000
+
3001
+ type InformationPackageDiff = {
3002
+ readonly path: string;
3003
+ readonly left: unknown;
3004
+ readonly right: unknown;
3005
+ };
3006
+ type InformationPackageCompare = {
3007
+ readonly equal: boolean;
3008
+ readonly diffs: readonly InformationPackageDiff[];
3009
+ };
3010
+ /** Shadow: identity snapshot. The live kernel is not copied. */
3011
+ declare function shadowInformationPackage(pack: DependencyInformationPackage): DependencyInformationPackage;
3012
+ declare function compareInformationPackages(left: DependencyInformationPackage, right: DependencyInformationPackage): InformationPackageCompare;
3013
+ /**
3014
+ * Replay: apply sequential snapshots as the "tape". Each step is compared to
3015
+ * the previous shadow. No bus, no store, no time travel across processes.
3016
+ */
3017
+ declare function replayInformationPackages(tape: readonly DependencyInformationPackage[]): InformationPackageCompare[];
3018
+
3019
+ /**
3020
+ * Default cap for in-memory history, trace, audit, and default event-buffer
3021
+ * records. Without a cap a long-running process grows without bound on every
3022
+ * publish. Pass `maxHistorySize: Infinity` to explicitly opt back into unbounded
3023
+ * retention. An injected `eventBuffer` owns its own retention.
3024
+ */
3025
+ declare const DEFAULT_MAX_HISTORY_SIZE = 1000;
3026
+ declare function createArkKernel(options?: CreateArkKernelOptions): ArkKernel;
3027
+ /**
3028
+ * Preferred ArkRun factory. Each call is a new isolated instance — there is no
3029
+ * process-wide singleton.
3030
+ */
3031
+ declare function createStrictArkKernel(options?: CreateArkKernelOptions): ArkKernel;
3032
+ declare function createArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
3033
+ /**
3034
+ * Strict kernel whose runtime layer profile comes from `ark.config.json`.
3035
+ * Hard observed-layer-flow needs every layer a deny rule names to resolve an
3036
+ * intent: declared `intentPrefixes`, or a canonical 11-layer name (`DomainModel`,
3037
+ * `ApplicationOrchestration`, … — what `ark init` writes) which gets the built-in
3038
+ * prefixes. A custom-named deny layer without prefixes is recorded as a
3039
+ * `layer.observedFlowUnresolvable` audit record (`ARKRUN_LAYER_FLOW_UNRESOLVABLE`);
3040
+ * passing `enforceObservedLayerFlow: 'hard'` explicitly throws `ArkKernelConfigError`
3041
+ * instead.
432
3042
  */
433
- declare function createStrictArkKernel(options?: CreateArkKernelOptions): ArkKernel;
434
- declare function createArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
435
3043
  declare function createStrictArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
436
3044
  declare function createLenientArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
437
3045
  declare function createLenientArkKernel(options?: CreateArkKernelOptions): ArkKernel;
@@ -517,4 +3125,4 @@ declare function createAdapter<T>(port: Port<T>, impl: T, requiredKeysOrOptions?
517
3125
  declare function checkContract(impl: unknown, requiredKeys?: string[]): ContractCheckResult;
518
3126
  declare function checkAdapterGovernance(adapter: Adapter): AdapterGovernanceResult;
519
3127
 
520
- export { type Adapter, type AdapterGovernanceIssue, type AdapterGovernanceResult, ArchitectureProfile, ArkKernel, ArkKernelConfig, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ContractCheckResult, type CreateAdapterOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DependencyInformationPackage, DomainEvent, EventBufferRecord, EventBufferStatus, EventBufferStore, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryEventBuffer, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, type InformationPackageCompare, type InformationPackageDiff, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, Policy, PolicyEnforcementMode, PolicyEngine, PolicySeverity, PolicyViolation, PolicyViolationError, type Port, ProjectionRegistry, type PublishPolicyContext, ReadModelStore, SagaDefinition, SagaInstance, SourceMetadataOverrideError, type SyncRegistryOptions, TraceRecord, TraceRecordType, UnknownEventSourceError, UnregisteredIntentError, WorkflowEngine, WorkflowSnapshot, WorkflowStore, architecturalPolicies, buildPublishPolicyContext, checkAdapterGovernance, checkContract, compareInformationPackages, createAdapter, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, isLayerPolicy, replayInformationPackages, shadowInformationPackage, syncRegistryToGraph, validateIntentName };
3128
+ export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, ARK_ANALYSIS_RESULT_SCHEMA, ARK_ANALYSIS_RESULT_SCHEMA_VERSION, ARK_DESIGN_DELTA_SCHEMA_VERSION, ARK_ENFORCEMENT_STATE_SCHEMA_VERSION, type Adapter, type AdapterCompletenessReason, type AdapterDiagnostic, type AdapterGovernanceIssue, type AdapterGovernanceResult, type AdapterResult, type AdapterSeverity, type AdapterViolationInput, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisCompleteness, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisMode, type AnalysisResult, type AnalysisViolation, type AnalyzeArchitectureConvergenceInput, type AnalyzeChangeInput, type AnalyzePolicyDeltaInput, type AnalyzeProjectInput, type AnalyzeResolvedProjectInput, type ArchitectureActualChange, type ArchitectureChangeMap, type ArchitectureChangeMapContract, type ArchitectureChangeMapDependency, type ArchitectureChangeMapFile, type ArchitectureChangeOperation, type ArchitectureConvergenceClassification, type ArchitectureConvergenceFinding, type ArchitectureConvergenceResult, type ArchitectureDependency, type ArchitectureEngineEdge, type ArchitectureEngineResult, type ArchitectureEngineViolation, ArchitectureProfile, ArkCheckConfig, type ArkDesignDeltaResult, type ArkEnforcementHost, type ArkEnforcementState, ArkKernel, ArkKernelConfig, ArkKernelConfigError, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ChangePreflightResult, type CollectAnalysisConfigWarningsInput, type ContractCheckResult, type CreateAdapterOptions, CreateArchitectureProfileFromArkConfigOptions, CreateArchitectureProfileOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateElevenLayerArkConfigOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DIAGNOSTIC_CATALOG, DIAGNOSTIC_CATALOG_SCHEMA_VERSION, DIAGNOSTIC_DOCS_RELATIVE_PATH, DIAGNOSTIC_RULE_IDS, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DependencyInformationPackage, type DesignDeltaChange, type DesignDeltaEnforcementScope, type DesignDeltaIdentity, type DesignSmellEvidence, type DesignSmellFinding, type DesignSmellId, type DiagnosticCatalogEntry, type DiagnosticCategory, DomainEvent, type EnforcementBoundaryState, type EnforcementEvidence, type EnforcementEvidenceField, type EnforcementVerification, type EvaluateArchitectureGraphInput, EventBufferRecord, EventBufferStatus, EventBufferStore, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, type ForbiddenCapabilityUse, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryEventBuffer, type InMemoryEventBufferOptions, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, type InformationPackageCompare, type InformationPackageDiff, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, POLICY_DELTA_SCHEMA_VERSION, Policy, type PolicyDelta, type PolicyDeltaAcknowledgement, type PolicyDeltaAnalysis, type PolicyDeltaClassification, type PolicyDeltaFinding, PolicyEnforcementMode, PolicyEngine, PolicySeverity, PolicyViolation, PolicyViolationError, type Port, type PreflightResolvedChangeInput, type PreparedChangeFile, ProjectionRegistry, type PublishPolicyContext, RESOLVED_CANDIDATE_FACTS_SCHEMA, RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION, ReadModelStore, type ResolvedAmbientFact, type ResolvedAnalysisFile, type ResolvedAnalysisIr, type ResolvedAnalysisResult, type ResolvedArkRunCompositionRootHitFact, type ResolvedArkRunDeclarationFact, type ResolvedArkRunKernelCallFact, type ResolvedArkRunKernelCallKind, type ResolvedArkRunManagedNewFact, type ResolvedCandidateFacts, type ResolvedCandidateFactsInput, type ResolvedCapability, type ResolvedCapabilityFact, type ResolvedChangePreflightResult, type ResolvedDependencyFact, type ResolvedDependencyKind, type ResolvedDependencyState, type ResolvedFactsCompleteness, type ResolvedFactsReason, type ResolvedFileFact, type ResolvedIntentReferenceFact, type ResolvedPublishFact, type ResolvedSafetyFact, type ResolvedSafetyKind, type ResolvedSafetyReport, SagaDefinition, SagaInstance, type SemanticDependency, type SemanticDependencyKind, SourceMetadataOverrideError, type SyncRegistryOptions, TraceRecord, TraceRecordType, UnknownEventSourceError, UnregisteredIntentError, WorkflowEngine, WorkflowSnapshot, WorkflowStore, analyzeArchitectureConvergence, analyzeChange, analyzePolicyDelta, analyzeProject, analyzeResolvedProject, architecturalPolicies, buildPublishPolicyContext, catalogFixForRuleId, catalogWhyForRuleId, checkAdapterGovernance, checkContract, classifyArkPolicyDelta, collectAnalysisConfigWarnings, collectForbiddenCapabilityUses, compareInformationPackages, createAICodeGate, createAdapter, createAdapterResult, createArchitectureProfile, createArchitectureProfileFromArkConfig, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createElevenLayerArkConfig, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createResolvedCandidateFacts, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, detectArchitectureCycles, deterministicHash, diagnosticDocsFragment, diagnosticDocsPath, elevenLayerProfile, evaluateArchitectureGraph, explainViolation, extractSemanticDependencies, getDiagnosticCatalogEntry, isCataloguedOrArkRuleFamily, isKnownDiagnosticCode, isLayerPolicy, loadContract, loadResolvedCandidateFacts, policyDeltaAcknowledgementMatches, preflightChange, preflightResolvedChange, replayInformationPackages, resolvedFactsEvidenceRequirementsHash, serializeDiagnosticCatalog, shadowInformationPackage, stableSerialize, syncRegistryToGraph, toAdapterDiagnostic, validateIntentName, version };