@nahisaho/musubix-wake-sleep 1.0.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/dist/cycle/cycle-manager.d.ts +40 -0
- package/dist/cycle/cycle-manager.d.ts.map +1 -0
- package/dist/cycle/cycle-manager.js +99 -0
- package/dist/cycle/cycle-manager.js.map +1 -0
- package/dist/cycle/index.d.ts +6 -0
- package/dist/cycle/index.d.ts.map +1 -0
- package/dist/cycle/index.js +6 -0
- package/dist/cycle/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/resource/index.d.ts +6 -0
- package/dist/resource/index.d.ts.map +1 -0
- package/dist/resource/index.js +6 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/resource-limiter.d.ts +54 -0
- package/dist/resource/resource-limiter.d.ts.map +1 -0
- package/dist/resource/resource-limiter.js +91 -0
- package/dist/resource/resource-limiter.js.map +1 -0
- package/dist/sleep/index.d.ts +6 -0
- package/dist/sleep/index.d.ts.map +1 -0
- package/dist/sleep/index.js +6 -0
- package/dist/sleep/index.js.map +1 -0
- package/dist/sleep/sleep-phase.d.ts +40 -0
- package/dist/sleep/sleep-phase.d.ts.map +1 -0
- package/dist/sleep/sleep-phase.js +105 -0
- package/dist/sleep/sleep-phase.js.map +1 -0
- package/dist/types.d.ts +121 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/wake/index.d.ts +6 -0
- package/dist/wake/index.d.ts.map +1 -0
- package/dist/wake/index.js +6 -0
- package/dist/wake/index.js.map +1 -0
- package/dist/wake/wake-phase.d.ts +111 -0
- package/dist/wake/wake-phase.d.ts.map +1 -0
- package/dist/wake/wake-phase.js +398 -0
- package/dist/wake/wake-phase.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wake-sleep cycle manager
|
|
3
|
+
* @traceability TSK-WAKE-003, REQ-WAKE-001-F003
|
|
4
|
+
*/
|
|
5
|
+
import type { CycleConfig, CycleStatus, WakeTask } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Manages the wake-sleep learning cycle
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Coordinates between wake and sleep phases:
|
|
11
|
+
* - Wake: Collect patterns from tasks
|
|
12
|
+
* - Sleep: Consolidate and abstract patterns
|
|
13
|
+
* - Auto-triggers sleep when threshold reached
|
|
14
|
+
*/
|
|
15
|
+
export declare class CycleManager {
|
|
16
|
+
private wake;
|
|
17
|
+
private sleep;
|
|
18
|
+
private config;
|
|
19
|
+
private cycleNumber;
|
|
20
|
+
private lastCycleTime;
|
|
21
|
+
private currentPhase;
|
|
22
|
+
constructor(config?: Partial<CycleConfig>);
|
|
23
|
+
/**
|
|
24
|
+
* Submit task during wake phase
|
|
25
|
+
*/
|
|
26
|
+
submitTask(task: WakeTask): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Manually trigger sleep phase
|
|
29
|
+
*/
|
|
30
|
+
runSleepPhase(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get current cycle status
|
|
33
|
+
*/
|
|
34
|
+
getStatus(): CycleStatus;
|
|
35
|
+
/**
|
|
36
|
+
* Reset cycle manager
|
|
37
|
+
*/
|
|
38
|
+
reset(): void;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=cycle-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle-manager.d.ts","sourceRoot":"","sources":["../../src/cycle/cycle-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAItE;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,YAAY,CAAqC;gBAE7C,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM;IAe7C;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/C;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAgCpC;;OAEG;IACH,SAAS,IAAI,WAAW;IAUxB;;OAEG;IACH,KAAK,IAAI,IAAI;CAMd"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wake-sleep cycle manager
|
|
3
|
+
* @traceability TSK-WAKE-003, REQ-WAKE-001-F003
|
|
4
|
+
*/
|
|
5
|
+
import { WakePhase } from '../wake/wake-phase.js';
|
|
6
|
+
import { SleepPhase } from '../sleep/sleep-phase.js';
|
|
7
|
+
/**
|
|
8
|
+
* Manages the wake-sleep learning cycle
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* Coordinates between wake and sleep phases:
|
|
12
|
+
* - Wake: Collect patterns from tasks
|
|
13
|
+
* - Sleep: Consolidate and abstract patterns
|
|
14
|
+
* - Auto-triggers sleep when threshold reached
|
|
15
|
+
*/
|
|
16
|
+
export class CycleManager {
|
|
17
|
+
wake;
|
|
18
|
+
sleep;
|
|
19
|
+
config;
|
|
20
|
+
cycleNumber = 0;
|
|
21
|
+
lastCycleTime = null;
|
|
22
|
+
currentPhase = 'idle';
|
|
23
|
+
constructor(config = {}) {
|
|
24
|
+
this.config = {
|
|
25
|
+
wakeTaskThreshold: config.wakeTaskThreshold ?? 10,
|
|
26
|
+
maxCycleDuration: config.maxCycleDuration ?? 60000,
|
|
27
|
+
minPatternFrequency: config.minPatternFrequency ?? 2,
|
|
28
|
+
mdlThreshold: config.mdlThreshold ?? 0.5,
|
|
29
|
+
};
|
|
30
|
+
this.wake = new WakePhase();
|
|
31
|
+
this.sleep = new SleepPhase({
|
|
32
|
+
minFrequency: this.config.minPatternFrequency,
|
|
33
|
+
mdlThreshold: this.config.mdlThreshold,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Submit task during wake phase
|
|
38
|
+
*/
|
|
39
|
+
async submitTask(task) {
|
|
40
|
+
this.currentPhase = 'wake';
|
|
41
|
+
this.wake.addTask(task);
|
|
42
|
+
// Auto-trigger sleep if threshold reached
|
|
43
|
+
if (this.wake.taskCount >= this.config.wakeTaskThreshold) {
|
|
44
|
+
await this.runSleepPhase();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Manually trigger sleep phase
|
|
49
|
+
*/
|
|
50
|
+
async runSleepPhase() {
|
|
51
|
+
this.currentPhase = 'sleep';
|
|
52
|
+
// Process all wake tasks
|
|
53
|
+
const wakeResults = await this.wake.processAll();
|
|
54
|
+
// Consolidate patterns during sleep
|
|
55
|
+
if (wakeResults.length > 0) {
|
|
56
|
+
const patternCandidates = wakeResults
|
|
57
|
+
.flatMap(r => r.extractedPatterns)
|
|
58
|
+
.map(p => ({
|
|
59
|
+
name: p,
|
|
60
|
+
code: p,
|
|
61
|
+
structure: {},
|
|
62
|
+
occurrences: 1,
|
|
63
|
+
confidence: 0.5,
|
|
64
|
+
source: 'code',
|
|
65
|
+
}));
|
|
66
|
+
if (patternCandidates.length > 0) {
|
|
67
|
+
await this.sleep.consolidate({
|
|
68
|
+
patterns: patternCandidates,
|
|
69
|
+
existingLibrary: [],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.cycleNumber++;
|
|
74
|
+
this.lastCycleTime = new Date().toISOString();
|
|
75
|
+
this.currentPhase = 'idle';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get current cycle status
|
|
79
|
+
*/
|
|
80
|
+
getStatus() {
|
|
81
|
+
return {
|
|
82
|
+
currentPhase: this.currentPhase,
|
|
83
|
+
taskCount: this.wake.taskCount,
|
|
84
|
+
patternCount: 0, // TODO: Get from pattern library
|
|
85
|
+
cycleNumber: this.cycleNumber,
|
|
86
|
+
lastCycleTime: this.lastCycleTime,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Reset cycle manager
|
|
91
|
+
*/
|
|
92
|
+
reset() {
|
|
93
|
+
this.wake.reset();
|
|
94
|
+
this.cycleNumber = 0;
|
|
95
|
+
this.lastCycleTime = null;
|
|
96
|
+
this.currentPhase = 'idle';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=cycle-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle-manager.js","sourceRoot":"","sources":["../../src/cycle/cycle-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACf,IAAI,CAAY;IAChB,KAAK,CAAa;IAClB,MAAM,CAAc;IACpB,WAAW,GAAG,CAAC,CAAC;IAChB,aAAa,GAAkB,IAAI,CAAC;IACpC,YAAY,GAA8B,MAAM,CAAC;IAEzD,YAAY,SAA+B,EAAE;QAC3C,IAAI,CAAC,MAAM,GAAG;YACZ,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,EAAE;YACjD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,KAAK;YAClD,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,IAAI,CAAC;YACpD,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,GAAG;SACzC,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,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ACpB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,YAAY,EAAE,CAAC,EAAE,iCAAiC;YAClD,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview MUSUBIX Wake-Sleep Learning Engine
|
|
3
|
+
* @module @nahisaho/musubix-wake-sleep
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
* @traceability REQ-WAKE-001
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './wake/index.js';
|
|
9
|
+
export * from './sleep/index.js';
|
|
10
|
+
export * from './cycle/index.js';
|
|
11
|
+
export * from './resource/index.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview MUSUBIX Wake-Sleep Learning Engine
|
|
3
|
+
* @module @nahisaho/musubix-wake-sleep
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
* @traceability REQ-WAKE-001
|
|
6
|
+
*/
|
|
7
|
+
// Types
|
|
8
|
+
export * from './types.js';
|
|
9
|
+
// Wake Phase (TSK-WAKE-001)
|
|
10
|
+
export * from './wake/index.js';
|
|
11
|
+
// Sleep Phase (TSK-WAKE-002)
|
|
12
|
+
export * from './sleep/index.js';
|
|
13
|
+
// Cycle Manager (TSK-WAKE-003)
|
|
14
|
+
export * from './cycle/index.js';
|
|
15
|
+
// Resource Limiter (TSK-WAKE-007)
|
|
16
|
+
export * from './resource/index.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,4BAA4B;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,6BAA6B;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,+BAA+B;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,kCAAkC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resource/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource limiter for wake-sleep operations
|
|
3
|
+
* @traceability TSK-WAKE-007, REQ-WAKE-001-F007
|
|
4
|
+
*/
|
|
5
|
+
import type { ResourceLimits, ResourceMetrics } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resource limiter for wake-sleep operations
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Enforces resource limits to prevent runaway operations:
|
|
11
|
+
* - Memory limits
|
|
12
|
+
* - CPU time limits
|
|
13
|
+
* - Pattern count limits
|
|
14
|
+
* - Concurrency limits
|
|
15
|
+
*/
|
|
16
|
+
export declare class ResourceLimiter {
|
|
17
|
+
private limits;
|
|
18
|
+
private activeOperations;
|
|
19
|
+
private operationStartTimes;
|
|
20
|
+
constructor(limits?: Partial<ResourceLimits>);
|
|
21
|
+
/**
|
|
22
|
+
* Check if operation can start
|
|
23
|
+
*/
|
|
24
|
+
canStartOperation(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Register operation start
|
|
27
|
+
*/
|
|
28
|
+
startOperation(operationId: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Register operation end
|
|
31
|
+
*/
|
|
32
|
+
endOperation(operationId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Check if operation has exceeded time limit
|
|
35
|
+
*/
|
|
36
|
+
isOperationTimedOut(operationId: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check if pattern count is within limit
|
|
39
|
+
*/
|
|
40
|
+
canAddPatterns(count: number, currentCount: number): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get current resource metrics
|
|
43
|
+
*/
|
|
44
|
+
getMetrics(): ResourceMetrics;
|
|
45
|
+
/**
|
|
46
|
+
* Check if memory is within limits
|
|
47
|
+
*/
|
|
48
|
+
isMemoryWithinLimits(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get limits
|
|
51
|
+
*/
|
|
52
|
+
getLimits(): ResourceLimits;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=resource-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-limiter.d.ts","sourceRoot":"","sources":["../../src/resource/resource-limiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;;;GASG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,mBAAmB,CAA6B;gBAE5C,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;IAShD;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAQ5C;;OAEG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKvC;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAMjD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAI5D;;OAEG;IACH,UAAU,IAAI,eAAe;IAU7B;;OAEG;IACH,oBAAoB,IAAI,OAAO;IAK/B;;OAEG;IACH,SAAS,IAAI,cAAc;CAG5B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource limiter for wake-sleep operations
|
|
3
|
+
* @traceability TSK-WAKE-007, REQ-WAKE-001-F007
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Resource limiter for wake-sleep operations
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* Enforces resource limits to prevent runaway operations:
|
|
10
|
+
* - Memory limits
|
|
11
|
+
* - CPU time limits
|
|
12
|
+
* - Pattern count limits
|
|
13
|
+
* - Concurrency limits
|
|
14
|
+
*/
|
|
15
|
+
export class ResourceLimiter {
|
|
16
|
+
limits;
|
|
17
|
+
activeOperations = 0;
|
|
18
|
+
operationStartTimes = new Map();
|
|
19
|
+
constructor(limits = {}) {
|
|
20
|
+
this.limits = {
|
|
21
|
+
maxMemoryMB: limits.maxMemoryMB ?? 512,
|
|
22
|
+
maxCpuTimeMs: limits.maxCpuTimeMs ?? 30000,
|
|
23
|
+
maxPatterns: limits.maxPatterns ?? 10000,
|
|
24
|
+
maxConcurrency: limits.maxConcurrency ?? 4,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if operation can start
|
|
29
|
+
*/
|
|
30
|
+
canStartOperation() {
|
|
31
|
+
return this.activeOperations < this.limits.maxConcurrency;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Register operation start
|
|
35
|
+
*/
|
|
36
|
+
startOperation(operationId) {
|
|
37
|
+
if (!this.canStartOperation())
|
|
38
|
+
return false;
|
|
39
|
+
this.activeOperations++;
|
|
40
|
+
this.operationStartTimes.set(operationId, Date.now());
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Register operation end
|
|
45
|
+
*/
|
|
46
|
+
endOperation(operationId) {
|
|
47
|
+
this.operationStartTimes.delete(operationId);
|
|
48
|
+
this.activeOperations = Math.max(0, this.activeOperations - 1);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if operation has exceeded time limit
|
|
52
|
+
*/
|
|
53
|
+
isOperationTimedOut(operationId) {
|
|
54
|
+
const startTime = this.operationStartTimes.get(operationId);
|
|
55
|
+
if (!startTime)
|
|
56
|
+
return false;
|
|
57
|
+
return Date.now() - startTime > this.limits.maxCpuTimeMs;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Check if pattern count is within limit
|
|
61
|
+
*/
|
|
62
|
+
canAddPatterns(count, currentCount) {
|
|
63
|
+
return currentCount + count <= this.limits.maxPatterns;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get current resource metrics
|
|
67
|
+
*/
|
|
68
|
+
getMetrics() {
|
|
69
|
+
const memoryUsage = process.memoryUsage();
|
|
70
|
+
return {
|
|
71
|
+
memoryUsedMB: Math.round(memoryUsage.heapUsed / 1024 / 1024),
|
|
72
|
+
cpuTimeMs: 0, // Would need process-level tracking
|
|
73
|
+
patternCount: 0, // Would need connection to pattern library
|
|
74
|
+
activeOperations: this.activeOperations,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if memory is within limits
|
|
79
|
+
*/
|
|
80
|
+
isMemoryWithinLimits() {
|
|
81
|
+
const metrics = this.getMetrics();
|
|
82
|
+
return metrics.memoryUsedMB < this.limits.maxMemoryMB;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get limits
|
|
86
|
+
*/
|
|
87
|
+
getLimits() {
|
|
88
|
+
return { ...this.limits };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=resource-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-limiter.js","sourceRoot":"","sources":["../../src/resource/resource-limiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAe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YAAY,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,KAAa,EAAE,YAAoB;QAChD,OAAO,YAAY,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,UAAU;QACR,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;YAC5D,SAAS,EAAE,CAAC,EAAE,oCAAoC;YAClD,YAAY,EAAE,CAAC,EAAE,2CAA2C;YAC5D,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sleep/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sleep/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Sleep phase for pattern consolidation and abstraction
|
|
3
|
+
* @traceability TSK-WAKE-002, REQ-WAKE-001-F002
|
|
4
|
+
*/
|
|
5
|
+
import type { ConsolidationInput, SleepResult } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Sleep phase executor
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Consolidates and abstracts patterns during the sleep phase.
|
|
11
|
+
* - Groups similar patterns
|
|
12
|
+
* - Creates higher-level abstractions
|
|
13
|
+
* - Prunes low-value patterns
|
|
14
|
+
* - Optimizes using MDL principle
|
|
15
|
+
*/
|
|
16
|
+
export declare class SleepPhase {
|
|
17
|
+
private mdlThreshold;
|
|
18
|
+
private minFrequency;
|
|
19
|
+
constructor(options?: {
|
|
20
|
+
mdlThreshold?: number;
|
|
21
|
+
minFrequency?: number;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Run consolidation on collected patterns
|
|
25
|
+
*/
|
|
26
|
+
consolidate(input: ConsolidationInput): Promise<SleepResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Group similar patterns together
|
|
29
|
+
*/
|
|
30
|
+
private groupSimilarPatterns;
|
|
31
|
+
/**
|
|
32
|
+
* Abstract a group of similar patterns into one
|
|
33
|
+
*/
|
|
34
|
+
private abstractGroup;
|
|
35
|
+
/**
|
|
36
|
+
* Calculate Minimum Description Length score
|
|
37
|
+
*/
|
|
38
|
+
private calculateMDL;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=sleep-phase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-phase.d.ts","sourceRoot":"","sources":["../../src/sleep/sleep-phase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAuC,MAAM,aAAa,CAAC;AAExG;;;;;;;;;GASG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAS;gBAEjB,OAAO,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAO;IAK1E;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAyClE;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;OAEG;IACH,OAAO,CAAC,aAAa;IAgBrB;;OAEG;IACH,OAAO,CAAC,YAAY;CAarB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Sleep phase for pattern consolidation and abstraction
|
|
3
|
+
* @traceability TSK-WAKE-002, REQ-WAKE-001-F002
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sleep phase executor
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* Consolidates and abstracts patterns during the sleep phase.
|
|
10
|
+
* - Groups similar patterns
|
|
11
|
+
* - Creates higher-level abstractions
|
|
12
|
+
* - Prunes low-value patterns
|
|
13
|
+
* - Optimizes using MDL principle
|
|
14
|
+
*/
|
|
15
|
+
export class SleepPhase {
|
|
16
|
+
mdlThreshold;
|
|
17
|
+
minFrequency;
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this.mdlThreshold = options.mdlThreshold ?? 0.5;
|
|
20
|
+
this.minFrequency = options.minFrequency ?? 2;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Run consolidation on collected patterns
|
|
24
|
+
*/
|
|
25
|
+
async consolidate(input) {
|
|
26
|
+
const { patterns, existingLibrary: _existingLibrary } = input;
|
|
27
|
+
// Get frequency from patterns (use occurrences if frequency not set)
|
|
28
|
+
const getFrequency = (p) => p.frequency ?? p.occurrences ?? 1;
|
|
29
|
+
// Filter by frequency
|
|
30
|
+
const frequentPatterns = patterns.filter(p => getFrequency(p) >= this.minFrequency);
|
|
31
|
+
// Group similar patterns for abstraction
|
|
32
|
+
const groups = this.groupSimilarPatterns(frequentPatterns);
|
|
33
|
+
// Abstract each group
|
|
34
|
+
const abstracted = [];
|
|
35
|
+
for (const group of groups) {
|
|
36
|
+
if (group.length > 1) {
|
|
37
|
+
const abstractedPattern = this.abstractGroup(group);
|
|
38
|
+
if (abstractedPattern) {
|
|
39
|
+
abstracted.push(abstractedPattern);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Calculate MDL score
|
|
44
|
+
const mdlScore = this.calculateMDL(abstracted, frequentPatterns);
|
|
45
|
+
// Determine which patterns to keep and which to prune
|
|
46
|
+
const getPatternId = (p) => p.id ?? p.name;
|
|
47
|
+
const consolidated = frequentPatterns.map(p => getPatternId(p));
|
|
48
|
+
const pruned = patterns
|
|
49
|
+
.filter(p => getFrequency(p) < this.minFrequency)
|
|
50
|
+
.map(p => getPatternId(p));
|
|
51
|
+
return {
|
|
52
|
+
consolidatedPatterns: consolidated,
|
|
53
|
+
abstractedPatterns: abstracted,
|
|
54
|
+
prunedPatterns: pruned,
|
|
55
|
+
mdlScore,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Group similar patterns together
|
|
60
|
+
*/
|
|
61
|
+
groupSimilarPatterns(patterns) {
|
|
62
|
+
// Group by source type first
|
|
63
|
+
const bySource = new Map();
|
|
64
|
+
for (const p of patterns) {
|
|
65
|
+
const source = p.source ?? 'unknown';
|
|
66
|
+
if (!bySource.has(source)) {
|
|
67
|
+
bySource.set(source, []);
|
|
68
|
+
}
|
|
69
|
+
bySource.get(source).push(p);
|
|
70
|
+
}
|
|
71
|
+
// Return groups
|
|
72
|
+
return Array.from(bySource.values());
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Abstract a group of similar patterns into one
|
|
76
|
+
*/
|
|
77
|
+
abstractGroup(group) {
|
|
78
|
+
if (group.length < 2)
|
|
79
|
+
return null;
|
|
80
|
+
const getPatternId = (p) => p.id ?? p.name;
|
|
81
|
+
const getPatternCode = (p) => p.code ?? JSON.stringify(p.structure);
|
|
82
|
+
// Create abstracted pattern
|
|
83
|
+
return {
|
|
84
|
+
id: `abstract-${Date.now()}`,
|
|
85
|
+
originalPatterns: group.map(p => getPatternId(p)),
|
|
86
|
+
abstractedCode: getPatternCode(group[0]),
|
|
87
|
+
compressionRatio: group.length,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Calculate Minimum Description Length score
|
|
92
|
+
*/
|
|
93
|
+
calculateMDL(abstracted, patterns) {
|
|
94
|
+
// MDL = Description of library + Description of data given library
|
|
95
|
+
// Lower is better
|
|
96
|
+
const librarySize = abstracted.reduce((sum, a) => sum + a.abstractedCode.length, 0);
|
|
97
|
+
const getFrequency = (p) => p.frequency ?? p.occurrences ?? 1;
|
|
98
|
+
const getPatternCode = (p) => p.code ?? JSON.stringify(p.structure);
|
|
99
|
+
const dataSize = patterns.reduce((sum, p) => sum + getPatternCode(p).length / getFrequency(p), 0);
|
|
100
|
+
const rawScore = librarySize + dataSize;
|
|
101
|
+
// Apply threshold normalization
|
|
102
|
+
return rawScore * this.mdlThreshold;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=sleep-phase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-phase.js","sourceRoot":"","sources":["../../src/sleep/sleep-phase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,MAAM,OAAO,UAAU;IACb,YAAY,CAAS;IACrB,YAAY,CAAS;IAE7B,YAAY,UAA4D,EAAE;QACxE,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,GAAG,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,KAAyB;QACzC,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;QAE9D,qEAAqE;QACrE,MAAM,YAAY,GAAG,CAAC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