Skip to content

Phase 1: Relationship Core Upgrade - Complete - #20

Merged
Earnest-Williams merged 5 commits into
mainfrom
vibe/phase1-relationship-core-566a93
Jun 7, 2026
Merged

Phase 1: Relationship Core Upgrade - Complete#20
Earnest-Williams merged 5 commits into
mainfrom
vibe/phase1-relationship-core-566a93

Conversation

@Earnest-Williams

Copy link
Copy Markdown
Owner

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

## 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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/sim/dateDiminishingReturns.js Outdated
Comment thread src/sim/relationshipConflicts.js
Comment thread src/state/reducers/social.js Outdated
Comment thread src/sim/dateDiminishingReturns.js
Earnest-Williams and others added 4 commits June 7, 2026 17:11
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>
@Earnest-Williams
Earnest-Williams merged commit 844bb34 into main Jun 7, 2026
1 of 2 checks passed
@Earnest-Williams
Earnest-Williams deleted the vibe/phase1-relationship-core-566a93 branch June 7, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants