Skip to content

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

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

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

Conversation

@glorydavid03023

Copy link
Copy Markdown
Contributor

Summary

Adds a feasibilityGate block to MinerGoalSpec (packages/gittensory-engine/src/miner-goal-spec.ts) so a maintainer can tune the miner's feasibility gate per-repo via .gittensory-miner.yml. It is additive and inert by default (score floor 0, nothing suppressed), so a repo that omits the block behaves exactly as before.

Two tolerant sub-fields (the tolerant "degrade, don't throw" convention of the existing parser):

  • minFeasibilityScore — a [0, 1] floor a candidate must reach; out-of-range or non-finite input clamps into [0, 1] with a warning. Default 0.
  • suppressedAvoidReasons — a free-form string list of feasibility avoid-reason keys to downgrade from blocking to advisory. Default [].

Wired through the canonical parseMinerGoalSpec + hasConfiguredGoalFields (a gate-only config is correctly present: true), exported from the engine barrel, mirrored in the JSON Schema and the docs, and covered by present / absent / malformed / clamp tests. Per the issue's caution, only miner-goal-spec.ts is extended — the non-exported, uncalled miner-goal-spec-parse.ts sibling is left untouched. buildFeasibilityVerdict (the gate's composer) does not exist yet, so this is purely the config surface, following the repo's config-before-consumer pattern; the block's shape is documented as the issue requested.

Closes #4275

Scope

Validation

  • git diff --check
  • npm run typecheck (green)
  • npm run build:miner (engine + miner build/typecheck, green)
  • New root vitest suite test/unit/miner-goal-spec-feasibility-gate.test.ts (6 tests) + extended engine node:test parser/contract tests + the doc/schema parity test now assert the new field. The existing MinerGoalSpec literal sites in three test/unit opportunity tests were updated for the new required field.
  • Adding a required field: verified the full field-surface (maxConcurrentClaims grep) so every MinerGoalSpec literal in the repo now includes feasibilityGate.

If any required check was skipped, explain why:

  • Full npm run test:ci was not run in the local Windows dev environment (several self-host suites require Linux/bash/Docker/Postgres). This change is confined to packages/gittensory-engine + packages/gittensory-miner config/docs/schema (pure parsing, no src/ app, API/OpenAPI, MCP, binding, DB, or migration surface); typecheck, the engine+miner build, and all affected unit tests are green locally, and the remaining CI runs on this PR.

Safety

  • No secrets, wallets, hotkeys, trust scores, private rankings, or maintainer evidence.
  • Public GitHub text stays sanitized and low-noise.
  • No auth/CORS/session changes.
  • No API/OpenAPI/MCP behavior changes (pure config-parsing surface).

UI Evidence

N/A - backend config parsing; no UI, frontend, or extension change.

…nsory-miner.yml

Adds a `feasibilityGate` block to MinerGoalSpec so a maintainer can tune the miner's feasibility gate per-repo. It is additive and inert by default (score floor 0, nothing suppressed), so a repo that omits it behaves exactly as before. Two tolerant sub-fields: minFeasibilityScore (a [0,1] floor; out-of-range/non-finite input clamps with a warning) and suppressedAvoidReasons (a free-form string list of avoid-reason keys to downgrade). Wired through the canonical parseMinerGoalSpec + hasConfiguredGoalFields (a gate-only config is correctly present), exported from the engine barrel, mirrored in the JSON Schema and the docs, and covered by present/absent/malformed/clamp tests. Per the issue, only miner-goal-spec.ts is extended; the non-exported, uncalled miner-goal-spec-parse.ts sibling is left untouched.

Closes JSONbored#4275
@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

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
12650 6 12644 12
View the top 2 failed test(s) by shortest run time
test/unit/miner-goal-spec-parser.test.ts > MinerGoalSpec parser (#2301) > falls back per field for invalid values without throwing
Stack Traces | 0.00644s run time
AssertionError: expected { present: true, spec: { …(8) }, …(1) } to deeply equal { present: true, spec: { …(7) }, …(1) }

- Expected
+ Received

@@ -5,10 +5,14 @@
        "wontfix",
      ],
      "blockedPaths": [
        "dist/**",
      ],
