workday-daemon 0.7.0 → 0.7.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.
|
@@ -21,7 +21,8 @@ export declare class ActivityEvaluator {
|
|
|
21
21
|
* Scoring algorithm ("stamina"):
|
|
22
22
|
* 1. EMA — binary moving average of activity (1 if dynamics/commit, 0 otherwise)
|
|
23
23
|
* 2. Touch floor — any active tick lifts score to STAMINA_FLOOR_RATIO * maxTicks.
|
|
24
|
-
* A single stray keystroke buys a
|
|
24
|
+
* A single stray keystroke buys a leash (Normal: ~11 min), nothing more —
|
|
25
|
+
* generous enough to ride out a normal "stop and think" gap unaided.
|
|
25
26
|
* 3. Frequency gain — ema * FREQUENCY_GAIN_MAX per active tick. Only a sustained
|
|
26
27
|
* tick-after-tick stream of updates (EMA → 1) outpaces decay on its own.
|
|
27
28
|
* 4. Volume gain — deltaMagnitude / linesPerGainTick (STAMINA_LINES_PER_MINUTE,
|
|
@@ -32,7 +33,8 @@ export declare class ActivityEvaluator {
|
|
|
32
33
|
* 7. Decay — BASE_DECAY on active ticks; on idle ticks BASE_DECAY +
|
|
33
34
|
* DECAY_BOOST × EMA (asymmetric fade: the denser the recent work, the
|
|
34
35
|
* faster the buffer cools once activity stops — a full Normal bar drains
|
|
35
|
-
* in ~
|
|
36
|
+
* in ~30 min after an abrupt stop, not 45; gentle enough that a think gap
|
|
37
|
+
* after a burst isn't mistaken for a break)
|
|
36
38
|
* 8. score == 0 → idle timeout → eligible for auto-pause (unless ignoreIdleTimeout)
|
|
37
39
|
*
|
|
38
40
|
* Leadership is driven by a separate short-window attention EMA (~2 min),
|
|
@@ -40,9 +42,11 @@ export declare class ActivityEvaluator {
|
|
|
40
42
|
* (~2 min) regardless of how full the bars are, while a single stray touch
|
|
41
43
|
* can never steal leadership.
|
|
42
44
|
*
|
|
43
|
-
* Net effect (30s ticks, Normal
|
|
44
|
-
* floor;
|
|
45
|
-
*
|
|
45
|
+
* Net effect (30s ticks, Normal 11–45 min): light sporadic edits hover at the
|
|
46
|
+
* floor; pulsed work (bursts with think gaps) now accumulates a buffer instead
|
|
47
|
+
* of collapsing back to the floor; a relentless every-tick stream saturates in
|
|
48
|
+
* ~40 min; ~15 lines per tick saturates in ~15 min; reaching 100% is
|
|
49
|
+
* intentionally hard.
|
|
46
50
|
*/
|
|
47
51
|
processAllTicks(ticks: readonly TickInput[]): EvaluatorResult;
|
|
48
52
|
/**
|
|
@@ -28,7 +28,8 @@ export class ActivityEvaluator {
|
|
|
28
28
|
* Scoring algorithm ("stamina"):
|
|
29
29
|
* 1. EMA — binary moving average of activity (1 if dynamics/commit, 0 otherwise)
|
|
30
30
|
* 2. Touch floor — any active tick lifts score to STAMINA_FLOOR_RATIO * maxTicks.
|
|
31
|
-
* A single stray keystroke buys a
|
|
31
|
+
* A single stray keystroke buys a leash (Normal: ~11 min), nothing more —
|
|
32
|
+
* generous enough to ride out a normal "stop and think" gap unaided.
|
|
32
33
|
* 3. Frequency gain — ema * FREQUENCY_GAIN_MAX per active tick. Only a sustained
|
|
33
34
|
* tick-after-tick stream of updates (EMA → 1) outpaces decay on its own.
|
|
34
35
|
* 4. Volume gain — deltaMagnitude / linesPerGainTick (STAMINA_LINES_PER_MINUTE,
|
|
@@ -39,7 +40,8 @@ export class ActivityEvaluator {
|
|
|
39
40
|
* 7. Decay — BASE_DECAY on active ticks; on idle ticks BASE_DECAY +
|
|
40
41
|
* DECAY_BOOST × EMA (asymmetric fade: the denser the recent work, the
|
|
41
42
|
* faster the buffer cools once activity stops — a full Normal bar drains
|
|
42
|
-
* in ~
|
|
43
|
+
* in ~30 min after an abrupt stop, not 45; gentle enough that a think gap
|
|
44
|
+
* after a burst isn't mistaken for a break)
|
|
43
45
|
* 8. score == 0 → idle timeout → eligible for auto-pause (unless ignoreIdleTimeout)
|
|
44
46
|
*
|
|
45
47
|
* Leadership is driven by a separate short-window attention EMA (~2 min),
|
|
@@ -47,9 +49,11 @@ export class ActivityEvaluator {
|
|
|
47
49
|
* (~2 min) regardless of how full the bars are, while a single stray touch
|
|
48
50
|
* can never steal leadership.
|
|
49
51
|
*
|
|
50
|
-
* Net effect (30s ticks, Normal
|
|
51
|
-
* floor;
|
|
52
|
-
*
|
|
52
|
+
* Net effect (30s ticks, Normal 11–45 min): light sporadic edits hover at the
|
|
53
|
+
* floor; pulsed work (bursts with think gaps) now accumulates a buffer instead
|
|
54
|
+
* of collapsing back to the floor; a relentless every-tick stream saturates in
|
|
55
|
+
* ~40 min; ~15 lines per tick saturates in ~15 min; reaching 100% is
|
|
56
|
+
* intentionally hard.
|
|
53
57
|
*/
|
|
54
58
|
processAllTicks(ticks) {
|
|
55
59
|
const scores = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-evaluator.js","sourceRoot":"","sources":["../../src/core/activity-evaluator.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAQxB;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACX,QAAQ,CAAS;IACjB,cAAc,CAAS;IACvB,WAAW,CAAS;IACpB,gBAAgB,CAAS;IACzB,KAAK,GAA8B,IAAI,GAAG,EAAE,CAAC;IACtD,YAAY,GAAkB,IAAI,CAAC;IAE3C,YAAmB,eAAuB;QACxC,MAAM,cAAc,GAAG,kBAAkB,GAAG,EAAE,GAAG,eAAe,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,cAAc,CAAC;QACnC,MAAM,oBAAoB,GAAG,wBAAwB,GAAG,EAAE,GAAG,eAAe,CAAC;QAC7E,IAAI,CAAC,cAAc,GAAG,CAAC,GAAG,oBAAoB,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,oBAAoB,GAAG,eAAe,CAAC;QAC1D,IAAI,CA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are const EMA_WINDOW_MINUTES = 10;
|
|
|
52
52
|
export declare const ATTENTION_WINDOW_MINUTES = 2;
|
|
53
53
|
/**
|
|
54
54
|
* Touch floor: any active tick lifts score to at least this fraction of the
|
|
55
|
-
* sensitivity max timeout (Low:
|
|
55
|
+
* sensitivity max timeout (Low: 3.75 min, Normal: 11.25 min, Patient: 22.5 min).
|
|
56
56
|
* Guards against pause noise from single keystrokes without jumping the bar.
|
|
57
|
+
*
|
|
58
|
+
* Tuned to 1/4 (was 1/6): a false pause — real work whose time goes UNLOGGED —
|
|
59
|
+
* is strictly worse than a late pause, so the guaranteed leash a single touch
|
|
60
|
+
* buys is deliberately generous enough to ride out a normal "stop and think"
|
|
61
|
+
* gap without any buildup. See the asymmetric-loss tuning note on DECAY_BOOST.
|
|
57
62
|
*/
|
|
58
63
|
export declare const STAMINA_FLOOR_RATIO: number;
|
|
59
64
|
/** Score per active tick at full activity frequency (EMA = 1) */
|
|
60
65
|
export declare const FREQUENCY_GAIN_MAX = 2;
|
|
61
66
|
/**
|
|
62
|
-
* Lines changed per minute worth +1 score per tick (
|
|
67
|
+
* Lines changed per minute worth +1 score per tick (4 lines per 30s tick).
|
|
63
68
|
* Converted to a per-tick divisor at evaluator construction so the
|
|
64
69
|
* lines-per-minute intensity needed to fill the bar doesn't depend on
|
|
65
70
|
* diffPollSeconds.
|
|
66
71
|
*/
|
|
67
|
-
export declare const STAMINA_LINES_PER_MINUTE =
|
|
68
|
-
/** Cap on the volume contribution per tick (reached at
|
|
69
|
-
export declare const VOLUME_GAIN_MAX =
|
|
72
|
+
export declare const STAMINA_LINES_PER_MINUTE = 8;
|
|
73
|
+
/** Cap on the volume contribution per tick (reached at 32 changed lines at 30s ticks) */
|
|
74
|
+
export declare const VOLUME_GAIN_MAX = 8;
|
|
70
75
|
/**
|
|
71
76
|
* Line-equivalent granted per file whose content changed while its diff
|
|
72
77
|
* numbers stayed flat (rewrite-in-place: lines already differed from the
|
|
@@ -76,18 +81,31 @@ export declare const IN_PLACE_CHURN_LINES = 8;
|
|
|
76
81
|
/** Churn scanner caps: don't read/hash absurd working sets */
|
|
77
82
|
export declare const CHURN_MAX_FILES = 100;
|
|
78
83
|
export declare const CHURN_MAX_FILE_BYTES: number;
|
|
79
|
-
/**
|
|
80
|
-
|
|
84
|
+
/**
|
|
85
|
+
* "Free" score on commit (in seconds, converted to ticks). Tuned up to 240
|
|
86
|
+
* (was 150): committing every few minutes while polishing a branch for review
|
|
87
|
+
* is real, focused work, so a commit should buy enough leash (Normal: ~4 min
|
|
88
|
+
* on top of the touch floor) to bridge the gap to the next commit without a
|
|
89
|
+
* false pause.
|
|
90
|
+
*/
|
|
91
|
+
export declare const COMMIT_BONUS_SECONDS = 240;
|
|
81
92
|
/** Constant per-tick score drain */
|
|
82
93
|
export declare const BASE_DECAY = 1;
|
|
83
94
|
/**
|
|
84
95
|
* Extra drain per idle tick, scaled by the frequency EMA: decay = BASE_DECAY +
|
|
85
|
-
* DECAY_BOOST × EMA. A dense coder who stops
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
96
|
+
* DECAY_BOOST × EMA. A dense coder who stops cools down faster than a sporadic
|
|
97
|
+
* one (who keeps the plain 1/tick fade), but only mildly: the v1 "sudden stop
|
|
98
|
+
* after intense work is a pause" instinct is wrong in the LLM era, where the
|
|
99
|
+
* stop after a big paste is usually *reading/thinking*, not a break.
|
|
100
|
+
*
|
|
101
|
+
* Tuned down to 2 (was 4): a boost of 4 collapsed every earned buffer back to
|
|
102
|
+
* the floor within ~15 min regardless of how hard you worked, so the leash
|
|
103
|
+
* never reflected real effort and pulsed work risked false pauses. At 2 the
|
|
104
|
+
* earned buffer survives normal think gaps while a true walk-away is still
|
|
105
|
+
* caught within ~half the ceiling. Parameter set chosen by the asymmetric-loss
|
|
106
|
+
* grid search in scripts/stamina-sim.mjs (false pause ≫ late pause).
|
|
89
107
|
*/
|
|
90
|
-
export declare const DECAY_BOOST =
|
|
108
|
+
export declare const DECAY_BOOST = 2;
|
|
91
109
|
export declare const SENSITIVITY_TIMEOUTS: {
|
|
92
110
|
readonly low: 15;
|
|
93
111
|
readonly normal: 45;
|
package/dist/core/constants.js
CHANGED
|
@@ -88,21 +88,26 @@ export const EMA_WINDOW_MINUTES = 10;
|
|
|
88
88
|
export const ATTENTION_WINDOW_MINUTES = 2;
|
|
89
89
|
/**
|
|
90
90
|
* Touch floor: any active tick lifts score to at least this fraction of the
|
|
91
|
-
* sensitivity max timeout (Low:
|
|
91
|
+
* sensitivity max timeout (Low: 3.75 min, Normal: 11.25 min, Patient: 22.5 min).
|
|
92
92
|
* Guards against pause noise from single keystrokes without jumping the bar.
|
|
93
|
+
*
|
|
94
|
+
* Tuned to 1/4 (was 1/6): a false pause — real work whose time goes UNLOGGED —
|
|
95
|
+
* is strictly worse than a late pause, so the guaranteed leash a single touch
|
|
96
|
+
* buys is deliberately generous enough to ride out a normal "stop and think"
|
|
97
|
+
* gap without any buildup. See the asymmetric-loss tuning note on DECAY_BOOST.
|
|
93
98
|
*/
|
|
94
|
-
export const STAMINA_FLOOR_RATIO = 1 /
|
|
99
|
+
export const STAMINA_FLOOR_RATIO = 1 / 4;
|
|
95
100
|
/** Score per active tick at full activity frequency (EMA = 1) */
|
|
96
101
|
export const FREQUENCY_GAIN_MAX = 2;
|
|
97
102
|
/**
|
|
98
|
-
* Lines changed per minute worth +1 score per tick (
|
|
103
|
+
* Lines changed per minute worth +1 score per tick (4 lines per 30s tick).
|
|
99
104
|
* Converted to a per-tick divisor at evaluator construction so the
|
|
100
105
|
* lines-per-minute intensity needed to fill the bar doesn't depend on
|
|
101
106
|
* diffPollSeconds.
|
|
102
107
|
*/
|
|
103
|
-
export const STAMINA_LINES_PER_MINUTE =
|
|
104
|
-
/** Cap on the volume contribution per tick (reached at
|
|
105
|
-
export const VOLUME_GAIN_MAX =
|
|
108
|
+
export const STAMINA_LINES_PER_MINUTE = 8;
|
|
109
|
+
/** Cap on the volume contribution per tick (reached at 32 changed lines at 30s ticks) */
|
|
110
|
+
export const VOLUME_GAIN_MAX = 8;
|
|
106
111
|
/**
|
|
107
112
|
* Line-equivalent granted per file whose content changed while its diff
|
|
108
113
|
* numbers stayed flat (rewrite-in-place: lines already differed from the
|
|
@@ -112,18 +117,31 @@ export const IN_PLACE_CHURN_LINES = 8;
|
|
|
112
117
|
/** Churn scanner caps: don't read/hash absurd working sets */
|
|
113
118
|
export const CHURN_MAX_FILES = 100;
|
|
114
119
|
export const CHURN_MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
115
|
-
/**
|
|
116
|
-
|
|
120
|
+
/**
|
|
121
|
+
* "Free" score on commit (in seconds, converted to ticks). Tuned up to 240
|
|
122
|
+
* (was 150): committing every few minutes while polishing a branch for review
|
|
123
|
+
* is real, focused work, so a commit should buy enough leash (Normal: ~4 min
|
|
124
|
+
* on top of the touch floor) to bridge the gap to the next commit without a
|
|
125
|
+
* false pause.
|
|
126
|
+
*/
|
|
127
|
+
export const COMMIT_BONUS_SECONDS = 240;
|
|
117
128
|
/** Constant per-tick score drain */
|
|
118
129
|
export const BASE_DECAY = 1;
|
|
119
130
|
/**
|
|
120
131
|
* Extra drain per idle tick, scaled by the frequency EMA: decay = BASE_DECAY +
|
|
121
|
-
* DECAY_BOOST × EMA. A dense coder who stops
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
132
|
+
* DECAY_BOOST × EMA. A dense coder who stops cools down faster than a sporadic
|
|
133
|
+
* one (who keeps the plain 1/tick fade), but only mildly: the v1 "sudden stop
|
|
134
|
+
* after intense work is a pause" instinct is wrong in the LLM era, where the
|
|
135
|
+
* stop after a big paste is usually *reading/thinking*, not a break.
|
|
136
|
+
*
|
|
137
|
+
* Tuned down to 2 (was 4): a boost of 4 collapsed every earned buffer back to
|
|
138
|
+
* the floor within ~15 min regardless of how hard you worked, so the leash
|
|
139
|
+
* never reflected real effort and pulsed work risked false pauses. At 2 the
|
|
140
|
+
* earned buffer survives normal think gaps while a true walk-away is still
|
|
141
|
+
* caught within ~half the ceiling. Parameter set chosen by the asymmetric-loss
|
|
142
|
+
* grid search in scripts/stamina-sim.mjs (false pause ≫ late pause).
|
|
125
143
|
*/
|
|
126
|
-
export const DECAY_BOOST =
|
|
144
|
+
export const DECAY_BOOST = 2;
|
|
127
145
|
// ─── Sensitivity → max timeout (stamina ceiling) in minutes ──────────────
|
|
128
146
|
// The single knob per level: the score ceiling. The touch floor is derived
|
|
129
147
|
// from it via STAMINA_FLOOR_RATIO — no separate min constant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAE5C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAE7B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,gBAAgB,SAAS,CAAC;AAC/F,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,C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