evoloop-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- evoloop_cli/__init__.py +3 -0
- evoloop_cli/__main__.py +10 -0
- evoloop_cli/_skills/evoloop-constitution/SKILL.md +59 -0
- evoloop_cli/_skills/evoloop-constitution/references/writing-guide.md +89 -0
- evoloop_cli/_skills/evoloop-constitution/templates/config.yaml +52 -0
- evoloop_cli/_skills/evoloop-constitution/templates/constitution.md +39 -0
- evoloop_cli/_skills/evoloop-evaluate/SKILL.md +85 -0
- evoloop_cli/_skills/evoloop-evaluate/schemas/parsed_report.schema.json +170 -0
- evoloop_cli/_skills/evoloop-evaluate/scripts/parse_junit_report.py +311 -0
- evoloop_cli/_skills/evoloop-evaluate/scripts/parse_pytest_report.py +276 -0
- evoloop_cli/_skills/evoloop-evaluate/scripts/parse_report.py +101 -0
- evoloop_cli/_skills/evoloop-evaluate/scripts/update_eval_index.py +111 -0
- evoloop_cli/_skills/evoloop-evaluate/scripts/validate_parsed_report.py +178 -0
- evoloop_cli/_skills/evoloop-evaluate/templates/analysis.md +51 -0
- evoloop_cli/_skills/evoloop-evaluate/templates/progress.md +42 -0
- evoloop_cli/_skills/evoloop-evaluate/templates/tasks.md +34 -0
- evoloop_cli/_skills/evoloop-evolve/SKILL.md +76 -0
- evoloop_cli/_skills/evoloop-evolve/scripts/evolve_state.py +333 -0
- evoloop_cli/_skills/evoloop-implement/SKILL.md +57 -0
- evoloop_cli/_skills/evoloop-implement/scripts/check_scope.py +154 -0
- evoloop_cli/_skills/evoloop-implement/scripts/commit_section.py +78 -0
- evoloop_cli/_skills/evoloop-init/SKILL.md +95 -0
- evoloop_cli/_skills/evoloop-init/scripts/scaffold_evals.py +546 -0
- evoloop_cli/_skills/evoloop-init/templates/common/evals/datasets/domain_flows.yaml +33 -0
- evoloop_cli/_skills/evoloop-init/templates/common/evaluations/README.md +9 -0
- evoloop_cli/_skills/evoloop-init/templates/java/src/test/java/__PACKAGE_PATH__/evals/AgentAdapter.java +13 -0
- evoloop_cli/_skills/evoloop-init/templates/java/src/test/java/__PACKAGE_PATH__/evals/AgenticFlowEvalTest.java +71 -0
- evoloop_cli/_skills/evoloop-init/templates/java/src/test/java/__PACKAGE_PATH__/evals/DeterministicEvaluators.java +174 -0
- evoloop_cli/_skills/evoloop-init/templates/java/src/test/java/__PACKAGE_PATH__/evals/EvalFrameworkTest.java +45 -0
- evoloop_cli/_skills/evoloop-init/templates/java/src/test/java/__PACKAGE_PATH__/evals/FlowRunResult.java +25 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/__init__.py +1 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/adapter.py +63 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/deepagents_adapter.py +223 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/evaluators/__init__.py +1 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/evaluators/deterministic.py +234 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/evaluators/llm_judge.py +189 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/fakes.py +26 -0
- evoloop_cli/_skills/evoloop-init/templates/python/evals/harness.py +100 -0
- evoloop_cli/_skills/evoloop-init/templates/python/tests/conftest.py +38 -0
- evoloop_cli/_skills/evoloop-init/templates/python/tests/test_agentic_flows.py +36 -0
- evoloop_cli/_skills/evoloop-init/templates/python/tests/test_eval_framework.py +175 -0
- evoloop_cli/_skills/evoloop-new/SKILL.md +125 -0
- evoloop_cli/_skills/evoloop-new/scripts/scaffold_agent.py +911 -0
- evoloop_cli/_skills/evoloop-new/templates/common/.evoloop/constitution.md +34 -0
- evoloop_cli/_skills/evoloop-new/templates/common/.gitignore +22 -0
- evoloop_cli/_skills/evoloop-new/templates/common/AGENTS.md +17 -0
- evoloop_cli/_skills/evoloop-new/templates/common/README.md +83 -0
- evoloop_cli/_skills/evoloop-new/templates/common/skills/__DOMAIN__/SKILL.md +21 -0
- evoloop_cli/_skills/evoloop-new/templates/java/eval_wiring/src/test/java/__PACKAGE_PATH__/evals/AgenticFlowEvalTest.java +113 -0
- evoloop_cli/_skills/evoloop-new/templates/java/eval_wiring/src/test/java/__PACKAGE_PATH__/evals/EvalFrameworkTest.java +85 -0
- evoloop_cli/_skills/evoloop-new/templates/java/eval_wiring/src/test/java/__PACKAGE_PATH__/evals/Fake__DOMAIN_PASCAL__Client.java +37 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/custom/src/main/java/__PACKAGE_PATH__/Application.java +46 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/custom/src/main/java/__PACKAGE_PATH__/OpenAiCompatibleRunner.java +433 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/custom/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Agent.java +125 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/langchain4j/src/main/java/__PACKAGE_PATH__/Application.java +46 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/langchain4j/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Agent.java +163 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/langchain4j/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Tools.java +18 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/java/__PACKAGE_PATH__/Application.java +15 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Agent.java +167 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Controller.java +41 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Factory.java +32 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Tools.java +20 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/micronaut/src/main/resources/application.yml +17 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/java/__PACKAGE_PATH__/Application.java +17 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Agent.java +159 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Config.java +32 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Controller.java +40 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Tools.java +25 -0
- evoloop_cli/_skills/evoloop-new/templates/java/frameworks/spring-ai/src/main/resources/application.yml +19 -0
- evoloop_cli/_skills/evoloop-new/templates/java/gradle/build_custom.gradle +33 -0
- evoloop_cli/_skills/evoloop-new/templates/java/gradle/build_langchain4j.gradle +40 -0
- evoloop_cli/_skills/evoloop-new/templates/java/gradle/build_micronaut.gradle +52 -0
- evoloop_cli/_skills/evoloop-new/templates/java/gradle/build_spring-ai.gradle +45 -0
- evoloop_cli/_skills/evoloop-new/templates/java/gradle/settings.gradle +1 -0
- evoloop_cli/_skills/evoloop-new/templates/java/maven/pom_custom.xml +57 -0
- evoloop_cli/_skills/evoloop-new/templates/java/maven/pom_langchain4j.xml +87 -0
- evoloop_cli/_skills/evoloop-new/templates/java/maven/pom_micronaut.xml +101 -0
- evoloop_cli/_skills/evoloop-new/templates/java/maven/pom_spring-ai.xml +61 -0
- evoloop_cli/_skills/evoloop-new/templates/java/src/main/java/__PACKAGE_PATH__/ConversationMemory.java +36 -0
- evoloop_cli/_skills/evoloop-new/templates/java/src/main/java/__PACKAGE_PATH__/Default__DOMAIN_PASCAL__Client.java +9 -0
- evoloop_cli/_skills/evoloop-new/templates/java/src/main/java/__PACKAGE_PATH__/DomainRecord.java +10 -0
- evoloop_cli/_skills/evoloop-new/templates/java/src/main/java/__PACKAGE_PATH__/TurnOutcome.java +15 -0
- evoloop_cli/_skills/evoloop-new/templates/java/src/main/java/__PACKAGE_PATH__/__DOMAIN_PASCAL__Client.java +8 -0
- evoloop_cli/_skills/evoloop-new/templates/python/eval_wiring/evals/fakes.py +22 -0
- evoloop_cli/_skills/evoloop-new/templates/python/eval_wiring/evals/harness_custom.py +186 -0
- evoloop_cli/_skills/evoloop-new/templates/python/eval_wiring/evals/harness_deepagents.py +100 -0
- evoloop_cli/_skills/evoloop-new/templates/python/eval_wiring/tests/test_eval_framework.py +196 -0
- evoloop_cli/_skills/evoloop-new/templates/python/pyproject.toml +18 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/__init__.py +13 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/__main__.py +6 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/agent_custom.py +209 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/agent_deepagents.py +61 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/cli.py +71 -0
- evoloop_cli/_skills/evoloop-new/templates/python/src/__PACKAGE__/client.py +31 -0
- evoloop_cli/_skills/evoloop-scenarios/SKILL.md +49 -0
- evoloop_cli/_skills/evoloop-scenarios/scripts/validate_scenarios.py +261 -0
- evoloop_cli/_skills/evoloop-scenarios/templates/scenario_schema.md +49 -0
- evoloop_cli/cli.py +331 -0
- evoloop_cli-0.1.0.dist-info/METADATA +214 -0
- evoloop_cli-0.1.0.dist-info/RECORD +103 -0
- evoloop_cli-0.1.0.dist-info/WHEEL +4 -0
- evoloop_cli-0.1.0.dist-info/entry_points.txt +2 -0
- evoloop_cli-0.1.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"""Fast offline unit tests for the evaluation harness, fakes, and evaluators."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
from evals.adapter import DomainToolCall, FlowRunResult, TurnResult
|
|
10
|
+
from evals.evaluators.deterministic import (
|
|
11
|
+
evaluate_efficiency_budget,
|
|
12
|
+
evaluate_forbidden_and_turn_tools,
|
|
13
|
+
evaluate_groundedness,
|
|
14
|
+
evaluate_trajectory_match,
|
|
15
|
+
run_deterministic_evaluators,
|
|
16
|
+
)
|
|
17
|
+
from evals.evaluators.llm_judge import (
|
|
18
|
+
_format_conversation,
|
|
19
|
+
_format_trajectory,
|
|
20
|
+
evaluate_response_quality,
|
|
21
|
+
)
|
|
22
|
+
from evals.fakes import FakeDomainClient
|
|
23
|
+
from evals.harness import load_flow_cases
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _make_run(
|
|
27
|
+
case_id: str,
|
|
28
|
+
turns_data: list[tuple[str, list[DomainToolCall], str]],
|
|
29
|
+
) -> FlowRunResult:
|
|
30
|
+
turns: list[TurnResult] = []
|
|
31
|
+
all_calls: list[DomainToolCall] = []
|
|
32
|
+
trajectory: list[dict] = []
|
|
33
|
+
|
|
34
|
+
for idx, (user_input, calls, final_response) in enumerate(turns_data):
|
|
35
|
+
turn_msgs: list[dict] = [{"role": "user", "content": user_input}]
|
|
36
|
+
if calls:
|
|
37
|
+
turn_msgs.append(
|
|
38
|
+
{
|
|
39
|
+
"role": "assistant",
|
|
40
|
+
"content": "",
|
|
41
|
+
"tool_calls": [
|
|
42
|
+
{
|
|
43
|
+
"function": {
|
|
44
|
+
"name": c.name,
|
|
45
|
+
"arguments": json.dumps(c.args, sort_keys=True),
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
for c in calls
|
|
49
|
+
],
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
if final_response:
|
|
53
|
+
turn_msgs.append({"role": "assistant", "content": final_response})
|
|
54
|
+
|
|
55
|
+
all_calls.extend(calls)
|
|
56
|
+
trajectory.extend(turn_msgs)
|
|
57
|
+
turns.append(
|
|
58
|
+
TurnResult(
|
|
59
|
+
turn_index=idx,
|
|
60
|
+
user_input=user_input,
|
|
61
|
+
new_messages=[],
|
|
62
|
+
domain_tool_calls=calls,
|
|
63
|
+
final_response=final_response,
|
|
64
|
+
latency_seconds=0.1,
|
|
65
|
+
openai_turn_messages=turn_msgs,
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
return FlowRunResult(
|
|
70
|
+
case_id=case_id,
|
|
71
|
+
turns=turns,
|
|
72
|
+
all_messages=[],
|
|
73
|
+
domain_tool_calls=all_calls,
|
|
74
|
+
openai_trajectory=trajectory,
|
|
75
|
+
final_response=turns[-1].final_response if turns else "",
|
|
76
|
+
total_latency_seconds=0.1 * len(turns),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def test_dataset_loads_unique_cases():
|
|
81
|
+
cases = load_flow_cases()
|
|
82
|
+
assert len(cases) >= 1
|
|
83
|
+
ids = [c["id"] for c in cases]
|
|
84
|
+
assert len(ids) == len(set(ids)), "Case IDs must be unique"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def test_fake_client_happy_and_outage():
|
|
88
|
+
client = FakeDomainClient()
|
|
89
|
+
assert client.example_lookup("item-1")["status"] == "ok"
|
|
90
|
+
|
|
91
|
+
outage = FakeDomainClient(fail_mode="service_outage")
|
|
92
|
+
with pytest.raises(RuntimeError, match="outage"):
|
|
93
|
+
outage.example_lookup("item-1")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_deterministic_evaluators_happy_path():
|
|
97
|
+
case = {
|
|
98
|
+
"id": "happy_path_example",
|
|
99
|
+
"expected_tool_calls": [{"name": "example_tool", "args": {"query": "item-1"}}],
|
|
100
|
+
"trajectory_match_mode": "unordered",
|
|
101
|
+
"max_tool_calls": 2,
|
|
102
|
+
"grounded_any_of": [["item-1"]],
|
|
103
|
+
}
|
|
104
|
+
run = _make_run(
|
|
105
|
+
"happy_path_example",
|
|
106
|
+
[
|
|
107
|
+
(
|
|
108
|
+
"Run an example lookup for item-1.",
|
|
109
|
+
[DomainToolCall(name="example_tool", args={"query": "item-1"}, turn_index=0)],
|
|
110
|
+
"Status for item-1 is ok.",
|
|
111
|
+
)
|
|
112
|
+
],
|
|
113
|
+
)
|
|
114
|
+
outcomes = run_deterministic_evaluators(run, case)
|
|
115
|
+
assert all(o.passed for o in outcomes), [(o.name, o.reason) for o in outcomes]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def test_forbidden_tools_and_duplicate_detection():
|
|
119
|
+
case = {
|
|
120
|
+
"id": "vague_input_no_tools",
|
|
121
|
+
"expected_tool_calls": [],
|
|
122
|
+
"trajectory_match_mode": "strict",
|
|
123
|
+
"forbidden_tools": ["example_tool"],
|
|
124
|
+
"max_tool_calls": 0,
|
|
125
|
+
}
|
|
126
|
+
run = _make_run(
|
|
127
|
+
"vague_input_no_tools",
|
|
128
|
+
[
|
|
129
|
+
(
|
|
130
|
+
"Check that thing.",
|
|
131
|
+
[
|
|
132
|
+
DomainToolCall(name="example_tool", args={"query": "x"}, turn_index=0),
|
|
133
|
+
DomainToolCall(name="example_tool", args={"query": "x"}, turn_index=0),
|
|
134
|
+
],
|
|
135
|
+
"Which item?",
|
|
136
|
+
)
|
|
137
|
+
],
|
|
138
|
+
)
|
|
139
|
+
assert not evaluate_trajectory_match(run, case).passed
|
|
140
|
+
assert not evaluate_forbidden_and_turn_tools(run, case).passed
|
|
141
|
+
eff = evaluate_efficiency_budget(run, case)
|
|
142
|
+
assert not eff.passed
|
|
143
|
+
assert "Duplicate" in eff.reason
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def test_groundedness_and_empty_response_guard():
|
|
147
|
+
empty_run = _make_run("empty_case", [("Hello", [], " ")])
|
|
148
|
+
assert not evaluate_groundedness(empty_run, {"grounded_any_of": [["ok"]]}).passed
|
|
149
|
+
|
|
150
|
+
judge_outcome = evaluate_response_quality(empty_run, {"rubric_criteria": "Must reply."})
|
|
151
|
+
assert not judge_outcome.passed
|
|
152
|
+
assert judge_outcome.score == 0.0
|
|
153
|
+
assert "empty" in judge_outcome.reason.lower()
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_format_conversation_and_turn_grouped_trajectory():
|
|
157
|
+
run = _make_run(
|
|
158
|
+
"multi_turn",
|
|
159
|
+
[
|
|
160
|
+
("First turn", [], "Please clarify."),
|
|
161
|
+
(
|
|
162
|
+
"Second turn",
|
|
163
|
+
[DomainToolCall(name="example_tool", args={"query": "item-1"}, turn_index=1)],
|
|
164
|
+
"Item-1 is ok.",
|
|
165
|
+
),
|
|
166
|
+
],
|
|
167
|
+
)
|
|
168
|
+
conv = _format_conversation(run)
|
|
169
|
+
assert "Turn 1 User: First turn" in conv
|
|
170
|
+
assert "Turn 2 Assistant: Item-1 is ok." in conv
|
|
171
|
+
|
|
172
|
+
parsed = json.loads(_format_trajectory(run))
|
|
173
|
+
assert len(parsed) == 2
|
|
174
|
+
assert parsed[0]["turn"] == 1
|
|
175
|
+
assert parsed[1]["turn"] == 2
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evoloop-new
|
|
3
|
+
description: Create a brand-new, minimal runnable, evaluation-ready agent application from scratch (greenfield). Interactively gathers domain, language stack (`python` or `java`), framework (`deepagents`, `custom`, `micronaut`, `spring-ai`, `langchain4j`), tools, and invariants, then scaffolds a runnable application entrypoint, testable client interface, default checkpointer/state persistence, compact `SYSTEM_PROMPT`, `README.md`, `AGENTS.md`, `skills/<domain>/SKILL.md`, `.evoloop/` constitution/config, wired evaluation harness, starter scenarios, and offline tests. Use `evoloop-init` instead when adding evoloop to an existing agent repository.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Evoloop New (Create a New Agent Application from Scratch / Greenfield)
|
|
7
|
+
|
|
8
|
+
Bootstrap a **minimal runnable, evaluation-ready agent application** starting from an empty folder.
|
|
9
|
+
|
|
10
|
+
> **Already have an existing agent repository?** Use **`evoloop-constitution`** followed by **`evoloop-init`** instead — `evoloop-init` inspects your existing codebase and scaffolds only the evaluation harness without touching your runtime code.
|
|
11
|
+
|
|
12
|
+
Supported built-in stacks and runnable frameworks:
|
|
13
|
+
- **`python`** (`uv` + `pytest`):
|
|
14
|
+
- `deepagents` *(default)* — Runnable CLI (`uv run <project-name>`) + `deepagents` & `langchain-openai` agent with `MemorySaver()` checkpointer and `DeepAgentsAdapter`
|
|
15
|
+
- `custom` — Runnable CLI (`uv run <project-name>`) + zero-extra-dependency OpenAI-compatible Chat Completions tool-calling loop, `ConversationStateStore` checkpointer, and `CustomAgentAdapter`
|
|
16
|
+
- **`java`** (`maven` or `gradle` + JUnit 5):
|
|
17
|
+
- `custom` *(default)* — Pure JDK 17 runnable CLI (`Application.java`) with `OpenAiCompatibleRunner` (order-independent recursive-descent JSON parser), `ConversationMemory`, and `exec-maven-plugin` / Gradle `application` plugin
|
|
18
|
+
- `micronaut` — Minimal runnable Micronaut 5 (JDK 25) HTTP + MCP server (`Application.java`, LangChain4j `AiServices` with `Result<String>` tool capture, Micronaut MCP `@Tool` bean at `/mcp`, `@Factory`, `@Controller("/api/<domain>")`, `application.yml`, `mvn mn:run` / `./gradlew run`)
|
|
19
|
+
- `spring-ai` — Minimal runnable Spring Boot 3 + Spring AI HTTP application (`Application.java`, native Spring AI `ChatClient` + `@Tool` adapter, `@Configuration`, `@RestController("/api/<domain>")`, `application.yml`, `mvn spring-boot:run` / `./gradlew bootRun`)
|
|
20
|
+
- `langchain4j` — Minimal runnable LangChain4j `1.0.0` CLI application (`Application.java`, `AiServices` with `Result<String>` tool capture, `@Tool` adapter, `OpenAiChatModel`, and `MessageWindowChatMemory`)
|
|
21
|
+
|
|
22
|
+
## Testability Invariants Built Into Every Generated Application
|
|
23
|
+
|
|
24
|
+
1. **External dependencies behind a `Protocol` / interface:** Production clients and deterministic eval fakes share the same contract (zero flaky network calls during evaluation).
|
|
25
|
+
2. **Checkpointer / multi-turn state enabled by default:** `MemorySaver()` (Python `deepagents`), `ConversationStateStore` (Python `custom`), or `ConversationMemory.InMemory` / `MessageWindowChatMemory` (Java) so multi-turn `thread_id` flows work out of the box.
|
|
26
|
+
3. **Compact `SYSTEM_PROMPT` within budget (`<= 120` words):** Verified automatically by the offline unit test suite.
|
|
27
|
+
4. **Eager + progressive agent memory + project documentation:** Generates `README.md` (documenting all generated artifacts, setup, run commands, and eval commands), `AGENTS.md`, and `skills/<domain>/SKILL.md`.
|
|
28
|
+
5. **Wired evaluation harness immediately ready:** Composes `evoloop-init/scripts/scaffold_evals.py` and wires the generated agent + deterministic fake client into both offline and live tests so offline tests pass on Day 1.
|
|
29
|
+
|
|
30
|
+
## Writing Style Requirement
|
|
31
|
+
|
|
32
|
+
Before generating or customizing any human-targeted document or code comment, read [`../evoloop-constitution/references/writing-guide.md`](../evoloop-constitution/references/writing-guide.md) (`.agents/skills/evoloop-constitution/references/writing-guide.md`). Apply its Simplified Technical English rules to every generated or edited:
|
|
33
|
+
- Documentation file (`README.md`, `.evoloop/constitution.md`, `AGENTS.md`, `skills/<domain>/SKILL.md`, `evaluations/README.md`)
|
|
34
|
+
- YAML comment (`.evoloop/config.yaml`, `evals/datasets/<domain>_flows.yaml`, `application.yml`)
|
|
35
|
+
- Code comment, Python docstring, and Java Javadoc across `src/`, `evals/`, and `tests/`
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
### Step 1: Gather Agent Specification Interactively
|
|
40
|
+
Ask the user concisely for any details not already provided:
|
|
41
|
+
1. **Project name** (kebab-case, e.g., `billing-assistant` — defaults to target directory name).
|
|
42
|
+
2. **Domain name** (short `snake_case`, e.g., `billing`, `support`, `inventory`).
|
|
43
|
+
3. **Language stack & build tool:**
|
|
44
|
+
- `python` (`uv` + `pytest`)
|
|
45
|
+
- `java` (`maven` or `gradle` + JUnit 5)
|
|
46
|
+
4. **Framework:**
|
|
47
|
+
- Python: `deepagents` *(recommended)* or `custom`
|
|
48
|
+
- Java: `custom` *(pure JDK 17 CLI)*, `micronaut` *(HTTP server)*, `spring-ai` *(Spring Boot HTTP server)*, or `langchain4j` *(CLI with `AiServices`)*
|
|
49
|
+
5. **Java base package** (Java only, e.g., `com.example.billing`).
|
|
50
|
+
6. **Initial domain tools** (comma-separated `snake_case` names, e.g., `get_account,list_invoices`; defaults to `lookup_record`).
|
|
51
|
+
7. **Core domain invariants** (what the agent must always/never do, e.g., never fabricate tool data, ask before calling tools on vague inputs, always reply honestly on errors, strict scope boundaries).
|
|
52
|
+
|
|
53
|
+
### Step 2: Run the Greenfield Scaffolder (`scaffold_agent.py`)
|
|
54
|
+
Preview first with `--dry-run` if desired, then generate the runnable application:
|
|
55
|
+
|
|
56
|
+
**Python (`deepagents` or `custom`):**
|
|
57
|
+
```bash
|
|
58
|
+
uv run .agents/skills/evoloop-new/scripts/scaffold_agent.py \
|
|
59
|
+
--target . \
|
|
60
|
+
--project-name <project-name> \
|
|
61
|
+
--domain <domain_name> \
|
|
62
|
+
--stack python \
|
|
63
|
+
--framework deepagents \
|
|
64
|
+
--tools <tool_one,tool_two>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Java (`custom`, `micronaut`, `spring-ai`, or `langchain4j`):**
|
|
68
|
+
```bash
|
|
69
|
+
uv run .agents/skills/evoloop-new/scripts/scaffold_agent.py \
|
|
70
|
+
--target . \
|
|
71
|
+
--project-name <project-name> \
|
|
72
|
+
--domain <domain_name> \
|
|
73
|
+
--stack java \
|
|
74
|
+
--build-tool maven \
|
|
75
|
+
--framework micronaut \
|
|
76
|
+
--java-package com.example.<domain_name> \
|
|
77
|
+
--tools <tool_one,tool_two>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
*(Note: `scaffold_agent.py` refuses to overwrite a non-empty project directory unless `--allow-non-empty` is passed; existing `.agents/` and `.git/` folders are safely ignored so you can copy `.agents/skills/evoloop-*` into an empty folder first. Optional flags `--git-init` and `--verify` can also initialize Git and run the offline test gate directly.)*
|
|
81
|
+
|
|
82
|
+
### Step 3: Refine the Constitution, Domain Logic & Generated `README.md`
|
|
83
|
+
Review and customize the generated files with the user's concrete domain details (or run **`evoloop-constitution`** to refine `.evoloop/constitution.md` and `.evoloop/config.yaml` interactively before expanding scenarios):
|
|
84
|
+
- **`.evoloop/constitution.md` & `.evoloop/config.yaml`**: Replace generic defaults with concrete, falsifiable domain invariants, prompt word budgets, and approval boundaries — every downstream skill (`evoloop-scenarios`, `evoloop-evaluate`, `evoloop-implement`, `evoloop-evolve`) relies on these rules to produce high-signal scenarios, clean prompts, and safe commits.
|
|
85
|
+
- **`AGENTS.md` and `skills/<domain>/SKILL.md`**: Align concrete tool-selection rules, input validation, error recovery, and response examples with `.evoloop/constitution.md`.
|
|
86
|
+
- **`README.md`**: Verify the generated artifact inventory, prerequisites, environment variables, app run command, and test commands reflect any domain-specific customizations you add, written according to `writing-guide.md`.
|
|
87
|
+
- **Runtime client & agent** (`src/<pkg>/client.py` + `agent.py`, or `src/main/java/<pkg>/...`): Refine tool signatures/descriptions, implement real backend calls if requested, keep `SYSTEM_PROMPT` within `budgets.max_system_prompt_words` (`<= 120` words), and ensure all code comments, docstrings, and Javadocs follow `writing-guide.md`.
|
|
88
|
+
- **Deterministic fakes** (`evals/fakes.py` or `Fake<Domain>Client.java`): Populate realistic deterministic test fixtures for each tool.
|
|
89
|
+
|
|
90
|
+
### Step 4: Initialize Git, Validate Scenarios & Verify Offline Gate
|
|
91
|
+
Run the standard Day-1 verification steps (or pass `--git-init --verify` to `scaffold_agent.py`):
|
|
92
|
+
|
|
93
|
+
1. **Initialize Git** (if not already a repo):
|
|
94
|
+
```bash
|
|
95
|
+
git init
|
|
96
|
+
```
|
|
97
|
+
2. **Validate the starter scenario dataset:**
|
|
98
|
+
```bash
|
|
99
|
+
# Python:
|
|
100
|
+
uv run .agents/skills/evoloop-scenarios/scripts/validate_scenarios.py \
|
|
101
|
+
evals/datasets/<domain>_flows.yaml \
|
|
102
|
+
--config .evoloop/config.yaml \
|
|
103
|
+
--harness evals/harness.py
|
|
104
|
+
|
|
105
|
+
# Java:
|
|
106
|
+
uv run .agents/skills/evoloop-scenarios/scripts/validate_scenarios.py \
|
|
107
|
+
evals/datasets/<domain>_flows.yaml \
|
|
108
|
+
--config .evoloop/config.yaml
|
|
109
|
+
```
|
|
110
|
+
3. **Sync dependencies and run the offline test gate:**
|
|
111
|
+
- **Python:** `uv sync --group eval && uv run pytest`
|
|
112
|
+
- **Java (Maven):** `mvn test`
|
|
113
|
+
- **Java (Gradle):** `./gradlew test`
|
|
114
|
+
4. **Commit the baseline:**
|
|
115
|
+
```bash
|
|
116
|
+
git add .
|
|
117
|
+
git commit -m "feat: initial runnable evaluation-ready <domain> agent application"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Step 5: Hand Off to the Evaluation Loop
|
|
121
|
+
Once the offline gate passes 100%, guide the user to:
|
|
122
|
+
1. **`evoloop-constitution`** *(recommended if defaults were used)* — Refine `.evoloop/constitution.md` and `.evoloop/config.yaml` with concrete domain invariants, prompt budgets, and approval boundaries so downstream scenarios and triage are maximally sharp.
|
|
123
|
+
2. **`evoloop-scenarios`** — Expand `evals/datasets/<domain>_flows.yaml` from your constitution across happy path, input validation, multi-turn, error recovery, edge cases, and scope adherence.
|
|
124
|
+
3. **`evoloop-evaluate`** — Run the baseline live evaluation against an OpenAI-compatible LLM endpoint.
|
|
125
|
+
4. **`evoloop-implement`** / **`evoloop-evolve`** — Iterate toward 100% pass rate with traceable commits and circuit-breaker safeguards.
|