arkgate 2.12.0 → 2.13.0

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 (70) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +55 -31
  3. package/bin/ark-check.mjs +95 -36
  4. package/bin/ark-mcp.mjs +11 -5
  5. package/bin/ark-shared.mjs +88 -56
  6. package/bin/ark.mjs +45 -10
  7. package/bin/lib/agent-gates.mjs +12 -0
  8. package/bin/lib/architecture-scan.mjs +8 -0
  9. package/bin/lib/ci-and-commands.mjs +9 -3
  10. package/bin/lib/codex-home.mjs +7 -0
  11. package/bin/lib/config-contract.mjs +331 -0
  12. package/bin/lib/doctor-plan.mjs +43 -16
  13. package/bin/lib/enforcement-profiles.mjs +97 -0
  14. package/bin/lib/host-support-matrix.mjs +77 -0
  15. package/bin/lib/install-migrate.mjs +45 -14
  16. package/bin/lib/mcp-adoption.mjs +35 -3
  17. package/bin/lib/open-html.mjs +75 -0
  18. package/bin/lib/presets.mjs +3 -2
  19. package/bin/lib/safety-diagnostics.mjs +31 -11
  20. package/bin/lib/skill-install.mjs +64 -0
  21. package/bin/lib/ts-resolve.mjs +2 -1
  22. package/bin/lib/weakest-link.mjs +417 -0
  23. package/bin/lib/write-path-capabilities.mjs +182 -0
  24. package/bin/lib/write-path-detect.mjs +62 -99
  25. package/dist/configContract-iBLxx5Tz.d.cts +53 -0
  26. package/dist/configContract-iBLxx5Tz.d.ts +53 -0
  27. package/dist/eslint/index.cjs +375 -13
  28. package/dist/eslint/index.cjs.map +1 -1
  29. package/dist/eslint/index.d.cts +30 -20
  30. package/dist/eslint/index.d.ts +30 -20
  31. package/dist/eslint/index.js +375 -13
  32. package/dist/eslint/index.js.map +1 -1
  33. package/dist/index.cjs +723 -61
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +95 -5
  36. package/dist/index.d.ts +95 -5
  37. package/dist/index.js +716 -61
  38. package/dist/index.js.map +1 -1
  39. package/dist/nestjs/index.cjs +150 -42
  40. package/dist/nestjs/index.cjs.map +1 -1
  41. package/dist/nestjs/index.d.cts +2 -1
  42. package/dist/nestjs/index.d.ts +2 -1
  43. package/dist/nestjs/index.js +150 -42
  44. package/dist/nestjs/index.js.map +1 -1
  45. package/dist/runtime/index.cjs +723 -61
  46. package/dist/runtime/index.cjs.map +1 -1
  47. package/dist/runtime/index.d.cts +3 -2
  48. package/dist/runtime/index.d.ts +3 -2
  49. package/dist/runtime/index.js +716 -61
  50. package/dist/runtime/index.js.map +1 -1
  51. package/dist/{types-BZ17b9i5.d.cts → types-BxBwnBpC.d.cts} +9 -36
  52. package/dist/{types-BZ17b9i5.d.ts → types-Wcs_l1_J.d.ts} +9 -36
  53. package/docs/agent-guide.md +32 -20
  54. package/docs/ai-gates.md +53 -18
  55. package/docs/configuration.md +97 -0
  56. package/docs/enthusiast/README.md +3 -3
  57. package/docs/enthusiast/how-to-agent-gates.md +7 -3
  58. package/docs/migrate-from-ark-runtime-kernel.md +3 -0
  59. package/docs/package-surface.md +14 -9
  60. package/docs/production-hardening.md +15 -2
  61. package/docs/threat-model.md +65 -0
  62. package/docs/typescript-support.md +3 -3
  63. package/package.json +15 -2
  64. package/schemas/ark.config.schema.json +750 -0
  65. package/server.json +2 -2
  66. package/templates/hooks/pre-commit-ark +37 -0
  67. package/templates/skills/ark-coverage.md +2 -2
  68. package/templates/skills/ark-runtime.md +8 -5
  69. package/templates/skills/ark-upgrade.md +36 -16
  70. package/tests/fixtures/ts-consumer/ark.config.json +2 -0
