Skip to content

refactor(rebrand): consolidate and rename hardcoded User-Agent literals - #5445

Merged
JSONbored merged 1 commit into
mainfrom
loopover/user-agent-consolidation
Jul 12, 2026
Merged

refactor(rebrand): consolidate and rename hardcoded User-Agent literals#5445
JSONbored merged 1 commit into
mainfrom
loopover/user-agent-consolidation

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Add PRODUCT_USER_AGENT in src/github/client.ts as the single shared constant for the 16 sites across src/ that had each independently drifted their own copy of the same outbound User-Agent literal (gittensory/0.1), fixing the maintainability gap githubHeaders()'s own doc comment already claimed was solved.
  • Rename the remaining distinct-purpose User-Agent literals to their loopover-* equivalents: miner (packages/gittensory-miner/lib/*.js, 7 sites), api, selfhost (x2), content-lane, orb (brand prefix only — the -orb codename suffix is deliberately untouched pending the still-open ORB-naming question), production-smoke, mcp-release-watch.
  • Update 3 stale test assertions that pinned the old literals.
  • Deliberately left untouched: x-gittensory-cache/x-gittensory-request-id header names (different header, different concern), .gittensory-ams.yml/.gittensory.yml config filenames, config-directory paths, CLI bin-command references, and any packages/gittensory-miner npm package path — all tracked by their own separate rebrand issues.

Closes #5335

Test plan

  • npm run typecheck clean
  • npm run test:ci green (772/774 files passed, 2 pre-existing skips; one single-flight coalescing test flaked once under full parallel load, confirmed passing standalone and on a clean re-run — unrelated to this change)
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Rebased onto latest origin/main, no conflicts
  • No generated artifacts require regeneration (no API/schema, wrangler binding, or env.* changes)

Introduce PRODUCT_USER_AGENT in src/github/client.ts as the single shared
constant for the 16 sites that had independently drifted their own copy of
the same outbound User-Agent literal, fixing the maintainability gap the
existing githubHeaders() doc comment already claimed was solved. Rename
the remaining distinct-purpose gittensory-* User-Agent literals (miner,
api, selfhost, content-lane, orb, production-smoke, mcp-release-watch) to
their loopover-* equivalents, leaving unrelated look-alike identifiers
(cache-replay header, config directory paths, CLI bin-command references,
package/config filenames) untouched since each is tracked by its own
separate rebrand issue.

Closes #5335
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 8ebb953 Commit Preview URL

Branch Preview URL
Jul 12 2026, 07:48 PM

@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.46%. Comparing base (156b382) to head (8ebb953).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5445   +/-   ##
=======================================
  Coverage   94.46%   94.46%           
=======================================
  Files         554      554           
  Lines       44426    44427    +1     
  Branches    14663    14663           
=======================================
+ Hits        41967    41968    +1     
  Misses       1784     1784           
  Partials      675      675           
Flag Coverage Δ
shard-1 44.11% <55.55%> (+<0.01%) ⬆️
shard-2 34.76% <22.22%> (+<0.01%) ⬆️
shard-3 31.59% <33.33%> (+<0.01%) ⬆️
shard-4 31.41% <33.33%> (+<0.01%) ⬆️
shard-5 33.28% <44.44%> (+<0.01%) ⬆️
shard-6 43.37% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/ams-policy.js 96.96% <100.00%> (ø)
packages/gittensory-miner/lib/ci-poller.js 95.87% <ø> (ø)
packages/gittensory-miner/lib/laptop-init.js 98.27% <ø> (ø)
...ckages/gittensory-miner/lib/live-issue-snapshot.js 100.00% <ø> (ø)
...ackages/gittensory-miner/lib/opportunity-fanout.js 89.93% <ø> (ø)
...ages/gittensory-miner/lib/pr-disposition-poller.js 96.61% <ø> (ø)
packages/gittensory-miner/lib/rejection-signal.js 100.00% <100.00%> (ø)
...ckages/gittensory-miner/lib/self-review-context.js 97.80% <100.00%> (ø)
src/auth/github-oauth.ts 95.04% <ø> (ø)
src/github/backfill.ts 97.22% <ø> (ø)
... and 19 more
🚀 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 added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-12 19:54:54 UTC

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

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): scripts/check-mcp-release-due.mjs (matched scripts/**), scripts/smoke-production.mjs (matched scripts/**), src/auth/github-oauth.ts (matched src/auth/**), src/github/backfill.ts (matched src/github/backfill.ts), src/review/content-lane/netuid-verification.ts (matched src/review/**), and 7 more.

Review summary
This is a mechanical rename/consolidation of hardcoded User-Agent literals into a single PRODUCT_USER_AGENT constant (for the generic 16-site case) plus systematic gittensory->loopover renames for service-specific variants (miner, api, selfhost, orb, content-lane, etc.), with 3 test assertions updated to match. The diff is internally consistent — every changed literal has a corresponding import/definition, CI is green, and the change closes #5335 as described. It's a low-risk, well-scoped rebrand chore with no behavioral change beyond the wire-visible User-Agent string value.

Nits — 8 non-blocking
  • src/github/client.ts: the new PRODUCT_USER_AGENT doc comment's '~16 sites' count will drift as more call sites are added/removed; consider dropping the specific number or phrasing it as approximate only (already is, but flagged since the brief calls out the magic number).
  • packages/gittensory-miner/lib/*.js (7 sites): each file duplicates its own local `githubHeaders`/inline user-agent string ('loopover-miner') rather than sharing one constant the way src/github/client.ts now does for the generic case — consider a small shared constant in this package too, though this is consistent with the PR's stated non-goal of touching package boundaries.
  • The PR touches 31 source files for a single-string rename; low test delta (+3 lines) is appropriate since only the value of a string literal changed and existing tests already assert header shapes, but worth confirming no other test elsewhere snapshots the old literal outside the 3 files touched.
  • Consider adding a lint rule or grep-based CI check that fails if a hardcoded 'gittensory' User-Agent literal reappears in src/, to prevent the exact drift this PR fixes from recurring (mirrors the intent of the githubHeaders() doc comment mentioned in the description).
  • If a follow-up rebrand PR touches packages/gittensory-miner, consider extracting the repeated `loopover-miner` literal into one shared constant analogous to PRODUCT_USER_AGENT.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5335
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: 44 registered-repo PR(s), 36 merged, 457 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 457 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ⚠️ ℹ️ None detected risk: low · value: none — No structural-improvement signals were detected for this PR. LLM value judgment: minor — The diff is a straightforward, correctly-scoped literal-rename/consolidation with no logic changes, closing a linked issue, so it moves the codebase forward but only in a small, mechanical way.
Linked issue satisfaction

Partially addressed
The PR successfully introduces a shared PRODUCT_USER_AGENT constant and updates nearly all ~33 listed call sites (including github/*, auth, review/*, selfhost, miner package, and scripts) to import/derive from shared constants, satisfying the bulk of the refactor. However, it explicitly violates the issue's boundary by changing src/orb/app-auth.ts and src/orb/relay.ts from 'gittensory-orb/0.1' to

Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 457 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
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

🟩 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 cc9080a into main Jul 12, 2026
20 checks passed
@JSONbored
JSONbored deleted the loopover/user-agent-consolidation branch July 12, 2026 20:09
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate and rename hardcoded User-Agent header literals

1 participant