Skip to content

fix(track-record): exempt the GitHub login line from the public-field blocklist scan (#6772) - #6865

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:fix/track-record-login-blocklist-6772-v2
Jul 17, 2026
Merged

fix(track-record): exempt the GitHub login line from the public-field blocklist scan (#6772)#6865
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:fix/track-record-login-blocklist-6772-v2

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

renderTrackRecordSummaryMarkdown (packages/loopover-engine/src/track-record-summary.ts) built the full
Markdown block — including the caller-provided - GitHub login: <login> identity line — and then ran
assertPublicSummaryText over the whole thing, which throws if any PUBLIC_FIELD_BLOCKLIST pattern (/\bwallet\b/,
/\breward\b/, /\branking\b/, /\bhotkey\b/, …) matches anywhere.

A hyphen is a legal GitHub username character and a word boundary, so a genuine login like team-wallet,
reward-hunter, or top-ranking matched the blocklist and crashed rendering entirely — no track-record
summary could be produced for that contributor.

The blocklist exists to keep computed private fields (trust score, reward, ranking, wallet/hotkey/coldkey
data) off public surfaces. The login is caller-provided identity, not computed private data, and is already
markdown-escaped. This fix scans only the computed body lines and renders the login line outside the scan:

  • output is byte-identical to before (same header, login, and body lines, same order);
  • fail-closed behavior is preserved — a genuinely-injected blocklisted term in a computed field (e.g. an
    incident label of "trust score leaked") still throws.

Closes #6772

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • 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 a currently open issue this PR resolves (Closes #6772).

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally — the rewritten renderTrackRecordSummaryMarkdown is exercised on every line and branch (disabled early-return; both optional-line conditionals true/false; the assertPublicSummaryText throw path; the login-excluded regression), verified via coverage-final.json. The render path was previously covered only by the engine's node:test, which is outside the Codecov patch measurement — this adds a ROOT vitest suite so the changed lines are measured.
  • engine build + node --test (588 passing, incl. the existing "fails closed if a blocked public field is introduced") + engine-parity:drift-check

If any required check was skipped, explain why:

  • Single engine predicate/render change + its unit test; no UI/OpenAPI/MCP/migration surface, so those checks are N/A to this diff.

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 surface.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A: no API/MCP surface changed.
  • No visible UI changes (backend render helper only), so no UI Evidence section is required.
  • Public docs/changelogs: none needed.

Notes

  • The exemption is identity-line-only: every computed/user-derived field (merge rate, tenure, conduct label, evidence URLs) is still scanned, so this narrows the check to exactly the line that can never be a private-data leak, rather than weakening the safety net.

… blocklist scan (JSONbored#6772)

renderTrackRecordSummaryMarkdown scanned the whole rendered block -- including the caller-provided
`- GitHub login: <login>` identity line -- against PUBLIC_FIELD_BLOCKLIST via assertPublicSummaryText,
which throws on any match. A genuine GitHub username containing a blocklisted word bounded by hyphens
(a legal username character), e.g. "team-wallet", therefore crashed rendering entirely.

The blocklist exists to keep COMPUTED private fields (trust score, reward, ranking, wallet/hotkey/coldkey
data) off public surfaces. The login is caller-provided identity, not computed private data, and is already
markdown-escaped. This scans only the computed body lines, then renders the login line outside the scan --
byte-identical output, fail-closed behavior preserved for a genuinely-injected term in a computed field.

Adds a ROOT vitest suite (the render path was previously covered only by the engine's node:test, which is
outside the Codecov patch measurement) exercising the regression, the still-fails-closed computed-field
case, the disabled-summary early return, and the optional open-ignored / evidence lines.

Closes JSONbored#6772
@real-venus
real-venus requested a review from JSONbored as a code owner July 17, 2026 09:18
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.69%. Comparing base (4b786b1) to head (7ed6328).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6865      +/-   ##
==========================================
+ Coverage   93.64%   93.69%   +0.04%     
==========================================
  Files         685      685              
  Lines       68243    68243              
  Branches    18707    18707              
==========================================
+ Hits        63908    63942      +34     
+ Misses       3350     3304      -46     
- Partials      985      997      +12     
Flag Coverage Δ
shard-1 43.63% <0.00%> (-0.06%) ⬇️
shard-2 36.80% <0.00%> (+0.12%) ⬆️
shard-3 32.78% <100.00%> (+0.07%) ⬆️
shard-4 34.75% <0.00%> (-0.01%) ⬇️
shard-5 31.15% <0.00%> (ø)
shard-6 45.69% <0.00%> (ø)

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

Files with missing lines Coverage Δ
...ckages/loopover-engine/src/track-record-summary.ts 29.45% <100.00%> (+23.28%) ⬆️

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-17 09:34:42 UTC

2 files · 1 AI reviewer · no blockers · readiness 88/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 3 non-blocking
  • nit: track-record-summary.ts is now ~455 lines per the size-smell report; consider whether the render/assert logic is worth splitting out, though this isn't something this narrow fix needs to address.
  • nit: the login itself is never checked against the blocklist even indirectly — if a login exactly equal to a blocklisted term (not just containing one) were of concern, this exemption also lets that through, though that's consistent with the PR's stated intent that login is identity, not computed data.
  • Consider a short comment at the `PUBLIC_FIELD_BLOCKLIST` definition (track-record-summary.ts) cross-referencing that the login line is intentionally exempt, for anyone who edits the blocklist later without re-reading `renderTrackRecordSummaryMarkdown`.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6772
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High 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: 156 registered-repo PR(s), 85 merged, 20 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 156 PR(s), 20 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 156 PR(s), 20 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
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.
🧪 Chat with LoopOver

Ask 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.

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

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 17, 2026
@JSONbored
JSONbored merged commit 4328d08 into JSONbored:main Jul 17, 2026
16 checks passed
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.

Track-record summary throws on a legitimate GitHub login that collides with the safety blocklist

2 participants