Skip to content

feat(miner-discovery): goal model — translate MinerGoalSpec into ranker weights - #2787

Merged
JSONbored merged 4 commits into
JSONbored:mainfrom
RenzoMXD:feat/goal-model-miner-goal-spec-2304
Jul 3, 2026
Merged

feat(miner-discovery): goal model — translate MinerGoalSpec into ranker weights#2787
JSONbored merged 4 commits into
JSONbored:mainfrom
RenzoMXD:feat/goal-model-miner-goal-spec-2304

Conversation

@RenzoMXD

@RenzoMXD RenzoMXD commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #2304.

What changed: Added \GoalModelInput\ and \computeLaneFit\ to \packages/gittensory-engine/src/goal-model.ts. Given a candidate issue's paths/labels and a parsed \MinerGoalSpec, returns a [0, 1] lane-fit score:

  • 0 immediately if any candidatePath matches a blockedPath glob (short-circuit)
  • 0 immediately if any candidateLabel matches a blockedLabel (case-insensitive)
  • 0 if wantedPaths/preferredLabels are set but neither matches
  • 0.5 when wantedPaths and preferredLabels are both empty (neutral default)
  • matched-criteria / total-criteria fractional ratio otherwise

Re-exports from the engine barrel so the ranker's laneFit parameter can consume the score via the shared package.

Files changed:

  • \packages/gittensory-engine/src/goal-model.ts\ — new file: \GoalModelInput\ type, \computeLaneFit\ function, scoped glob helper
  • \packages/gittensory-engine/test/goal-model.test.ts\ — new file: 10 unit tests
  • \packages/gittensory-engine/src/index.ts\ — re-export \computeLaneFit\ and \GoalModelInput\

Validation:


  • pm run test\ (engine package) — 54/54 pass (44 original + 10 new)

  • px vitest run test/unit/plan-templates.test.ts test/unit/miner-goal-spec-parser.test.ts test/unit/miner-goal-lane-fit.test.ts\ — 29/29 pass

  • pm run typecheck\ — clean
  • \git diff --check\ — clean

Linked issue: Closes #2304

@RenzoMXD
RenzoMXD requested a review from JSONbored as a code owner July 3, 2026 14:32
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-03 21:40:44 UTC

3 files · no blockers · readiness 80/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • The AI review could not be completed for this change, so the gate is held for a human reviewer rather than passed automatically. It re-evaluates on the next update.

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.
Signal Result Evidence
Code review ✅ No blockers No AI review summary
Linked issue ✅ Linked #2304
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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 113 registered-repo PR(s), 60 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RenzoMXD; Gittensor profile; 113 PR(s), 7 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: RenzoMXD
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 113 PR(s), 7 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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

RenzoMXD added a commit to RenzoMXD/gittensory that referenced this pull request Jul 3, 2026
Switch the denominator from total list entries to active dimensions (one
for wantedPaths, one for preferredLabels). A spec with wantedPaths
containing multiple globs and a candidate matching one of them now
returns 1.0 instead of 0.5, matching the boolean matching semantics.

Add 3 regression tests for multi-entry wantedPaths, multi-entry
preferredLabels, and both-multi-entry-with-match cases.

Resolves the Gittensory Orb Review blocker on PR JSONbored#2787.
loopover-orb[bot]
loopover-orb Bot previously approved these changes Jul 3, 2026

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

RenzoMXD added 3 commits July 3, 2026 11:26
…er weights

Add GoalModelInput and computeLaneFit to packages/gittensory-engine/src/goal-model.ts.
Given a candidate issue's paths/labels and a parsed MinerGoalSpec, returns a
[0, 1] lane-fit score:

- 0 immediately if any candidatePath matches a blockedPath glob (short-circuit,
  mirrors focus-manifest blockedPaths-precedence convention)
- 0 immediately if any candidateLabel matches a blockedLabel (case-insensitive)
- 0 if wantedPaths/preferredLabels are set but neither matches
- 0.5 when wantedPaths and preferredLabels are both empty (neutral default)
- matched-criteria / total-criteria fractional ratio otherwise

Includes a minimal scoped glob helper for path matching — the existing
matchesManifestPath in src/signals/focus-manifest.ts lives outside the engine
package's rootDir, so a self-contained glob matcher is defined here per the
issue's note about the import gap.

Re-exports from packages/gittensory-engine/src/index.ts so the ranker's
laneFit parameter can consume the score via the shared package.

Adds 10 unit tests covering: blockedPath short-circuit, blockedLabel hit,
empty-preferences neutral default, no-match zero, full-match one, partial-match
fraction, path-only and label-only match, case-insensitive label matching.

Closes JSONbored#2304
Switch the denominator from total list entries to active dimensions (one
for wantedPaths, one for preferredLabels). A spec with wantedPaths
containing multiple globs and a candidate matching one of them now
returns 1.0 instead of 0.5, matching the boolean matching semantics.

Add 3 regression tests for multi-entry wantedPaths, multi-entry
preferredLabels, and both-multi-entry-with-match cases.

Resolves the Gittensory Orb Review blocker on PR JSONbored#2787.
@RenzoMXD
RenzoMXD force-pushed the feat/goal-model-miner-goal-spec-2304 branch from 69e3341 to c793f40 Compare July 3, 2026 21:27
Signed-off-by: Renzo <170978465+RenzoMXD@users.noreply.github.com>
@JSONbored
JSONbored merged commit 755499d into JSONbored:main Jul 3, 2026
8 checks passed
RealDiligent added a commit to RealDiligent/gittensory that referenced this pull request Jul 3, 2026
…2824)

Main dropped the export opener in packages/gittensory-engine/src/index.ts
(JSONbored#2787), breaking tsc for every backend PR including this one.

Co-authored-by: Cursor <cursoragent@cursor.com>
JSONbored added a commit that referenced this pull request Jul 3, 2026
…util import (#2855)

Two independently-merged PRs (#2787, #2795) landed a build-breaking
state on main: a spliced-in export block ate the opening brace of the
adjacent contributor-fit re-export (TS1005/TS1109), and governor-ledger.ts
imports node:util under this package's types:[] tsconfig, which never
resolves the module's type declarations. Both broke `tsc --noEmit` and
`build:miner` for every contributor. Replaced isDeepStrictEqual with a
small local structural-equality check scoped to the JSON-safe values this
one call site actually compares.
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-discovery): goal model — translate MinerGoalSpec into ranker weights

2 participants