Skip to content

feat(miner): add manage poll command writing CI snapshots to ledger - #3080

Closed
jony376 wants to merge 1 commit into
JSONbored:mainfrom
jony376:feat/miner-manage-poll-command
Closed

feat(miner): add manage poll command writing CI snapshots to ledger#3080
jony376 wants to merge 1 commit into
JSONbored:mainfrom
jony376:feat/miner-manage-poll-command

Conversation

@jony376

@jony376 jony376 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add gittensory-miner manage poll <owner/repo> <pr#> to poll GitHub check runs and append manage_pr_update snapshots to the local event ledger.
  • Map CI poller conclusions into manage-status fields (ciState, gateVerdict, outcome) and ensure a pr:<number> portfolio row exists for status rendering.
  • Cover argv parsing, conclusion mapping, ledger writes, portfolio bootstrap, and CLI output in unit tests.

Follow-up to #2323 (CI poller lib), #2325 / #3070 (manage status reader), and #3076 (portfolio queue CLI).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format (feat — new miner capability).
  • Focused on manage poll orchestration only — read-only GitHub GETs plus local ledger/queue writes.

Validation

  • npm run test:ci locally — CI will run the full gate on push.
  • Unit tests cover mapping, ledger append, portfolio row bootstrap, JSON output, and poll error surfacing.

Safety

  • No secrets in code or PR text; GITHUB_TOKEN is read from the environment only.
  • GitHub access is read-only GET via the existing ci-poller module; no uploads or PR mutations.

UI Evidence

Not applicable — miner CLI package only.

Notes

  • manage poll runs after the npm update-check bootstrap (network command, unlike offline manage status).
  • Poll snapshots populate the columns that manage status already renders from the event ledger.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jony376
jony376 requested a review from JSONbored as a code owner July 4, 2026 13:05
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

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

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
8411 1 8410 7
View the top 1 failed test(s) by shortest run time
test/unit/miner-manage-poll.test.ts > gittensory-miner manage poll (#2323/#2325) > recordManagePollSnapshot appends manage_pr_update and ensures a portfolio row
Stack Traces | 0.0448s run time
AssertionError: expected [] to deeply equal [ ObjectContaining{…} ]

- Expected
+ Received

- [
-   ObjectContaining {
-     "identifier": "pr:12",
-     "priority": 0,
-     "status": "queued",
-   },
- ]
+ []

 ❯ test/unit/miner-manage-poll.test.ts:125:54

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - fixes required

Review updated: 2026-07-04 13:09:33 UTC

7 files · 1 AI reviewer · no blockers · readiness 73/100 · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This adds a coherent `manage poll` path: argv parsing, CI polling, ledger snapshot writing, portfolio row bootstrapping, CLI dispatch, help text, declaration coverage, and focused unit tests. The visible implementation wires the existing ledger/status/queue path correctly, and the tests exercise the production-facing record and CLI flows rather than only fabricated payloads. I do not see a reachable breaking defect in the provided diff, but there are a few hardening and contract-sharpness points worth tightening before this becomes a relied-on operator command.

Nits — 6 non-blocking
  • nit: packages/gittensory-miner/lib/manage-poll.js:114 validates an injected portfolio queue only for `enqueue`, but `ensureManagedPrRow` also requires `listQueue`; either validate both methods up front or only call the helper when both are present.
  • nit: packages/gittensory-miner/lib/manage-poll.js:15 accepts owner/repo segments without trimming each side, so inputs like `acme/ widgets` pass parsing and fail later at the GitHub layer with a less useful error.
  • nit: packages/gittensory-miner/lib/manage-poll.js:24 maps only `failure` to `block`; if `pollCheckRuns` can surface terminal non-success conclusions other than `failure`, document why they remain advisory/open or fold them into the blocking path here.
  • nit: packages/gittensory-miner/lib/manage-poll.js:153 initializes the event ledger before the portfolio queue, so a portfolio queue initialization throw can leave the ledger open; this is a small local resource leak rather than a functional break.
  • nit: test/unit/miner-manage-poll.test.ts:53 covers valid parsing and one invalid PR number, but it does not cover unknown options, malformed repo names, or missing `--branch` values despite those being explicit branches in the new parser.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (no linked issue context).
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: 975 registered-repo PR(s), 693 merged, 40 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 975 PR(s), 40 issue(s).
Gate result ✅ Passing No configured 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: not available
  • Official Gittensor activity: 975 PR(s), 40 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@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.

1 participant