/**
 * Three OPERATING POSTURE variants to A/B against memory-driven scenarios.
 *
 * The full status-quo prose was lifted verbatim from baseTool.js so the
 * results map directly back to the prompt that ships today.
 */

const TOOL_DISTINCTIONS = [
  '**Distinction:**',
  '- `memory` = persistent knowledge that survives sessions (why, constraints, durable facts, working plans).',
  '- `taskmanager` = step-by-step checkboxes for the CURRENT task (what to do next, in order).',
  '',
].join('\n');

/**
 * Variant A — STATUS QUO. The full OPERATING POSTURE block currently
 * injected into every tool-equipped agent's system prompt by
 * baseTool.generateToolDescriptionsForPrompt(). Reproduced verbatim
 * minus the skills sub-paragraphs (we're testing a memory-only agent).
 */
export const VARIANT_A_STATUS_QUO = [
  '## OPERATING POSTURE',
  '',
  'Treat these as habits, not optional extras. Use them proactively, before you need them.',
  '',
  '**At the start of a new task or topic shift:**',
  '- Run `memory` → `list` (titles only) to scan for relevant context the team or your past self stored. If a title looks relevant, `read` it before improvising.',
  '',
  '**WRITE memory on these events (not "when you think it\'s a good idea" — these are mandatory):**',
  '- **A new user message contains a numbered list, a multi-bullet ask, OR more than ~30 words of substantive request.** Your VERY NEXT tool call must be `memory` → `add` with title `plan/<short-topic>` and content = the user\'s entire message verbatim. Do this BEFORE any other tool call, including taskmanager. Why mandatory: compaction may later destroy that message and the agent (you, next session) will not remember what the user actually asked for.',
  '- **You are about to call `taskmanager` → `sync` with more than 3 tasks at once.** First, save a `memory` titled `plan/<feature>` containing the user\'s original request + your rationale for the plan. The task list is fragile (it can be wiped by a later sync); the plan/* memory is the source of truth.',
  '- **You made a non-obvious decision** (chose approach A over B, fixed a tricky bug, discovered a constraint while exploring code, hit an unexpected error and figured out the cause). Save it as a `memory` with a non-`plan/` title before the next tool call. Format: title = the conclusion, content = the evidence. The next agent will not re-derive it.',
  '- **The user gave you a preference or rule that should apply to all future work** ("never use emojis", "always use Tailwind", "the API base URL is X"). Save it immediately as a `memory`.',
  '',
  '**`plan/*` memories auto-inject into your system prompt every turn under `## AGENT WORKING PLAN` — that\'s how they survive compaction. Update or delete them as the situation evolves; a stale plan is worse than no plan.**',
  '',
  TOOL_DISTINCTIONS,
].join('\n');

/**
 * Variant B — STRIPPED. No OPERATING POSTURE section at all. The
 * agent gets only the tool description plus the distinction footer.
 * Hypothesis: tool description alone is sufficient when memory plumbing
 * (catalog injection, transition auto-load, post-compaction nudge) does
 * the heavy lifting structurally.
 */
export const VARIANT_B_STRIPPED = TOOL_DISTINCTIONS;

/**
 * Variant C — MINIMAL. Three short bullets, no prescriptive prose.
 * Tests the hypothesis that the prose is bait for smaller models but
 * we still need a tiny nudge for tool discovery.
 */
export const VARIANT_C_MINIMAL = [
  '## OPERATING POSTURE',
  '',
  '- New topic? `memory list` first.',
  '- User gave a durable preference, rule, or multi-part ask? `memory add` it (use `plan/...` titles for plans).',
  '- Discovered something non-obvious? `memory add` it before moving on.',
  '',
  TOOL_DISTINCTIONS,
].join('\n');

export const VARIANTS = {
  A: { id: 'A', name: 'status-quo', body: VARIANT_A_STATUS_QUO },
  B: { id: 'B', name: 'stripped',  body: VARIANT_B_STRIPPED },
  C: { id: 'C', name: 'minimal',   body: VARIANT_C_MINIMAL },
};
