Skip to main content

Current state

The mana stack now has its architectural seams in place:
  • ManaRepository and DriftManaRepository assemble ManaDayInputs
  • application actions and Riverpod providers exist for input and compute paths
  • engine-facing models are defined
  • the engine sub-services and test harness exist
What is still missing is the actual computation and learning behavior.
This page tracks non-UI work only: engine logic, repository/runtime behavior, event semantics, and test coverage.

Engine implementation

Event and learning semantics

  • Decide which parts of learning depend only on current state and which must be event-replay-driven
  • Start emitting and consuming dayTypeSet with opportunityWeight where end-of-day learning uses it
  • Start emitting and consuming taskCostCalibrated when the task-cost override flow exists
  • Start emitting and consuming taskRecoveryWeightUpdated if recovery weights become learned state rather than static fields
  • Start emitting and consuming pemDetected / pemResolved once PEM detection becomes real
  • Ensure any learned state can still be reconstructed deterministically from persisted inputs and events

Determinism and algorithm runtime

  • Keep the mana engine pure for a fixed ManaDayInputs bundle
  • Add deterministic maths helpers for EWMA, clamping, bounded updates, and safe rounding where needed
  • Implement algorithm versioning/runtime migration support as described in Versioning, Migration, Rollback
  • Ensure no double-counting between pool changes and cost changes from the same signal

Test work

  • Turn the intentionally red engine tests under app/test/domain/mana/engine/ green
  • Add focused subsystem tests for:
    • axis factor
    • pool EWMA and conservative bias
    • task costing
    • task surfacing
    • return recovery
    • PEM detection
    • regime shift detection
    • transparency output
  • Add replay/integration tests that exercise DriftManaRepository -> ManaDayInputs -> ManaEngine -> ManaDayResult
  • Add property-style tests for boundedness, determinism, and no-feedback-loop invariants
  • Add scenario regression tests matching the worked examples in Example Scenarios

Explicitly out of scope here

  • Mana screen and widget implementation
  • Visual explainers and UI affordances
  • Non-Mana task UI flows
Those should be tracked separately once the engine behavior is implemented and test-backed.