Feature: Local/Remote Task Execution Tracking & Credits System
Date: 2026-02-15 Status: Approved (Option B) — V1.1 Version: V1.1 (post-launch)
1. Context & Motivation
Problem
Currently, Morphee's task system:
- Only executes tasks in the Python backend (TaskProcessor)
- Has no concept of where a task runs (locally on Tauri vs remotely on server)
- Has no credits/usage tracking
- No abstraction layer for alternative storage backends
Opportunity
As Morphee evolves toward offline-first (Phase 3d M3), tasks should be:
- Offloadable to local Tauri layer (ONNX embeddings, local LLM inference, file ops)
- Tracked with location visibility (user sees "running locally" vs "running in cloud")
- Accountable with credits (per-user, per-space quotas for API calls, compute, etc.)
- Storage-agnostic (PostgreSQL now, Redis queue later, S3 archive, etc.)
Strategic Goals
- Hybrid execution: Route tasks intelligently (local if capable, remote if needed)
- Cost visibility: Users understand what resources they're using
- Offline operation: Tasks queued/cached locally, synced when online
- Extensibility: Easy to swap storage backend without code changes