signals
signals ¶
Signal
dataclass
¶
A regex-based signal pattern used in the scoring pipeline.
Signals are matched against transcript text via re.search. Each match
contributes weight to the cumulative score. Use negative weights to
suppress false positives.
Example
Signal(pattern=r"retry", weight=2, flags=re.IGNORECASE)
Signals
dataclass
¶
Bundle of signal patterns with a scoring threshold.
When a bare list[Signal] is passed to a primitive, resolve_signals
wraps it with threshold=1 — meaning any single signal match triggers.
Pass a higher threshold to require multiple signals to fire together.
transcript_texts ¶
Extract text from recent transcript messages for signal scoring.
For UserPromptSubmit events, returns just the user prompt.
Otherwise returns .text from the last window messages.
cite_message ¶
Append trigger context to a message when signal matches are found.
resolve_signals ¶
Normalize signals input into a Signals bundle, or None.
A bare list[Signal] is wrapped with threshold=1 (any single match triggers).