Skip to content

refactor(signals): shared public-safe redaction module #542

Description

@JSONbored

Parent roadmap: #525
Parent phase: #529

Background

isPublicSafeText is a private local function in src/signals/local-branch.ts (~line 1164, 8 in-file call sites, no external importers). Every new public surface in this wave (extension payloads, notifications, badge, slop reasons, check annotations) needs the same canonical filter.

Goal

Lift it into a shared src/signals/redaction.ts and re-export, with no behavior change.

Current Behavior

The function is not exported; new surfaces would otherwise re-derive the regex and drift.

Desired Behavior

  • New src/signals/redaction.ts exports isPublicSafeText (and a reusable PUBLIC_UNSAFE_PATTERN constant); local-branch.ts imports it. Identical matching behavior.

Implementation Requirements

  • Keep the regex non-global so .test() stays stateless. Update the single import; no call-site behavior change.

Public/Private Output Boundaries

  • This IS the public/private boundary primitive; it must reject wallets/hotkeys/rewards/raw trust/farming + local filesystem paths exactly as today.

Acceptance Criteria

  • All existing local-branch redaction tests stay green; the function is importable by other modules.

Testing Requirements

  • npm run test:ci, 97%+ coverage. Move/keep the redaction unit tests against the shared module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions