@evolith/core-domain 1.0.2 → 1.0.3

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 (2) hide show
  1. package/README.md +102 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # @evolith/core-domain
2
+
3
+ > Domain and application logic for the Evolith governance framework.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@evolith/core-domain)](https://www.npmjs.com/package/@evolith/core-domain)
6
+ [![license](https://img.shields.io/npm/l/@evolith/core-domain)](./LICENSE)
7
+
8
+ ## Overview
9
+
10
+ `@evolith/core-domain` is the heart of the Evolith architecture governance framework. It provides the **domain model, application use-cases, and rule evaluation engine** used by all Evolith surfaces (Core API, MCP Server, CLI).
11
+
12
+ Built on **Domain-Driven Design** principles with hexagonal architecture — all dependencies point inward; infrastructure is injected via ports.
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @evolith/core-domain
18
+ ```
19
+
20
+ ## What's inside
21
+
22
+ | Layer | What it provides |
23
+ |-------|-----------------|
24
+ | **Domain** | Phase, Gate, Verdict, Satellite Manifest, Workflow Definition, RBAC, Audit entities |
25
+ | **Application** | `EvaluateGateUseCase`, `ValidateBlueprintUseCase`, `ValidateWorkflowUseCase`, Architecture Drift detection, Satellite evaluation pipeline |
26
+ | **Ports** | `IFileSystem`, `ILogger`, `IConfigParser`, `IRulesetRepository`, `IEventBus` — inject your own adapters |
27
+ | **Gates** | Phase-gate validator, composable validation engine, OPA/Native dual-engine parity |
28
+
29
+ ## Usage
30
+
31
+ ```ts
32
+ import { EvaluateGateUseCase } from '@evolith/core-domain/application/use-cases';
33
+ import { loadDefaultWorkflow } from '@evolith/core-domain/domain/services';
34
+
35
+ // Load the default SDLC workflow
36
+ const workflow = loadDefaultWorkflow();
37
+
38
+ // Evaluate a phase gate
39
+ const useCase = new EvaluateGateUseCase(rulesetRepo, fileSystem, logger);
40
+ const result = await useCase.execute({ projectId, phase, artifacts });
41
+ ```
42
+
43
+ > **Runtime requirement:** set `WORKSPACE_ROOT` to the directory containing the `rulesets/` folder.
44
+ > In Docker: `ENV WORKSPACE_ROOT=/app/corpus`. Locally: the monorepo root is used automatically.
45
+
46
+ ## Key exports
47
+
48
+ ```ts
49
+ // Domain entities
50
+ import { Phase, Verdict, GateDecision } from '@evolith/core-domain';
51
+
52
+ // Use cases
53
+ import { EvaluateGateUseCase } from '@evolith/core-domain/application/use-cases';
54
+ import { ValidateBlueprintUseCase } from '@evolith/core-domain/application/use-cases';
55
+ import { ValidateWorkflowUseCase } from '@evolith/core-domain/application/use-cases';
56
+
57
+ // Validators
58
+ import { PhaseGateValidatorService } from '@evolith/core-domain/application/validators';
59
+ import { ComposableValidationEngine } from '@evolith/core-domain/application/validators/modes';
60
+
61
+ // Services
62
+ import { loadDefaultWorkflow } from '@evolith/core-domain/domain/services';
63
+ import { SatelliteEvaluationPipeline } from '@evolith/core-domain/application/services';
64
+
65
+ // Ports (interfaces for your adapters)
66
+ import type { IFileSystem, ILogger } from '@evolith/core-domain/domain/interfaces';
67
+ import type { IRulesetRepository } from '@evolith/core-domain';
68
+ ```
69
+
70
+ ## Environment variables
71
+
72
+ | Variable | Default | Description |
73
+ |----------|---------|-------------|
74
+ | `WORKSPACE_ROOT` | *(monorepo root)* | Base directory containing `rulesets/` |
75
+
76
+ ## Architecture
77
+
78
+ ```
79
+ @evolith/core-domain
80
+ ├── domain/ # Entities, value objects, ports (no external deps)
81
+ │ ├── entities/ # Phase, Gate, Verdict, Satellite...
82
+ │ ├── ports/ # IFileSystem, ILogger, IRulesetRepository...
83
+ │ └── services/ # Workflow loading, domain services
84
+ ├── application/ # Use cases, validators, pipelines
85
+ │ ├── use-cases/ # EvaluateGate, ValidateBlueprint, ValidateWorkflow
86
+ │ ├── validators/ # PhaseGateValidator, ComposableValidationEngine
87
+ │ └── services/ # SatelliteEvaluationPipeline, AuditService
88
+ └── infrastructure/ # In-memory adapters (for testing)
89
+ ├── events/ # InMemoryEventBus
90
+ └── audit/ # InMemoryAuditRepository
91
+ ```
92
+
93
+ ## Part of the Evolith suite
94
+
95
+ | Package | Role |
96
+ |---------|------|
97
+ | **`@evolith/core-domain`** | Domain logic and rule engine ← you are here |
98
+ | [`@evolith/infra-providers`](https://www.npmjs.com/package/@evolith/infra-providers) | Infrastructure adapters (filesystem, logger, config) |
99
+
100
+ ## License
101
+
102
+ UNLICENSED — proprietary. Copyright © Beyondnet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolith/core-domain",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Shared Domain and Application logic for Evolith Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",