## Context Gap Refutation (Kill Mandate)

> Your goal is to refute the defect report. Only conclusive code evidence can refute.
> Core question: detection reported a defect in limited context, but with more context visible, the defect may not hold.

### Applicable Scenarios

- The defect involves "symbol undefined" or "method does not exist", but may be introduced implicitly
- The defect involves "type mismatch", but a legitimate type relationship may exist
- The defect involves "resource not released", but implicit resource management may exist
- The defect draws conclusions based on a diff fragment rather than a complete function/class

### Refutation Process

1. **Read the complete context**: Use `Read` to get the complete function or class containing the problematic code (not just the diff fragment)
2. **Search for missed context**: Use tools to search for implicit sources that detection may have missed
3. **Determination**: Found missed context → Kill; still not found after comprehensive search → Not refuted

### Refutation Patterns

#### Implicit Symbol Definition

Detection reports "symbol undefined", but the symbol is implicitly introduced through the following means:

| Implicit Source | Search Command | Determination |
|---------|---------|------|
| Inheritance chain | `Read` current class declaration → `Grep` to search for the symbol in parent classes/interfaces | Defined in parent class → Kill |
| Mixin/Trait | `Grep` to search for `include`/`extends`/`mixins`/`with` → search for the symbol in Mixin | Defined in Mixin → Kill |
| Dependency injection | `Grep` to search for `@Autowired`/`@Inject`/`@Injectable()`/`@Component`/`@Service` | Managed by DI container and exists in configuration → Kill |
| Dynamic features | `Grep` to search for `eval()`/`Proxy`/`Object.defineProperty()`/`__getattr__`/`method_missing` | Provided through dynamic features → Mark "dynamic injection, requires manual confirmation" |

**Tool chain**:
- Prefer `find_definition` to look up symbol definitions
- When `find_definition` returns no results, sequentially search inheritance chain → Mixin → DI → dynamic features

#### Implicit Type Compatibility

Detection reports "type mismatch", but a legitimate type relationship exists:

| Compatibility Method | Verification Method | Determination |
|---------|---------|------|
| Subtype polymorphism | `Read` to get the declared type and actual type → `find_definition` to look up definitions → check inheritance/implementation relationship | Assignment type is a subtype → Kill |
| Implicit conversion | Check language built-in conversions: JS `==`/`+`, Python `__int__()`/`__str__()`, Java autoboxing | Legitimate implicit conversion exists → Kill |
| Type narrowing | `Read` to check `typeof`/`instanceof`/`in` and other type guards | Type matches after narrowing → Kill |
| Generic covariance | Check covariance/contravariance of generic parameters (TypeScript `readonly`, Java `? extends`) | Legitimate covariance → Kill |

#### Definition Outside Scope

Detection only analyzed local code, but the symbol is defined in a broader scope:

| Definition Location | Search Method | Determination |
|---------|---------|------|
| Global/module-level definition | `Grep` to search for symbol assignment at file top or module level | Found global definition → Kill |
| Configuration-driven behavior | `Read` configuration files (`application.yml`/`.env`/`config.json`) | Behavior defined in configuration → Kill |
| Runtime injection | `Grep` to search for `window.`/`global.`/`process.env` injection points | Runtime dynamic injection → Kill |

#### Implicit Resource Management

Detection reports "resource not released", but implicit resource management exists:

| Implicit Management Method | Search Command | Determination |
|-------------|---------|------|
| finally block release | `Read` to get the complete function → search for release logic in `finally` block | Release in finally → Kill |
| defer delayed release | `Grep` to search for `defer file.Close()`/`defer conn.Close()` etc. | defer declares release → Kill |
| try-with-resources | `Grep` to search for resource declarations starting with `try (`/`using (`/`with ` | Automatic management pattern → Kill |
| Framework resource pool | `Read` to check connection pool/ORM session configuration | Framework manages lifecycle → Kill |

### Refutation Determination Rules

- **Kill condition**: Found through tool search an effective context that detection missed, and that context invalidates the defect
- **Not refuted condition**: After comprehensively searching all implicit sources, still no context found that invalidates the defect
- **Partial refutation**: The found context only partially mitigates the defect → Do not Kill, but note the mitigation degree in the result

### Degradation Strategy

- `find_definition` unavailable → Degrade to `Grep` search for symbol definitions (`def`/`function`/`class` + symbol name)
- `find_references` unavailable → Degrade to `Grep` search for call sites
- LSP tools entirely unavailable → Use `Grep` + `Read` as replacement
- Tool timeout or error returned → Record "context not fully verified", this strategy is determined as "not refuted"
