fix(miner): reject unsafe telemetry metric names#4487
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | fe42405 | Commit Preview URL Branch Preview URL |
Jul 10 2026, 07:01 AM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4487 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 430 430
Lines 38181 38183 +2
Branches 13922 13922
=======================================
+ Hits 35939 35941 +2
Misses 1585 1585
Partials 657 657
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-10 07:17:35 UTC
⏸️ Suggested Action - Manual Review
Review summary Blockers
Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Motivation
JSON.stringify-ed the wholemetricsobject, which preserved unvalidated metric keys and could leak raw repo/issue identifiers or free text intometricsJson.Description
metricNamePatternand updatenormalizeMetricsto validate both metric names and values so keys must be low-cardinality identifier-style names before serialization.normalizeMetricsJSDoc to document that free-text or raw-identifier metric names are rejected and absent metrics normalize to{}./, whitespace, punctuation, empty string or dashed names) are rejected withinvalid_metrics.Testing
npx vitest run test/unit/miner-telemetry.test.ts, and the new/updated tests passed.npm run build:minerandnpm run typecheck, both of which succeeded.npm run test:coveragefor the modified test file; tests passed but coverage remapping failed in this environment withTypeError: jsTokens is not a function.npm run test:ci, but the run did not complete in this environment due to unrelated pre-existing checks (cf-typegenreporting stale runtime types) and annpm auditnetwork error (registry returned 403).Codex Task