package/dist/index.d.cts CHANGED
@@ -1,8 +1,9 @@
1
- import { I as IntentRegistry, a as IntentName, D as DefineIntentOptions, b as IntentCreator, P as PolicyViolation, c as PolicySeverity, d as PolicyEnforcementMode, e as Policy, f as CreateArchitectureProfileOptions, g as ArchitectureProfile, h as ArkCheckConfig, i as CreateArchitectureProfileFromArkConfigOptions, j as CreateElevenLayerArkConfigOptions, k as DependencyGraph, G as GraphEdge, l as IntentRelationship, m as AuditStore, n as AuditRecord, o as AuditQuery, p as CreateAuditTrailOptions, q as AuditTrail, E as EventContractRegistry, r as EventContract, s as DomainEvent, t as EventContractValidationResult, O as OutboxStore, u as OutboxRecord, v as OutboxStatus, w as EventBusOptions, x as EventBus, y as CreateObservabilityReporterOptions, z as ObservabilityReporter, M as MetadataRegistry, R as ReadModelStore, B as CreateProjectionRegistryOptions, F as ProjectionRegistry, 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, C as CreateArkKernelOptions, A as ArkKernel, U as ArkKernelConfig, V as CreateArkKernelFromConfigOptions, X as TraceRecordType, Y as TraceRecord, Z as ObservabilityDriftReport } from './types-BZ17b9i5.cjs';
2
- export { _ as ArchitectureLayer, $ as ArchitectureLayerConfig, a0 as ArchitectureRule, a1 as ArkManifestArchitecture, a2 as ArkManifestData, a3 as ArkManifestEntityLink, a4 as ArkManifestGraph, a5 as ArkManifestIntent, a6 as ArkManifestPolicy, a7 as ArkManifestProjection, a8 as AuditRecordInput, a9 as AuditRecordType, aa as CorrelationId, ab as EntityMeta, ac as EventContractIssue, ad as EventHandler, ae as EventInterceptionInfo, af as EventInterceptor, ag as EventInterceptorContext, ah as EventMetadata, ai as EventPayloadPatch, aj as EventPayloadSchema, ak as EventPublisher, al as EventSchemaField, am as EventSchemaFieldType, an as FieldMeta, ao as GraphNode, ap as IntentRelationshipKind, aq as ObservabilityFlow, ar as ObservedLayerFlowMode, as as PolicyEvaluationResult, at as ProjectionCheckpoint, au as ProjectionDefinition, av as PublishedEventRecord, aw as RetryPolicy, ax as SagaStatus, ay as SagaStep, az as TraceSink, aA as Unsubscribe, aB as WorkflowDefinition, aC as WorkflowStatus, aD as WorkflowStep } from './types-BZ17b9i5.cjs';
1
+ import { I as IntentRegistry, a as IntentName, D as DefineIntentOptions, b as IntentCreator, P as PolicyViolation, c as PolicySeverity, d as PolicyEnforcementMode, e as Policy, f as CreateArchitectureProfileOptions, g as ArchitectureProfile, h as ArkCheckConfig, i as CreateArchitectureProfileFromArkConfigOptions, j as CreateElevenLayerArkConfigOptions, k as DependencyGraph, G as GraphEdge, l as IntentRelationship, m as AuditStore, n as AuditRecord, o as AuditQuery, p as CreateAuditTrailOptions, q as AuditTrail, E as EventContractRegistry, r as EventContract, s as DomainEvent, t as EventContractValidationResult, O as OutboxStore, u as OutboxRecord, v as OutboxStatus, w as EventBusOptions, x as EventBus, y as CreateObservabilityReporterOptions, z as ObservabilityReporter, M as MetadataRegistry, R as ReadModelStore, B as CreateProjectionRegistryOptions, F as ProjectionRegistry, 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, C as CreateArkKernelOptions, A as ArkKernel, U as ArkKernelConfig, V as CreateArkKernelFromConfigOptions, X as TraceRecordType, Y as TraceRecord, Z as ObservabilityDriftReport } from './types-BxBwnBpC.cjs';
2
+ export { _ as ArchitectureLayer, $ as ArchitectureLayerConfig, a0 as ArchitectureRule, a1 as ArkManifestArchitecture, a2 as ArkManifestData, a3 as ArkManifestEntityLink, a4 as ArkManifestGraph, a5 as ArkManifestIntent, a6 as ArkManifestPolicy, a7 as ArkManifestProjection, a8 as AuditRecordInput, a9 as AuditRecordType, aa as CorrelationId, ab as EntityMeta, ac as EventContractIssue, ad as EventHandler, ae as EventInterceptionInfo, af as EventInterceptor, ag as EventInterceptorContext, ah as EventMetadata, ai as EventPayloadPatch, aj as EventPayloadSchema, ak as EventPublisher, al as EventSchemaField, am as EventSchemaFieldType, an as FieldMeta, ao as GraphNode, ap as IntentRelationshipKind, aq as ObservabilityFlow, ar as ObservedLayerFlowMode, as as PolicyEvaluationResult, at as ProjectionCheckpoint, au as ProjectionDefinition, av as PublishedEventRecord, aw as RetryPolicy, ax as SagaStatus, ay as SagaStep, az as TraceSink, aA as Unsubscribe, aB as WorkflowDefinition, aC as WorkflowStatus, aD as WorkflowStep } from './types-BxBwnBpC.cjs';
3
+ import { c as ArkConfigLoadResult } from './configContract-iBLxx5Tz.cjs';
3
4
 
