feat(miner-config): parse a feasibility-gate policy block from .gittensory-miner.yml - #4458
feat(miner-config): parse a feasibility-gate policy block from .gittensory-miner.yml#4458jeffrey701 wants to merge 1 commit into
Conversation
…nsory-miner.yml `.gittensory-miner.yml`'s MinerGoalSpec covered six behavioral fields, but none governed the analyze-phase feasibility gate (buildFeasibilityVerdict). This adds a `feasibilityGate` block so a repo maintainer can tune that gate per-repo. Extends the CANONICAL, exported parser (miner-goal-spec.ts) — the one every real consumer depends on (opportunity-ranker.js) — NOT the second, unexported, uncalled miner-goal-spec-parse.ts sibling. Design decision (the issue's open question): the block is scoped to reason suppression, not threshold tuning. A repo lists avoid/raise reason codes it opts out of (`suppressAvoidReasons` / `suppressRaiseReasons`), leaving every other reason in force; unknown codes are kept verbatim and simply never match. This config carries intent only — enforcing it against the composer is the gate consumer's job (JSONbored#4270), so this change is purely the config-parsing surface. - packages/gittensory-engine/src/miner-goal-spec.ts: `MinerFeasibilityGatePolicy` type + `feasibilityGate` field + entry in DEFAULT_MINER_GOAL_SPEC + a tolerant `normalizeFeasibilityGatePolicy` helper (reusing normalizeStringList), wired through parseMinerGoalSpec, hasConfiguredGoalFields (a feasibilityGate-only file is correctly `present: true`), and cloneDefaultMinerGoalSpec. - packages/gittensory-engine/src/index.ts: export the new type. - packages/gittensory-miner/schema/miner-goal-spec.schema.json: additive property. - packages/gittensory-miner/docs/miner-goal-spec.md: field reference + example. - Tests: new present/absent/malformed cases in the root parser suite, plus the existing exact-shape assertions (root + engine node:test) updated for the new field. Closes JSONbored#4275
|
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 #4458 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 418 418
Lines 37417 37424 +7
Branches 13677 13679 +2
=======================================
+ Hits 35178 35185 +7
Misses 1583 1583
Partials 656 656
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-09 20:01:28 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 1 non-blocking
Why this is blocked
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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of another open PR). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Closes #4275
What
.gittensory-miner.yml'sMinerGoalSpeccovered six behavioral fields, but none governed the analyze-phase feasibility gate (buildFeasibilityVerdict, feasibility.ts). This adds afeasibilityGateblock so a repo maintainer can tune that gate per-repo.Per the issue's caution, this extends the canonical, exported parser (
packages/gittensory-engine/src/miner-goal-spec.ts) — the one every real consumer depends on (opportunity-ranker.js:57) — not the second, unexported, caller-lessminer-goal-spec-parse.tssibling.Design decision (the issue's open question)
The block is scoped to reason suppression, not threshold tuning. A repo lists the avoid/raise reason codes it opts out of, leaving every other reason in force:
suppressAvoidReasons— avoid-reason codes this repo opts out of. Default:[].suppressRaiseReasons— raise-reason codes this repo opts out of. Default:[].Reason codes are the strings
buildFeasibilityVerdictemits (e.g.duplicate_cluster_medium,claim_status_claimed,issue_quality_uncertain); an unknown code is kept verbatim and simply never matches. This config carries intent only — enforcing it against the composer is the gate consumer's job (#4270), so this change is purely the config-parsing surface, built independently as the issue notes.Changes
miner-goal-spec.ts—MinerFeasibilityGatePolicytype;feasibilityGatefield (with aDefault:JSDoc); an entry inDEFAULT_MINER_GOAL_SPEC(deep-frozen); a tolerantnormalizeFeasibilityGatePolicy(reusingnormalizeStringList— dedupe/skip-invalid/cap, non-mapping → empty policy + warning); wired throughparseMinerGoalSpec,hasConfiguredGoalFields(afeasibilityGate-only file is stillpresent: true), andcloneDefaultMinerGoalSpec.index.ts— export the new type.schema/miner-goal-spec.schema.json— additivefeasibilityGateproperty (additionalProperties: trueis unchanged, so this is non-breaking).docs/miner-goal-spec.md— field reference + example.node:testsuite for the new field.Testing
Typecheck clean; root suites pass; the full engine
node:testsuite passes (321/321). The newminer-goal-spec.tslines are fully covered.