Skip to main content

Module paste

Module paste 

Source
Expand description

PASTE — Pattern-Aware Speculative Tool Execution (issue #2409).

Tracks per-skill tool invocation sequences in SQLite and surfaces top-K predicted next tool calls at skill activation time. Predictions are scored using exponentially decayed frequency × Wilson 95% one-sided lower bound on success rate.

§Scoring formula

count_decayed = Σ_i  0.5 ^ ((now - t_i) / half_life_seconds)
p_hat         = success_raw / count_raw
wilson_low    = (p_hat + z²/(2n) - z·sqrt(p_hat(1-p_hat)/n + z²/(4n²))) / (1 + z²/n)
                where n = count_raw, z = 1.645 (95% one-sided)
freq_norm     = count_decayed / total_decayed  (over sibling (skill_hash, prev_tool) rows)
score         = freq_norm * wilson_low

Structs§

PatternStore
SQLite-backed tool invocation pattern store for PASTE.

Enums§

PatternError
Error type for PatternStore operations.
ToolOutcome
Outcome of a tool call, used when observing a transition.