@gitgov/core 1.2.0 → 1.4.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.
- package/README.md +17 -11
- package/dist/src/index.d.ts +2090 -515
- package/dist/src/index.js +1697 -718
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
This example shows how to create a new task using the `BacklogAdapter`. The SDK uses dependency injection - each adapter requires its dependencies to be explicitly provided.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
_Note: This example assumes it is run inside an initialized GitGovernance project._
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
import { Adapters, Store, EventBus } from "@gitgov/core";
|
|
17
|
-
import type {
|
|
17
|
+
import type {
|
|
18
|
+
TaskRecord,
|
|
19
|
+
CycleRecord,
|
|
20
|
+
ActorRecord,
|
|
21
|
+
AgentRecord,
|
|
22
|
+
} from "@gitgov/core";
|
|
18
23
|
|
|
19
24
|
// Extract classes from namespaces
|
|
20
|
-
const { IdentityAdapter, BacklogAdapter, WorkflowMethodologyAdapter } =
|
|
25
|
+
const { IdentityAdapter, BacklogAdapter, WorkflowMethodologyAdapter } =
|
|
26
|
+
Adapters;
|
|
21
27
|
const { RecordStore } = Store;
|
|
22
28
|
const { EventBus: EventBusClass } = EventBus;
|
|
23
29
|
|
|
@@ -97,11 +103,11 @@ console.log({
|
|
|
97
103
|
### Adapter Ecosystem (9/9 Adapters)
|
|
98
104
|
|
|
99
105
|
- **ProjectAdapter**: Project initialization engine with 3-adapter orchestration (18 tests)
|
|
100
|
-
- **BacklogAdapter**: Task and cycle lifecycle management with workflow validation (
|
|
106
|
+
- **BacklogAdapter**: Task and cycle lifecycle management with workflow validation (71 tests)
|
|
101
107
|
- **MetricsAdapter**: Pure calculation engine for system analytics (32 tests)
|
|
102
108
|
- **ChangelogAdapter**: System historian for change documentation (31 tests)
|
|
103
109
|
- **ExecutionAdapter**: Audit log for work execution (13 tests)
|
|
104
|
-
- **FeedbackAdapter**: Structured communication and blocking management (
|
|
110
|
+
- **FeedbackAdapter**: Structured communication and blocking management (21 tests)
|
|
105
111
|
- **IdentityAdapter**: Cryptographic identity and agent management (25 tests)
|
|
106
112
|
- **WorkflowMethodologyAdapter**: Configurable workflow validation engine (51 tests)
|
|
107
113
|
- **IndexerAdapter**: Local cache optimization for performance (5 tests)
|
|
@@ -196,7 +202,7 @@ import {
|
|
|
196
202
|
|
|
197
203
|
function handleCoreErrors(error: unknown) {
|
|
198
204
|
if (error instanceof DetailedValidationError) {
|
|
199
|
-
return { type: "validation", fields: error.
|
|
205
|
+
return { type: "validation", fields: error.errors };
|
|
200
206
|
} else if (error instanceof RecordNotFoundError) {
|
|
201
207
|
return { type: "not_found", code: error.code };
|
|
202
208
|
} else if (error instanceof ProjectRootError) {
|
|
@@ -229,7 +235,7 @@ const generator = new DiagramGenerator();
|
|
|
229
235
|
// Generate Mermaid diagrams from GitGovernance records
|
|
230
236
|
const result = await generator.generateFromRecords(cycles, tasks, {
|
|
231
237
|
cycleId: "1704067200-cycle-identity-adapter",
|
|
232
|
-
layout:
|
|
238
|
+
layout: "TD",
|
|
233
239
|
showWarnings: true,
|
|
234
240
|
});
|
|
235
241
|
|
|
@@ -240,7 +246,7 @@ console.log(result.mermaidCode);
|
|
|
240
246
|
## 🧪 Testing & Development
|
|
241
247
|
|
|
242
248
|
```bash
|
|
243
|
-
# Run all tests (
|
|
249
|
+
# Run all tests (737 tests total)
|
|
244
250
|
npm test
|
|
245
251
|
npm run test:coverage # Run tests with coverage report
|
|
246
252
|
|
|
@@ -266,13 +272,13 @@ npm test -- --watch
|
|
|
266
272
|
|
|
267
273
|
### Test Coverage
|
|
268
274
|
|
|
269
|
-
- **
|
|
275
|
+
- **737 tests total** with EARS methodology
|
|
270
276
|
- **ProjectAdapter**: 18 tests (project initialization + template processing + error recovery)
|
|
271
|
-
- **BacklogAdapter**:
|
|
277
|
+
- **BacklogAdapter**: 71 tests (workflow lifecycle + event handlers + E2E simulation + deduplication)
|
|
272
278
|
- **MetricsAdapter**: 32 tests (Tier 1+2 calculations + performance validation)
|
|
273
279
|
- **ChangelogAdapter**: 31 tests (multi-entity changelog + conditional validation)
|
|
274
280
|
- **EventBusModule**: 32 tests (20 unit + 12 integration tests with cross-adapter scenarios)
|
|
275
|
-
- **FeedbackAdapter**:
|
|
281
|
+
- **FeedbackAdapter**: 21 tests (EARS coverage with dual event emission + duplicate assignment prevention)
|
|
276
282
|
- **ExecutionAdapter**: 13 tests (EARS coverage with performance validation)
|
|
277
283
|
- **WorkflowMethodologyAdapter**: 51 tests (29 unit + 22 integration tests)
|
|
278
284
|
- **Identity Domain**: 66 tests (Adapter + ActorRecord/AgentRecord factories & validators)
|