@anarchitects/governance-core 0.0.3 → 0.0.4
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 +18 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/project-matching.d.ts +7 -0
- package/dist/core/project-matching.d.ts.map +1 -0
- package/dist/core/snapshots.d.ts +2 -0
- package/dist/core/snapshots.d.ts.map +1 -1
- package/dist/index.js +534 -491
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ This package is responsible for:
|
|
|
22
22
|
- defining adapter-facing input contracts such as `GovernanceProjectInput`, `GovernanceDependencyInput`, and `GovernanceWorkspaceAdapterResult`
|
|
23
23
|
- defining profile, rule, signal, exception, measurement, health, assessment, snapshot, and drift contracts
|
|
24
24
|
- providing deterministic helpers such as profile normalization, rule evaluation, assessment assembly, snapshot comparison, and AI handoff payload builders
|
|
25
|
+
- providing host-independent helpers that map changed files onto canonical `GovernanceProject` models and shape snapshot delivery-impact summaries
|
|
25
26
|
- providing portable extension contracts and runtime helpers that stay independent from Nx
|
|
26
27
|
|
|
27
28
|
This package is not responsible for:
|
|
@@ -40,6 +41,7 @@ The package has a single public entrypoint:
|
|
|
40
41
|
```ts
|
|
41
42
|
import {
|
|
42
43
|
buildDeliveryImpactAssessment,
|
|
44
|
+
buildSnapshotDeliveryImpactSummary,
|
|
43
45
|
buildCognitiveLoadContext,
|
|
44
46
|
buildDriftInterpretationAnalysis,
|
|
45
47
|
buildGovernanceAssessment,
|
|
@@ -53,6 +55,7 @@ import {
|
|
|
53
55
|
buildPersistentSmellSignals,
|
|
54
56
|
buildPrImpactContext,
|
|
55
57
|
buildRecommendationsTrendContext,
|
|
58
|
+
resolveAffectedGovernanceProjects,
|
|
56
59
|
buildRefactoringSuggestionsContext,
|
|
57
60
|
buildGovernanceWorkspace,
|
|
58
61
|
buildMetricSnapshot,
|
|
@@ -91,6 +94,7 @@ The root export currently re-exports these API groups:
|
|
|
91
94
|
- `models`
|
|
92
95
|
- `exceptions`
|
|
93
96
|
- `profile`
|
|
97
|
+
- `project-matching`
|
|
94
98
|
- `rule-engine`
|
|
95
99
|
- `rules`
|
|
96
100
|
- `signals`
|
|
@@ -124,10 +128,12 @@ Deterministic helpers include:
|
|
|
124
128
|
- `buildGovernanceRecommendations(...)`
|
|
125
129
|
- `applyGovernanceExceptions(...)`, `evaluateGovernanceExceptionLifecycle(...)`, and `buildGovernanceExceptionReport(...)`
|
|
126
130
|
- `buildDeliveryImpactAssessment(...)` and `summarizeDeliveryImpact(...)`
|
|
131
|
+
- `buildSnapshotDeliveryImpactSummary(...)`
|
|
127
132
|
- deterministic AI request builders and summarizers such as `buildRootCauseRequest(...)`, `buildPrImpactRequest(...)`, `buildScorecardRequest(...)`, `buildOnboardingRequest(...)`, `buildManagementInsightsAiRequest(...)`, `summarizeRootCause(...)`, `summarizePrImpact(...)`, `summarizeScorecard(...)`, `summarizeOnboarding(...)`, and `summarizeManagementInsights(...)`
|
|
128
133
|
- deterministic payload-scope helpers such as `buildGovernancePayloadTruncationMetadata(...)`, `sliceGovernancePayloadItems(...)`, `scopeGovernanceDependencies(...)`, and `compareGovernanceViolationsForPriority(...)`
|
|
129
134
|
- scoped AI handoff request helpers such as `buildScopedRootCauseRequest(...)`, `buildScopedDriftRequest(...)`, and `buildScopedScorecardRequest(...)`
|
|
130
135
|
- deterministic AI context builders such as `buildPrImpactContext(...)`, `buildCognitiveLoadContext(...)`, `buildRecommendationsTrendContext(...)`, `buildPersistentSmellSignals(...)`, `buildRefactoringSuggestionsContext(...)`, `buildOnboardingContext(...)`, and `buildDriftInterpretationAnalysis(...)`
|
|
136
|
+
- `resolveAffectedGovernanceProjects(...)`
|
|
131
137
|
- `evaluateRules(...)` and `evaluateRulePack(...)`
|
|
132
138
|
- `normalizeGovernanceProfile(...)`
|
|
133
139
|
- `normalizeGovernanceException(...)`
|
|
@@ -225,6 +231,18 @@ Thin runtime hosts can consume the package in this order:
|
|
|
225
231
|
- apply exception lifecycle and suppression with `evaluateGovernanceExceptionLifecycle(...)`, `applyGovernanceExceptions(...)`, and `buildGovernanceExceptionReport(...)`
|
|
226
232
|
- build higher-level delivery and AI artifacts with `buildDeliveryImpactAssessment(...)`, `buildManagementInsightsAiRequest(...)`, `summarizeManagementInsights(...)`, and the other deterministic AI request/summarizer helpers
|
|
227
233
|
|
|
234
|
+
Hosts remain responsible for:
|
|
235
|
+
|
|
236
|
+
- collecting changed files from git or another host runtime
|
|
237
|
+
- resolving refs, workspace roots, and process execution
|
|
238
|
+
- discovering snapshot files and choosing baseline/current snapshot inputs
|
|
239
|
+
- persisting snapshots and other host-owned artifacts
|
|
240
|
+
|
|
241
|
+
Core also provides two small host-independent handoff helpers:
|
|
242
|
+
|
|
243
|
+
- `resolveAffectedGovernanceProjects(...)` maps host-supplied repo-relative changed file paths onto canonical `GovernanceProject` records. It normalizes Windows separators, trims trailing slashes from project roots, ignores empty changed-file entries, and treats `'.'` or `''` project roots as root-level projects that match any non-empty changed file.
|
|
244
|
+
- `buildSnapshotDeliveryImpactSummary(...)` shapes a `DeliveryImpactAssessment` into a `SnapshotDeliveryImpactSummary` by sorting indices by `id` and copying the first five delivery-impact drivers into the snapshot-safe summary contract.
|
|
245
|
+
|
|
228
246
|
## AI Host Helpers
|
|
229
247
|
|
|
230
248
|
Thin host packages can now keep AI handoff shaping in Core by composing:
|
package/dist/core/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './exceptions.js';
|
|
|
15
15
|
export * from './health.js';
|
|
16
16
|
export * from './metrics.js';
|
|
17
17
|
export * from './profile.js';
|
|
18
|
+
export * from './project-matching.js';
|
|
18
19
|
export * from './rule-engine.js';
|
|
19
20
|
export * from './rules.js';
|
|
20
21
|
export * from './signal-builders.js';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core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Ac,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GovernanceProject } from './models.js';
|
|
2
|
+
export interface ResolveAffectedGovernanceProjectsOptions {
|
|
3
|
+
projects: readonly GovernanceProject[];
|
|
4
|
+
changedFiles: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveAffectedGovernanceProjects(options: ResolveAffectedGovernanceProjectsOptions): GovernanceProject[];
|
|
7
|
+
//# sourceMappingURL=project-matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-matching.d.ts","sourceRoot":"","sources":["../../src/core/project-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,wCAAwC;IACvD,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wCAAwC,GAChD,iBAAiB,EAAE,CAiBrB"}
|
package/dist/core/snapshots.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GovernanceAssessment, MetricSnapshot, SnapshotDeliveryImpactSummary } from './models.js';
|
|
2
|
+
import type { DeliveryImpactAssessment } from './delivery-impact.js';
|
|
2
3
|
export interface GovernanceSnapshotMetadata {
|
|
3
4
|
timestamp: string;
|
|
4
5
|
repo: string;
|
|
@@ -9,4 +10,5 @@ export interface GovernanceSnapshotMetadata {
|
|
|
9
10
|
deliveryImpact?: SnapshotDeliveryImpactSummary;
|
|
10
11
|
}
|
|
11
12
|
export declare function buildMetricSnapshot(assessment: GovernanceAssessment, metadata: GovernanceSnapshotMetadata): MetricSnapshot;
|
|
13
|
+
export declare function buildSnapshotDeliveryImpactSummary(deliveryImpact: DeliveryImpactAssessment): SnapshotDeliveryImpactSummary;
|
|
12
14
|
//# sourceMappingURL=snapshots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../src/core/snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAE9B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../src/core/snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAE9B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAIrE,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,6BAA6B,CAAC;CAChD;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,0BAA0B,GACnC,cAAc,CA2ChB;AAED,wBAAgB,kCAAkC,CAChD,cAAc,EAAE,wBAAwB,GACvC,6BAA6B,CAoB/B"}
|