Skip to content

feat(miner): add manage-phase status CLI command - #2791

Closed
pekar9781 wants to merge 3 commits into
JSONbored:mainfrom
pekar9781:feat/miner-metadata-opportunity-ranker
Closed

feat(miner): add manage-phase status CLI command#2791
pekar9781 wants to merge 3 commits into
JSONbored:mainfrom
pekar9781:feat/miner-metadata-opportunity-ranker

Conversation

@pekar9781

@pekar9781 pekar9781 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a read-only gittensory-miner status command that aggregates managed PR rows from the local portfolio queue and event ledger.
  • Introduce manage_pr_update event vocabulary plus table/JSON renderers for CI state, gate verdict, outcome, and last-polled timestamp.
  • Cover empty portfolio, mixed portfolio/event snapshots, --json output shape, and bin entrypoint wiring in unit tests.

Closes #2325.

Scope

Validation

  • npm run test:ci locally — Node.js is not installed on the contributor machine; CI will run the full gate on push.
  • New behavior has unit tests for empty portfolio, mixed state, JSON output, and CLI help/status wiring.

Safety

  • No secrets, wallet details, hotkeys, or private scoring output in code or PR text.
  • Read-only command: SELECT/list only, no GitHub writes, no uploads.

UI Evidence

Not applicable — miner CLI package only.

Notes

  • Portfolio PR identifiers use the pr:<number> convention; manage rows merge latest manage_pr_update payloads from the append-only event ledger.
  • Does not wire CI polling yet — this issue defines the local read/render contract later manage phases will populate.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (0e61493) to head (a446fc0).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2791   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files         256      256           
  Lines       28023    28023           
  Branches    10182    10182           
=======================================
  Hits        26966    26966           
  Misses        433      433           
  Partials      624      624           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-04 00:57:06 UTC

8 files · 1 AI reviewer · 1 blocker · readiness 80/100 · CI green · dirty

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: packages/gittensory-miner/lib/manage-status.js:70 creates a row from every `manage_pr_update` event missing from the portfolio map, so an append-only historical event for a PR that is no longer queued/in progress still appears in `gittensory-miner status` instead of being excluded from the local portfolio status view. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
The PR adds a read-only miner `status` command with table/JSON rendering and tests for the new CLI path. The core renderer is mostly straightforward, but the snapshot merge treats ledger-only events as active rows, so any historical `manage_pr_update` remains visible even when the portfolio has no corresponding managed PR row. That violates the stated local-portfolio status contract and will surface stale completed/removed PRs indefinitely.

Blockers

  • packages/gittensory-miner/lib/manage-status.js:70 creates a row from every `manage_pr_update` event missing from the portfolio map, so an append-only historical event for a PR that is no longer queued/in progress still appears in `gittensory-miner status` instead of being excluded from the local portfolio status view.
Nits — 5 non-blocking
  • packages/gittensory-miner/lib/manage-status.js:54 sets `ciState` with `item.status === "in_progress" ? "unknown" : "unknown"`, which is dead conditional noise and should be simplified.
  • packages/gittensory-miner/README.md:44 documents `gittensory-miner status`, but the Commands block below still omits the new command.
  • packages/gittensory-miner/lib/manage-status.d.ts:21 types `payload` as `Record<string, unknown>`, while the implementation explicitly accepts non-null objects and rejects arrays; consider aligning the reader contract with the runtime shape if event-ledger payloads can be nullable.
  • In `packages/gittensory-miner/lib/manage-status.js:70`, merge events only into existing portfolio rows, or explicitly filter ledger-only rows by a live managed state source before rendering.
  • Add a unit test in `test/unit/miner-manage-status.test.ts` where the ledger contains a `manage_pr_update` but `portfolio.listQueue()` is empty or the row is marked done, and assert the status output remains empty.

Why this is blocked

  • packages/gittensory-miner/lib/manage-status.js:70 creates a row from every `manage_pr_update` event missing from the portfolio map, so an append-only historical event for a PR that is no longer queued/in progress still appears in `gittensory-miner status` instead of being excluded from the local portfolio status view.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2325
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 (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: 892 registered-repo PR(s), 642 merged, 28 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 892 PR(s), 28 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: jony376
  • 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, Rust, MDX, Clojure, Cuda, Dart
  • Official Gittensor activity: 892 PR(s), 28 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

Aggregate local portfolio pr:* rows and manage_pr_update ledger events into
a read-only status table or JSON output for contributor manage visibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@pekar9781

Copy link
Copy Markdown
Contributor Author
  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@JSONbored JSONbored self-assigned this Jul 4, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge conflicts, please fix:

This branch has conflicts that must be resolved
Use the [web editor](https://github.com/JSONbored/gittensory/pull/2791/conflicts) or the command line to resolve conflicts before continuing.

packages/gittensory-miner/bin/gittensory-miner.js
packages/gittensory-miner/package.json

@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; AI reviewers agree on a likely critical defect: packages/gittensory-miner/lib/manage-status.js:70 creates a row from every `manage_pr_update` event missing from the portfolio map, so an append-only historical event for a PR that is no longer queued/in progress still appears in `gittensory-miner status` instead of being excluded from the local portfolio status view.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

@loopover-orb loopover-orb Bot closed this Jul 4, 2026
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

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-manage): local manage-phase CLI status command

2 participants