Skip to content

fix(signals): sync extension overlay redaction with canonical PUBLIC_UNSAFE_TERMS - #6119

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix-signals-extension-forbidden-terms
Jul 15, 2026
Merged

fix(signals): sync extension overlay redaction with canonical PUBLIC_UNSAFE_TERMS#6119
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix-signals-extension-forbidden-terms

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Closes #5840.

FORBIDDEN_EXTENSION_TERMS in src/signals/extension-contributor-context.ts (the browser-extension overlay's defense-in-depth scrubber) had drifted from the canonical PUBLIC_UNSAFE_TERMS in src/signals/redaction.ts, letting these economic-identity terms reach the contributor overlay unredacted: bare cohort, bare ranking, miner-originated/human-originated, and standalone reviewability.

Change

  • Extended the regex with cohort\w*, ranking\w*, miner[-_\s]?originated, human[-_\s]?originated, and bare reviewability — matching PUBLIC_UNSAFE_TERMS's own [-_\s]? separator convention. The compound reviewability/ranking alternatives stay ordered before the bare words so "reviewability internals" / "private reviewability" / "private rankings" still redact as a whole.
  • Strictly additive — no existing term removed or narrowed; redactExtensionText's "[redacted]" + whitespace-collapse behavior and its call sites are unchanged. Kept hand-synced (no import) so the module stays cycle-free.

Tests

  • Regression cases asserting each of the four previously-leaking strings from the issue now redacts.
  • A drift-guard test that walks a representative sample of PUBLIC_UNSAFE_TERMS and asserts each is also scrubbed by redactExtensionText, so the two vocabularies can't silently diverge again. Bare score is the one documented, intentional exception (this surface returns readiness as public bands; redaction.ts itself records sibling surfaces that deliberately don't redact bare score).
  • Updated the test's own local leak-check regex, which had the same gaps.

Validation

  • Full extension-contributor-context.test.ts suite passes locally (17 tests).
  • The only changed source line is the regex const (covered on import → 100% patch coverage); verified with vitest --coverage. No other file imports these helpers, so no cross-cutting breakage.

…UNSAFE_TERMS

FORBIDDEN_EXTENSION_TERMS in extension-contributor-context.ts had drifted from
src/signals/redaction.ts's canonical PUBLIC_UNSAFE_TERMS, letting bare cohort,
bare ranking, miner-originated/human-originated, and standalone reviewability
reach the contributor overlay unredacted. Extend the pattern to cover them
(matching PUBLIC_UNSAFE_TERMS's [-_\s]? separator on the originated pair, and
keeping the compound reviewability/ranking terms ordered so they still match as
a whole). Strictly additive -- no existing term removed or narrowed, and
redactExtensionText's replacement behavior is unchanged. Adds regression tests
for each newly-covered term plus a drift-guard test that fails if the two
vocabularies diverge again (bare score stays the one documented, band-gated
exception).

Closes JSONbored#5840
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 15, 2026 10:10
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.31%. Comparing base (6c9154a) to head (4ca475e).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6119      +/-   ##
==========================================
+ Coverage   95.24%   95.31%   +0.06%     
==========================================
  Files         595      595              
  Lines       47096    47097       +1     
  Branches    15030    15030              
==========================================
+ Hits        44858    44890      +32     
+ Misses       1493     1476      -17     
+ Partials      745      731      -14     
Flag Coverage Δ
shard-1 43.97% <100.00%> (-0.06%) ⬇️
shard-2 36.64% <100.00%> (+0.01%) ⬆️
shard-3 32.13% <100.00%> (+0.05%) ⬆️
shard-4 33.26% <100.00%> (-0.52%) ⬇️
shard-5 31.47% <100.00%> (-0.19%) ⬇️
shard-6 44.87% <100.00%> (+0.33%) ⬆️

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

Files with missing lines Coverage Δ
src/signals/extension-contributor-context.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-15 10:21:05 UTC

2 files · 1 AI reviewer · no blockers · readiness 100/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
  • test/unit/extension-contributor-context.test.ts: the drift-guard's `intentionalExceptions` set only contains 'public score', so if PUBLIC_UNSAFE_TERMS ever gains another sibling-surface exception it will silently fail rather than documenting the new exception explicitly.
  • Consider extracting the shared `[-_\s]?` separator convention into a small local regex-building helper shared conceptually with redaction.ts's docstring, even though the modules intentionally stay import-free, to make future manual syncs less error-prone.
  • The large comment block above FORBIDDEN_EXTENSION_TERMS is helpful but could reference the specific PUBLIC_UNSAFE_TERMS line/export name for faster manual diffing next time.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5840
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: 142 registered-repo PR(s), 94 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 142 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Rust
  • Official Gittensor activity: 142 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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://gittensory.aethereal.dev/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 d3bc79e into JSONbored:main Jul 15, 2026
15 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.

fix(signals): extension overlay's forbidden-term redaction has drifted from the canonical PUBLIC_UNSAFE_TERMS vocabulary

1 participant