feat(miner): de-hardcode discovery from gittensory's own conventions (#4784) - #5472
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:16:26 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 #5472 +/- ##
=======================================
Coverage 94.72% 94.72%
=======================================
Files 559 560 +1
Lines 44664 44690 +26
Branches 14664 14664
=======================================
+ Hits 42308 42334 +26
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
lib/forge-config.js— a single per-tenant forge adapter.DEFAULT_FORGE_CONFIGholds every github.com value (base URL, API version + version-header name,acceptheader, user-agent, repo path prefix, search endpoint, search qualifiers, token env var);resolveForgeConfig(overrides)fills any missing field from that default.resolveForgeConfig()with no overrides is byte-identical to the pre-De-hardcode discovery from gittensory's own conventions #4784 hardcoded behavior, so the existing gittensory discovery path is unchanged.opportunity-fanout.jsnow reads the API version, request headers, repo path, search endpoint, and search-qualifier dialect from the resolved forge instead of module constants (checklist item 1 + 5). The pre-existing top-levelapiBaseUrloverride still wins overforge.apiBaseUrl, so every current caller is untouched.discoversurfaces--api-base-url <url>so the fan-out's forge host is reachable from the CLI (item 2), and--token-env <VAR>to read a non-GITHUB_TOKENcredential (item 3).runDiscoveralso forwards a caller-supplied goal spec (goalSpecsByRepo/goalSpecContentByRepo) to the ranker and surfacesusedDefaultGoalSpecin the JSON and the human-readable summary, so a fall-back to gittensory's built-in rubric is explicit rather than silent (item 4).DEFAULT_TYPE_LABELS(gittensor:*) is a review-stack default (already overridable per repo via the focus manifest) that the miner discovery ranker never consults — the discovery label taxonomy is the goal spec's genericpreferredLabels/blockedLabels, which is now threaded through.Closes #4784.
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(the engine'sdist/is unbuilt andnode:sqliteis unavailable), so the Vitest gate could not be executed here.node --checkpasses on all three changed JS modules, and the new logic was verified out-of-band with a standalone Node script against the realforge-config.js(defaults == baseline; trim / blank / non-string / null-arg fall-backs; frozen default) plus faithful replicas of the newparseDiscoverArgsconditional-key parsing and therunDiscovertoken/apiBaseUrl precedence.opportunity-fanout/discover-clitests are left untouched and still pass by construction:resolveForgeConfig()with no overrides reproduces the exact previous URLs/headers, andparseDiscoverArgsonly addsapiBaseUrl/tokenEnvkeys when the corresponding flag is supplied (so the existing exact-match.toEqual({ targets, search, json })assertions are unchanged).Safety
UI Evidencesection below. (Not applicable — no UI changes.)CHANGELOG.mduntouched.)UI Evidence
Not applicable — this change is miner-package runtime modules + tests + package docs (Markdown). No rendered frontend surface changed.
Notes
resolveForgeConfig()== the old hardcoded baseline, which is what keeps existing gittensory-repo discovery behavior identical (the acceptance criterion).DEFAULT_TYPE_LABELS(gittensor:*) belongs to the review/PR-type path (overridable per repo via the focus manifest) and is never read by the miner discovery ranker, so de-hardcoding it is out of De-hardcode discovery from gittensory's own conventions #4784's discovery/claim scope — documented in the audit's Resolution section.discoverdoes not (yet) auto-fetch each target repo's.gittensory-miner.yml, real runs surfaceusedDefaultGoalSpec: truein both JSON and the summary, making the default-rubric fall-back explicit instead of silent.