feat(miner): add --dry-run to attempt and loop - #5527
Conversation
Both are the two REMOTE-mutating commands in the miner CLI (attempt opens a real git worktree, claims the issue, and can run a real coding-agent driver that pushes/opens a PR; loop wraps attempt plus its own portfolio-queue/ledger writes). --live's absence already skipped the coding-agent driver, but every worktree/claim/ledger write still happened regardless -- not the "zero actual writes, local or remote" #4847 asks for. --dry-run reports what a real invocation would target (repo, issue, resolved coding-agent mode, base branch) and returns immediately, BEFORE any store is opened -- a provable zero-write path, not just "opened but didn't write to." For loop specifically, this also means skipping discovery, since it enqueues newly-found candidates into the local portfolio queue even before any attempt happens. The MINER_CODING_AGENT_PAUSED check still runs before the dry-run short-circuit, so a dry run of a paused config honestly reports the refusal rather than fabricating a "would succeed." Extending --dry-run to the remaining local-mutating commands (claim, queue, state, governor, discover, orb export) is scoped as a follow-up -- those are simple single-DB-write commands with none of attempt/loop's semantic questions, and bundling them here would risk the review getting bogged down in this PR's harder design decision. Advances #4847
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | d527bb2 | Commit Preview URL Branch Preview URL |
Jul 13 2026, 01:20 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5527 +/- ##
=======================================
Coverage 94.79% 94.79%
=======================================
Files 566 566
Lines 45065 45085 +20
Branches 14675 14675
=======================================
+ Hits 42718 42738 +20
Misses 1613 1613
Partials 734 734
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-13 03:13:45 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
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.
|
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
Summary
--dry-runtogittensory-miner attemptandgittensory-miner loop— the two REMOTE-mutating commands (attemptopens a real git worktree, claims the issue, and can run a real coding-agent driver that pushes/opens a PR;loopwrapsattemptplus its own portfolio-queue/ledger writes).--live's absence already skipped the coding-agent driver, but every worktree clone, claim-ledger write, and ledger append still happened regardless — not the "zero actual writes, local or remote" Add a--dry-run/ simulate mode across the miner CLI #4847's acceptance criteria asks for.--dry-runreports what a real invocation would target (repo, issue, resolved coding-agent mode, base branch) and returns immediately, before any store is opened — a provable zero-write path, not just "opened but didn't write to."loopspecifically, this also means skipping discovery, sincerunDiscoveryOnce()enqueues newly-found candidates into the local portfolio queue even before any attempt happens.MINER_CODING_AGENT_PAUSEDcheck still runs before the dry-run short-circuit, so a dry run of a paused config honestly reports the refusal rather than fabricating a "would succeed."Scope note: the issue's acceptance criteria covers "every mutating command." This PR covers the two highest-stakes, remote-mutating commands, which needed real design work (deciding what "--dry-run" means given the existing
--livesemantics, and how far up the pipeline to short-circuit). The remaining ~10 commands (claim claim/release,queue next/done/claim-batch,state set,governor pause/resume,discover,orb export --enable) are simple, mechanical single-local-DB-write additions with none ofattempt/loop's semantic questions — scoped as a follow-up PR so this one stays reviewable and its harder design decision doesn't get bundled with (or block) the easy ones.Test plan
npx vitest run test/unit test/contract— 779 files / 15233 tests passing, 0 regressions (one pre-existing unrelated flake inagent-sdk-driver.test.ts, a real-git-worktree test timing out under full-suite parallel load — confirmed passing in isolation, untouched by this diff)npm run build --workspace @jsonbored/gittensory-minercleannpx tsc --noEmitcleannpm run docs:drift-check && npm run manifest:drift-check && npm run engine-parity:drift-check && npm run miner:env-reference:checknpm audit --audit-level=moderate— 0 vulnerabilities--dry-run(everyopen*/init*dependency spied and asserted never-called) for both commands, JSON + human-readable output,--dry-run --livereporting the live mode it would have used, and the pause-check-before-dry-run-short-circuit precedenceAdvances #4847