You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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/scoringmodules fromgittensory-engine) is out of scope here — this issue is the queue's persistence and basic FIFO/priority-ordered read/write API only.Deliverables
portfolio-queuemodule exposingenqueue(item: { repoFullName; identifier; priority?: number }): QueueEntry,dequeueNext(): QueueEntry | null(highest-priority-first, insertion-order tiebreak),listQueue(repoFullName?),markDone(repoFullName, identifier).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).dequeueNextorders bypriority DESC, enqueued_at ASCand returnsnullon an empty/all-done queue (both branches tested).markDoneremoving an item from futuredequeueNextresults, and multi-repo isolation inlistQueue.priorityfield 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 intogittensory-engineby a sibling issue) — the FUTURE priority-scoring source this queue'spriorityfield will eventually be populated from; cite as forward context only, not a dependency of this issue.packages/gittensory-miner/lib/portfolio-queue.js.