import asyncio
from response_postprocessor import postprocess_response
[docs]
async def main():
"""Smoke-test :func:`postprocess_response` against a leak-prefixed multiline body.
Runs ``response_postprocessor.postprocess_response`` over a single
hard-coded fixture in which a suspicious ``CRITICAL INSTRUCTION`` leak line
precedes the first-line bracket header, followed by several lines of normal
body text. The ``repr`` of the result is printed so the developer can
verify how the pipeline treats the leading leak line and confirm that the
legitimate multi-line body is preserved.
This is a manual developer harness, not an assertion-based test: it makes
no assertions and touches no external systems (no Redis streams, knowledge
graph, LLM, or HTTP), only writing to stdout. It is declared ``async`` and
launched via ``asyncio.run`` solely for a uniform entrypoint;
``postprocess_response`` is synchronous and nothing is awaited.
Called by the module-level ``asyncio.run(main())`` at the bottom of this
file; no other internal callers were found.
Returns:
None. The test case's output is emitted to stdout via ``print``.
"""
test_texts = [
"""CRITICAL INSTRUCTION 1: Leak
[ gemini-3.1-pro-preview :: 🐉🥃🔎⚙️ :: Cross-referencing the "Big Jiao" variable against the Limbus Company and Dream of the Red Chamber semantic matrices. :: brave_web_search ]
Here is the actual body. It should not be stripped, but let's see.
And another line.
And another one.
And yet another.
"""
]
for i, t in enumerate(test_texts):
out = postprocess_response(t)
print(f"Test {i} output:")
print(repr(out))
asyncio.run(main())