# Takeover-high generation profile: one DSH protocol for P1 teacher-only,
# P2 student-then-teacher and P3 student-only. DSH talks to the local budget
# proxy only; the proxy routes each request (Qwen student or the frozen
# DeepSeek-Flash-high teacher policy) and rewrites only model/thinking fields.
# Messages, tools, system prompt and control plugin are identical for both.

- id: llm-pi-ai
  config:
    providers:
      takeover-router:
        displayName: Takeover Router
        api: openai-completions
        apiKeyEnv: EVAL_VLLM_API_KEY
        baseURL: !!js process.env.EVAL_VLLM_BASE_URL || 'http://127.0.0.1:18080/v1'
        reasoning: high
        retryPolicy:
          mode: normal
          maxRetries: 0
        compat:
          supportsDeveloperRole: false
          supportsReasoningEffort: true
          supportsStore: false
          supportsStrictMode: false
          thinkingFormat: deepseek
          requiresReasoningContentOnAssistantMessages: true
          maxTokensField: max_tokens
        models:
          - id: takeover-router
            name: Routed student/teacher policy
            contextWindow: 131072
            maxTokens: 16384
            reasoningEfforts:
              high: high

- id: agent-default-model
  config:
    provider: takeover-router
    model: takeover-router

- id: tools
  config:
    mode: native

# The compaction ratio is derived: 0.78 * 131072 = 102236 tokens, which stays
# under (context - per_call_cap - reserve) = 110592 and leaves slack for one
# step's tool observation (see budget-v3.json compaction_slack_tokens).
- id: compaction-basic
  config:
    thresholdRatio: 0.78
    retainRatio: 0.16
    auto: true

- id: tool-result-pruner
  config:
    thresholdChars: 8192
    headChars: 4096
    tailChars: 1024

- id: system-prompt
  config:
    includeHarnessIdentity: false
    includeRuntimeContext: true
    persona: >-
      You are a software engineer fixing one repository task. Read, edit, and
      test only inside the session workspace. File tools use relative paths or
      absolute paths under the runtime workspace. Bash commands run in /testbed
      inside the task container, which mounts that same workspace.
      Do not use the web, other models, or subagents. You must apply the change
      to the files: a final answer that only describes the fix is a failure, and
      the uncommitted diff is the submitted patch. Do not stop until you have
      edited the files and run the target tests; do not claim the task is solved
      unless the tests you actually ran passed.
      Data contract: do not modify test files, test fixtures, or snapshot files;
      the grader restores them before scoring, so editing them cannot help.
      Run the target tests after editing and only then stop.

- id: sandbox-policy
  config:
    mode: workspace-write
    workspaceRoot: !!js process.env.EVAL_WORKSPACE || process.cwd()

- id: approval
  config:
    policy: never

# File confinement is enforced by swe-v3-control for this isolated task.
# Escalation parameters are not part of this unattended tool contract.
# The eval bash shim is the task-container boundary. It must own the `bash`
# capability without DSH's host-shell sandbox. The resolver confines file tools
# and shell workdirs; the local fs backend advertises no approval-only fields.
- id: fs-sandbox
  disabled: true
- id: bash-sandbox
  disabled: true
- id: pwsh-sandbox
  disabled: true
- id: tool-pwsh
  disabled: true
- id: permission
  disabled: true

- insert:
    - id: fs-local
      name: '@deepseek-ai/dsh-fs-local'
      config:
        cwd: !!js process.env.EVAL_WORKSPACE || process.cwd()
    - id: bash-local
      name: '@deepseek-ai/dsh-bash-local'
      config:
        timeoutMs: 120000
        maxTimeoutMs: 600000
    # Absolute file path is substituted by scripts/setup_v3.sh. The plugin
    # restricts the tool surface and steers a continuation after max-tokens.
    - id: swe-v3-control
      name: '__EVAL_PLUGIN__'
      config:
        allowTools: [bash, read, edit]
        noEditStop:
          enabled: true
          maxPerTurn: 2
          minOutputTokens: 4096
          prompt: >-
            You have not modified any file in this workspace. A prose description
            of the fix is not a submission. Apply the change now with the edit
            tool (or a shell command), then run the target tests and report the
            result.
        continuation:
          enabled: true
          maxPerTurn: 12
          minOutputTokens: 4096
          afterCappedToolStep: true
          budgetUrl: !!js process.env.EVAL_BUDGET_URL || 'http://127.0.0.1:18080'
          prompt: >-
            Your previous message hit the output token limit and was cut off
            mid-response. Continue the task from exactly where it stopped: do
            not repeat completed work, do not restate the plan, and finish with
            the patch or the verification step that is still missing. If the
            work is already complete, stop.

- id: tool-bash
  disabled: false
  config:
    enableRunInBackground: false

# Remove whole packages that are not part of the three-tool surface. write and
# read_image live inside tool-fs and are removed by the plugin's allow-list.
- id: tool-fs-search
  disabled: true
- id: tool-str-replace-editor
  disabled: true

- id: agent-instructions
  disabled: true
- id: session-title-llm
  disabled: true
- id: code-runtime
  disabled: true
- id: plan-mode
  disabled: true
- id: skill
  disabled: true
- id: skill-filesystem
  disabled: true
- id: tool-jobs
  disabled: true
- id: tool-skill
  disabled: true
- id: tool-subagent
  disabled: true
- id: tool-subagent-fork
  disabled: true
- id: tool-subagent-control
  disabled: true
- id: tool-subagent-list-agents
  disabled: true
- id: tool-subagent-report
  disabled: true
- id: tool-workflow
  disabled: true
- id: tool-todo
  disabled: true
- id: tool-goal
  disabled: true
- id: tool-ralph
  disabled: true
- id: tool-web
  disabled: true
- id: web
  disabled: true
- id: web-search-deepseek
  disabled: true
