# CircleDetector

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/autonomous/circle-detector.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/autonomous/circle-detector.ts#L307)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `recordTurn` | `recordTurn(record: TurnRecord)` | `void` |
| `analyze` | `analyze()` | `CircleDetectionResult` |
| `getProgressDelta` | `getProgressDelta()` | `number` |
| `suggestBudgetExtension` | `suggestBudgetExtension(currentTurn: number, maxTurns: number)` | `number` |
| `reset` | `reset()` | `void` |
| `getWindow` | `getWindow()` | `readonly TurnRecord[]` |

## Where it refuses work

- `CircleDetector` stops the work with an early return when `this.window.length < this.minTurnsBeforeDetection`.
- `CircleDetector` stops the work with an early return when `signals.length === 0`.
- `CircleDetector` stops the work with an early return when `currentTurn < Math.floor(maxTurns * 0.8)`.
