Skip to content

feat(planning): reward-risk severity taxonomy, opportunity factors, eligibility gap (#816)#1351

Merged
JSONbored merged 6 commits into
JSONbored:mainfrom
oktofeesh1:feat/816-reward-risk-severity-opportunity
Jun 26, 2026
Merged

feat(planning): reward-risk severity taxonomy, opportunity factors, eligibility gap (#816)#1351
JSONbored merged 6 commits into
JSONbored:mainfrom
oktofeesh1:feat/816-reward-risk-severity-opportunity

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

Implements the three deliverables from issue #816 (fold upstream-inspired advisor/scan ideas into gittensory miner planning):

  • Action severity taxonomyRewardRiskAction now carries severity: "critical" | "warning" | "tip" | "info". critical = score gate is blocked by at least one scoreBlocker; warning = active penalty (cleanup pressure or closed-PR rate); tip = multiplier opportunity; info = planning context / maintainer lane.
  • Opportunity factorsRepoRewardRisk.rewardUpside gains opportunityFactors: { competitionFactor, freshnessFactor }. competitionFactor = ratio of high-risk duplicate clusters to open PRs (0 = open field, 1 = fully contested). freshnessFactor decays exponentially with the age of the most-recently-updated open issue (~1.0 at 0 d, ~0.6 at 7 d, ≤0.05 at 90 d).
  • Eligibility gap viewContributorRewardRiskStrategy gains eligibilityGap: EligibilityGapEntry[] listing contributor repos where landing or withdrawing 1–5 open PRs would flip the open-PR gate toward scoreable, sorted by fewest cleanups needed (≤5 entries).

OpenAPI schema regenerated (ui:openapi). local-branch.ts waitAction updated with the required severity field. Three new test blocks in signals-coverage.test.ts cover both sides of every new branch (cleanupNeeded > 0, hasBlockers, freshness decay, closed-issue exclusion, null-date fallback, eligibility threshold 1–5 vs 0 vs >5).

Scope

  • src/ changes only — no site/, CNAME, or **/lovable/**
  • OpenAPI JSON regenerated and committed
  • No secrets, tokens, wallets, trust scores, or payout values

Validation

  • npm run typecheck — clean
  • npm run test:ci — all 3768 tests pass, exit 0
  • npm run ui:openapi:check — passes (JSON regenerated)

Safety

  • No auth/session/CORS changes
  • No secrets or private scoring values in code, tests, or this PR text
  • close_or_withdraw_low_fit_prs action fires only for contributor (non-maintainer) lane

Closes #816

…ligibility gap (JSONbored#816)

Adds three advisory signals to the miner planning surface:

1. **Action severity** — every `RewardRiskAction` now carries a `severity`
   field (`"critical" | "warning" | "tip" | "info"`) so UIs can triage the
   action list at a glance.  Classification rules:
   - `critical` — score gate is blocked (any `scoreBlocker` present)
   - `warning` — active penalty (cleanup pressure or high closed-PR rate)
   - `tip`     — multiplier opportunity (land PRs, file issues, open new PR)
   - `info`    — planning context (maintainer lane, readiness steps)

2. **Opportunity factors** — `RepoRewardRisk.rewardUpside` gains
   `opportunityFactors: { competitionFactor, freshnessFactor }`.
   `competitionFactor` is the ratio of high-risk duplicate clusters to open
   PRs (0 = open field, 1 = fully contested).  `freshnessFactor` decays
   exponentially with the age of the most-recently-updated open issue
   (~1.0 at 0 d, ~0.6 at 7 d, ~0.05 at 90 d).

3. **Eligibility gap** — `ContributorRewardRiskStrategy` gains
   `eligibilityGap: EligibilityGapEntry[]` listing contributor repos where
   landing or withdrawing 1–5 open PRs would flip the open-PR gate toward
   scoreable, sorted by fewest cleanups needed (up to 5 entries).

OpenAPI schema regenerated; `local-branch.ts` waitAction updated with the
new required `severity` field; full branch-coverage tests added.
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner June 25, 2026 10:11
@dosubot dosubot Bot added the size:M label Jun 25, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (1b7c72c) to head (1def9aa).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1351      +/-   ##
==========================================
+ Coverage   95.42%   95.43%   +0.01%     
==========================================
  Files         193      193              
  Lines       21026    21044      +18     
  Branches     7614     7618       +4     
==========================================
+ Hits        20064    20084      +20     
  Misses        383      383              
+ Partials      579      577       -2     
Files with missing lines Coverage Δ
src/openapi/schemas.ts 100.00% <ø> (ø)
src/signals/local-branch.ts 97.19% <ø> (ø)
src/signals/reward-risk.ts 96.52% <100.00%> (+1.23%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored added gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jun 25, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Screen: ✅ Wanted. #816 is owner-authored, OPEN, gittensor:feature+roadmap; planning signals are core to the maintainer-agent thesis. One coherent subsystem (5 files), real value, low risk. Verdict: MERGE · gittensor:feature. Three deliverables map clause-by-clause to #816, OpenAPI regenerated, both-branch tests, green.

@dosubot dosubot Bot added the lgtm label Jun 26, 2026
@JSONbored
JSONbored merged commit c4a5bb8 into JSONbored:main Jun 26, 2026
16 checks passed
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(planning): fold upstream-inspired advisor/scan ideas into gittensory miner planning

2 participants