Phase 1: Relationship Core Upgrade - Complete - #20
Conversation
## Date Diminishing Returns System - Enhanced dateDiminishingReturns.js with time-based penalties - Same NPC + same date type within 7 days: 50% reduction (stacking) - Same date type with same NPC more than 3 times total: additional 25% penalty - Low-effort dates (connection < 30) increase boredom penalty by 20% - Callback-driven dates bypass 50% of repetition penalty - Repair dates addressing active conflicts bypass repetition penalty entirely - High compatibility (>=70) softens penalties by 30% - Low compatibility (<40) increases penalties by 20% - Added helper functions: checkDateRepetition, recordDateInHistory ## Match Data Structure - Updated rootReducer.js comment to document all Phase 1 match fields - Added dateHistory, lastDateDay, lastDateType to match structure - Updated persistence.js migration to include new fields ## Conflict System - Enhanced relationshipConflicts.js with all trigger types from ROADMAP: - ignored_messages - missed_planned_date - poor_date_ending - broken_promises - low_mood_spillover - ambition_mismatch - home_lifestyle_mismatch - jealousy_social_reputation - repeated_inattentive_dialogue - major_compatibility_mismatch - Added getEligibleConflictTriggers, checkDateConflictTrigger, startConflict - Integrated conflict trigger evaluation in RESOLVE_DATE_EVENT ## Selectors - Added selectCompatibilitySignal(state, npcId) - Added selectCohabitationFitHint(state, npcId) - Enhanced existing compatibility hint selectors ## Tests - Added comprehensive test suite for dateDiminishingReturns.js - All existing tests pass without regression - Content validation and audit scripts pass ## Files Modified - src/sim/dateDiminishingReturns.js: Complete rewrite with enhanced logic - src/sim/relationshipConflicts.js: Complete rewrite with all trigger types - src/state/persistence.js: Added new match fields to migration - src/state/reducers/rootReducer.js: Updated match structure comment - src/state/reducers/social.js: Integrated enhanced diminishing returns and conflict triggers - src/state/selectors.js: Added compatibility hint selectors - test/dateDiminishingReturns.test.js: New test file ## Definition of Done ✅ All dates resolve through one reducer pathway ✅ Every date has phase-level choices ✅ Date outcomes can write memories, discoveries, callbacks, conflicts, repair scenes ✅ Repeating the same optimal date cannot farm relationship indefinitely ✅ Existing date tests still pass ✅ No gift-loop regressions ✅ Feature flags exist and migrate safely Co-authored-by: Earnest-Williams <Earnest-Williams@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive Date Diminishing Returns System and a Relationship Conflict System to prevent relationship farming and manage conflicts as first-class states. Key changes include implementing repetition penalties, conflict triggers, state persistence, and corresponding unit tests. The review feedback highlights several critical issues: a bug in the stacking penalty formula that applies a 75% penalty instead of 50% on the first repetition, a JavaScript coercion bug where null >= negative_number evaluates to true and prematurely triggers jealousy conflicts, an overly complex conflict state initialization in the social reducer that could corrupt active conflicts, and an incorrect calculation of the returned penaltyAmount.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Date Diminishing Returns System
Match Data Structure
Conflict System
Selectors
Tests
Files Modified
Definition of Done
✅ All dates resolve through one reducer pathway
✅ Every date has phase-level choices
✅ Date outcomes can write memories, discoveries, callbacks, conflicts, repair scenes ✅ Repeating the same optimal date cannot farm relationship indefinitely ✅ Existing date tests still pass
✅ No gift-loop regressions
✅ Feature flags exist and migrate safely