+     "feasibilityGate": {
+       "minFeasibilityScore": 0,
+       "suppressedAvoidReasons": [],
+     },
      "issueDiscoveryPolicy": "neutral",
      "maxConcurrentClaims": 1,
      "minerEnabled": true,
      "preferredLabels": [
        "bugfix",

 ❯ test/unit/miner-goal-spec-parser.test.ts:136:20
test/unit/miner-goal-spec-parser.test.ts > MinerGoalSpec parser (#2301) > normalizes valid goal fields, dedupes strings, truncates long entries, and floors claims
Stack Traces | 0.0201s run time
AssertionError: expected { present: true, spec: { …(8) }, …(1) } to deeply equal { present: true, spec: { …(7) }, …(1) }

- Expected
+ Received

@@ -6,10 +6,14 @@
      ],
      "blockedPaths": [
        "dist/**",
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      ],
+     "feasibilityGate": {
+       "minFeasibilityScore": 0,
+       "suppressedAvoidReasons": [],
+     },
      "issueDiscoveryPolicy": "encouraged",
      "maxConcurrentClaims": 2,
      "minerEnabled": false,
      "preferredLabels": [
        "help wanted",

 ❯ test/unit/miner-goal-spec-parser.test.ts:46:20
View the full list of 4 ❄️ flaky test(s)
test/unit/check-engine-parity-script.test.ts > check-engine-parity script > engine version skew > uses default version readers against the real monorepo workspace

Flake rate in main: 40.00% (Passed 3 times, Failed 2 times)

Stack Traces | 0.0211s run time
AssertionError: expected [ Array(1) ] to deeply equal []

- Expected
+ Received

- []
+ [
+   "src/review/linked-issue-label-propagation.ts and .../src/review/linked-issue-label-propagation.ts have drifted apart (normalized comparison).
+ Edit both copies together or convert the host file to a thin engine re-export shim.",
+ ]

 ❯ test/unit/check-engine-parity-script.test.ts:192:31
test/unit/check-engine-parity-script.test.ts > check-engine-parity script > prints a clean summary and exits 0 for the real repo state when run as a subprocess

Flake rate in main: 40.00% (Passed 3 times, Failed 2 times)

Stack Traces | 1.14s run time
Error: Command failed: .../gittensory/node_modules/.bin/tsx scripts/check-engine-parity.ts
Engine-parity check found 1 issue(s):
src/review/linked-issue-label-propagation.ts and .../src/review/linked-issue-label-propagation.ts have drifted apart (normalized comparison).
Edit both copies together or convert the host file to a thin engine re-export shim.

 ❯ test/unit/check-engine-parity-script.test.ts:210:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { status: 1, signal: null, output: [ null, '', 'Engine-parity check found 1 issue(s):\nsrc/review/linked-issue-label-propagation.ts and .../src/review/linked-issue-label-propagation.ts have drifted apart (normalized comparison).\nEdit both copies together or convert the host file to a thin engine re-export shim.\n' ], pid: 10435, stdout: '', stderr: 'Engine-parity check found 1 issue(s):\nsrc/review/linked-issue-label-propagation.ts and .../src/review/linked-issue-label-propagation.ts have drifted apart (normalized comparison).\nEdit both copies together or convert the host file to a thin engine re-export shim.\n' }
test/unit/check-engine-parity-script.test.ts > check-engine-parity script > runEngineParityMain returns 0 for the real monorepo workspace

Flake rate in main: 40.00% (Passed 3 times, Failed 2 times)

Stack Traces | 0.0229s run time
AssertionError: expected 1 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 1

 ❯ test/unit/check-engine-parity-script.test.ts:205:48
test/unit/check-engine-parity-script.test.ts > check-engine-parity script > the real repo's hand-duplicated pairs agree after normalization (regression guard)

Flake rate in main: 40.00% (Passed 3 times, Failed 2 times)

Stack Traces | 0.0376s run time
AssertionError: expected [ Array(1) ] to deeply equal []

- Expected
+ Received

- []
+ [
+   "src/review/linked-issue-label-propagation.ts and .../src/review/linked-issue-label-propagation.ts have drifted apart (normalized comparison).
+ Edit both copies together or convert the host file to a thin engine re-export shim.",
+ ]

 ❯ test/unit/check-engine-parity-script.test.ts:88:29

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - fixes required

Review updated: 2026-07-09 18:52:49 UTC

11 files · no blockers · readiness 100/100 · CI failing · blocked

🛑 Suggested Action - Fix Blockers

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

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ✅ No blockers 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: 255 registered-repo PR(s), 155 merged, 18 issue(s).
Contributor context ✅ Confirmed Gittensor contributor glorydavid03023; Gittensor profile; 255 PR(s), 18 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The diff adds the feasibilityGate field (minFeasibilityScore + suppressedAvoidReasons) to MinerGoalSpec, DEFAULT_MINER_GOAL_SPEC, and the canonical parseMinerGoalSpec/hasConfiguredGoalFields exactly as specified, deliberately avoiding the non-exported sibling file, and pairs it with schema, docs, and present/absent/malformed/clamp test coverage matching every deliverable checkbox.

Review context
  • Author: glorydavid03023
  • 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: 255 PR(s), 18 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 (CI is failing (validate, validate-code)). 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.

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