@agent-e/core 1.5.8 → 1.5.10

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.mjs CHANGED
@@ -17,8 +17,8 @@ var DEFAULT_THRESHOLDS = {
17
17
  payPowerRatioMax: 2,
18
18
  payPowerRatioTarget: 1.5,
19
19
  // Operations (P51, P53)
20
- sharkToothPeakDecay: 0.95,
21
- sharkToothValleyDecay: 0.9,
20
+ cyclicalPeakDecay: 0.95,
21
+ cyclicalValleyDecay: 0.9,
22
22
  eventCompletionMin: 0.4,
23
23
  eventCompletionMax: 0.8,
24
24
  // System Dynamics (P39, P44)
@@ -450,8 +450,8 @@ var Observer = class {
450
450
  avgSatisfaction,
451
451
  blockedAgentCount,
452
452
  timeToValue,
453
- sharkToothPeaks: this.previousMetrics?.sharkToothPeaks ?? [],
454
- sharkToothValleys: this.previousMetrics?.sharkToothValleys ?? [],
453
+ cyclicalPeaks: this.previousMetrics?.cyclicalPeaks ?? [],
454
+ cyclicalValleys: this.previousMetrics?.cyclicalValleys ?? [],
455
455
  eventCompletionRate: 0,
456
456
  contentDropAge,
457
457
  systems: state.systems ?? [],
@@ -602,8 +602,8 @@ function emptyMetrics(tick = 0) {
602
602
  avgSatisfaction: 100,
603
603
  blockedAgentCount: 0,
604
604
  timeToValue: 0,
605
- sharkToothPeaks: [],
606
- sharkToothValleys: [],
605
+ cyclicalPeaks: [],
606
+ cyclicalValleys: [],
607
607
  eventCompletionRate: 0,
608
608
  contentDropAge: 0,
609
609
  systems: [],
@@ -2557,11 +2557,11 @@ var P51_CyclicalEngagement = {
2557
2557
  category: "operations",
2558
2558
  description: "Each activity peak should be >=95% of the previous peak. If peaks are shrinking (cyclical engagement becoming flat), activity fatigue is setting in. If valleys are deepening, the off-activity economy is failing to sustain engagement.",
2559
2559
  check(metrics, thresholds) {
2560
- const { sharkToothPeaks, sharkToothValleys } = metrics;
2561
- if (sharkToothPeaks.length < 2) return { violated: false };
2562
- const lastPeak = sharkToothPeaks[sharkToothPeaks.length - 1] ?? 0;
2563
- const prevPeak = sharkToothPeaks[sharkToothPeaks.length - 2] ?? 0;
2564
- if (prevPeak > 0 && lastPeak / prevPeak < thresholds.sharkToothPeakDecay) {
2560
+ const { cyclicalPeaks, cyclicalValleys } = metrics;
2561
+ if (cyclicalPeaks.length < 2) return { violated: false };
2562
+ const lastPeak = cyclicalPeaks[cyclicalPeaks.length - 1] ?? 0;
2563
+ const prevPeak = cyclicalPeaks[cyclicalPeaks.length - 2] ?? 0;
2564
+ if (prevPeak > 0 && lastPeak / prevPeak < thresholds.cyclicalPeakDecay) {
2565
2565
  return {
2566
2566
  violated: true,
2567
2567
  severity: 5,
@@ -2569,22 +2569,22 @@ var P51_CyclicalEngagement = {
2569
2569
  lastPeak,
2570
2570
  prevPeak,
2571
2571
  ratio: lastPeak / prevPeak,
2572
- threshold: thresholds.sharkToothPeakDecay
2572
+ threshold: thresholds.cyclicalPeakDecay
2573
2573
  },
2574
2574
  suggestedAction: {
2575
2575
  parameterType: "reward",
2576
2576
  direction: "increase",
2577
2577
  magnitude: 0.1,
2578
- reasoning: `Peak engagement dropped to ${(lastPeak / prevPeak * 100).toFixed(0)}% of previous peak (threshold: ${(thresholds.sharkToothPeakDecay * 100).toFixed(0)}%). Activity fatigue detected. Boost activity rewards to restore peak engagement.`
2578
+ reasoning: `Peak engagement dropped to ${(lastPeak / prevPeak * 100).toFixed(0)}% of previous peak (threshold: ${(thresholds.cyclicalPeakDecay * 100).toFixed(0)}%). Activity fatigue detected. Boost activity rewards to restore peak engagement.`
2579
2579
  },
2580
2580
  confidence: 0.75,
2581
2581
  estimatedLag: 30
2582
2582
  };
2583
2583
  }
2584
- if (sharkToothValleys.length >= 2) {
2585
- const lastValley = sharkToothValleys[sharkToothValleys.length - 1] ?? 0;
2586
- const prevValley = sharkToothValleys[sharkToothValleys.length - 2] ?? 0;
2587
- if (prevValley > 0 && lastValley / prevValley < thresholds.sharkToothValleyDecay) {
2584
+ if (cyclicalValleys.length >= 2) {
2585
+ const lastValley = cyclicalValleys[cyclicalValleys.length - 1] ?? 0;
2586
+ const prevValley = cyclicalValleys[cyclicalValleys.length - 2] ?? 0;
2587
+ if (prevValley > 0 && lastValley / prevValley < thresholds.cyclicalValleyDecay) {
2588
2588
  return {
2589
2589
  violated: true,
2590
2590
  severity: 4,