Spaces:
Sleeping
Sleeping
File size: 3,008 Bytes
994efe1 8745cf0 994efe1 2e7ba3e 994efe1 f142e73 994efe1 926dae2 7f832a3 2497bd9 926dae2 994efe1 926dae2 994efe1 926dae2 994efe1 7f832a3 926dae2 7f832a3 926dae2 994efe1 7f832a3 994efe1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | import random
# Templates designed to sound like technical complaints/discussions.
# placeholders {} will be filled with words from our WORDLIST.
# CRITICAL: The "filler" text must NOT contain any words from WORDLIST.
# WORDLIST includes: hardware, layer, error, flag, optimize, latency, performance, function, etc.
TEMPLATES = [
"Honestly, I think the {} is causing the lag.",
"Did you check if the {} configures the {} correctly?",
"The documentation for {} says it depends on {} but that seems wrong.",
"My readout is showing a weird fault in the {} tier.",
"Why does the {} always break when I touch the {}?",
"It is basically a {} issue, not an equipment problem.",
"I rewrote the {} to improve the {} usage.",
"The new update deprecated the {} behavior.",
"Can we talk about how bad the {} support is?",
"Just use a {} wrapper around the {} and it should work.",
"The {} velocity is bottlenecked by the {}.",
"I suspect the {} is conflicting with the {}.",
"Is there a reason the {} is not compatible with {}?",
"The {} implementation in this project is terrible.",
"Make sure to enable the {} toggle before running the {}.",
]
# Simple Markov-like tech jargon generator
# This makes the text look like a "stream of consciousness" from a bot.
CONNECTORS = [
"Essentially,", "Basically,", "Actually,", "Honestly speaking,",
"Regarding the issue,", "Concerning the spec,", "With respect to the logs,",
"Even if we ignore that,", "Unless the setup is wrong,"
]
def generate_stealth_text(payload_words):
"""
Wraps payload words into a rambling pseudo-technical stream.
"""
result = []
i = 0
# We use a mix of templates and connectors to build a "paragraph"
while i < len(payload_words):
sentence_parts = []
# 30% chance of using a connector prefix
if random.random() < 0.3:
connector = random.choice(CONNECTORS)
sentence_parts.append(connector)
tmpl = random.choice(TEMPLATES)
slots = tmpl.count("{}")
if i + slots > len(payload_words):
single_slot_templates = [t for t in TEMPLATES if t.count("{}") == 1]
tmpl = random.choice(single_slot_templates)
slots = 1
chunk = payload_words[i : i+slots]
i += slots
filled_template = tmpl.format(*chunk)
# Grammar fix: If we have a connector, lowercase the template (unless it starts with 'I' or proper noun)
if sentence_parts:
first_word = filled_template.split()[0]
if first_word not in ["I", "My", "Did", "Is", "Why"]: # Keep these capped usually
# Lowercase the first letter
filled_template = filled_template[0].lower() + filled_template[1:]
sentence_parts.append(filled_template)
result.append(" ".join(sentence_parts))
return " ".join(result) |