4
5
  /** ArkGate library version — single source of truth. */
5
- declare const version = "2.12.0";
6
+ declare const version = "2.13.0";
6
7
 
7
8
  /**
8
9
  * defineIntent
@@ -603,9 +604,98 @@ interface AICodeGateOptions<Context = AICodeGateContext> {
603
604
  name: string;
604
605
  patterns?: string[];
605
606
  }>;
606
- /** Explicit file-level escape hatch for reviewed non-literal dynamic imports. */
607
+ /** Explicit file-level escape hatch for reviewed non-literal import()/require() calls. */
607
608
  allowNonLiteralDynamicImport?: (filePath?: string) => boolean;
608
609
  }
609
610
  declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
610
611
 
611
- export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, type Adapter, type AdapterGovernanceIssue, type AdapterGovernanceResult, ArchitectureProfile, ArkCheckConfig, ArkKernel, ArkKernelConfig, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ContractCheckResult, type CreateAdapterOptions, CreateArchitectureProfileFromArkConfigOptions, CreateArchitectureProfileOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateElevenLayerArkConfigOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DomainEvent, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, OutboxStore, 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, createAICodeGate, createAdapter, createArchitectureProfile, createArchitectureProfileFromArkConfig, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createElevenLayerArkConfig, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, elevenLayerProfile, isLayerPolicy, syncRegistryToGraph, validateIntentName, version };
612
+ /**
613
+ * Stable, pure vocabulary for ArkGate's importable analysis engine.
614
+ *
615
+ * Parsing and filesystem discovery belong to adapters. This module intentionally
616
+ * contains only the versioned data contract and deterministic hash primitives.
617
+ */
618
+ declare const ANALYSIS_IR_SCHEMA_VERSION: "1.0";
619
+ type AnalysisFileInput = {
620
+ path: string;
621
+ content: string;
622
+ };
623
+ type AnalysisFileChange = {
624
+ path: string;
625
+ content: string;
626
+ } | {
627
+ path: string;
628
+ delete: true;
629
+ };
630
+ type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
631
+ type AnalysisFile = AnalysisFileInput & {
632
+ contentHash: string;
633
+ layer: string | null;
634
+ };
635
+ type AnalysisImportEdge = {
636
+ from: string;
637
+ specifier: string;
638
+ to: string | null;
639
+ resolution: 'resolved' | 'unresolved';
640
+ fromLayer: string | null;
641
+ toLayer: string | null;
642
+ evidence: AnalysisEvidence;
643
+ };
644
+ /** A capability use is reserved for C04's symbol-aware implementation. */
645
+ type AnalysisCapabilityUse = {
646
+ file: string;
647
+ symbol: string;
648
+ capability: string;
649
+ evidence: AnalysisEvidence;
650
+ };
651
+ type AnalysisEvidence = {
652
+ kind: 'import' | 'policy';
653
+ file: string;
654
+ line: number;
655
+ excerpt: string;
656
+ };
657
+ type AnalysisViolation = {
658
+ ruleId: string;
659
+ message: string;
660
+ edge?: AnalysisImportEdge;
661
+ evidence: AnalysisEvidence;
662
+ };
663
+ type AnalysisIr = {
664
+ schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
665
+ policyHash: string;
666
+ compilerOptionsHash: string;
667
+ files: AnalysisFile[];
668
+ layers: string[];
669
+ edges: AnalysisImportEdge[];
670
+ capabilityUses: AnalysisCapabilityUse[];
671
+ violations: AnalysisViolation[];
672
+ };
673
+ /**
674
+ * Stable FNV-1a hash. It is an identity/fingerprint, not a security primitive.
675
+ * The output is deliberately portable across the CLI, MCP, hooks, and browserless
676
+ * consumers without Node's crypto runtime.
677
+ */
678
+ declare function deterministicHash(value: string): string;
679
+ /** Serialize JSON-like values with sorted object keys for reproducible hashes. */
680
+ declare function stableSerialize(value: unknown): string;
681
+
682
+ type AnalysisContract = ArkConfigLoadResult & {
683
+ policyHash: string;
684
+ };
685
+ type AnalyzeProjectInput = {
686
+ contract: AnalysisContract;
687
+ files: readonly AnalysisFileInput[];
688
+ compilerOptions?: AnalysisCompilerOptions;
689
+ };
690
+ type AnalyzeChangeInput = AnalyzeProjectInput & {
691
+ changes: readonly AnalysisFileChange[];
692
+ };
693
+ type AnalysisResult = {
694
+ ir: AnalysisIr;
695
+ };
696
+ declare function loadContract(input: unknown, source?: string): AnalysisContract;
697
+ declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
698
+ declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
699
+ declare function explainViolation(violation: AnalysisViolation): string;
700
+
701
+ export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, type Adapter, type AdapterGovernanceIssue, type AdapterGovernanceResult, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisResult, type AnalysisViolation, type AnalyzeChangeInput, type AnalyzeProjectInput, ArchitectureProfile, ArkCheckConfig, ArkKernel, ArkKernelConfig, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ContractCheckResult, type CreateAdapterOptions, CreateArchitectureProfileFromArkConfigOptions, CreateArchitectureProfileOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateElevenLayerArkConfigOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DomainEvent, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, OutboxStore, Policy, PolicyEnforcementMode, PolicyEngine, PolicySeverity, PolicyViolation, PolicyViolationError, type Port, ProjectionRegistry, type PublishPolicyContext, ReadModelStore, SagaDefinition, SagaInstance, SourceMetadataOverrideError, type SyncRegistryOptions, TraceRecord, TraceRecordType, UnknownEventSourceError, UnregisteredIntentError, WorkflowEngine, WorkflowSnapshot, WorkflowStore, analyzeChange, analyzeProject, architecturalPolicies, buildPublishPolicyContext, checkAdapterGovernance, checkContract, createAICodeGate, createAdapter, createArchitectureProfile, createArchitectureProfileFromArkConfig, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createElevenLayerArkConfig, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, deterministicHash, elevenLayerProfile, explainViolation, isLayerPolicy, loadContract, stableSerialize, syncRegistryToGraph, validateIntentName, version };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { I as IntentRegistry, a as IntentName, D as DefineIntentOptions, b as IntentCreator, P as PolicyViolation, c as PolicySeverity, d as PolicyEnforcementMode, e as Policy, f as CreateArchitectureProfileOptions, g as ArchitectureProfile, h as ArkCheckConfig, i as CreateArchitectureProfileFromArkConfigOptions, j as CreateElevenLayerArkConfigOptions, k as DependencyGraph, G as GraphEdge, l as IntentRelationship, m as AuditStore, n as AuditRecord, o as AuditQuery, p as CreateAuditTrailOptions, q as AuditTrail, E as EventContractRegistry, r as EventContract, s as DomainEvent, t as EventContractValidationResult, O as OutboxStore, u as OutboxRecord, v as OutboxStatus, w as EventBusOptions, x as EventBus, y as CreateObservabilityReporterOptions, z as ObservabilityReporter, M as MetadataRegistry, R as ReadModelStore, B as CreateProjectionRegistryOptions, F as ProjectionRegistry, 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, C as CreateArkKernelOptions, A as ArkKernel, U as ArkKernelConfig, V as CreateArkKernelFromConfigOptions, X as TraceRecordType, Y as TraceRecord, Z as ObservabilityDriftReport } from './types-BZ17b9i5.js';
2
- export { _ as ArchitectureLayer, $ as ArchitectureLayerConfig, a0 as ArchitectureRule, a1 as ArkManifestArchitecture, a2 as ArkManifestData, a3 as ArkManifestEntityLink, a4 as ArkManifestGraph, a5 as ArkManifestIntent, a6 as ArkManifestPolicy, a7 as ArkManifestProjection, a8 as AuditRecordInput, a9 as AuditRecordType, aa as CorrelationId, ab as EntityMeta, ac as EventContractIssue, ad as EventHandler, ae as EventInterceptionInfo, af as EventInterceptor, ag as EventInterceptorContext, ah as EventMetadata, ai as EventPayloadPatch, aj as EventPayloadSchema, ak as EventPublisher, al as EventSchemaField, am as EventSchemaFieldType, an as FieldMeta, ao as GraphNode, ap as IntentRelationshipKind, aq as ObservabilityFlow, ar as ObservedLayerFlowMode, as as PolicyEvaluationResult, at as ProjectionCheckpoint, au as ProjectionDefinition, av as PublishedEventRecord, aw as RetryPolicy, ax as SagaStatus, ay as SagaStep, az as TraceSink, aA as Unsubscribe, aB as WorkflowDefinition, aC as WorkflowStatus, aD as WorkflowStep } from './types-BZ17b9i5.js';
1
+ import { I as IntentRegistry, a as IntentName, D as DefineIntentOptions, b as IntentCreator, P as PolicyViolation, c as PolicySeverity, d as PolicyEnforcementMode, e as Policy, f as CreateArchitectureProfileOptions, g as ArchitectureProfile, h as ArkCheckConfig, i as CreateArchitectureProfileFromArkConfigOptions, j as CreateElevenLayerArkConfigOptions, k as DependencyGraph, G as GraphEdge, l as IntentRelationship, m as AuditStore, n as AuditRecord, o as AuditQuery, p as CreateAuditTrailOptions, q as AuditTrail, E as EventContractRegistry, r as EventContract, s as DomainEvent, t as EventContractValidationResult, O as OutboxStore, u as OutboxRecord, v as OutboxStatus, w as EventBusOptions, x as EventBus, y as CreateObservabilityReporterOptions, z as ObservabilityReporter, M as MetadataRegistry, R as ReadModelStore, B as CreateProjectionRegistryOptions, F as ProjectionRegistry, 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, C as CreateArkKernelOptions, A as ArkKernel, U as ArkKernelConfig, V as CreateArkKernelFromConfigOptions, X as TraceRecordType, Y as TraceRecord, Z as ObservabilityDriftReport } from './types-Wcs_l1_J.js';
2
+ export { _ as ArchitectureLayer, $ as ArchitectureLayerConfig, a0 as ArchitectureRule, a1 as ArkManifestArchitecture, a2 as ArkManifestData, a3 as ArkManifestEntityLink, a4 as ArkManifestGraph, a5 as ArkManifestIntent, a6 as ArkManifestPolicy, a7 as ArkManifestProjection, a8 as AuditRecordInput, a9 as AuditRecordType, aa as CorrelationId, ab as EntityMeta, ac as EventContractIssue, ad as EventHandler, ae as EventInterceptionInfo, af as EventInterceptor, ag as EventInterceptorContext, ah as EventMetadata, ai as EventPayloadPatch, aj as EventPayloadSchema, ak as EventPublisher, al as EventSchemaField, am as EventSchemaFieldType, an as FieldMeta, ao as GraphNode, ap as IntentRelationshipKind, aq as ObservabilityFlow, ar as ObservedLayerFlowMode, as as PolicyEvaluationResult, at as ProjectionCheckpoint, au as ProjectionDefinition, av as PublishedEventRecord, aw as RetryPolicy, ax as SagaStatus, ay as SagaStep, az as TraceSink, aA as Unsubscribe, aB as WorkflowDefinition, aC as WorkflowStatus, aD as WorkflowStep } from './types-Wcs_l1_J.js';
3
+ import { c as ArkConfigLoadResult } from './configContract-iBLxx5Tz.js';
3
4
 
