fix(registry): agent-resources subnet_count excludes root (netuid 0) - #8464
fix(registry): agent-resources subnet_count excludes root (netuid 0)#8464JSONbored wants to merge 1 commit into
Conversation
/api/v1/agent-resources' summary.subnet_count counted mergedSubnets directly, including root (netuid 0, subnet_type "root") -- base-layer chain infrastructure, not an application subnet. coverage.json already draws this exact distinction via root_subnet_count/application_subnet_count; this is the same off-by-one #8340 fixed in the README's catalog count, just a second independent consumer that drifted the same way. callable_service_count is untouched: root's own surfaces (RPC/WSS endpoints, docs, source repo) are genuinely callable services an agent can use for chain access, so excluding them would be wrong -- only the subnet count itself is off. Closes #8461
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-28 00:08:21 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Decision record
🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8464 +/- ##
=======================================
Coverage 97.81% 97.81%
=======================================
Files 419 419
Lines 29074 29074
Branches 10931 10931
=======================================
Hits 28440 28440
Misses 143 143
Partials 491 491 🚀 New features to boost your workflow:
|
Summary
/api/v1/agent-resources'ssummary.subnet_countreported 129 — it countedmergedSubnets.lengthdirectly, which includes root (netuid 0,subnet_type: "root"). Root is base-layer chain infrastructure, not an application subnet(
registry/subnets/root.json's own notes say so), andcoverage.jsonalready draws this exact distinction via
root_subnet_count/application_subnet_count(128 application subnets). This is the sameoff-by-one #8340 already fixed in the README's catalog count — a second,
independent consumer that drifted the same way, on the AI-agents-facing
surface this time (surfaced by /agents' new stat rail in #8455/#8457).
What changed
scripts/build-artifacts.ts'sagentResourcesContent.summary.subnet_countnow filters
mergedSubnetstosubnet_type !== "root"before counting,mirroring
coverage.json's existingapplication_subnet_countfield.callable_service_countis intentionally untouched: root's own surfaces (17of them — RPC/WSS endpoints, docs, source repo) are genuinely callable
services an agent can use for chain access (the agent-catalog readiness
logic explicitly points agents at
get_best_rpc_endpointfor exactly this),so excluding them from the callable count would be wrong, unlike excluding
root from a "how many subnets" count.
Added a regression assertion in
tests/artifacts.test.tscross-checkingagentResources.summary.subnet_countagainstcoverage.application_subnet_countso the two can't independently drift again.
Registry Safety
Closes #8461)agent-resources.jsonis R2-only — no committedpublic/metagraphartifact to regenerate)Validation
git diff --checknpm run lint— cleannpm run format:check— cleannpm run typecheck— cleannpm run build— succeeds; confirmeddist/metagraph-r2/metagraph/agent-resources.json'ssummary.subnet_countis now128(was129)npm run validate—Validated 129 native subnet(s), 129 curated overlay(s), 3444 surface(s), 136 provider(s), and 2037 candidate(s).npm run validate:schemas/validate:api/validate:openapi— cleannpm run scan:public-safety— cleannpm run test:coverage— 502 files / 12336 tests passed, including the new regression assertionCloses #8461