SPIKE: Proof of Concept for Time-aware Credits Implementation

SPIKE: Proof of Concept for Time-aware Credits Implementation

Objective

Build a simplified Proof of Concept to validate the time-aware credits approach and uncover any undiscovered implementation challenges before committing to the full solution for FY26Q1.

Scope

Create a minimal, working implementation of the core concepts without full test coverage to:

1. Validate Core Technical Approach

  • Add start_at column to wallet_transactions (in development environment)
  • Implement simplified non_expired(at_time) scope with time window logic
  • Build basic version of Option B balance calculation (allocations-based)
  • Recalculate balance on Wallet::Transaction writes
  • Test with sample data representing different scenarios

2. Uncover Hidden Implementation Challenges

  • Identify any unexpected database constraints or migration issues
  • Discover edge cases not covered in the original proposal
  • Validate that existing wallet operations don't break
  • Test interaction with current allocation logic

3. Performance Reality Check

  • Run basic performance tests on balance calculation approaches
  • Identify any query performance surprises

4. Integration Complexity Assessment

  • Test integration with existing spend_without_lock! method
  • Validate compatibility with current monthly reset logic
  • Identify any breaking changes to existing APIs

Success Criteria

  • PoC demonstrates core time-aware logic works as expected
  • No major technical blockers discovered
  • Performance is acceptable for current data volumes
  • Integration points identified and validated
  • List of undiscovered issues/challenges documented

Timeline

Duration: 1 week

Out of Scope (for PoC)

  • Full test coverage
  • Production-ready error handling
  • Feature flags
  • Complete edge case handling
  • Documentation updates
  • Migration rollback strategies

Related Work Items

  • Parent Epic: Time-aware Credits System (#20530)
  • Original Proposal: [Proposal]Time-aware credits to fix rollover and drop transition hacks (#15087)
Edited Jan 21, 2026 by Nikola Milojevic
Assignee Loading
Time tracking Loading