30 lines
642 B
Python
30 lines
642 B
Python
# SPDX-FileCopyrightText: 2026 Art Sea LLC
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
from abc import abstractmethod, ABC
|
|
from dataclasses import dataclass
|
|
|
|
from band_aider.context.contex_bag import ContextBag
|
|
from band_aider.judgement.check import Check
|
|
|
|
|
|
@dataclass
|
|
class LoopGate(ABC):
|
|
context: ContextBag
|
|
may_enter_check: Check
|
|
should_retry_check: Check
|
|
should_continue_check: Check # This maybe aggregate check
|
|
|
|
|
|
@abstractmethod
|
|
def may_enter(self) -> bool:
|
|
...
|
|
|
|
@abstractmethod
|
|
def should_retry(self) -> bool:
|
|
...
|
|
|
|
@abstractmethod
|
|
def should_continue(self) -> bool:
|
|
...
|