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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@

from typing import Any

from lintel.persistence.data_models import AgentDefinitionData
from pydantic import BaseModel, ConfigDict, Field


class AgentDefinitionData(BaseModel):
"""User-defined agent definition."""

agent_id: str
name: str = ""
description: str = ""
role: str = ""
system_prompt: str = ""
model_id: str = ""
temperature: float = 0.7
tools: list[str] = Field(default_factory=list)
skills: list[str] = Field(default_factory=list)

model_config = ConfigDict(extra="allow")


class AgentDefinitionStore:
Expand Down
2 changes: 2 additions & 0 deletions packages/domain/src/lintel/domain/seed_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"plan",
"approve_spec",
"implement",
"verify_implementation",
"review",
"approved_for_pr",
"raise_pr",
Expand All @@ -34,6 +35,7 @@
"plan",
"approval_gate_spec",
"implement",
"verify_implementation",
"review",
"approval_gate_pr",
"close",
Expand Down
19 changes: 19 additions & 0 deletions packages/workflows/src/lintel/workflows/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,23 @@ class HumanInterruptTimedOut(EventEnvelope):
event_type: str = "HumanInterruptTimedOut"


# --- Implementation Verification Events ---


@dataclass(frozen=True)
class ImplementationVerified(EventEnvelope):
"""Emitted when plan-vs-implementation verification passes."""

event_type: str = "ImplementationVerified"


@dataclass(frozen=True)
class ImplementationVerificationFailed(EventEnvelope):
"""Emitted when plan-vs-implementation verification finds unaddressed tasks."""

event_type: str = "ImplementationVerificationFailed"


# --- Guardrail Approval Events (GRD-6) ---


Expand Down Expand Up @@ -192,4 +209,6 @@ class GuardrailApprovalRequested(EventEnvelope):
GuardrailApprovalRequested,
ChangeRequestTriggered,
WorkflowQueued,
ImplementationVerified,
ImplementationVerificationFailed,
)
16 changes: 15 additions & 1 deletion packages/workflows/src/lintel/workflows/feature_to_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
from lintel.workflows.nodes.review import review_output
from lintel.workflows.nodes.route import route_intent
from lintel.workflows.nodes.setup_workspace import setup_workspace
from lintel.workflows.nodes.verify_implementation import (
VerifyImplementationNode,
route_after_verification,
)
from lintel.workflows.state import ThreadWorkflowState

MAX_REVIEW_CYCLES = 3
Expand All @@ -40,6 +44,10 @@ def _resolve_max_review_cycles(state: ThreadWorkflowState) -> int:
return int(state.get("max_review_cycles", DEFAULT_MAX_REVIEW_CYCLES))


# Singleton node instance — safe because WorkflowNode is stateless between calls.
_verify_implementation_node = VerifyImplementationNode()


def build_feature_to_pr_graph() -> StateGraph[Any]:
"""Build the feature-to-PR workflow graph."""
graph: StateGraph[Any] = StateGraph(ThreadWorkflowState)
Expand All @@ -58,6 +66,7 @@ def build_feature_to_pr_graph() -> StateGraph[Any]:
partial(approval_gate, gate_type="spec_approval"),
)
graph.add_node("implement", spawn_implementation)
graph.add_node("verify_implementation", _verify_implementation_node)
graph.add_node("review", review_output)
graph.add_node(
"approval_gate_pr",
Expand All @@ -83,7 +92,12 @@ def build_feature_to_pr_graph() -> StateGraph[Any]:
graph.add_conditional_edges(
"implement",
_check_phase,
{"continue": "review", "close": "close"},
{"continue": "verify_implementation", "close": "close"},
)
graph.add_conditional_edges(
"verify_implementation",
route_after_verification,
{"review": "review", "implement": "implement", "close": "close"},
)
graph.add_conditional_edges(
"review",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"plan": "plan",
"approval_gate_spec": "approve_spec",
"implement": "implement",
"verify_implementation": "verify_implementation",
"test": "test",
"review": "review",
"approval_gate_pr": "approved_for_pr",
Expand Down
Loading
Loading