Skip to content

feat(miner-portfolio): add pure portfolio queue primitives - #2545

Merged
JSONbored merged 5 commits into
JSONbored:mainfrom
9876543210-tc-0123456789:feat/portfolio-queue-2326
Jul 2, 2026
Merged

feat(miner-portfolio): add pure portfolio queue primitives#2545
JSONbored merged 5 commits into
JSONbored:mainfrom
9876543210-tc-0123456789:feat/portfolio-queue-2326

Conversation

@9876543210-tc-0123456789

@9876543210-tc-0123456789 9876543210-tc-0123456789 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add pure PortfolioQueue bookkeeping primitives to @jsonbored/gittensory-engine for #2326
  • implement deterministic enqueueItem, dequeueItem, and nextEligibleItems with repo bucketing, global/per-repo WIP caps, and stable cross-repo alternation
  • cover empty, capped, diversified, and no-op paths in repo-level and package-level tests

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Re-ran targeted tests after rebasing onto the latest origin/main:
    • npx vitest run test/unit/portfolio-queue.test.ts
    • npm --workspace @jsonbored/gittensory-engine run test
    • npm run db:migrations:check
  • A full local npm run test:coverage retry on an earlier rebased attempt hit an unrelated test/unit/queue-trends.test.ts flake; the file passed on isolated retry.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

No visible UI changes.

Notes

@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 10:40:39 UTC

4 files · 1 AI reviewer · no blockers · readiness 78/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The PR adds a small pure portfolio queue module, exports it from the engine barrel, and covers the expected enqueue, dequeue, cap, and alternation behavior in both source-level and package-level tests. The implementation is deterministic, normalizes ids/repo names/caps before selection, and the visible tests exercise the main edge cases called out in the PR description. I do not see a reachable correctness break in the provided diff.

Nits — 4 non-blocking
  • nit: packages/gittensory-engine/src/portfolio/queue.ts:96 enforces duplicate ids globally across all repos, so add a short comment or test name clarifying that item ids are intended to be globally unique rather than repo-scoped.
  • nit: packages/gittensory-engine/src/portfolio/queue.ts:112 normalizes the touched bucket's existing items but leaves untouched buckets in their original shape, which is fine for selection but mildly surprising for a function that otherwise returns normalized queue data.
  • packages/gittensory-engine/src/portfolio/queue.ts:96 should document the global-id contract, or change `queueHasItem` to check `(repoFullName,id)` if future callers can reuse ids across repos.
  • packages/gittensory-engine/src/portfolio/queue.ts:126 could normalize surviving items when an item is actually removed, matching `enqueueItem`'s normalized-return behavior and making stored queue shape more predictable.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2326
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (size label size:L; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 35 registered-repo PR(s), 17 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor DragunovX16; Gittensor profile; 35 PR(s), 3 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: DragunovX16
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, Python, JavaScript, Clojure, CSS, Cuda, HTML, Java
  • Official Gittensor activity: 35 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.99%. Comparing base (7bab053) to head (88da84f).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2545      +/-   ##
==========================================
+ Coverage   95.97%   95.99%   +0.02%     
==========================================
  Files         226      230       +4     
  Lines       25526    25888     +362     
  Branches     9289     9411     +122     
==========================================
+ Hits        24498    24852     +354     
- Misses        417      425       +8     
  Partials      611      611              
Files with missing lines Coverage Δ
packages/gittensory-engine/src/portfolio/queue.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm label Jul 2, 2026
@JSONbored
JSONbored merged commit 2af7092 into JSONbored:main Jul 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

feat(miner-portfolio): define PortfolioQueueManager types + pure bucketing primitives

2 participants