Skip to content

feat(miner-extension): add read-only issue-page opportunity badge #4308

Description

@JSONbored

Depends on the browser extension scaffold (sibling Phase 6 issue, apps/gittensory-miner-extension/) landing first.

The score to surface already exists as a pure function: packages/gittensory-miner/lib/opportunity-ranker.js's rankCandidateIssues/rankCandidateIssuesWithSummary (:104-118) compose the deterministic engine ranker (rankMetadataOpportunities from @jsonbored/gittensory-engine) over normalized candidates and return a ranked list. This badge surfaces that same signal directly on a GitHub issue page — read-only, matching the Phase 1 design principle already written down in packages/gittensory-miner/docs/cross-repo-discovery-phase1.md's Acceptance section (:50-55): "Read-only... every deliverable in this Phase 1 batch performs GET/list/search only; no GitHub writes." The badge displays a precomputed or locally-computed rank/tier; it does not claim, comment, or otherwise act on the issue.

Mechanically, this is the same content-script-overlay pattern the existing (differently-scoped) apps/gittensory-extension/content.js already uses on GitHub pages — path-matching via a small regex against location.pathname (matchGitHubPageTarget), then mounting a DOM node into the page, falling back to a floating position if the expected sidebar host isn't found (mountOverlay). That pattern is directly reusable here even though the product/audience differs (see the scaffold issue for that distinction).

Deliverables

  • A content script matching GitHub issue pages that mounts a small badge (score/tier + a short "why") without needing GitHub write access.
  • Reads the ranked-candidate signal via whatever local/hosted data path the badge has available — for a laptop-mode install, likely calling into opportunity-ranker.js's exports through the extension's background script (not duplicating the ranking math in extension code); if only the hosted discovery-index (Phase 6 discovery-plane issues) is available in a given install, degrade gracefully rather than erroring.
  • No autonomous action from the badge — read-only, consistent with cross-repo-discovery-phase1.md's Acceptance criteria.
  • Handle the "no signal available" case (repo not tracked / not ranked yet) by omitting the badge rather than showing a broken or misleading one.

References

  • packages/gittensory-miner/lib/opportunity-ranker.js:104-118 (rankCandidateIssues, rankCandidateIssuesWithSummary) — the scoring signal this badge surfaces.
  • packages/gittensory-miner/docs/cross-repo-discovery-phase1.md:50-55 (Acceptance section) — the read-only boundary this badge must respect.
  • apps/gittensory-extension/content.js:1-19 (matchGitHubPageTarget, mountOverlay) — the mechanical DOM-mount pattern to reuse (different product, same mechanism).
  • Sibling Phase 6 issue: feat(miner-extension): scaffold browser extension surface — hard dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions