@codeledger/aggregations 0.8.9
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/LICENSE +27 -0
- package/dist/engine.d.ts +4 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +184 -0
- package/dist/engine.js.map +1 -0
- package/dist/hotspots.d.ts +7 -0
- package/dist/hotspots.d.ts.map +1 -0
- package/dist/hotspots.js +107 -0
- package/dist/hotspots.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/insights.d.ts +6 -0
- package/dist/insights.d.ts.map +1 -0
- package/dist/insights.js +89 -0
- package/dist/insights.js.map +1 -0
- package/dist/job.d.ts +9 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +360 -0
- package/dist/job.js.map +1 -0
- package/dist/ownership.d.ts +4 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +52 -0
- package/dist/ownership.js.map +1 -0
- package/dist/patterns.d.ts +3 -0
- package/dist/patterns.d.ts.map +1 -0
- package/dist/patterns.js +55 -0
- package/dist/patterns.js.map +1 -0
- package/dist/recommendations.d.ts +3 -0
- package/dist/recommendations.d.ts.map +1 -0
- package/dist/recommendations.js +33 -0
- package/dist/recommendations.js.map +1 -0
- package/dist/scheduler.d.ts +9 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +19 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/store.d.ts +6 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +125 -0
- package/dist/store.js.map +1 -0
- package/dist/team-attribution.d.ts +9 -0
- package/dist/team-attribution.d.ts.map +1 -0
- package/dist/team-attribution.js +73 -0
- package/dist/team-attribution.js.map +1 -0
- package/dist/value.d.ts +11 -0
- package/dist/value.d.ts.map +1 -0
- package/dist/value.js +113 -0
- package/dist/value.js.map +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Intelligent Context AI, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Note: This license applies to the CLI wrapper, types, repository scanning,
|
|
26
|
+
instrumentation, harness, and report packages (the "Plugin"). The scoring
|
|
27
|
+
engine (packages/core-engine/bin/) is licensed separately under LICENSE-CORE.
|
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FilterOptions, InsightEvent, InsightMetrics } from '@codeledger/types';
|
|
2
|
+
export declare function computeMetrics(events: InsightEvent[], filters?: FilterOptions): InsightMetrics;
|
|
3
|
+
export declare function filterEvents(events: InsightEvent[], filters: FilterOptions): InsightEvent[];
|
|
4
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,aAAa,EACb,YAAY,EAEZ,cAAc,EAKf,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,cAAc,CAGlG;AAuGD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,EAAE,CAW3F"}
|
package/dist/engine.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
export function computeMetrics(events, filters = {}) {
|
|
2
|
+
const filtered = filterEvents(events, filters);
|
|
3
|
+
return computeMetricsFromFilteredEvents(filtered, true);
|
|
4
|
+
}
|
|
5
|
+
function computeMetricsFromFilteredEvents(filtered, includeTrend) {
|
|
6
|
+
const executions = filtered.filter((event) => event.type === 'EXECUTION_RESULT');
|
|
7
|
+
const policies = filtered.filter((event) => event.type === 'POLICY_EVALUATION');
|
|
8
|
+
const contexts = filtered.filter((event) => event.type === 'CONTEXT_EVALUATION');
|
|
9
|
+
const shadows = filtered.filter((event) => event.type === 'SHADOW_KNOWLEDGE_SIGNAL');
|
|
10
|
+
const patternEvents = filtered.filter((event) => event.type === 'PATTERN_REUSE');
|
|
11
|
+
const goldenPaths = filtered.filter((event) => event.type === 'GOLDEN_PATH_ADHERENCE');
|
|
12
|
+
const writeSafetySuccessRate = rate(executions.filter((event) => event.writeSafe === true).length, executions.filter((event) => event.writeSafe !== undefined).length);
|
|
13
|
+
const redactRate = rate(executions.filter((event) => event.redactApplied === true).length, executions.filter((event) => event.redactApplied !== undefined).length);
|
|
14
|
+
const rejectRate = rate(executions.filter((event) => event.rejected === true).length, executions.filter((event) => event.rejected !== undefined).length);
|
|
15
|
+
const integrityDrift = rate(policies.filter((event) => event.violations > 0).length, policies.length);
|
|
16
|
+
const firstPassSuccessRate = rate(executions.filter((event) => event.firstPass === true && event.status === 'success').length, executions.filter((event) => event.firstPass !== undefined).length);
|
|
17
|
+
const reworkRatio = rate(executions.filter((event) => event.rework === true).length, executions.filter((event) => event.rework !== undefined).length);
|
|
18
|
+
const executionReliability = rate(executions.filter((event) => event.status === 'success').length, executions.length);
|
|
19
|
+
const patternReuseRate = rate(patternEvents.filter((event) => event.type === 'PATTERN_REUSE' && event.reused).length, patternEvents.length);
|
|
20
|
+
const timeToContext = averageMetric(contexts.map((event) => Math.max(1, Math.round(event.totalTokens / 500))));
|
|
21
|
+
const shadowKnowledgeIndex = averageMetric(shadows.map((event) => clamp(event.weight)));
|
|
22
|
+
const goldenPathAdherence = rate(goldenPaths.filter((event) => event.type === 'GOLDEN_PATH_ADHERENCE' && event.adhered).length, goldenPaths.length);
|
|
23
|
+
const primitiveAdoptionRate = rate(new Set(patternEvents.filter((event) => event.type === 'PATTERN_REUSE' && event.reused).map((event) => event.primitive)).size, new Set(patternEvents.filter((event) => event.type === 'PATTERN_REUSE').map((event) => event.primitive)).size);
|
|
24
|
+
// Efficiency: Prompt Lift (blended), Context Compression, Waste Avoided
|
|
25
|
+
const refinements = filtered.filter((event) => event.type === 'PROMPT_REFINEMENT');
|
|
26
|
+
const promptLift = computePromptLift(refinements);
|
|
27
|
+
const contextCompression = refinements.length > 0
|
|
28
|
+
? averageMetric(refinements.map((e) => clamp(e.contextReductionPct / 100)))
|
|
29
|
+
: rate(0, 0);
|
|
30
|
+
const wasteAvoided = computeWasteAvoided(refinements, executions);
|
|
31
|
+
return {
|
|
32
|
+
integrity: {
|
|
33
|
+
writeSafetySuccessRate,
|
|
34
|
+
redactRate,
|
|
35
|
+
rejectRate,
|
|
36
|
+
integrityDrift,
|
|
37
|
+
},
|
|
38
|
+
quality: {
|
|
39
|
+
firstPassSuccessRate,
|
|
40
|
+
reworkRatio,
|
|
41
|
+
executionReliability,
|
|
42
|
+
},
|
|
43
|
+
knowledge: {
|
|
44
|
+
patternReuseRate,
|
|
45
|
+
timeToContext,
|
|
46
|
+
shadowKnowledgeIndex,
|
|
47
|
+
},
|
|
48
|
+
patterns: {
|
|
49
|
+
goldenPathAdherence,
|
|
50
|
+
primitiveAdoptionRate,
|
|
51
|
+
},
|
|
52
|
+
efficiency: {
|
|
53
|
+
promptLift,
|
|
54
|
+
contextCompression,
|
|
55
|
+
wasteAvoided,
|
|
56
|
+
},
|
|
57
|
+
overview: {
|
|
58
|
+
eventCount: filtered.length,
|
|
59
|
+
repos: Array.from(new Set(filtered.map((event) => event.repo))).sort(),
|
|
60
|
+
teams: Array.from(new Set(filtered.map((event) => event.team).filter((team) => Boolean(team)))).sort(),
|
|
61
|
+
trend: includeTrend ? buildTrend(filtered) : [],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function filterEvents(events, filters) {
|
|
66
|
+
return events.filter((event) => {
|
|
67
|
+
if (filters.repo && event.repo !== filters.repo)
|
|
68
|
+
return false;
|
|
69
|
+
if (filters.team && event.team !== filters.team)
|
|
70
|
+
return false;
|
|
71
|
+
if (filters.dateFrom && event.timestamp < filters.dateFrom)
|
|
72
|
+
return false;
|
|
73
|
+
if (filters.dateTo && event.timestamp > filters.dateTo)
|
|
74
|
+
return false;
|
|
75
|
+
if (filters.syntheticOnly === true && !event.isSynthetic)
|
|
76
|
+
return false;
|
|
77
|
+
if (filters.syntheticOnly === false && event.isSynthetic)
|
|
78
|
+
return false;
|
|
79
|
+
if (filters.scenarioId && event.scenarioId !== filters.scenarioId)
|
|
80
|
+
return false;
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function buildTrend(events) {
|
|
85
|
+
const days = new Map();
|
|
86
|
+
for (const event of events) {
|
|
87
|
+
const day = event.timestamp.slice(0, 10);
|
|
88
|
+
const bucket = days.get(day) ?? [];
|
|
89
|
+
bucket.push(event);
|
|
90
|
+
days.set(day, bucket);
|
|
91
|
+
}
|
|
92
|
+
return Array.from(days.entries())
|
|
93
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
94
|
+
.slice(-30)
|
|
95
|
+
.map(([date, bucket]) => {
|
|
96
|
+
const metrics = computeMetricsFromFilteredEvents(bucket, false);
|
|
97
|
+
return {
|
|
98
|
+
date,
|
|
99
|
+
integrity: metrics.integrity.writeSafetySuccessRate.value,
|
|
100
|
+
quality: metrics.quality.executionReliability.value,
|
|
101
|
+
knowledge: 1 - metrics.knowledge.shadowKnowledgeIndex.value,
|
|
102
|
+
patterns: metrics.patterns.goldenPathAdherence.value,
|
|
103
|
+
efficiency: metrics.efficiency.promptLift.value,
|
|
104
|
+
value: metrics.quality.firstPassSuccessRate.value + metrics.knowledge.patternReuseRate.value,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function rate(numerator, denominator) {
|
|
109
|
+
return {
|
|
110
|
+
value: denominator === 0 ? 0 : numerator / denominator,
|
|
111
|
+
numerator,
|
|
112
|
+
denominator,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function averageMetric(values) {
|
|
116
|
+
return {
|
|
117
|
+
value: values.length === 0 ? 0 : values.reduce((sum, value) => sum + value, 0) / values.length,
|
|
118
|
+
numerator: values.length === 0 ? 0 : Math.round(values.reduce((sum, value) => sum + value, 0) * 100),
|
|
119
|
+
denominator: values.length === 0 ? 0 : values.length * 100,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function clamp(value) {
|
|
123
|
+
return Math.max(0, Math.min(1, value));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Prompt Lift: a blended indicator of prompt refinement effectiveness.
|
|
127
|
+
*
|
|
128
|
+
* Components (weighted):
|
|
129
|
+
* - Refinement usage rate (40%): fraction of tasks that used prompt coach
|
|
130
|
+
* - Acceptance rate (30%): accepted / (accepted + bypassed)
|
|
131
|
+
* - Low bypass rate (15%): 1 - bypass rate
|
|
132
|
+
* - Edit engagement (15%): edit-after-refinement indicates active use
|
|
133
|
+
*
|
|
134
|
+
* Returns 0 when no PROMPT_REFINEMENT events exist (graceful zero-state).
|
|
135
|
+
*/
|
|
136
|
+
function computePromptLift(refinements) {
|
|
137
|
+
if (refinements.length === 0)
|
|
138
|
+
return rate(0, 0);
|
|
139
|
+
const total = refinements.length;
|
|
140
|
+
const accepted = refinements.filter((e) => e.accepted).length;
|
|
141
|
+
const bypassed = refinements.filter((e) => e.bypassed).length;
|
|
142
|
+
const edited = refinements.filter((e) => e.edited).length;
|
|
143
|
+
const decided = accepted + bypassed;
|
|
144
|
+
const acceptanceRate = decided > 0 ? accepted / decided : 0;
|
|
145
|
+
const lowBypassRate = decided > 0 ? 1 - (bypassed / decided) : 0;
|
|
146
|
+
const editEngagement = total > 0 ? edited / total : 0;
|
|
147
|
+
// Usage rate is always 1.0 when refinement events exist (they only fire when coach is used)
|
|
148
|
+
const usageSignal = 1.0;
|
|
149
|
+
const blended = (usageSignal * 0.40) + (acceptanceRate * 0.30) + (lowBypassRate * 0.15) + (editEngagement * 0.15);
|
|
150
|
+
return {
|
|
151
|
+
value: clamp(blended),
|
|
152
|
+
numerator: accepted,
|
|
153
|
+
denominator: total,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Waste Avoided: estimated operational proxy (not a precise accounting metric).
|
|
158
|
+
*
|
|
159
|
+
* Derived from:
|
|
160
|
+
* - Retries avoided from prompt refinement events
|
|
161
|
+
* - First-pass success rate from execution results
|
|
162
|
+
* - Low rework rate from execution results
|
|
163
|
+
*
|
|
164
|
+
* Returns a 0-1 score representing the fraction of waste that was avoided.
|
|
165
|
+
*/
|
|
166
|
+
function computeWasteAvoided(refinements, executions) {
|
|
167
|
+
const totalRetries = refinements.reduce((sum, e) => sum + e.retriesAvoided, 0);
|
|
168
|
+
const firstPassCount = executions.filter((e) => e.firstPass === true && e.status === 'success').length;
|
|
169
|
+
const firstPassTotal = executions.filter((e) => e.firstPass !== undefined).length;
|
|
170
|
+
const reworkCount = executions.filter((e) => e.rework === true).length;
|
|
171
|
+
const reworkTotal = executions.filter((e) => e.rework !== undefined).length;
|
|
172
|
+
if (refinements.length === 0 && firstPassTotal === 0)
|
|
173
|
+
return rate(0, 0);
|
|
174
|
+
const retriesSignal = refinements.length > 0 ? Math.min(1, totalRetries / (refinements.length * 2)) : 0;
|
|
175
|
+
const firstPassSignal = firstPassTotal > 0 ? firstPassCount / firstPassTotal : 0;
|
|
176
|
+
const lowReworkSignal = reworkTotal > 0 ? 1 - (reworkCount / reworkTotal) : 0;
|
|
177
|
+
const blended = (retriesSignal * 0.40) + (firstPassSignal * 0.35) + (lowReworkSignal * 0.25);
|
|
178
|
+
return {
|
|
179
|
+
value: clamp(blended),
|
|
180
|
+
numerator: totalRetries + firstPassCount,
|
|
181
|
+
denominator: refinements.length + firstPassTotal,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,cAAc,CAAC,MAAsB,EAAE,UAAyB,EAAE;IAChF,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO,gCAAgC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,gCAAgC,CAAC,QAAwB,EAAE,YAAqB;IACvF,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAiC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC;IAChH,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAA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|
1
|
+
import type { InsightEvent, InsightHotspotEntry, InsightPatternEntry, InsightShadowEntry, InsightValueTrend } from '@codeledger/types';
|
|
2
|
+
export declare function computeQualityHotspots(events: InsightEvent[]): InsightHotspotEntry[];
|
|
3
|
+
export declare function computeIntegrityHotspots(events: InsightEvent[]): InsightHotspotEntry[];
|
|
4
|
+
export declare function computeKnowledgePatterns(events: InsightEvent[]): InsightPatternEntry[];
|
|
5
|
+
export declare function computeShadowHotspots(events: InsightEvent[]): InsightShadowEntry[];
|
|
6
|
+
export declare function computeValueTrend(current: number, previous: number): InsightValueTrend;
|
|
7
|
+
//# sourceMappingURL=hotspots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotspots.d.ts","sourceRoot":"","sources":["../src/hotspots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvI,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,mBAAmB,EAAE,CA8BpF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,mBAAmB,EAAE,CA0BtF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,mBAAmB,EAAE,CAiBtF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,kBAAkB,EAAE,CAgBlF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAStF"}
|
package/dist/hotspots.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export function computeQualityHotspots(events) {
|
|
2
|
+
const repoStats = new Map();
|
|
3
|
+
for (const event of events) {
|
|
4
|
+
if (event.type !== 'EXECUTION_RESULT')
|
|
5
|
+
continue;
|
|
6
|
+
const repo = event.repo;
|
|
7
|
+
const stats = repoStats.get(repo) ?? { rework: 0, firstPass: 0, total: 0, lastSuccess: 0, prevSuccess: 0 };
|
|
8
|
+
stats.total += 1;
|
|
9
|
+
if (event.rework)
|
|
10
|
+
stats.rework += 1;
|
|
11
|
+
if (event.firstPass)
|
|
12
|
+
stats.firstPass += 1;
|
|
13
|
+
const success = event.status === 'success' ? 1 : 0;
|
|
14
|
+
stats.prevSuccess = stats.lastSuccess;
|
|
15
|
+
stats.lastSuccess = success;
|
|
16
|
+
repoStats.set(repo, stats);
|
|
17
|
+
}
|
|
18
|
+
return Array.from(repoStats.entries())
|
|
19
|
+
.map(([repo, stats]) => {
|
|
20
|
+
const reworkRatio = stats.total ? stats.rework / stats.total : 0;
|
|
21
|
+
const firstPassRate = stats.total ? stats.firstPass / stats.total : 0;
|
|
22
|
+
const direction = stats.lastSuccess > stats.prevSuccess ? 'up' : stats.lastSuccess < stats.prevSuccess ? 'down' : 'flat';
|
|
23
|
+
return {
|
|
24
|
+
repo,
|
|
25
|
+
value: reworkRatio,
|
|
26
|
+
secondaryValue: firstPassRate,
|
|
27
|
+
label: 'Rework',
|
|
28
|
+
direction,
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
.sort((a, b) => b.value - a.value)
|
|
32
|
+
.slice(0, 3);
|
|
33
|
+
}
|
|
34
|
+
export function computeIntegrityHotspots(events) {
|
|
35
|
+
const repoViolations = new Map();
|
|
36
|
+
for (const event of events) {
|
|
37
|
+
if (event.type === 'POLICY_EVALUATION') {
|
|
38
|
+
const repo = event.repo;
|
|
39
|
+
const stats = repoViolations.get(repo) ?? { violations: 0, rejects: 0 };
|
|
40
|
+
stats.violations += event.violations;
|
|
41
|
+
repoViolations.set(repo, stats);
|
|
42
|
+
}
|
|
43
|
+
if (event.type === 'EXECUTION_RESULT' && event.rejected) {
|
|
44
|
+
const repo = event.repo;
|
|
45
|
+
const stats = repoViolations.get(repo) ?? { violations: 0, rejects: 0 };
|
|
46
|
+
stats.rejects += 1;
|
|
47
|
+
repoViolations.set(repo, stats);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return Array.from(repoViolations.entries())
|
|
51
|
+
.map(([repo, stats]) => ({
|
|
52
|
+
repo,
|
|
53
|
+
value: stats.violations,
|
|
54
|
+
secondaryValue: stats.rejects,
|
|
55
|
+
label: 'Violations',
|
|
56
|
+
direction: stats.violations > 3 ? 'up' : 'flat',
|
|
57
|
+
}))
|
|
58
|
+
.sort((a, b) => b.value - a.value)
|
|
59
|
+
.slice(0, 3);
|
|
60
|
+
}
|
|
61
|
+
export function computeKnowledgePatterns(events) {
|
|
62
|
+
const patternMap = new Map();
|
|
63
|
+
for (const event of events) {
|
|
64
|
+
if (event.type !== 'PATTERN_REUSE')
|
|
65
|
+
continue;
|
|
66
|
+
const entry = patternMap.get(event.pattern) ?? { count: 0, repos: new Set() };
|
|
67
|
+
entry.count += 1;
|
|
68
|
+
entry.repos.add(event.repo);
|
|
69
|
+
patternMap.set(event.pattern, entry);
|
|
70
|
+
}
|
|
71
|
+
return Array.from(patternMap.entries())
|
|
72
|
+
.map(([pattern, entry]) => ({
|
|
73
|
+
pattern,
|
|
74
|
+
count: entry.count,
|
|
75
|
+
repos: Array.from(entry.repos),
|
|
76
|
+
}))
|
|
77
|
+
.sort((a, b) => b.count - a.count)
|
|
78
|
+
.slice(0, 3);
|
|
79
|
+
}
|
|
80
|
+
export function computeShadowHotspots(events) {
|
|
81
|
+
const repoShadow = new Map();
|
|
82
|
+
for (const event of events) {
|
|
83
|
+
if (event.type !== 'SHADOW_KNOWLEDGE_SIGNAL')
|
|
84
|
+
continue;
|
|
85
|
+
const stats = repoShadow.get(event.repo) ?? { total: 0, sum: 0 };
|
|
86
|
+
stats.total += 1;
|
|
87
|
+
stats.sum += event.weight ?? 0;
|
|
88
|
+
repoShadow.set(event.repo, stats);
|
|
89
|
+
}
|
|
90
|
+
return Array.from(repoShadow.entries())
|
|
91
|
+
.map(([repo, stats]) => ({
|
|
92
|
+
repo,
|
|
93
|
+
shadowIndex: stats.total ? stats.sum / stats.total : 0,
|
|
94
|
+
}))
|
|
95
|
+
.sort((a, b) => b.shadowIndex - a.shadowIndex)
|
|
96
|
+
.slice(0, 3);
|
|
97
|
+
}
|
|
98
|
+
export function computeValueTrend(current, previous) {
|
|
99
|
+
const direction = current > previous ? 'up' : current < previous ? 'down' : 'flat';
|
|
100
|
+
const delta = Number((current - previous).toFixed(2));
|
|
101
|
+
return {
|
|
102
|
+
direction,
|
|
103
|
+
delta,
|
|
104
|
+
period: 'last 7 days',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=hotspots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotspots.js","sourceRoot":"","sources":["../src/hotspots.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,MAAsB;IAC3D,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0G,CAAC;IACpI,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB;YAAE,SAAS;QAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;QAC3G,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QACjB,IAAI,KAAK,CAAC,MAAM;YAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,SAAS;YAAE,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAA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 -0,0 +1,10 @@
|
|
|
1
|
+
export * from './engine.js';
|
|
2
|
+
export * from './job.js';
|
|
3
|
+
export * from './recommendations.js';
|
|
4
|
+
export * from './value.js';
|
|
5
|
+
export * from './store.js';
|
|
6
|
+
export * from './scheduler.js';
|
|
7
|
+
export * from './team-attribution.js';
|
|
8
|
+
export * from './ownership.js';
|
|
9
|
+
export * from './patterns.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './engine.js';
|
|
2
|
+
export * from './job.js';
|
|
3
|
+
export * from './recommendations.js';
|
|
4
|
+
export * from './value.js';
|
|
5
|
+
export * from './store.js';
|
|
6
|
+
export * from './scheduler.js';
|
|
7
|
+
export * from './team-attribution.js';
|
|
8
|
+
export * from './ownership.js';
|
|
9
|
+
export * from './patterns.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InsightBaseline, InsightMetrics, InsightSignal, InsightValueTrend, ValueSummary } from '@codeledger/types';
|
|
2
|
+
export declare function generateSystemInsights(metrics: InsightMetrics, value: ValueSummary, context?: {
|
|
3
|
+
valueTrend?: InsightValueTrend;
|
|
4
|
+
baseline?: InsightBaseline;
|
|
5
|
+
}): InsightSignal[];
|
|
6
|
+
//# sourceMappingURL=insights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insights.d.ts","sourceRoot":"","sources":["../src/insights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,aAAa,EAEb,iBAAiB,EACjB,YAAY,EACb,MAAM,mBAAmB,CAAC;AA4B3B,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;CAAE,GACvE,aAAa,EAAE,CAyKjB"}
|
package/dist/insights.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function buildLink(metric) {
|
|
2
|
+
return `/api/evidence?metric=${encodeURIComponent(metric)}`;
|
|
3
|
+
}
|
|
4
|
+
function addSignal(list, title, detail, severity, linkedMetric) {
|
|
5
|
+
list.push({
|
|
6
|
+
title,
|
|
7
|
+
detail,
|
|
8
|
+
severity,
|
|
9
|
+
linkedMetric,
|
|
10
|
+
link: buildLink(linkedMetric),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
const severityRank = {
|
|
14
|
+
critical: 3,
|
|
15
|
+
warn: 2,
|
|
16
|
+
info: 1,
|
|
17
|
+
};
|
|
18
|
+
export function generateSystemInsights(metrics, value, context) {
|
|
19
|
+
const insights = [];
|
|
20
|
+
const trend = metrics.overview.trend;
|
|
21
|
+
const last = trend.at(-1);
|
|
22
|
+
const prev = trend.length > 1 ? trend.at(-2) : undefined;
|
|
23
|
+
const baseline = context?.baseline;
|
|
24
|
+
const rework = metrics.quality.reworkRatio.value;
|
|
25
|
+
if (rework > 0.32) {
|
|
26
|
+
addSignal(insights, 'Rework is elevated', `Rework ratio is ${Math.round(rework * 100)}% this period—review rework flows before downstream work starts.`, 'warn', 'reworkRatio');
|
|
27
|
+
}
|
|
28
|
+
else if (rework < 0.15) {
|
|
29
|
+
addSignal(insights, 'Rework under control', `Rework is low (${Math.round(rework * 100)}%); first-pass success is holding steady.`, 'info', 'reworkRatio');
|
|
30
|
+
}
|
|
31
|
+
const drift = metrics.integrity.integrityDrift.value;
|
|
32
|
+
if (drift > 0.25) {
|
|
33
|
+
addSignal(insights, 'Policy drift alert', `Integrity drift ${Math.round(drift * 100)}%—policy violations and rejects are rising.`, 'critical', 'integrityDrift');
|
|
34
|
+
}
|
|
35
|
+
else if (drift < 0.1) {
|
|
36
|
+
addSignal(insights, 'Integrity signals stable', `Policy drift is low (${Math.round(drift * 100)}%); enforcement is staying tight.`, 'info', 'integrityDrift');
|
|
37
|
+
}
|
|
38
|
+
const shadowRisk = metrics.knowledge.shadowKnowledgeIndex.value;
|
|
39
|
+
const timeToContext = metrics.knowledge.timeToContext.value;
|
|
40
|
+
if (shadowRisk > 0.5 && timeToContext > 5) {
|
|
41
|
+
addSignal(insights, 'Shadow knowledge rising', `Shadow index ${shadowRisk.toFixed(2)} with ${timeToContext.toFixed(1)} min context—the docs gap may be widening.`, 'warn', 'shadowKnowledgeIndex');
|
|
42
|
+
}
|
|
43
|
+
else if (shadowRisk < 0.4 && metrics.knowledge.patternReuseRate.value > 0.65) {
|
|
44
|
+
addSignal(insights, 'Knowledge compounding', `Pattern reuse ${Math.round(metrics.knowledge.patternReuseRate.value * 100)}% with low shadow risk—reuse signals are amplifying.`, 'info', 'patternReuseRate');
|
|
45
|
+
}
|
|
46
|
+
const reuse = metrics.knowledge.patternReuseRate.value;
|
|
47
|
+
if (reuse < 0.25) {
|
|
48
|
+
addSignal(insights, 'Pattern reuse muted', `Reuse events are sparse (${Math.round(reuse * 100)}%); surface re-use candidates or references.`, 'warn', 'patternReuseRate');
|
|
49
|
+
}
|
|
50
|
+
if (last && prev) {
|
|
51
|
+
const deltaQuality = last.quality - prev.quality;
|
|
52
|
+
if (deltaQuality > 0.02) {
|
|
53
|
+
addSignal(insights, 'Quality trending upward', `Execution reliability improved ${(deltaQuality * 100).toFixed(1)} pts vs last period.`, 'info', 'executionReliability');
|
|
54
|
+
}
|
|
55
|
+
else if (deltaQuality < -0.02) {
|
|
56
|
+
addSignal(insights, 'Quality facing headwinds', `Execution reliability slipped ${(-deltaQuality * 100).toFixed(1)} pts—check the failing flows.`, 'warn', 'executionReliability');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (baseline) {
|
|
60
|
+
if (metrics.quality.executionReliability.value > baseline.qualityScore + 0.03) {
|
|
61
|
+
addSignal(insights, 'Quality above typical baseline', `Quality (${Math.round(metrics.quality.executionReliability.value * 100)}%) exceeds the baseline (${Math.round(baseline.qualityScore * 100)}%).`, 'info', 'executionReliability');
|
|
62
|
+
}
|
|
63
|
+
else if (metrics.quality.executionReliability.value < baseline.qualityScore - 0.03) {
|
|
64
|
+
addSignal(insights, 'Quality below baseline', `Quality is ${Math.round(metrics.quality.executionReliability.value * 100)}% vs baseline ${Math.round(baseline.qualityScore * 100)}%.`, 'warn', 'executionReliability');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (metrics.patterns.goldenPathAdherence.value < 0.8) {
|
|
68
|
+
addSignal(insights, 'Golden path pressure', 'Golden path adherence slipped below 80%; review the divergent flows for potential drift.', 'warn', 'goldenPathAdherence');
|
|
69
|
+
}
|
|
70
|
+
const valueTrend = context?.valueTrend;
|
|
71
|
+
if (valueTrend) {
|
|
72
|
+
if (valueTrend.direction === 'up') {
|
|
73
|
+
addSignal(insights, 'Value accelerating', `Estimated savings up ${valueTrend.delta} vs ${valueTrend.period}.`, 'info', 'executionReliability');
|
|
74
|
+
}
|
|
75
|
+
else if (valueTrend.direction === 'down') {
|
|
76
|
+
addSignal(insights, 'Value slipping', `Estimated savings down ${Math.abs(valueTrend.delta)} vs ${valueTrend.period}; rework or knowledge may need attention.`, 'warn', 'executionReliability');
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
addSignal(insights, 'Value holding steady', `Estimated savings stable over ${valueTrend.period}.`, 'info', 'executionReliability');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (value.estimatedSavings > 0) {
|
|
83
|
+
addSignal(insights, 'Value compounding', `Estimated savings $${Math.round(value.estimatedSavings)} this period; keep the evidence traceable.`, 'info', 'estimatedSavings');
|
|
84
|
+
}
|
|
85
|
+
return insights
|
|
86
|
+
.sort((a, b) => severityRank[b.severity] - severityRank[a.severity])
|
|
87
|
+
.slice(0, 5);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=insights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../src/insights.ts"],"names":[],"mappings":"AASA,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,wBAAwB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED,SAAS,SAAS,CAChB,IAAqB,EACrB,KAAa,EACb,MAAc,EACd,QAA+B,EAC/B,YAAoB;IAEpB,IAAI,CAAC,IAAI,CAAC;QACR,KAAK;QACL,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,YAAY,GAA0C;IAC1D,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,OAAuB,EACvB,KAAmB,EACnB,OAAwE;IAExE,MAAM,QAAQ,GAAoB,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|
|
|
1
|
+
import type { FilterOptions, InsightSnapshot, ValueAssumptions } from '@codeledger/types';
|
|
2
|
+
export interface InsightJobOptions {
|
|
3
|
+
cwd: string;
|
|
4
|
+
filters?: FilterOptions;
|
|
5
|
+
assumptions?: ValueAssumptions;
|
|
6
|
+
}
|
|
7
|
+
export declare function writeInsightSnapshot(cwd: string, snapshot: InsightSnapshot): string;
|
|
8
|
+
export declare function runInsightAggregationJob(options: InsightJobOptions): InsightSnapshot;
|
|
9
|
+
//# sourceMappingURL=job.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,aAAa,EAKb,eAAe,EAMf,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAgB3B,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,MAAM,CAMnF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAoEpF"}
|