Skip to content

feat(miner-foundation): local SQLite persistence adapter for the stateless MCP plan DAG #2318

Description

@JSONbored

gittensory_build_plan/gittensory_plan_status/gittensory_record_step_result are deliberately STATELESS (the caller holds the plan and passes it back each call — see the #783 comment at src/mcp/server.ts:321). A miner running unattended across process restarts needs somewhere to persist the plan object between calls; that's local-only bookkeeping, not new plan logic, so this issue is pure client-side infra with zero write-risk.

Deliverables

  • packages/gittensory-miner/src/plan-store/store.ts exporting savePlan(planId, plan), loadPlan(planId), listPlans(filter?) backed by local SQLite (reuse the same DB file / connection helper as the claim ledger where practical, to avoid two competing local-storage patterns in the same package)
  • The stored plan blob round-trips EXACTLY through the real planDagSchema zod shape (src/mcp/server.ts:345) — validate on both save and load so a corrupted local row fails loudly instead of silently feeding a malformed plan back into gittensory_plan_status
  • Unit tests: save/load round-trip, listing with a status filter, and the corrupted-row-rejected-on-load case
  • No network calls; this module never talks to the MCP server directly (that's the caller's job) — it only persists/restores the plan JSON

References

  • src/mcp/server.ts:321 (module comment: plan tools are "stateless: pass the plan back each call" — this issue is exactly the local persistence that makes that workable across restarts)
  • src/mcp/server.ts:345 (planDagSchema — the exact shape to validate on save/load)
  • Depends on (soft, for shared DB conventions only): the local claim-ledger schema issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions