refactor(subplans): Centralize subplan errors per v3.3.0 spec (#8725)

Move SubplanSpawnError from local subplan_service definition to centralized
cleveragents.core.exceptions alongside four new spec-defined error types:
SubplanExecutionError, MaxParallelExceededError, and SubplanDepthLimitError.

Per the v3.3.0 specification (AUTO-ARCH-6), all subplan-related errors are
defined in exceptions.py with proper inheritance hierarchy under DomainError/
PlanError/BusinessRuleViolation. The old local SpawnValidationError class has
been replaced with SubplanSpawnError(PlanError) with a simplified constructor
API (message string instead of validation_errors list).

Updates:
- exceptions.py: Added 4 subplan error classes + __all__ entries
- subplan_service.py: Remove local SpawnValidationError, import SubplanSpawnError from exceptions
- services/__init__.py: Update TYPE_CHECKING stub and _LAZY_IMPORTS for new location
- vulture_whitelist.py: Replace old entry with new error class names
- docs/reference/subplan_service.md: Update to reference SubplanSpawnError (v3.3.0)
- features/*.feature + steps: Update test references from SpawnValidationError to SubplanSpawnError
This commit is contained in:
2026-05-09 00:23:19 +00:00
committed by Forgejo
parent 57fe30d15c
commit 5e89f1016c
9 changed files with 179 additions and 67 deletions
+3 -3
View File
@@ -525,10 +525,10 @@ Feature: Services __init__ lazy-import coverage (round 3)
When svcov3 I access lazy attribute "SpawnResult"
Then svcov3 the attribute "SpawnResult" should be resolved
Scenario: svcov3 lazy-load SpawnValidationError
Scenario: svcov3 lazy-load SubplanSpawnError
Given svcov3 a fresh services module
When svcov3 I access lazy attribute "SpawnValidationError"
Then svcov3 the attribute "SpawnValidationError" should be resolved
When svcov3 I access lazy attribute "SubplanSpawnError"
Then svcov3 the attribute "SubplanSpawnError" should be resolved
Scenario: svcov3 lazy-load SpawnValidationResult
Given svcov3 a fresh services module