@lumenflow/metrics 2.2.2 → 2.3.1

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/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * DORA/SPACE analytics and flow metrics for LumenFlow workflow framework.
5
5
  *
6
+ * WU-1160: Verified no .mjs references exist in this package.
7
+ *
6
8
  * @module @lumenflow/metrics
7
9
  */
8
10
  export declare const METRICS_VERSION = "0.1.0";
@@ -10,4 +12,5 @@ export type { DORAStatusTier, WUMetrics, GitCommit, SkipGatesEntry, DeploymentFr
10
12
  export { calculateDeploymentFrequency, calculateLeadTime, calculateCFR, calculateMTTR, calculateDORAMetrics, identifyEmergencyFixes, DEPLOYMENT_FREQUENCY, LEAD_TIME_HOURS, CFR_PERCENT, MTTR_HOURS, STATISTICS, } from './dora/index.js';
11
13
  export { calculateFlowState, analyzeBottlenecks, criticalPath, impactScore, topologicalSort, getBottleneckAnalysis, generateFlowReport, captureMetricsSnapshot, type DependencyGraph, } from './flow/index.js';
12
14
  export { createTelemetryEmitter, TELEMETRY_PATHS, type TelemetryEmitter, } from './telemetry/index.js';
15
+ export { createMethodologyTelemetryEmitter, METHODOLOGY_TELEMETRY_PATHS, isMethodologyTelemetryEnabled, type MethodologyTelemetryEmitter, type MethodologyTelemetryEvent, type MethodologyTelemetryInput, type MethodologyTelemetryConfig, type TestingMethodologyValue, type ArchitectureMethodologyValue, type MethodologyEventContext, } from './methodology-telemetry.js';
13
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,UAAU,CAAC;AAGvC,YAAY,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,cAAc,EACd,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,eAAe,UAAU,CAAC;AAGvC,YAAY,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,cAAc,EACd,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,6BAA6B,EAC7B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * DORA/SPACE analytics and flow metrics for LumenFlow workflow framework.
5
5
  *
6
+ * WU-1160: Verified no .mjs references exist in this package.
7
+ *
6
8
  * @module @lumenflow/metrics
7
9
  */
8
10
  export const METRICS_VERSION = '0.1.0';
@@ -12,4 +14,6 @@ export { calculateDeploymentFrequency, calculateLeadTime, calculateCFR, calculat
12
14
  export { calculateFlowState, analyzeBottlenecks, criticalPath, impactScore, topologicalSort, getBottleneckAnalysis, generateFlowReport, captureMetricsSnapshot, } from './flow/index.js';
13
15
  // Telemetry
14
16
  export { createTelemetryEmitter, TELEMETRY_PATHS, } from './telemetry/index.js';
17
+ // Methodology Telemetry (WU-1270)
18
+ export { createMethodologyTelemetryEmitter, METHODOLOGY_TELEMETRY_PATHS, isMethodologyTelemetryEnabled, } from './methodology-telemetry.js';
15
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAoCvC,eAAe;AACf,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,eAAe;AACf,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,iBAAiB,CAAC;AAEzB,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,eAAe,GAEhB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAoCvC,eAAe;AACf,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,eAAe;AACf,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,iBAAiB,CAAC;AAEzB,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAE9B,kCAAkC;AAClC,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,6BAA6B,GAQ9B,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Methodology Telemetry Module
3
+ *
4
+ * WU-1270: Opt-in telemetry for methodology mode tracking.
5
+ * Captures methodology.testing and methodology.architecture values on wu:spawn.
6
+ * Privacy-preserving: No PII or project-identifying information collected.
7
+ *
8
+ * @module @lumenflow/metrics/methodology-telemetry
9
+ */
10
+ import type { TelemetryEmitFn } from './types.js';
11
+ /**
12
+ * Telemetry paths for methodology tracking
13
+ */
14
+ export declare const METHODOLOGY_TELEMETRY_PATHS: {
15
+ readonly METHODOLOGY: ".lumenflow/telemetry/methodology.ndjson";
16
+ };
17
+ /**
18
+ * Testing methodology values (from resolve-policy.ts)
19
+ */
20
+ export type TestingMethodologyValue = 'tdd' | 'test-after' | 'none';
21
+ /**
22
+ * Architecture methodology values (from resolve-policy.ts)
23
+ */
24
+ export type ArchitectureMethodologyValue = 'hexagonal' | 'layered' | 'none';
25
+ /**
26
+ * Event context indicating where the telemetry was triggered
27
+ */
28
+ export type MethodologyEventContext = 'spawn';
29
+ /**
30
+ * Input for methodology telemetry emission
31
+ *
32
+ * Note: wuId and lane are accepted as input but NOT emitted
33
+ * to preserve privacy (no project-identifying information).
34
+ */
35
+ export interface MethodologyTelemetryInput {
36
+ /** Testing methodology value */
37
+ testing: TestingMethodologyValue;
38
+ /** Architecture methodology value */
39
+ architecture: ArchitectureMethodologyValue;
40
+ /** Context in which telemetry was triggered */
41
+ eventContext: MethodologyEventContext;
42
+ /** WU ID (not emitted - privacy) */
43
+ wuId?: string;
44
+ /** Lane name (not emitted - privacy) */
45
+ lane?: string;
46
+ }
47
+ /**
48
+ * Methodology telemetry event structure (emitted to NDJSON)
49
+ *
50
+ * Privacy-preserving: Does NOT include:
51
+ * - WU ID
52
+ * - Lane name
53
+ * - Project name
54
+ * - Any other project-identifying information
55
+ */
56
+ export interface MethodologyTelemetryEvent {
57
+ /** ISO timestamp */
58
+ timestamp: string;
59
+ /** Event type identifier */
60
+ event_type: 'methodology.selection';
61
+ /** Testing methodology value */
62
+ methodology_testing: TestingMethodologyValue;
63
+ /** Architecture methodology value */
64
+ methodology_architecture: ArchitectureMethodologyValue;
65
+ /** Context where telemetry was triggered */
66
+ event_context: MethodologyEventContext;
67
+ /** Index signature for Record compatibility */
68
+ [key: string]: string;
69
+ }
70
+ /**
71
+ * Methodology telemetry emitter interface
72
+ */
73
+ export interface MethodologyTelemetryEmitter {
74
+ /**
75
+ * Emit a methodology selection event
76
+ * @param data - Methodology telemetry input
77
+ * @param logPath - Optional custom log path
78
+ */
79
+ emitMethodologySelection(data: MethodologyTelemetryInput, logPath?: string): void;
80
+ }
81
+ /**
82
+ * Create a methodology telemetry emitter
83
+ *
84
+ * @param emit - Telemetry emit function (writes to NDJSON file)
85
+ * @returns Methodology telemetry emitter
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * import { createMethodologyTelemetryEmitter } from '@lumenflow/metrics/methodology-telemetry';
90
+ *
91
+ * const emit = (path: string, event: Record<string, unknown>) => {
92
+ * fs.appendFileSync(path, JSON.stringify(event) + '\n');
93
+ * };
94
+ *
95
+ * const emitter = createMethodologyTelemetryEmitter(emit);
96
+ *
97
+ * // Emit methodology selection (wuId is NOT included in output)
98
+ * emitter.emitMethodologySelection({
99
+ * testing: 'tdd',
100
+ * architecture: 'hexagonal',
101
+ * eventContext: 'spawn',
102
+ * wuId: 'WU-1270', // Accepted but not emitted
103
+ * });
104
+ * ```
105
+ */
106
+ export declare function createMethodologyTelemetryEmitter(emit: TelemetryEmitFn): MethodologyTelemetryEmitter;
107
+ /**
108
+ * Configuration structure for methodology telemetry opt-in
109
+ */
110
+ export interface MethodologyTelemetryConfig {
111
+ telemetry?: {
112
+ methodology?: {
113
+ /** Whether methodology telemetry is enabled (opt-in) */
114
+ enabled?: boolean;
115
+ };
116
+ };
117
+ }
118
+ /**
119
+ * Check if methodology telemetry is enabled in configuration
120
+ *
121
+ * Methodology telemetry is OPT-IN only. Returns false unless
122
+ * explicitly enabled via config.
123
+ *
124
+ * @param config - Configuration object with optional telemetry settings
125
+ * @returns true if methodology telemetry is enabled
126
+ *
127
+ * @example
128
+ * ```yaml
129
+ * # .lumenflow.config.yaml
130
+ * telemetry:
131
+ * methodology:
132
+ * enabled: true # Opt-in to methodology tracking
133
+ * ```
134
+ */
135
+ export declare function isMethodologyTelemetryEnabled(config: MethodologyTelemetryConfig): boolean;
136
+ //# sourceMappingURL=methodology-telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methodology-telemetry.d.ts","sourceRoot":"","sources":["../src/methodology-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,2BAA2B;;CAE9B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,OAAO,EAAE,uBAAuB,CAAC;IACjC,qCAAqC;IACrC,YAAY,EAAE,4BAA4B,CAAC;IAC3C,+CAA+C;IAC/C,YAAY,EAAE,uBAAuB,CAAC;IACtC,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,UAAU,EAAE,uBAAuB,CAAC;IACpC,gCAAgC;IAChC,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,qCAAqC;IACrC,wBAAwB,EAAE,4BAA4B,CAAC;IACvD,4CAA4C;IAC5C,aAAa,EAAE,uBAAuB,CAAC;IACvC,+CAA+C;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,wBAAwB,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,eAAe,GACpB,2BAA2B,CAmB7B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE;YACZ,wDAAwD;YACxD,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB,CAAC;KACH,CAAC;CACH;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAEzF"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Methodology Telemetry Module
3
+ *
4
+ * WU-1270: Opt-in telemetry for methodology mode tracking.
5
+ * Captures methodology.testing and methodology.architecture values on wu:spawn.
6
+ * Privacy-preserving: No PII or project-identifying information collected.
7
+ *
8
+ * @module @lumenflow/metrics/methodology-telemetry
9
+ */
10
+ /**
11
+ * Telemetry paths for methodology tracking
12
+ */
13
+ export const METHODOLOGY_TELEMETRY_PATHS = {
14
+ METHODOLOGY: '.lumenflow/telemetry/methodology.ndjson',
15
+ };
16
+ /**
17
+ * Create a methodology telemetry emitter
18
+ *
19
+ * @param emit - Telemetry emit function (writes to NDJSON file)
20
+ * @returns Methodology telemetry emitter
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { createMethodologyTelemetryEmitter } from '@lumenflow/metrics/methodology-telemetry';
25
+ *
26
+ * const emit = (path: string, event: Record<string, unknown>) => {
27
+ * fs.appendFileSync(path, JSON.stringify(event) + '\n');
28
+ * };
29
+ *
30
+ * const emitter = createMethodologyTelemetryEmitter(emit);
31
+ *
32
+ * // Emit methodology selection (wuId is NOT included in output)
33
+ * emitter.emitMethodologySelection({
34
+ * testing: 'tdd',
35
+ * architecture: 'hexagonal',
36
+ * eventContext: 'spawn',
37
+ * wuId: 'WU-1270', // Accepted but not emitted
38
+ * });
39
+ * ```
40
+ */
41
+ export function createMethodologyTelemetryEmitter(emit) {
42
+ return {
43
+ emitMethodologySelection(data, logPath = METHODOLOGY_TELEMETRY_PATHS.METHODOLOGY) {
44
+ // Create event WITHOUT project-identifying information
45
+ // wuId and lane are intentionally NOT included (privacy requirement)
46
+ const event = {
47
+ timestamp: new Date().toISOString(),
48
+ event_type: 'methodology.selection',
49
+ methodology_testing: data.testing,
50
+ methodology_architecture: data.architecture,
51
+ event_context: data.eventContext,
52
+ };
53
+ emit(logPath, event);
54
+ },
55
+ };
56
+ }
57
+ /**
58
+ * Check if methodology telemetry is enabled in configuration
59
+ *
60
+ * Methodology telemetry is OPT-IN only. Returns false unless
61
+ * explicitly enabled via config.
62
+ *
63
+ * @param config - Configuration object with optional telemetry settings
64
+ * @returns true if methodology telemetry is enabled
65
+ *
66
+ * @example
67
+ * ```yaml
68
+ * # .lumenflow.config.yaml
69
+ * telemetry:
70
+ * methodology:
71
+ * enabled: true # Opt-in to methodology tracking
72
+ * ```
73
+ */
74
+ export function isMethodologyTelemetryEnabled(config) {
75
+ return config.telemetry?.methodology?.enabled === true;
76
+ }
77
+ //# sourceMappingURL=methodology-telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methodology-telemetry.js","sourceRoot":"","sources":["../src/methodology-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,WAAW,EAAE,yCAAyC;CAC9C,CAAC;AAwEX;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iCAAiC,CAC/C,IAAqB;IAErB,OAAO;QACL,wBAAwB,CACtB,IAA+B,EAC/B,UAAkB,2BAA2B,CAAC,WAAW;YAEzD,uDAAuD;YACvD,qEAAqE;YACrE,MAAM,KAAK,GAA8B;gBACvC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,UAAU,EAAE,uBAAuB;gBACnC,mBAAmB,EAAE,IAAI,CAAC,OAAO;gBACjC,wBAAwB,EAAE,IAAI,CAAC,YAAY;gBAC3C,aAAa,EAAE,IAAI,CAAC,YAAY;aACjC,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC;AAcD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAkC;IAC9E,OAAO,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/metrics",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "DORA/SPACE analytics and flow metrics for LumenFlow workflow framework",
5
5
  "keywords": [
6
6
  "lumenflow",