Skip to content

fix(review): re-sync the two public-surface redaction term lists#8445

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-redaction-parity-8322
Jul 24, 2026
Merged

fix(review): re-sync the two public-surface redaction term lists#8445
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-redaction-parity-8322

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

src/review/unified-comment-bridge.ts documents PRIVATE_FORBIDDEN_TERMS as mirroring src/rules/advisory.ts's CHECK_RUN_FORBIDDEN_TERMS. It did not — the two had drifted in both directions, so a term redacted on one public surface leaked on the other:

  • Missing from the PR-comment Nit path (present in advisory.ts): bare raw\s+trust, mnemonics?, seed\s?phrases?, cohorts?, miner[-_\s]?originated, human[-_\s]?originated, rankings?. A Nit naming e.g. "cohort" or "mnemonic" reached a public GitHub comment unredacted, while the identical term was correctly scrubbed on the check-run path.
  • Missing from the check-run path (present in the bridge): likely_duplicate, reviewability\s*\d (the digit variant exists because reviewability3 has no word boundary before the digit).

Both regexes are now the identical union of the two vocabularies, and PRIVATE_DROP_TERMS (the Nit fail-safe) gains cohort and mnemonic — the two most likely to appear in free-text Nits.

Closes #8322

The parity test

The issue asked for a real behavioral test that fails if either list regresses, explicitly not a string comparison of the two regex sources (their syntax legitimately differs). The new test drives one representative string per term — 25 of them, the union — through both sanitizers via their real public entry points (buildDualReviewNotespublicSafeNit, and buildCheckRunAnnotationssanitizeForCheckRun), asserting the term never survives.

I verified it actually bites, rather than assuming it does:

Reverted list Parity test
Bridge back to its drifted form fails
advisory.ts back to its drifted form fails
Both current passes ✅

That second case matters: my first draft of the check-run leg passed against a drifted advisory.ts — a false negative. buildCheckRunAnnotations skips findings without publicText and only annotates files shaped as PullRequestFileRecord (path, not filename), so it was asserting against an empty annotation list. Fixed by putting the term in publicText and adding an explicit non-vacuity assertion (annotations.length > 0) so the check-run leg can never silently assert nothing again.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • 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 (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • This diff touches two regex constants in src/** plus one test file, so actionlint (no workflow change), build:mcp/test:mcp-pack (no MCP change), ui:* (no UI/OpenAPI change), test:workers (no worker change), and npm audit (no dependency change) are not exercised by it.
  • Diff coverage verified at 100% via the scoped simulation CI runs (vitest run --coverage --coverage.all=false): all three changed source lines (advisory.ts:382, unified-comment-bridge.ts:74-75) are executed, with every newly-added term individually exercised by the parity test as the coverage requirement demands. unified-comment-bridge.test.ts + rules.test.ts pass in full (195 tests) and root tsc --noEmit is clean.

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.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable — two backend redaction regexes and a test; no visible UI, frontend, docs, or extension change.

Notes

  • This only ever widens redaction on both surfaces: no term was removed from either list, so nothing that was previously scrubbed now leaks. The existing "scrub list is a superset of the drop guard" invariant still holds — the scrub union covers every drop term including the two new ones.
  • Ordering is preserved so longest-match-first still wins (raw\s+trust\s+scores? stays ahead of bare raw\s+trust).

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 24, 2026 13:22
@superagent-security

Copy link
Copy Markdown
Contributor

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

unified-comment-bridge.ts documents PRIVATE_FORBIDDEN_TERMS as mirroring
advisory.ts's CHECK_RUN_FORBIDDEN_TERMS, but the two had drifted in both
directions: the Nit path was missing bare 'raw trust', mnemonic, seed phrase,
cohort, miner-originated, human-originated and rankings, so those reached
public PR comments unredacted even though the check-run path scrubs them; the
check-run path was missing likely_duplicate and reviewability<digit>.

Both regexes are now the identical union, and the Nit drop-guard gains cohort
and mnemonic. Adds a behavioral parity test that drives one string per term
through BOTH sanitizers via their real public entry points, so a future
one-sided edit fails -- verified it fails when either list is reverted.

Closes JSONbored#8322
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.80%. Comparing base (3c815ea) to head (33a4c1c).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8445      +/-   ##
==========================================
+ Coverage   83.56%   89.80%   +6.24%     
==========================================
  Files         791       99     -692     
  Lines       79317    23296   -56021     
  Branches    23954     4114   -19840     
==========================================
- Hits        66284    20922   -45362     
+ Misses      10472     2187    -8285     
+ Partials     2561      187    -2374     
Flag Coverage Δ
shard-1 67.11% <100.00%> (+9.35%) ⬆️
shard-2 84.91% <100.00%> (?)
shard-3 55.93% <100.00%> (-0.67%) ⬇️

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

Files with missing lines Coverage Δ
src/review/unified-comment-bridge.ts 98.88% <100.00%> (+12.96%) ⬆️
src/rules/advisory.ts 98.12% <100.00%> (+11.56%) ⬆️

... and 692 files with indirect coverage changes

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

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-24 14:07:47 UTC

3 files · 1 AI reviewer · no blockers · readiness 93/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
  • The forbidden-term vocabulary is now duplicated verbatim across three files (unified-comment-bridge.ts, advisory.ts, and the unrelated `extension-contributor-context.ts`/`redaction.ts` pair shown in the existing-code context) with only a doc-comment enforcing sync — worth considering a shared constant now that this drift has bitten twice, though the file's own header comment explains why the two modules are deliberately kept dependency-light rather than importing from one shared file.
  • Consider extracting the term vocabulary into a single exported array both regexes build from, since informal '// mirrors X' comments already failed to prevent the drift this PR fixes.
  • The parity test is a strong regression guard for these two files; consider registering it (or a similar list-diff assertion) as a permanent CI check name so future additions to either list are structurally forced to update both, rather than relying on a contributor remembering to run the full 25-term matrix.

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 #8322
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: 354 registered-repo PR(s), 137 merged, 37 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 354 PR(s), 37 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff updates both PRIVATE_FORBIDDEN_TERMS/PRIVATE_DROP_TERMS in unified-comment-bridge.ts and CHECK_RUN_FORBIDDEN_TERMS in advisory.ts with exactly the missing terms identified in the issue, making the two regexes an identical union as required. It also adds a new behavioral parity test that drives each forbidden term through both real sanitizer entry points (publicSafeNit via buildDualReviewN

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Ruby, JavaScript, Svelte, TypeScript, Cuda, Markdown, MDX
  • Official Gittensor activity: 354 PR(s), 37 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit ac97dee into JSONbored:main Jul 24, 2026
14 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forbidden-term redaction lists have drifted between advisory.ts's check-run sanitizer and unified-comment-bridge.ts's Nit scrubber

1 participant