Skip to main content

Module ttsr

Module ttsr 

Source
Expand description

Time-Traveling Stream Rules engine. TTSR (Time-Traveling Stream Rules) engine.

Monitors streaming model output against project rules. When a rule is violated, the stream is aborted and the rule is injected as a system reminder so the model can correct itself.

Ported from omp packages/coding-agent/src/export/ttsr.ts (TtsrManager).

Only regex-based matching is implemented in the default build. AST-based matching (astCondition) requires an additional parser dependency and is deferred to a future feature gate.

Structs§

Rule
A single TTSR rule.
TtsrEngine
TTSR engine that buffers streaming deltas and checks them against registered rules.
TtsrMatchContext
Context passed to TtsrEngine::check_delta describing what is being generated right now.
TtsrSettings
Knobs for the TTSR engine.

Enums§

InterruptMode
Interrupt mode controlling which stream sources TTSR inspects.
MatchSource
Which stream source produced a delta.
RuleSource
Where a rule originated.
ScopeToken
Which source produced a TTSR match.

Traits§

RuleRegistry
Registry of TTSR rules (supplied by the host).