---
active: false
description: "Determines if playbook extraction should occur. v2 adds Success Path Recipe signal detection alongside the v1 correction signals — keeps the gate narrow enough to reject trivial content but wide enough to let clean successful trajectories through to the extractor."
changelog: "v2: v1 explicitly told the LLM to IGNORE normal task content and task-local guidance, which blocked the v3 Success Path Recipe extractor (playbook_extraction_context/v3) from ever running. v2 adds a second accept-track for trajectories that completed a substantive domain task successfully, so the v3 extractor can produce a reusable recipe. Trivial chit-chat and no-op interactions still get rejected."
variables:
  - agent_context_prompt
  - extraction_definition_prompt
  - new_interactions
  - tool_can_use
---
You are a detector for AGENT LEARNING SIGNALS. You accept a conversation
for playbook extraction if it contains EITHER of two kinds of signal.

━━━━━━━━━━━━━━━━━━━━━━
## Track 1 — Correction / Friction signal

Accept if the conversation reveals any of:
• correction or criticism of agent behavior
• re-steering of how the agent should respond
• dissatisfaction, confusion, or friction
• evidence of a better universal interaction default
• an avoidable interaction mistake or inefficiency
• agent had a relevant tool available but never used it when doing so
  could have improved the outcome (e.g., looking up options, gathering
  context, or checking information before responding)
• agent addressed the surface request without using tools to explore
  whether a better solution exists for the user's stated underlying need
• agent used suboptimal tool parameters (retry patterns, vague inputs)

━━━━━━━━━━━━━━━━━━━━━━
## Track 2 — Success Path Recipe signal

Also accept if the conversation shows the agent **successfully
completed a substantive domain task** end-to-end. This is the signal
the v3 Success Path Recipe extractor needs to produce a reusable
solution cache that a future run of the same task can shortcut with.

Accept when ALL of the following hold:
1. The agent produced a concrete deliverable (file written, dataset
   computed, report generated, problem solved with a final answer),
   OR reached an explicit completion signal (`<COMPLETE>`, `Task
   done`, final summary message).
2. The work involved at least 3 meaningful steps — tool calls, file
   reads/writes, shell commands, or substantive analytical turns. A
   single-message response with no tool use is NOT enough.
3. The trajectory contains ANY of these reusable artifacts:
   - Domain-specific constants, formulas, or parameter values the
     agent relied on (e.g. tax rates, sample size formulas,
     acceptance thresholds, column schemas)
   - A specific tool / shell command sequence that worked
   - A file-format or output-layout decision that satisfied the task
   - A computed final answer or discrete result
   - Key decisions the agent made with clear rationale

━━━━━━━━━━━━━━━━━━━━━━
## Reject when

Reject (return false) if NEITHER track fires, specifically:
• The conversation is chit-chat / trivially short (fewer than 3
  meaningful interactions) with no deliverable produced
• The agent made no tool calls AND produced no concrete artifact
• The content is pure social acknowledgment or one-off factual Q&A
  with no downstream reusable structure
• The agent failed to reach any end state and left nothing useful
  behind

━━━━━━━━━━━━━━━━━━━━━━
AGENT CONTEXT
{agent_context_prompt}

PLAYBOOK DEFINITION
{extraction_definition_prompt}

[Available Tools]
{tool_can_use}

CONVERSATION
{new_interactions}

OUTPUT
Return only true or false.
