Skip to content

fix(miner-extension): remove dead discoveryIndexUrl config field - #5343

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor712:fix/miner-extension-remove-dead-discovery-url
Jul 12, 2026
Merged

fix(miner-extension): remove dead discoveryIndexUrl config field#5343
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor712:fix/miner-extension-remove-dead-discovery-url

Conversation

@joaovictor712

Copy link
Copy Markdown
Contributor

Summary

  • apps/gittensory-miner-extension's options page had a "Discovery index URL" field that was saved to chrome.storage.sync and loaded back into loadMinerExtensionSettings()'s return value, but never actually read anywhere downstream — the extension's own README explicitly acknowledged it ("A discovery-index URL can be saved for a future hosted client path; it is not read yet"). Confirmed dead by tracing every reference: background.js's loadIssueOpportunityContext only reads settings.watchedRepos, never settings.discoveryIndexUrl.
  • Per the issue's own guidance ("default to removing it if the hosted discovery plane's fate is still undecided"), removed the field entirely rather than implementing it — the hosted discovery-plane control-plane work is still an open, maintainer-only roadmap epic with no shipped consumer for this URL.
  • Removed from: options.html (input + label), options.js (querySelector, submit-time save, restore-time read), background.js (loadMinerExtensionSettings's storage default/destructure/return), and the README's now-inaccurate paragraph describing it.
  • packages/gittensory-engine/src/discovery-index-contract.ts (an unrelated, real, already-shipped request/response contract for a different "discovery index" concept — the hosted-plane API contract, not the extension's dead URL field) is untouched; confirmed via a full-repo grep that no other reference to the removed discoveryIndexUrl config field remains anywhere.

Fixes #4861

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally — this change lives entirely under apps/gittensory-miner-extension/**, which (like the rest of the miner ecosystem) sits outside vitest's coverage.include glob today, so codecov/patch cannot measure it directly. It is nonetheless fully covered by test/unit/miner-extension-content.test.ts, a root-level test file per house convention.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run build:miner
  • npm run test:miner-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:test
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

Updated test/unit/miner-extension-content.test.ts: removed the now-obsolete discoveryIndexUrl mock keys from the existing loadBackgroundInternals/loadOptionsInternals fixtures, added a regression test asserting no discoveryIndexUrl string remains anywhere in options.html/options.js/background.js (the deliverable's literal acceptance criterion — "no dead, documented-as-dead config fields remaining"), and added an end-to-end save/restore test driving the real options.js submit handler through a chrome.storage.sync mock, asserting the persisted object contains only { watchedRepos } and never a discoveryIndexUrl key. All 11 tests in the file pass (9 pre-existing + 2 new).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no auth/session/CORS surface touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — no public API/OpenAPI/MCP surface change; browser-extension-local chrome.storage field removal only.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — the options page continues to read/write real chrome.storage data; no mock/demo fallback introduced or removed.
  • Visible UI changes include a UI Evidence section below — this is a minor extension-options-page field removal (one <label>/<input> row deleted from a settings form), not a feature requiring visual review; see Notes.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable per CONTRIBUTING.md's intent for UI Evidence (visible feature changes needing visual review) — this PR only removes one dead, never-functional form field from a browser-extension options page; there is no new or changed visible behavior to demonstrate, only a deletion.

Notes

  • Confirmed genuinely dead (not just unused-looking) by tracing the full data flow: options.js saves it → background.js's loadMinerExtensionSettings() loads it → but the only caller, loadIssueOpportunityContext, destructures and uses settings.watchedRepos alone. No other file in the repo reads settings.discoveryIndexUrl or the chrome.storage.sync key.
  • packages/gittensory-engine/src/discovery-index-contract.ts and its DiscoveryIndex* types are a distinct, already-shipped, unrelated concept (the hosted discovery-plane's own request/response API contract) and are untouched by this PR.

The options page saved a "discovery index URL" to chrome.storage.sync
and loaded it back into loadMinerExtensionSettings(), but no code path
ever read it — background.js's loadIssueOpportunityContext only
consumes settings.watchedRepos. The extension's own README already
acknowledged the field as unread. Removed it from options.html,
options.js, and background.js, and updated the README accordingly.
@joaovictor712
joaovictor712 requested a review from JSONbored as a code owner July 12, 2026 14:13
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (23604df) to head (2df1257).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5343      +/-   ##
==========================================
- Coverage   94.40%   94.36%   -0.04%     
==========================================
  Files         550      550              
  Lines       44116    44116              
  Branches    14631    14631              
==========================================
- Hits        41649    41632      -17     
- Misses       1792     1809      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.75% <ø> (-0.26%) ⬇️
shard-2 34.03% <ø> (-0.61%) ⬇️
shard-3 32.18% <ø> (+0.63%) ⬆️
shard-4 31.28% <ø> (-0.14%) ⬇️
shard-5 33.04% <ø> (-0.12%) ⬇️
shard-6 43.63% <ø> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 14:26:03 UTC

5 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR cleanly removes the dead `discoveryIndexUrl` field from the miner extension's options page, options.js, background.js, and README, matching the linked issue #4861's guidance to default to removal when the hosted discovery-plane fate is undecided. The removal is traceable end-to-end: the field is gone from HTML, storage read/write, and settings return value, and no downstream consumer (`loadIssueOpportunityContext`) ever referenced it. New tests directly assert the field's absence and verify the save/restore flow no longer touches it.

Nits — 5 non-blocking
  • The new regression test in test/unit/miner-extension-content.test.ts checks `optionsHtml`/`optionsScript`/`backgroundScript` don't match /discoveryIndexUrl/, which is a reasonable grep-style guard but somewhat redundant with the more behavioral save/restore test right below it — could consolidate.
  • README.md's rewritten sentence reads slightly awkwardly ('When no ranked signal is cached for the current issue, the badge degrades gracefully by staying hidden.') but is factually accurate and fine as-is.
  • Consider squashing the two new test cases (grep-based and behavior-based) into one clearer test if future dead-field removals follow this pattern, to avoid test bloat per removed field.
  • nit: apps/gittensory-miner-extension/options.js:28 keeps the mounted-page branch body flush-left after `else`, which matches the preexisting shape but makes this block harder to scan as it grows.
  • nit: test/unit/miner-extension-content.test.ts:150 uses a broad source-text absence check for `discoveryIndexUrl`; that is useful as a guard, but it can become noisy if a future migration or explanatory comment needs to mention the old key.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #4861
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: 1885 registered-repo PR(s), 1240 merged, 49 issue(s).
Contributor context ✅ Confirmed Gittensor contributor galuis116; Gittensor profile; 1885 PR(s), 49 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: minor — This is a small, well-scoped dead-code removal that closes a specific linked issue but doesn't add new capability or fix a live defect.
Linked issue satisfaction

Addressed
The PR removes the discoveryIndexUrl field from options.html, options.js, and background.js, updates the README to drop the now-inaccurate paragraph, and adds regression tests confirming no reference remains — directly satisfying the issue's stated default preference to remove the dead field.

Review context
  • Author: galuis116
  • 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: 1885 PR(s), 49 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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before / after /
/ mobile before / (mobile) after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 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 the manual-review Gittensor contributor context label Jul 12, 2026
@JSONbored
JSONbored merged commit 181cc0f into JSONbored:main Jul 12, 2026
16 checks passed
JSONbored added a commit that referenced this pull request Jul 13, 2026
…me.storage.sync (#5511)

#5343 removed the discoveryIndexUrl UI field and stopped reading/writing
it, but chrome.storage.sync.set only merges keys -- it never deletes ones
an earlier extension version already synced. Without an active purge, a
value synced before #5343 stays in a user's account indefinitely, which
is a real privacy/data-retention gap #5343 didn't close.

Add removeLegacyDiscoveryIndexUrl(), called from refreshSettings() (which
runs on every options-page load and again at the end of every save), so
any stale value is cleared regardless of which path a user hits first.
Extends the existing dead-field regression test with coverage for the
purge on both load and save.

Also regenerates packages/gittensory-miner/docs/env-reference.md, which
was already stale on main (GITTENSORY_MINER_KILL_SWITCH from #5198/#5500
was never regenerated in) -- unrelated to this fix but required for
miner:env-reference:check to pass in this PR's own CI; also fixed
standalone in #5507.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

Remove or implement the dead discoveryIndexUrl field

2 participants