Skip to content

feat(miner): add --dry-run to the remaining local-mutating CLI commands#5532

Merged
JSONbored merged 1 commit into
mainfrom
feat/dry-run-remaining-commands-4847
Jul 13, 2026
Merged

feat(miner): add --dry-run to the remaining local-mutating CLI commands#5532
JSONbored merged 1 commit into
mainfrom
feat/dry-run-remaining-commands-4847

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Advances #4847 (full closure needs this PR + #5527 + the governor-pause follow-up).

Test plan

  • npx tsc --noEmit --incremental false
  • npx vitest run test/unit test/contract (798 files, 15527 tests passed, 2 pre-existing skips)
  • npm run test:coverage (unsharded) — 100% patch coverage (lines + branches) on every changed line in the 6 touched lib/*.js files, verified against git diff --unified=0 hunks
  • npm run docs:drift-check, manifest:drift-check, engine-parity:drift-check, miner:env-reference:check
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • npm run build (packages/gittensory-miner) — node --check on all lib files
  • Rebased on latest origin/main

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.88%. Comparing base (7cffca2) to head (e10b1db).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5532      +/-   ##
==========================================
+ Coverage   94.87%   94.88%   +0.01%     
==========================================
  Files         568      568              
  Lines       45055    45161     +106     
  Branches    14675    14675              
==========================================
+ Hits        42746    42852     +106     
  Misses       1575     1575              
  Partials      734      734              
Flag Coverage Δ
shard-1 43.69% <8.73%> (-0.53%) ⬇️
shard-2 35.42% <26.98%> (-0.07%) ⬇️
shard-3 32.14% <34.12%> (+0.13%) ⬆️
shard-4 31.31% <12.69%> (-0.73%) ⬇️
shard-5 33.44% <2.38%> (+0.54%) ⬆️
shard-6 44.34% <38.88%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/claim-ledger-cli.js 99.36% <100.00%> (+0.08%) ⬆️
packages/gittensory-miner/lib/cli.js 100.00% <ø> (ø)
packages/gittensory-miner/lib/discover-cli.js 100.00% <100.00%> (ø)
packages/gittensory-miner/lib/manage-poll.js 97.91% <100.00%> (+0.35%) ⬆️
packages/gittensory-miner/lib/orb-export.js 90.90% <100.00%> (+1.29%) ⬆️
...ckages/gittensory-miner/lib/portfolio-queue-cli.js 97.59% <100.00%> (+0.50%) ⬆️
packages/gittensory-miner/lib/run-state-cli.js 94.59% <100.00%> (+0.74%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui e10b1db Commit Preview URL

Branch Preview URL
Jul 13 2026, 04:17 AM

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

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-13 04:28:58 UTC

19 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This mechanically extends the existing --dry-run pattern (from #5527) to claim/queue/state/discover/orb-export/manage-poll CLI commands: pure-write commands short-circuit before opening any local store, while discover/manage-poll perform the real read-only GitHub work and route the result through a no-op queue/ledger stub. I traced the dry-run branches against their real-write counterparts across all six touched lib files and they consistently return before any store initializer is invoked, matching the stated goal. Test coverage is thorough and exercises the actual code paths (real fan-out/poll functions, spy-based assertions that store initializers are never called), not fabricated states.

Nits — 5 non-blocking
  • run-state-cli.js's dry-run JSON output uses `JSON.stringify(dryRunResult)` with no indentation while every other command in this PR uses `JSON.stringify(x, null, 2)` — pick one for consistency across the CLI.
  • The 'debug leftover console' and 'deep nesting' findings from the external brief are false positives here: console.log/error is this CLI's actual output mechanism (every existing command uses it the same way), and the nesting is just the ordinary try/catch + dry-run-branch shape already used elsewhere in these files.
  • discover-cli.js's dry-run block duplicates renderDiscoverSummary's non-JSON rendering path via the same result shape as the real run — consider factoring the shared `{outcome: 'dry_run', ...}` wrapping into a small helper since the same `{outcome, ...fields}` shape is repeated six times across files.
  • Consider a tiny shared `printDryRun(result, json, textLine)` helper in a common module to cut the repeated `if (parsed.json) { JSON.stringify... } else { console.log... }` boilerplate across claim/queue/state/orb-export.
  • Double-check the CHANGELOG/docs (not shown in this diff) mention --dry-run is now supported for these subcommands, since cli.js's --help text was updated but a separate docs page may also need the same sync per this repo's docs:drift-check convention.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.
Signal Result Evidence
Code review ❌ 2 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 ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 399 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 399 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 399 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • 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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 the manual-review Gittensor contributor context label Jul 13, 2026
Extends the --dry-run pattern already added to attempt/loop across the rest
of the miner CLI's write paths: claim claim/release, queue next/done/release/
requeue/claim-batch, state set, discover, and orb export. Read-only commands
(discover, manage poll) still perform their real GitHub fetch/poll under
--dry-run and report what a write would have done via a no-op store stub;
pure-write commands short-circuit before opening any store.

Advances #4847
@JSONbored JSONbored force-pushed the feat/dry-run-remaining-commands-4847 branch from 60be716 to e10b1db Compare July 13, 2026 04:15
@JSONbored JSONbored merged commit 34ae1e5 into main Jul 13, 2026
19 checks passed
@JSONbored JSONbored deleted the feat/dry-run-remaining-commands-4847 branch July 13, 2026 04:30
JSONbored added a commit that referenced this pull request Jul 13, 2026
Completes the --dry-run coverage started in #5527/#5532: governor pause/resume
(#4851) are the last local-mutating commands in the CLI. Reports what would
happen and returns before opening governor-state, matching every other
mutating command's dry-run pattern. governor status is read-only and needs no
dry-run.

Closes #4847
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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant