Skip to content

feat(miner-config): parse a feasibilityGate policy block from .gittensory-miner.yml (#4275) - #4433

Closed
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-feasibility-gate-config
Closed

feat(miner-config): parse a feasibilityGate policy block from .gittensory-miner.yml (#4275)#4433
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-feasibility-gate-config

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Adds a feasibilityGate field to MinerGoalSpec so a maintainer can tune the miner feasibility gate per repo, extending the existing tolerant .gittensory-miner.yml parser (packages/gittensory-engine/src/miner-goal-spec.ts).

Design

  • A policy block, not a scalarfeasibilityGate is an object (so it can grow), today carrying a single field: suppressReasons, the feasibility-verdict avoid/raise reason codes the gate should ignore for this repo. Default: an empty block (suppress nothing). This implements the "suppress specific avoid/raise reasons per-repo" option the issue names.
  • Wired exactly like the existing six fields: a normalizeFeasibilityGate helper (reusing normalizeStringList for suppressReasons, degrading a non-object/list value to the empty block with a warning, never throwing), the DEFAULT_MINER_GOAL_SPEC entry + deep clone, and hasConfiguredGoalFields (so a spec that sets only feasibilityGate is still detected as present).
  • Deliberately does not touch the non-exported miner-goal-spec-parse.ts sibling (no real caller — per the issue's caution).
  • Updates the JSON Schema mirror + docs/miner-goal-spec.md to match (kept in sync with the drift test), and re-exports the new MinerFeasibilityGatePolicy type from the package barrel.
  • The gate's actual consumer is separate, maintainer-owned wiring (feat(miner-plan): wire the feasibility gate into a new MCP tool + miner CLI command #4270); this defines the config surface only.

Tests

New test/unit/miner-goal-spec-feasibility-gate.test.ts covers absent (default, bare spec stays not-present), a set block (marks present), suppressReasons de-dup/non-string skipping, and non-object + list degradation with targeted warnings — 100% branch coverage on the new code. Updated the engine's node:test contract/parser suites (exact field-surface + full-spec assertions) and the docs/schema drift test's field list; the whole engine suite (311 tests) and typecheck are green.

Closes #4275

…sory-miner.yml (JSONbored#4275)

Add a feasibilityGate field to MinerGoalSpec (packages/gittensory-engine/src/
miner-goal-spec.ts) so a maintainer can tune the miner feasibility gate per repo.
It is a policy BLOCK (an object, so it can grow), today carrying suppressReasons
- feasibility-verdict avoid/raise reason codes the gate should ignore for this
repo. Default: an empty block (suppress nothing).

Wired through the canonical tolerant parser exactly like the existing six fields:
a normalizeFeasibilityGate helper (reusing normalizeStringList for suppressReasons,
degrading a non-object/list value to the empty block with a warning, never
throwing), the DEFAULT_MINER_GOAL_SPEC entry + deep clone, and hasConfiguredGoalFields
(so a spec that sets ONLY feasibilityGate is still detected as present). The
non-exported miner-goal-spec-parse.ts sibling is deliberately left untouched (no
real caller). Updates the JSON Schema mirror + docs to match. The gate's actual
consumer is separate, maintainer-owned wiring (JSONbored#4270); this defines the config
surface only.

Closes JSONbored#4275
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 9, 2026 17:53
@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
12649 6 12643 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.0065s run time
AssertionError: expected { present: true, spec: { …(8) }, …(1) } to deeply equal { present: true, spec: { …(7) }, …(1) }

- Expected
+ Received

@@ -5,10 +5,13 @@
        "wontfix",
      ],
      "blockedPaths": [
        "dist/**",
      ],
+     "feasibilityGate": {
+       "suppressReasons": [],
+     },
      "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.0215s run time
AssertionError: expected { present: true, spec: { …(8) }, …(1) } to deeply equal { present: true, spec: { …(7) }, …(1) }

- Expected
+ Received

@@ -6,10 +6,13 @@
      ],
      "blockedPaths": [
        "dist/**",
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      ],
+     "feasibilityGate": {
+       "suppressReasons": [],
+     },
      "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: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0.0228s 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: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 1.05s 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: 10340, 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: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0.0339s 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: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0.0411s 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:06:07 UTC

10 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: 88 registered-repo PR(s), 51 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 88 PR(s), 4 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The diff adds a `feasibilityGate` object field (with a `suppressReasons` sub-field) to `MinerGoalSpec`, wires it through `DEFAULT_MINER_GOAL_SPEC`, `normalizeFeasibilityGate`, `parseMinerGoalSpec`, and `hasConfiguredGoalFields`, deliberately avoids touching the non-exported sibling parser, and updates the JSON schema, docs, and adds targeted tests covering absent/present/malformed cases as the iss

Review context
  • Author: davion-knight
  • 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: 88 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 (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