symfonic.agent.middleware.citation_default¶
citation_default ¶
Citation hygiene by default for the public Agent.
The legacy engine strips HMS layer tags ([semantic], [episodic], …)
from every user-visible reply. The public Agent returns the raw model
reply; presentation stays opt-in. CitationDefaultMiddleware is the
default-wire vehicle: wrap once and run/stream return presented text
through the parity-tested present_response/HoldBackStream path, so no
new tag pattern is introduced and the differential tests in
tests/agent/presentation/ keep covering the strip.
Wrapping anything that is not exactly the public Agent refuses at
construction. A mis-wrapped object would silently pass raw text through,
which is the failure this module exists to prevent.
CitationDefaultMiddleware ¶
Bases: PresentedAgent
An Agent whose turns ship with citation hygiene applied.
Identical output contract to :class:PresentedAgent; the only addition
is the construction refusal, which makes an unwired composition a loud
error instead of a tag leak.