4
5
  /** ArkGate library version — single source of truth. */
5
- declare const version = "2.12.0";
6
+ declare const version = "2.13.0";
6
7
 
7
8
  /**
8
9
  * defineIntent
@@ -603,9 +604,98 @@ interface AICodeGateOptions<Context = AICodeGateContext> {
603
604
  name: string;
604
605
  patterns?: string[];
605
606
  }>;
606
- /** Explicit file-level escape hatch for reviewed non-literal dynamic imports. */
607
+ /** Explicit file-level escape hatch for reviewed non-literal import()/require() calls. */
607
608
  allowNonLiteralDynamicImport?: (filePath?: string) => boolean;
608
609
  }
609
610
  declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
610
611
 
611
- export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, type Adapter, type AdapterGovernanceIssue, type AdapterGovernanceResult, ArchitectureProfile, ArkCheckConfig, ArkKernel, ArkKernelConfig, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ContractCheckResult, type CreateAdapterOptions, CreateArchitectureProfileFromArkConfigOptions, CreateArchitectureProfileOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateElevenLayerArkConfigOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DomainEvent, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, OutboxStore, 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, createAICodeGate, createAdapter, createArchitectureProfile, createArchitectureProfileFromArkConfig, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createElevenLayerArkConfig, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, elevenLayerProfile, isLayerPolicy, syncRegistryToGraph, validateIntentName, version };
612
+ /**
613
+ * Stable, pure vocabulary for ArkGate's importable analysis engine.
614
+ *
615
+ * Parsing and filesystem discovery belong to adapters. This module intentionally
616
+ * contains only the versioned data contract and deterministic hash primitives.
617
+ */
618
+ declare const ANALYSIS_IR_SCHEMA_VERSION: "1.0";
619
+ type AnalysisFileInput = {
620
+ path: string;
621
+ content: string;
622
+ };
623
+ type AnalysisFileChange = {
624
+ path: string;
625
+ content: string;
626
+ } | {
627
+ path: string;
628
+ delete: true;
629
+ };
630
+ type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
631
+ type AnalysisFile = AnalysisFileInput & {
632
+ contentHash: string;
633
+ layer: string | null;
634
+ };
635
+ type AnalysisImportEdge = {
636
+ from: string;
637
+ specifier: string;
638
+ to: string | null;
639
+ resolution: 'resolved' | 'unresolved';
640
+ fromLayer: string | null;
641
+ toLayer: string | null;
642
+ evidence: AnalysisEvidence;
643
+ };
644
+ /** A capability use is reserved for C04's symbol-aware implementation. */
645
+ type AnalysisCapabilityUse = {
646
+ file: string;
647
+ symbol: string;
648
+ capability: string;
649
+ evidence: AnalysisEvidence;
650
+ };
651
+ type AnalysisEvidence = {
652
+ kind: 'import' | 'policy';
653
+ file: string;
654
+ line: number;
655
+ excerpt: string;
656
+ };
657
+ type AnalysisViolation = {
658
+ ruleId: string;
659
+ message: string;
660
+ edge?: AnalysisImportEdge;
661
+ evidence: AnalysisEvidence;
662
+ };
663
+ type AnalysisIr = {
664
+ schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
665
+ policyHash: string;
666
+ compilerOptionsHash: string;
667
+ files: AnalysisFile[];
668
+ layers: string[];
669
+ edges: AnalysisImportEdge[];
670
+ capabilityUses: AnalysisCapabilityUse[];
671
+ violations: AnalysisViolation[];
672
+ };
673
+ /**
674
+ * Stable FNV-1a hash. It is an identity/fingerprint, not a security primitive.
675
+ * The output is deliberately portable across the CLI, MCP, hooks, and browserless
676
+ * consumers without Node's crypto runtime.
677
+ */
678
+ declare function deterministicHash(value: string): string;
679
+ /** Serialize JSON-like values with sorted object keys for reproducible hashes. */
680
+ declare function stableSerialize(value: unknown): string;
681
+
682
+ type AnalysisContract = ArkConfigLoadResult & {
683
+ policyHash: string;
684
+ };
685
+ type AnalyzeProjectInput = {
686
+ contract: AnalysisContract;
687
+ files: readonly AnalysisFileInput[];
688
+ compilerOptions?: AnalysisCompilerOptions;
689
+ };
690
+ type AnalyzeChangeInput = AnalyzeProjectInput & {
691
+ changes: readonly AnalysisFileChange[];
692
+ };
693
+ type AnalysisResult = {
694
+ ir: AnalysisIr;
695
+ };
696
+ declare function loadContract(input: unknown, source?: string): AnalysisContract;
697
+ declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
698
+ declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
699
+ declare function explainViolation(violation: AnalysisViolation): string;
700
+
701
+ export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, type Adapter, type AdapterGovernanceIssue, type AdapterGovernanceResult, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisResult, type AnalysisViolation, type AnalyzeChangeInput, type AnalyzeProjectInput, ArchitectureProfile, ArkCheckConfig, ArkKernel, ArkKernelConfig, ArkManifest, type ArkTestHarness, type ArkTestSnapshot, AuditQuery, AuditRecord, AuditStore, AuditTrail, type BuildPublishPolicyContextOptions, type ContractCheckResult, type CreateAdapterOptions, CreateArchitectureProfileFromArkConfigOptions, CreateArchitectureProfileOptions, CreateArkKernelFromConfigOptions, CreateArkKernelOptions, type CreateArkManifestOptions, CreateAuditTrailOptions, CreateElevenLayerArkConfigOptions, CreateObservabilityReporterOptions, CreateProjectionRegistryOptions, CreateWorkflowEngineOptions, DEFAULT_MAX_HISTORY_SIZE, DefineIntentOptions, type DefinePolicyOptions, type DefinePortOptions, DependencyGraph, DomainEvent, EventBus, EventBusOptions, EventContract, EventContractRegistry, EventContractRegistryImpl, EventContractValidationResult, EventContractViolationError, GraphEdge, type GraphPolicyContext, InMemoryAuditStore, InMemoryOutboxStore, InMemoryReadModelStore, InMemoryWorkflowStore, IntentCreator, IntentCreator as IntentDefinition, IntentName, type IntentNameValidation, IntentRegistry, IntentRelationship, InvalidIntentNameError, type LayerFlowRule, LayerPolicyContextError, type LayerPolicyOptions, MANIFEST_SCHEMA_VERSION, MetadataRegistry, ObservabilityDriftReport, ObservabilityReporter, ObservedLayerFlowViolationError, OutboxRecord, OutboxStatus, OutboxStore, Policy, PolicyEnforcementMode, PolicyEngine, PolicySeverity, PolicyViolation, PolicyViolationError, type Port, ProjectionRegistry, type PublishPolicyContext, ReadModelStore, SagaDefinition, SagaInstance, SourceMetadataOverrideError, type SyncRegistryOptions, TraceRecord, TraceRecordType, UnknownEventSourceError, UnregisteredIntentError, WorkflowEngine, WorkflowSnapshot, WorkflowStore, analyzeChange, analyzeProject, architecturalPolicies, buildPublishPolicyContext, checkAdapterGovernance, checkContract, createAICodeGate, createAdapter, createArchitectureProfile, createArchitectureProfileFromArkConfig, createArkKernel, createArkKernelFromConfig, createArkManifest, createArkTestHarness, createAuditTrail, createDependencyGraph, createElevenLayerArkConfig, createEventBus, createEventContractRegistry, createIntentRegistry, createLenientArkKernel, createLenientArkKernelFromConfig, createMetadataRegistry, createObservabilityReporter, createProjectionRegistry, createSaga, createStrictArkKernel, createStrictArkKernelFromConfig, createWorkflowEngine, defaultIntentRegistry, defineArchitectureProfilePolicy, defineIntent, defineLayerPolicy, definePolicy, definePort, definePublishPolicy, deterministicHash, elevenLayerProfile, explainViolation, isLayerPolicy, loadContract, stableSerialize, syncRegistryToGraph, validateIntentName, version };