Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/operations_center/contracts/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class FailureReasonCategory(str, Enum):
POLICY_BLOCKED = "policy_blocked"
BUDGET_EXHAUSTED = "budget_exhausted"
ROUTING_ERROR = "routing_error"
SCOPE_TOO_WIDE = "scope_too_wide"
UNKNOWN = "unknown"


Expand Down
3 changes: 2 additions & 1 deletion src/operations_center/execution/artifact_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def write_run(
"written_at": datetime.now(timezone.utc).isoformat(),
}
if result.failure_category is not None:
metadata["failure_category"] = result.failure_category.value
fc = result.failure_category
metadata["failure_category"] = fc.value if hasattr(fc, "value") else str(fc)
if extra_metadata:
metadata.update(extra_metadata)

Expand Down
3 changes: 2 additions & 1 deletion src/operations_center/execution/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from pathlib import Path

from operations_center.adapters.git.client import GitClient
from operations_center.contracts.enums import FailureReasonCategory
from operations_center.contracts.execution import ExecutionRequest, ExecutionResult

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -255,7 +256,7 @@ def finalize(
return result.model_copy(
update={
"branch_pushed": False,
"failure_category": "scope_too_wide",
"failure_category": FailureReasonCategory.SCOPE_TOO_WIDE,
"failure_reason": (
f"diff exceeded soft cap: {n_files} files, {n_lines} lines "
f"(caps {self._max_files} / {self._max_lines}). "
Expand Down
Loading