Skip to content

test(miner-plan): adversarial redaction/allowlist test suite for the prompt-packet builder #2321

Description

@JSONbored

The prompt-packet builder (sibling issue) is the single membrane deciding what reaches a coding agent, so it deserves an adversarial test suite beyond the builder issue's own happy-path tests — every unsafe-term family in PUBLIC_UNSAFE_TERMS (src/signals/redaction.ts:23) individually, plus combinations, plus the local-path patterns. This is a mechanical, test-only, zero-design-risk task that hardens an already-built module — good for a focused first contribution once the builder lands.

Deliverables

  • test/unit/prompt-packet-redaction.test.ts — parametrized over EVERY term family in PUBLIC_UNSAFE_TERMS (reward, score, wallet, hotkey, coldkey, mnemonic, payout, ranking, farming, raw-trust, trust-score, private-reviewability, reviewability) injected into each of the packet's four text fields individually
  • Local-path injection tests for every prefix in PUBLIC_LOCAL_PATH_INLINE (/Users/, /home/, /var/, /opt/, /tmp/, Windows C:\Users\... form) — confirm each is stripped/rejected
  • A "double jeopardy" test: an unsafe term AND a local path in the SAME field (confirms both filters apply, not just the first one that matches)
  • A regression test asserting a field with ZERO unsafe content is byte-identical after passing through the builder (confirms the filter doesn't over-redact clean text)
  • Depends on: the prompt-packet-builder issue above

References

  • src/signals/redaction.ts:23 (PUBLIC_UNSAFE_TERMS — enumerate every term family from this exact regex source, don't hand-copy a possibly-stale list)
  • src/signals/redaction.ts:33 (PUBLIC_LOCAL_PATH_INLINE — enumerate every path prefix from this exact regex source)
  • Depends on: the metadata-only prompt-packet-builder issue above (packages/gittensory-engine/src/prompt-packet.ts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions