From 145612a44f26f2861d0dd605015d0fe6133d3fa5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:29:51 +0000 Subject: [PATCH 1/2] docs: add inline comments explaining probability weights in generateFeedbackType Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com> --- src/simulator/hooks/useSimulator.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/simulator/hooks/useSimulator.ts b/src/simulator/hooks/useSimulator.ts index ecc93c13e..36952e6ce 100644 --- a/src/simulator/hooks/useSimulator.ts +++ b/src/simulator/hooks/useSimulator.ts @@ -210,11 +210,15 @@ function generateFeedbackType( recommendedTechniques.includes(t), ) - // Randomly select feedback type with weighted probability + // Randomly select feedback type with weighted probability. + // We use magic numbers here to simulate the non-deterministic, + // subjective nature of human responses in therapeutic settings. + // Even if a recommended technique is used perfectly, a client might not + // always respond positively. This avoids creating a binary training environment. const rand = Math.random() if (usedRecommendedTechnique) { - // Higher chance of positive feedback when using recommended techniques + // 70% chance of POSITIVE, 15% DEVELOPMENTAL, 15% TECHNIQUE_SUGGESTION if (rand < 0.7) { return FeedbackType.POSITIVE } else if (rand < 0.85) { @@ -223,6 +227,7 @@ function generateFeedbackType( return FeedbackType.TECHNIQUE_SUGGESTION } } else if (rand < 0.3) { + // 30% chance of POSITIVE, 30% DEVELOPMENTAL, 20% TECHNIQUE_SUGGESTION, 20% ALTERNATIVE_APPROACH return FeedbackType.POSITIVE } else if (rand < 0.6) { return FeedbackType.DEVELOPMENTAL From 6f44e7ff4c4101058bec355d1b14ee9c0731ae99 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:36:01 +0000 Subject: [PATCH 2/2] docs: add inline comments explaining probability weights in generateFeedbackType Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>