feat(miner): wire the attempt CLI subcommand's real dependencies (#5132) - #5152
Conversation
Adds the `gittensory-miner attempt` subcommand: real GitHub-backed fetchLiveIssueSnapshot (GraphQL closedByPullRequestsReferences), a real executeLocalWrite (child_process, mirrors the #5131 driver spawn), and orchestration that gives worktree-allocator.js its first production caller and wires the four ledgers plus the #5131 driver and #5133 slop assessor into a real AttemptDeps object. runMinerAttempt still isn't reachable: it needs a SelfReviewContext (tracked by #5145, filed alongside this) and a coding-task-spec builder (title/instructions/acceptanceCriteriaPath, a second gap found while building this) that don't exist yet. Rather than fabricate either, the command builds and verifies every other real dependency and reports the block explicitly instead of calling runMinerAttempt with invalid input.
|
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 | 3e6177f | Commit Preview URL Branch Preview URL |
Jul 12 2026, 08:52 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5152 +/- ##
=======================================
Coverage 94.34% 94.34%
=======================================
Files 473 473
Lines 39927 39927
Branches 14557 14557
=======================================
Hits 37669 37669
Misses 1583 1583
Partials 675 675
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-12 09:01:59 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
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.
|
…line (#5132) packages/gittensory-miner/lib/worktree-allocator.js (given "its first real caller" in #5152) only does SQLite slot bookkeeping + mkdir -- it runs zero git commands. workingDirectory handed to runIterateLoop would have been an empty, non-git directory: the coding agent driver would have nothing real to edit. Adds repo-clone.js (a per-repo base-clone cache: git clone once, then fetch + hard-reset to the base branch on every subsequent attempt so content stays fresh) and attempt-worktree.js, which composes it with @jsonbored/gittensory-engine's addWorktree/ removeWorktree/shouldRetainWorktree primitives -- these already existed, tested, but were never called from this package (confirmed via git grep: zero production call sites anywhere in packages/gittensory-miner before this). A test caught a real wiring bug before this ever shipped: prepareAttemptWorktree initially forgot to forward its own remoteUrl/runGit test-injection options through to ensureRepoCloned, so every call silently hit the real GitHub URL regardless of what the caller passed -- caught by the REGRESSION integration test (a real local repo, real git worktree add, asserting real repo content lands on a real branch), not by review.
…line (#5132) (#5237) * feat(miner): wire real git worktree preparation into the attempt pipeline (#5132) packages/gittensory-miner/lib/worktree-allocator.js (given "its first real caller" in #5152) only does SQLite slot bookkeeping + mkdir -- it runs zero git commands. workingDirectory handed to runIterateLoop would have been an empty, non-git directory: the coding agent driver would have nothing real to edit. Adds repo-clone.js (a per-repo base-clone cache: git clone once, then fetch + hard-reset to the base branch on every subsequent attempt so content stays fresh) and attempt-worktree.js, which composes it with @jsonbored/gittensory-engine's addWorktree/ removeWorktree/shouldRetainWorktree primitives -- these already existed, tested, but were never called from this package (confirmed via git grep: zero production call sites anywhere in packages/gittensory-miner before this). A test caught a real wiring bug before this ever shipped: prepareAttemptWorktree initially forgot to forward its own remoteUrl/runGit test-injection options through to ensureRepoCloned, so every call silently hit the real GitHub URL regardless of what the caller passed -- caught by the REGRESSION integration test (a real local repo, real git worktree add, asserting real repo content lands on a real branch), not by review. * fix(miner): reject path-traversal owner/repo segments in repo-clone normalizeRepoFullName only checked for exactly one "/" separator, so a value like "../foo" passed validation and resolveRepoCloneDir/ensureRepoCloned would join it straight into the clone base dir, escaping the intended clone directory. Reject "."/".." segments and restrict owner/repo to GitHub's actual allowed character set.
Summary
gittensory-miner attemptCLI subcommand to real infrastructure — a GitHub-backedfetchLiveIssueSnapshot(GraphQLclosedByPullRequestsReferences), a realexecuteLocalWrite(child_process, mirrors Build production CodingAgentDriver construction + wire into the create phase #5131's driver spawn), and orchestration that givesworktree-allocator.jsits first production caller and assembles a realAttemptDepsfrom the four ledgers plus the Build production CodingAgentDriver construction + wire into the create phase #5131 driver and Build a real production runSlopAssessment implementation #5133 slop assessor.runMinerAttemptis not reachable yet: it needs aSelfReviewContext(issue/PR/manifest data at live-gate fidelity — filed Build a SelfReviewContext fetcher for the miner's self-review pass #5145 for this) and a coding-task-spec builder (title/instructions/acceptanceCriteriaPath derived from the target issue — a second gap found while building this, noted on Wire CLI dispatch for the real attempt pipeline (attempt command) #5132). Rather than fabricate either,runAttemptbuilds and verifies every other real dependency, then reports the block explicitly (blocked_missing_prerequisite, logged to both the attempt log and event ledger) instead of callingrunMinerAttemptwith invalid or fabricated input.--liveis opt-in only:resolveCodingAgentModeFromConfig's own default (noagentDryRunoverride) is"live", not"dry_run"— found via testing — so Wire CLI dispatch for the real attempt pipeline (attempt command) #5132's "dry-run is default" acceptance criteria is enforced in this CLI by requiring an explicit--liveflag.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coveragelocally (737 test files, 0 failures).packages/gittensory-miner/**is outside vitest'scoverage.includeglob (onlysrc/**+packages/gittensory-engine/src/**are collected), socodecov/patchcannot measure this diff — confirmed via an emptylcov.infofor these files. Full unit test coverage was still written (34 new tests across the 3 new files) as real correctness verification, independent of the Codecov gate.npm run build:miner+npm run test:miner-packnpx tsx scripts/check-engine-parity.tsnpm audit --audit-level=moderatenpm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:*— skipped, nosrc/**,apps/**, or MCP-surface files touched by this diff (confined topackages/gittensory-miner/**+ 3 newtest/unit/*.tsfiles).If any required check was skipped, explain why:
packages/gittensory-miner/**andtest/unit/*.ts— none of those pipelines build or test miner-package changes.Safety
Notes
packages/gittensory-miner/lib/worktree-allocator.jsnow has its first real (non-test) caller.