Skip to content

feat(engine): add opportunity freshness scorer#2730

Closed
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/engine-opportunity-freshness
Closed

feat(engine): add opportunity freshness scorer#2730
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/engine-opportunity-freshness

Conversation

@kiannidev

@kiannidev kiannidev commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add computeOpportunityFreshness to @jsonbored/gittensory-engine for the ranker freshness signal documented by opportunity-ranker.
  • Mirror the decay curve from src/signals/reward-risk.ts with an injected nowMs clock so the engine stays pure and testable.
  • Export the helper from the engine barrel with unit coverage.

Test plan

  • npm test --workspace @jsonbored/gittensory-engine
  • CI green on upstream

Expose a pure computeOpportunityFreshness helper with an injected clock so miners can derive the ranker freshness signal without importing reward-risk IO.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 08:43:40 UTC

3 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The change adds a pure `computeOpportunityFreshness` helper, exports it from the engine barrel, and covers the main decay/no-open/malformed timestamp cases. The core math is small and consistent with the documented [0.05, 1] open-issue freshness factor, with non-finite clocks failing closed to 0. The main gap is test-contract coverage: the new export is not exercised through the public barrel even though this package’s existing tests use that pattern for public APIs.

Nits — 6 non-blocking
  • nit: `packages/gittensory-engine/test/opportunity-freshness.test.ts:4` imports `../dist/opportunity-freshness.js`, so the new barrel export in `packages/gittensory-engine/src/index.ts:33` is not directly covered; import from `../dist/index.js` or add a small barrel smoke assertion.
  • nit: `packages/gittensory-engine/src/opportunity-freshness.ts:31` compares `state` to exactly `"open"`; normalize with `toLowerCase()` if this helper may receive API-shaped states rather than already-normalized engine records.
  • nit: `packages/gittensory-engine/src/opportunity-freshness.ts:33` treats an empty `updatedAt` string as fresh instead of falling back to `createdAt`, because `??` does not skip `""`; confirm callers never pass empty strings or normalize blank timestamps before scoring.
  • In `packages/gittensory-engine/test/opportunity-freshness.test.ts`, import `computeOpportunityFreshness` from `../dist/index.js` so the public engine API contract is tested like `opportunity-ranker.test.ts` already does.
  • In `packages/gittensory-engine/src/opportunity-freshness.ts`, consider a small timestamp picker that treats blank strings as missing before applying `updatedAt` over `createdAt`.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (no linked issue context).
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: 1626 registered-repo PR(s), 796 merged, 49 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1626 PR(s), 49 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: kiannidev
  • 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: 1626 PR(s), 49 issue(s).
  • Related work: Titles/paths share 10 meaningful terms. (issue #2280, issue #2278)
  • Related work: Titles/paths share 10 meaningful terms. (issue #2280, issue #2281)
  • Related work: Titles/paths share 10 meaningful terms. (issue #2278, issue #2281)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Explain no-issue PR.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
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 added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 3, 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.

Closing:

The main gap is test-contract coverage: the new export is not exercised through the public barrel even though this package’s existing tests use that pattern for public APIs.

@JSONbored JSONbored closed this Jul 3, 2026
@kiannidev
kiannidev deleted the feat/engine-opportunity-freshness branch July 3, 2026 12:40
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.

2 participants