File size: 2,226 Bytes
4997b06
 
 
 
09e0e4a
 
 
 
 
a64c042
 
 
 
 
09e0e4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e5c847
 
4cf7fc5
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from typing import Annotated, Literal

from pydantic import AfterValidator, Field, StringConstraints

from multi_agent_sdlc.tools.coder.validation import (
    PROHIBITED_CODER_DEPENDENCY_PACKAGES,
    PROHIBITED_CODER_ENTRY_POINTS,
    PROHIBITED_CODER_PYTHON_MODULES,
)
from multi_agent_sdlc.tools.shared.validation import (
    create_dependency_validator,
    create_entry_point_validator,
    create_module_name_validator,
)

validate_entry_point = create_entry_point_validator(
    role="Coder",
    prohibited_entry_points=PROHIBITED_CODER_ENTRY_POINTS,
)

EntryPoint = Annotated[
    str,
    StringConstraints(
        strip_whitespace=True,
        min_length=1,
        max_length=100,
        pattern=r"[A-Za-z0-9][A-Za-z0-9._-]*",
    ),
    AfterValidator(validate_entry_point),
]

validate_module_name = create_module_name_validator(
    role="Coder", prohibited_python_modules=PROHIBITED_CODER_PYTHON_MODULES
)

PythonModuleName = Annotated[
    str,
    Field(
        min_length=1,
        max_length=200,
        description=(
            "A dotted Python module belonging to the generated application. "
            "Testing, package-management, environment-management, and "
            "process-execution modules are prohibited."
        ),
    ),
    AfterValidator(validate_module_name),
]

validate_dependency = create_dependency_validator(
    role="Coder", prohibited_dependencies=PROHIBITED_CODER_DEPENDENCY_PACKAGES
)

PackageDependency = Annotated[
    str,
    AfterValidator(validate_dependency),
]


PackageDependencyList = Annotated[
    list[PackageDependency],
    Field(
        min_length=1,
        max_length=20,
        description="Package Dependencies to add with uv.",
    ),
]

VerificationCommand = Annotated[
    Literal[
        "ruff",
        "mypy",
        "coverage",
    ],
    Field(
        description=(
            "Approved development or verification executable to run "
            "inside the project's uv-managed environment."
        )
    ),
]


DockerComposeService = Annotated[
    str,
    "Docker Compose service name.",
]

DockerComposeExecCommand = Annotated[
    list[str],
    "Command and arguments to execute inside the running service container.",
]