Current state
The mana stack now has its architectural seams in place:ManaRepositoryandDriftManaRepositoryassembleManaDayInputs- application actions and Riverpod providers exist for input and compute paths
- engine-facing models are defined
- the engine sub-services and test harness exist
This page tracks non-UI work only: engine logic, repository/runtime behavior, event semantics, and test coverage.
Engine implementation
- Implement
AxisFactorCalculatorbehavior from the check-in rules - Implement
DailyPoolCalculatorwith cold start, conservative bias, EWMA updates, and explicit clamping - Implement
TaskCostCalculatorso per-task costs are derived deterministically from task properties and the current axis factor - Implement
TaskSurfacingServiceso essentials, timing constraints, low-capacity rules, and actionability filtering follow spec - Implement
ReturnRecoveryServicefor the neutral return-after-absence behavior - Implement
PemDetectorusing the documented thresholds and confidence rules - Implement
RegimeShiftDetectorfor sustained baseline changes - Implement
ManaTransparencyBuilderso explainers match actual deterministic behavior - Wire the above into
ComposedManaEngine.computesoComputeManaDayandWatchComputedManaDayreturn realManaDayResultvalues
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
dayTypeSetwithopportunityWeightwhere end-of-day learning uses it - Start emitting and consuming
taskCostCalibratedwhen the task-cost override flow exists - Start emitting and consuming
taskRecoveryWeightUpdatedif recovery weights become learned state rather than static fields - Start emitting and consuming
pemDetected/pemResolvedonce 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
ManaDayInputsbundle - 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