Skip to content

feat(miner-config): parse a feasibility-gate policy block from .gittensory-miner.yml - #4458

Closed
jeffrey701 wants to merge 1 commit into
JSONbored:mainfrom
jeffrey701:feat/miner-feasibility-gate-config
Closed

feat(miner-config): parse a feasibility-gate policy block from .gittensory-miner.yml#4458
jeffrey701 wants to merge 1 commit into
JSONbored:mainfrom
jeffrey701:feat/miner-feasibility-gate-config

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

Closes #4275

What

.gittensory-miner.yml's MinerGoalSpec covered six behavioral fields, but none governed the analyze-phase feasibility gate (buildFeasibilityVerdict, feasibility.ts). This adds a feasibilityGate block 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-less 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 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 buildFeasibilityVerdict emits (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.

feasibilityGate:
  suppressAvoidReasons:
    - duplicate_cluster_high
  suppressRaiseReasons:
    - claim_status_claimed

Changes

  • miner-goal-spec.tsMinerFeasibilityGatePolicy type; feasibilityGate field (with a Default: JSDoc); an entry in DEFAULT_MINER_GOAL_SPEC (deep-frozen); a tolerant normalizeFeasibilityGatePolicy (reusing normalizeStringList — dedupe/skip-invalid/cap, non-mapping → empty policy + warning); wired through parseMinerGoalSpec, hasConfiguredGoalFields (a feasibilityGate-only file is still present: true), and cloneDefaultMinerGoalSpec.
  • index.ts — export the new type.
  • schema/miner-goal-spec.schema.json — additive feasibilityGate property (additionalProperties: true is unchanged, so this is non-breaking).
  • docs/miner-goal-spec.md — field reference + example.
  • Tests — new present / feasibilityGate-only / non-mapping / absent cases in the root parser suite; existing exact-shape assertions updated in both the root vitest suite and the engine node:test suite for the new field.

Testing

npm run typecheck
npx vitest run test/unit/miner-goal-spec-parser.test.ts test/unit/miner-goal-spec-doc.test.ts
npm run test --workspace @jsonbored/gittensory-engine

Typecheck clean; root suites pass; the full engine node:test suite passes (321/321). The new miner-goal-spec.ts lines are fully covered.

…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
@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 9, 2026 19:40
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (861e8b7) to head (5994b53).
⚠️ Report is 6 commits behind head on main.

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           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/miner-goal-spec.ts 97.67% <100.00%> (+0.20%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-09 20:01:28 UTC

9 files · 1 blocker · readiness 100/100 · CI green · unstable

🛑 Suggested Action - Reject/Close

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

Why this is blocked

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
Signal Result Evidence
Code review ❌ 1 blocker No AI review summary
Linked issue ✅ Linked #4275
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 97 registered-repo PR(s), 40 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 97 PR(s), 4 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Linked issue satisfaction

Addressed
The PR adds a feasibilityGate field (MinerFeasibilityGatePolicy with suppressAvoidReasons/suppressRaiseReasons) to the canonical, exported MinerGoalSpec in miner-goal-spec.ts, wires it through DEFAULT_MINER_GOAL_SPEC, cloneDefaultMinerGoalSpec, parseMinerGoalSpec, and hasConfiguredGoalFields, explicitly avoids touching the non-exported sibling file, updates the JSON schema and docs, and adds tests

Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 97 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.

@loopover-orb loopover-orb Bot closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-config): parse a feasibility-gate policy block from .gittensory-miner.yml

1 participant