@@ -5,24 +5,96 @@ import type {
55 IterationRecord ,
66} from "./core/orchestrator.js" ;
77
8- function mockIter ( n : number , success : boolean , summary : string , agoMs : number ) : IterationRecord {
9- return { number : n , success, summary, keyChanges : [ ] , keyLearnings : [ ] , timestamp : new Date ( Date . now ( ) - agoMs ) } ;
8+ function mockIter (
9+ n : number ,
10+ success : boolean ,
11+ summary : string ,
12+ agoMs : number ,
13+ ) : IterationRecord {
14+ return {
15+ number : n ,
16+ success,
17+ summary,
18+ keyChanges : [ ] ,
19+ keyLearnings : [ ] ,
20+ timestamp : new Date ( Date . now ( ) - agoMs ) ,
21+ } ;
1022}
1123
1224const MOCK_ITERATIONS : IterationRecord [ ] = [
13- mockIter ( 1 , true , "Profiled cold start — identified 3 major bottlenecks" , 25_200_000 ) ,
14- mockIter ( 2 , true , "Lazy-loaded config module, shaved 340ms off init" , 24_000_000 ) ,
25+ mockIter (
26+ 1 ,
27+ true ,
28+ "Profiled cold start — identified 3 major bottlenecks" ,
29+ 25_200_000 ,
30+ ) ,
31+ mockIter (
32+ 2 ,
33+ true ,
34+ "Lazy-loaded config module, shaved 340ms off init" ,
35+ 24_000_000 ,
36+ ) ,
1537 mockIter ( 3 , true , "Deferred plugin discovery to post-render" , 22_800_000 ) ,
16- mockIter ( 4 , false , "Attempted parallel module init — race condition in DI container" , 21_000_000 ) ,
17- mockIter ( 5 , true , "Fixed DI ordering, parallelized safe modules only" , 19_200_000 ) ,
18- mockIter ( 6 , true , "Replaced synchronous JSON parse with streaming decoder" , 17_400_000 ) ,
19- mockIter ( 7 , true , "Cached resolved dependency graph across restarts" , 15_000_000 ) ,
20- mockIter ( 8 , false , "Tree-shaking broke runtime dynamic import paths" , 12_600_000 ) ,
21- mockIter ( 9 , true , "Restored dynamic imports, added explicit entry chunks" , 10_800_000 ) ,
22- mockIter ( 10 , true , "Inlined critical-path CSS, deferred non-essential styles" , 8_400_000 ) ,
23- mockIter ( 11 , true , "Switched from full Intl polyfill to locale-on-demand" , 6_000_000 ) ,
24- mockIter ( 12 , true , "Pre-compiled handlebars templates at build time" , 3_600_000 ) ,
25- mockIter ( 13 , true , "Moved telemetry init behind requestIdleCallback" , 1_800_000 ) ,
38+ mockIter (
39+ 4 ,
40+ false ,
41+ "Attempted parallel module init — race condition in DI container" ,
42+ 21_000_000 ,
43+ ) ,
44+ mockIter (
45+ 5 ,
46+ true ,
47+ "Fixed DI ordering, parallelized safe modules only" ,
48+ 19_200_000 ,
49+ ) ,
50+ mockIter (
51+ 6 ,
52+ true ,
53+ "Replaced synchronous JSON parse with streaming decoder" ,
54+ 17_400_000 ,
55+ ) ,
56+ mockIter (
57+ 7 ,
58+ true ,
59+ "Cached resolved dependency graph across restarts" ,
60+ 15_000_000 ,
61+ ) ,
62+ mockIter (
63+ 8 ,
64+ false ,
65+ "Tree-shaking broke runtime dynamic import paths" ,
66+ 12_600_000 ,
67+ ) ,
68+ mockIter (
69+ 9 ,
70+ true ,
71+ "Restored dynamic imports, added explicit entry chunks" ,
72+ 10_800_000 ,
73+ ) ,
74+ mockIter (
75+ 10 ,
76+ true ,
77+ "Inlined critical-path CSS, deferred non-essential styles" ,
78+ 8_400_000 ,
79+ ) ,
80+ mockIter (
81+ 11 ,
82+ true ,
83+ "Switched from full Intl polyfill to locale-on-demand" ,
84+ 6_000_000 ,
85+ ) ,
86+ mockIter (
87+ 12 ,
88+ true ,
89+ "Pre-compiled handlebars templates at build time" ,
90+ 3_600_000 ,
91+ ) ,
92+ mockIter (
93+ 13 ,
94+ true ,
95+ "Moved telemetry init behind requestIdleCallback" ,
96+ 1_800_000 ,
97+ ) ,
2698] ;
2799
28100const AGENT_MESSAGES : string [ ] = [
@@ -105,12 +177,15 @@ export class MockOrchestrator extends EventEmitter<OrchestratorEvents> {
105177 }
106178
107179 private scheduleTokenBump ( ) : void {
108- this . tokenTimer = setTimeout ( ( ) => {
109- this . state . totalInputTokens += randInt ( 40_000 , 180_000 ) ;
110- this . state . totalOutputTokens += randInt ( 200 , 2_000 ) ;
111- this . emit ( "state" , this . getState ( ) ) ;
112- if ( this . state . status === "running" ) this . scheduleTokenBump ( ) ;
113- } , randInt ( 1500 , 7000 ) ) ;
180+ this . tokenTimer = setTimeout (
181+ ( ) => {
182+ this . state . totalInputTokens += randInt ( 40_000 , 180_000 ) ;
183+ this . state . totalOutputTokens += randInt ( 200 , 2_000 ) ;
184+ this . emit ( "state" , this . getState ( ) ) ;
185+ if ( this . state . status === "running" ) this . scheduleTokenBump ( ) ;
186+ } ,
187+ randInt ( 1500 , 7000 ) ,
188+ ) ;
114189 }
115190
116191 private scheduleNextMessage ( ) : void {
0 commit comments