feat(miner): add repo stack auto-detection (#4785) - #5477
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 22:37:24 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5477 +/- ##
==========================================
+ Coverage 94.72% 94.73% +0.01%
==========================================
Files 560 561 +1
Lines 44699 44786 +87
Branches 14667 14667
==========================================
+ Hits 42343 42430 +87
Misses 1621 1621
Partials 735 735
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
detectRepoStack(packages/gittensory-miner/lib/stack-detection.js) inspects an already-cloned target repo's manifest / lockfile / config files and returns a structured description —language,packageManager,buildCommand,testCommand,lintCommand,formatCommand, plus theevidence(manifest + lockfile) that drove it.tsconfig.jsonor atypescriptdep; commands frompackage.jsonscripts), Python (pip / poetry / pipenv / uv; ruff + pytest inferred only from real config), Rust (cargo), Go (go vet, orgolangci-lintwhen configured), Maven, and Gradle (wrapper-aware).{ detected: false, reason }, and any command that can't be inferred from real config staysnullrather than being assumed. The module is pure and never throws — an unreadable/unparseable/binary file degrades to "no evidence".miner-goal-spec.js): injectableexistsSync/readFileSyncthat always receive the full joined path, so it's unit-testable against fixtures with no real filesystem.Closes #4785.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:ci(andnpm run test:coverageunsharded) under Node 22 (.nvmrc) before pushing. The development sandbox runs Node 18 without the workspacenode_modules, so the Vitest gate could not be executed here. Because this module depends only onnode:fs/node:path(no engine, nonode:sqlite), its logic was executed here against the real compiled module via a standalone Node script exercising every detector, package-manager, command-category, and fail-closed branch (all green), andnode --checkpasses.packages/gittensory-miner/lib/stack-detection.js; the.d.ts,package.json, README, andtest/**are not. The module is pure and dependency-injected, andtest/unit/miner-stack-detection.test.tstargets 100% of its lines and branches (each ecosystem, each package manager, each command variant, unparseable/unreadable/non-string reads, the exists/read throw guards, precedence, and both summary arms).Safety
UI Evidencesection below. (Not applicable — no UI changes.)CHANGELOG.mduntouched.)UI Evidence
Not applicable — this change is a miner-package runtime module + tests + package docs (Markdown). No rendered frontend surface changed.
Notes
{ detected: false, reason }vs a structured stack withnullcommand fields) enforces that at the type level. Commands are asserted only when they're canonical for the toolchain (cargo/go) or declared in real config/scripts.RECOGNIZED_MANIFESTSorder wins;evidence.manifestreports which one, so a caller can special-case if needed.