feat(miner-config): parse a feasibilityGate policy block from .gittensory-miner.yml - #4456
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4456 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 418 418
Lines 37417 37423 +6
Branches 13677 13679 +2
=======================================
+ Hits 35178 35184 +6
Misses 1583 1583
Partials 656 656
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 19:59:30 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
Summary
feasibilityGatepolicy block toMinerGoalSpec(packages/gittensory-engine/src/miner-goal-spec.ts), the canonical config surface for.gittensory-miner.ymlthatpackages/gittensory-miner/lib/opportunity-ranker.jsalready consumes viaparseMinerGoalSpecContent(content).spec.buildFeasibilityVerdictor its callers (that consumption is left to feat(miner-plan): wire the feasibility gate into a new MCP tool + miner CLI command #4270's follow-up work, "coordinating loosely" as the issue puts it). No changes tofeasibility.tsor the (separately-shipped, unrelated)feasibilityMCP tool/CLI command.{ enabled: boolean, suppressedReasons: string[] }.enabledmirrors the existingminerEnabled-style opt-out pattern;suppressedReasonsis a data-only list ofbuildFeasibilityVerdictreason codes (e.g.duplicate_cluster_high) a future consumer can filter on — deliberately the more conservative of the two options since it needs no new enum/threshold surface and stays a simple mirror of the existingnormalizeStringList/normalizeBooleanprimitives already used throughout this file.parseMinerGoalSpec/hasConfiguredGoalFieldswith a newnormalizeFeasibilityGatePolicyhelper (nested-object variant of the existing per-field normalizers: absent → default, non-mapping → warn+default, each sub-field independently normalized via the existingnormalizeBoolean/normalizeStringList). Explicitly did not touchminer-goal-spec-parse.ts, the second non-exported/uncalled implementation the issue flags as a trap.packages/gittensory-miner/schema/miner-goal-spec.schema.json), the field docs (packages/gittensory-miner/docs/miner-goal-spec.md), and the root example config (.gittensory-miner.yml.example) to match.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— not run; no workflow files touched.npm run typecheck(clean on this diff; the repo's one pre-existing failure — a missingaws4fetchtype declaration insrc/selfhost/s3-blob-store.ts— reproduces identically on a cleanmaincheckout and is unrelated). Adding a new requiredMinerGoalSpecfield surfaced 5 pre-existing hand-writtenMinerGoalSpecobject literals acrosstest/unit/miner-opportunity-ranker.test.ts,test/unit/opportunity-branch-internals.test.ts, andtest/unit/opportunity-metadata-signals.test.ts; all five now include the new field so they still satisfy the type.npm run test:coveragelocally — ranpackages/gittensory-engine/src/miner-goal-spec.ts's coverage in isolation against every test file that exercises it: 100% statements/branches/functions/lines on every line this diff touches (the file's only uncovered lines, 325-326, are the pre-existing, untoucheddiscoverMinerGoalSpecPath— unrelated to this change). Also rannpm run test --workspace @jsonbored/gittensory-engine(the package's ownnode:testsuite, which duplicates the parser/default-spec assertions): 322/322 pass. Did not run the full unshardednpm run test:coverage(this dev machine is shared with several other concurrent contributor sessions and a full run does not complete in reasonable time).npm run test:workers— not run; no Cloudflare Worker code touched.npm run build:mcp/npm run test:mcp-pack/ miner-pack equivalents — not run directly, butnpm --workspace @jsonbored/gittensory-engine run buildwas run locally (required to exercise the compiled package in tests) and succeeds.test:mcp-pack/test:miner-packthemselves fail on this Windows machine for an unrelated, pre-existing reason (spawnSync("npm", ...)needsshell:trueon Windows; reproduces identically on a cleanmaincheckout).npm run docs:drift-check— clean, unaffected.npm run ui:openapi:check/ui:lint/ui:build— not run; no UI files touched.npm audit --audit-level=moderate— not run; no dependency changes.test/unit/miner-goal-spec-parser.test.ts(vitest) andpackages/gittensory-engine/test/miner-goal-spec-parser.test.ts(node:test): present/valid, absent (defaults), non-mapping (warn + default), each nested sub-field malformed independently, and a policy-only config (no other fields set) still marking the specpresent.If any required check was skipped, explain why:
mainWindows-local environment issue (npm pack'sspawnSyncWindows incompatibility) that does not reflect real CI behavior (GitHub Actions runs on Linux, and a dedicated CI step already builds@jsonbored/gittensory-enginebeforetest:coverageruns).Safety
.mdfile touched is the field reference doc this issue explicitly asks to update, not a changelog).UI Evidence
Not applicable; config-parsing surface change only, no UI.
Notes
MinerGoalSpectest literals that a concurrent merge (landed between my initial implementation and pushing) reintroduced during a rebase.