Skip to content

feat(miner-foundation): local portfolio/queue store for gittensory-miner #2292

Description

@JSONbored

Add the last piece of local persistence the phase brief calls for: a portfolio/queue table tracking the miner's own backlog of candidate work items across all target repos it has been pointed at — a simple prioritized queue (repo + issue/opportunity identifier + a locally-computed priority score placeholder + status). This is the client-side "what should I look at next, across everything I'm tracking" store; the actual priority-scoring logic (which will likely reuse the extracted reward-risk/scoring modules from gittensory-engine) is out of scope here — this issue is the queue's persistence and basic FIFO/priority-ordered read/write API only.

Deliverables

  • A portfolio-queue module exposing enqueue(item: { repoFullName; identifier; priority?: number }): QueueEntry, dequeueNext(): QueueEntry | null (highest-priority-first, insertion-order tiebreak), listQueue(repoFullName?), markDone(repoFullName, identifier).
  • Schema: repo_full_name TEXT NOT NULL, identifier TEXT NOT NULL, priority REAL NOT NULL DEFAULT 0, status TEXT NOT NULL DEFAULT 'queued' CHECK(status IN ('queued','in_progress','done')), enqueued_at TEXT NOT NULL, PRIMARY KEY (repo_full_name, identifier).
  • dequeueNext orders by priority DESC, enqueued_at ASC and returns null on an empty/all-done queue (both branches tested).
  • Unit tests: enqueue-then-dequeue ordering across mixed priorities, tie-break by enqueue order, markDone removing an item from future dequeueNext results, and multi-repo isolation in listQueue.
  • Doc comment noting the priority field is a PLACEHOLDER numeric input in this foundation phase — later phases wire it to the extracted reward-risk/scoring modules, not invented here.

References

  • src/signals/reward-risk.ts (877 lines, being extracted into gittensory-engine by a sibling issue) — the FUTURE priority-scoring source this queue's priority field will eventually be populated from; cite as forward context only, not a dependency of this issue.
  • New path: packages/gittensory-miner/lib/portfolio-queue.js.

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

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions