---
active: false
description: "Sliding-window critique-and-revise pass over user-profile / user-playbook items the agent cited within the recent interaction window. Adds per-citation post-horizon context and structured polarity for playbook flips. Defaults strongly to no_change."
changelog: "v1.1.0: per-citation has_full_horizon flag; ReflectionDecision drops action enum in favor of field-presence revision; new_polarity is a typed enum for playbook polarity flips; flip requires new_rationale."
variables:
  - agent_context
  - window_interactions_json
  - cited_profiles_json
  - cited_user_playbooks_json
  - per_citation_context_json
---
You are reviewing how the agent applied a small set of remembered facts and rules across a recent slice of conversation, with the benefit of seeing what happened *after* the agent used them. Your job is to decide, for each cited item, whether to leave it alone, tighten its phrasing, rewrite it, or — for playbooks only — flip its polarity.

[Agent context]
{agent_context}

[Recent interaction window (oldest first; each interaction may include `citations` showing which items it relied on)]
{window_interactions_json}

[Per-citation context]
For each citation below, a JSON object indicating whether we have a full post-citation horizon. When `has_full_horizon` is false, the post-citation context for that citation is incomplete; bias even more strongly toward no_change for it.
{per_citation_context_json}

[Cited user profile rows that are still current]
{cited_profiles_json}

[Cited user playbook rows that are still current]
{cited_user_playbooks_json}

# Decision rules

For each cited item above, emit one ReflectionDecision in `decisions`. A decision is either **no_change** (default) or a **revision** — there is no `action` enum; the LLM signals revision by setting one or more of the optional fields. Default is no_change.

## no_change

Set only `target_kind` and `target_id`. Leave every other field null/empty. Choose this whenever you are not sure, AND whenever `has_full_horizon` is false unless the cited turn itself contains very clear evidence (e.g., user explicitly pushed back inside the cited turn's exchange, or the cited row contradicted what the user said earlier in the window).

## Revision modes (set the appropriate fields; the LLM does not emit a category label)

- **Tighten phrasing (substance preserved).** Set `new_trigger` (playbook) or rewrite `new_content` keeping the same meaning. Use when the row was over-retrieved or misapplied but the underlying rule/fact is still correct. Do not change polarity.
- **Rewrite substance.** Set `new_content` (and `new_rationale` for playbooks). Use when the row is factually wrong or outdated. Do not change polarity unless this is also a flip (then follow flip rules below).
- **Flip polarity** (playbooks only). Set `new_polarity` to the opposite value of the cited row's polarity. **MUST** set `new_rationale` naming the failure pattern observed in the post-citation context. Also set `new_content` framed as a negative rule starting with `Avoid`, `Do not`, `Don't`, or `Never` (this is a soft convention for the downstream agent that reads the rule; the structural signal is `new_polarity`).

Use flip only when the post-citation window shows the cited rule pushed the agent into a failure trap: user pushback against the recommended action, agent self-correction away from it, an external check refuting it, or the user explicitly disliking the outcome.

Use no_change when evidence is unclear or absent.

# Hard constraints

- Do **not** set `new_polarity` for a profile decision.
- Do **not** flip a profile's polarity (profiles have no polarity field).
- Do **not** invent new playbook rules or profile rows. If something new should be remembered, that is a different system's job — return no_change here.
- Do **not** generalize beyond what the window actually demonstrates.
- Do **not** propose decisions for items not present in the cited lists above.
- If both cited lists are empty, return `decisions: []`.

Output strictly conforming to the `ReflectionOutput` schema (a JSON object with a single key `decisions`).
