Skip to content

Fix bare-word hotkey/coldkey false positives in containsSecretLikeText + static-message redaction bug #7981

Description

@JSONbored

Implements #7980.

Problem

containsSecretLikeText (src/review/content-lane/registry-logic.ts:101) matches the bare words hotkey/coldkey anywhere in a JSON-stringified subnet/provider document, with no adjacency/context requirement — unlike wallet, which is correctly scoped to the phrase "wallet path". In the Bittensor/Gittensor domain "hotkey" is the standard public miner identifier, not secret material, and appears routinely in legitimate registry content (API paths like /miners/hotkey/{hotkey}, field names like miner_hotkey, even explicit denials like "No wallet/hotkey data"). Confirmed root cause of 4 mis-closed metagraphed PRs in one day (#7469, #7589, #7591, #7594 — filed against JSONbored/metagraphed), 3 of which remain incorrectly closed. Because assessSubnetDocument scans the WHOLE file (not just the diff), any future PR touching an already-affected file is permanently blocked until this ships.

Separately: the blocker text rendered to contributors/maintainers reads "...secret, [context], PAT..." instead of "...secret, wallet, PAT..."PRIVATE_FORBIDDEN_TERMS's scrub (src/review/unified-comment-bridge.ts:80, mirrored in src/rules/advisory.ts's CHECK_RUN_FORBIDDEN_TERMS) is being applied to a static, hardcoded, non-dynamic message template, not just AI-generated text, degrading the bot's own explanation of what it found.

Area

src/review/content-lane/registry-logic.ts (secret scanner); src/review/unified-comment-bridge.ts + src/rules/advisory.ts (public-text redaction).

Proposal

Deliverables

  • Passing fix + tests in registry-logic.ts and the redaction path.
  • A short note on which repos/files were affected repo-wide (any other subnet file matching the old pattern), so a targeted sweep can confirm no other files are silently blocked.

Resources

Boundaries

Scoped to this exact regex bug and the redaction bug. Does not touch the broader self-correction architecture (sub-issues 2-6 of #7980).

maintainer-only — security/content-lane logic, not contributor-scoped.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions