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,111 @@
|
|
|
1
|
+
#!/usr/bin/env -S uv run --script
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.11"
|
|
4
|
+
# dependencies = []
|
|
5
|
+
# ///
|
|
6
|
+
"""Idempotently append or update an evaluation run row in evaluations/README.md."""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
TABLE_HEADER = """# Evaluation Reports
|
|
16
|
+
|
|
17
|
+
This table lists historical live evaluation runs.
|
|
18
|
+
Each row links to the analysis, progress comparison, task list, and raw output.
|
|
19
|
+
|
|
20
|
+
## Reports
|
|
21
|
+
|
|
22
|
+
| Timestamp | Git HEAD | Command or Mode | Result | Checks | Duration | Analysis | Progress | Tasks | Raw Output |
|
|
23
|
+
| :--- | :---: | :--- | :---: | :---: | :---: | :--- | :--- | :--- | :--- |
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def build_row(
|
|
28
|
+
*,
|
|
29
|
+
timestamp: str,
|
|
30
|
+
git_head: str,
|
|
31
|
+
command: str,
|
|
32
|
+
scenarios_passed: int,
|
|
33
|
+
scenarios_total: int,
|
|
34
|
+
checks_passed: int,
|
|
35
|
+
checks_total: int,
|
|
36
|
+
duration: str,
|
|
37
|
+
has_progress: bool,
|
|
38
|
+
) -> str:
|
|
39
|
+
sc_pct = round((scenarios_passed / scenarios_total) * 100) if scenarios_total else 0
|
|
40
|
+
ch_pct = round((checks_passed / checks_total) * 100, 1) if checks_total else 0.0
|
|
41
|
+
is_perfect = scenarios_total > 0 and scenarios_passed == scenarios_total and checks_passed == checks_total
|
|
42
|
+
|
|
43
|
+
result_cell = f"**{scenarios_passed}/{scenarios_total} ({sc_pct}%)**" if is_perfect else f"{scenarios_passed}/{scenarios_total} ({sc_pct}%)"
|
|
44
|
+
checks_cell = f"**{checks_passed}/{checks_total} ({ch_pct:.0f}%)**" if is_perfect else f"{checks_passed}/{checks_total} ({ch_pct:.1f}%)"
|
|
45
|
+
dur_cell = f"**{duration}**" if is_perfect else duration
|
|
46
|
+
progress_cell = f"[progress.md](./{timestamp}/progress.md)" if has_progress else "— (baseline)"
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
f"| `{timestamp}` | `{git_head}` | `{command}` | {result_cell} | {checks_cell} | {dur_cell} "
|
|
50
|
+
f"| [analysis.md](./{timestamp}/analysis.md) | {progress_cell} "
|
|
51
|
+
f"| [tasks.md](./{timestamp}/tasks.md) | [report](./{timestamp}/report) |"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def update_index(index_path: Path, timestamp: str, row: str) -> None:
|
|
56
|
+
if not index_path.is_file():
|
|
57
|
+
index_path.parent.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
index_path.write_text(TABLE_HEADER + row + "\n", encoding="utf-8")
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
lines = index_path.read_text(encoding="utf-8").splitlines()
|
|
62
|
+
marker = f"| `{timestamp}` |"
|
|
63
|
+
replaced = False
|
|
64
|
+
for idx, line in enumerate(lines):
|
|
65
|
+
if line.startswith(marker):
|
|
66
|
+
lines[idx] = row
|
|
67
|
+
replaced = True
|
|
68
|
+
break
|
|
69
|
+
|
|
70
|
+
if not replaced:
|
|
71
|
+
lines.append(row)
|
|
72
|
+
|
|
73
|
+
index_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def main(argv: list[str] | None = None) -> int:
|
|
77
|
+
parser = argparse.ArgumentParser(description="Update evaluations/README.md with a run row.")
|
|
78
|
+
parser.add_argument("--index", type=Path, default=Path("evaluations/README.md"))
|
|
79
|
+
parser.add_argument("--timestamp", required=True)
|
|
80
|
+
parser.add_argument("--head", required=True, help="Short git HEAD SHA.")
|
|
81
|
+
parser.add_argument("--command", required=True)
|
|
82
|
+
parser.add_argument("--report-json", type=Path, required=True, help="Output JSON from parse_pytest_report.py.")
|
|
83
|
+
parser.add_argument("--baseline", action="store_true", help="Mark Progress column as baseline.")
|
|
84
|
+
args = parser.parse_args(argv)
|
|
85
|
+
|
|
86
|
+
if not args.report_json.is_file():
|
|
87
|
+
print(f"ERROR: Report JSON not found: {args.report_json}", file=sys.stderr)
|
|
88
|
+
return 2
|
|
89
|
+
|
|
90
|
+
data = json.loads(args.report_json.read_text(encoding="utf-8"))
|
|
91
|
+
run_dir = args.index.parent / args.timestamp
|
|
92
|
+
has_progress = (not args.baseline) and (run_dir / "progress.md").is_file()
|
|
93
|
+
|
|
94
|
+
row = build_row(
|
|
95
|
+
timestamp=args.timestamp,
|
|
96
|
+
git_head=args.head,
|
|
97
|
+
command=args.command,
|
|
98
|
+
scenarios_passed=int(data["scenarios_passed"]),
|
|
99
|
+
scenarios_total=int(data["scenarios_total"]),
|
|
100
|
+
checks_passed=int(data["checks_passed"]),
|
|
101
|
+
checks_total=int(data["checks_total"]),
|
|
102
|
+
duration=str(data.get("duration_human", "—")),
|
|
103
|
+
has_progress=has_progress,
|
|
104
|
+
)
|
|
105
|
+
update_index(args.index, args.timestamp, row)
|
|
106
|
+
print(f"Updated {args.index} for {args.timestamp}.")
|
|
107
|
+
return 0
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
if __name__ == "__main__":
|
|
111
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env -S uv run --script
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.11"
|
|
4
|
+
# dependencies = ["pyyaml>=6.0"]
|
|
5
|
+
# ///
|
|
6
|
+
"""Validate a parsed.json evaluation report against the Evoloop parsed-report v1.0 contract."""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
SCHEMA_PATH = Path(__file__).resolve().parent.parent / "schemas" / "parsed_report.schema.json"
|
|
17
|
+
|
|
18
|
+
REQUIRED_TOP_LEVEL = {
|
|
19
|
+
"schema_version",
|
|
20
|
+
"stack",
|
|
21
|
+
"report_format",
|
|
22
|
+
"scenarios_passed",
|
|
23
|
+
"scenarios_total",
|
|
24
|
+
"scenario_pass_rate_pct",
|
|
25
|
+
"checks_passed",
|
|
26
|
+
"checks_total",
|
|
27
|
+
"check_pass_rate_pct",
|
|
28
|
+
"deterministic_checks_passed",
|
|
29
|
+
"deterministic_checks_total",
|
|
30
|
+
"judge_active",
|
|
31
|
+
"duration_seconds",
|
|
32
|
+
"duration_human",
|
|
33
|
+
"evaluators",
|
|
34
|
+
"judge_only_failures",
|
|
35
|
+
"cases",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _is_int(v: Any) -> bool:
|
|
40
|
+
return isinstance(v, int) and not isinstance(v, bool)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _is_num(v: Any) -> bool:
|
|
44
|
+
return isinstance(v, (int, float)) and not isinstance(v, bool)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def validate_parsed_report(data: Any) -> list[str]:
|
|
48
|
+
"""Return a list of schema violation messages (empty if valid)."""
|
|
49
|
+
errors: list[str] = []
|
|
50
|
+
if not isinstance(data, dict):
|
|
51
|
+
return ["Root must be a JSON object."]
|
|
52
|
+
|
|
53
|
+
missing = sorted(REQUIRED_TOP_LEVEL - set(data.keys()))
|
|
54
|
+
if missing:
|
|
55
|
+
errors.append(f"Missing required top-level field(s): {missing}")
|
|
56
|
+
|
|
57
|
+
extra = sorted(set(data.keys()) - REQUIRED_TOP_LEVEL)
|
|
58
|
+
if extra:
|
|
59
|
+
errors.append(f"Unexpected top-level field(s): {extra}")
|
|
60
|
+
|
|
61
|
+
if data.get("schema_version") != "1.0":
|
|
62
|
+
errors.append(f"schema_version must be '1.0', got {data.get('schema_version')!r}.")
|
|
63
|
+
|
|
64
|
+
for str_field in ("stack", "report_format", "duration_human"):
|
|
65
|
+
val = data.get(str_field)
|
|
66
|
+
if not isinstance(val, str) or not val.strip():
|
|
67
|
+
errors.append(f"'{str_field}' must be a non-empty string.")
|
|
68
|
+
|
|
69
|
+
for int_field in (
|
|
70
|
+
"scenarios_passed",
|
|
71
|
+
"scenarios_total",
|
|
72
|
+
"checks_passed",
|
|
73
|
+
"checks_total",
|
|
74
|
+
"deterministic_checks_passed",
|
|
75
|
+
"deterministic_checks_total",
|
|
76
|
+
):
|
|
77
|
+
val = data.get(int_field)
|
|
78
|
+
if not _is_int(val) or val < 0:
|
|
79
|
+
errors.append(f"'{int_field}' must be a non-negative integer, got {val!r}.")
|
|
80
|
+
|
|
81
|
+
for pct_field in ("scenario_pass_rate_pct", "check_pass_rate_pct"):
|
|
82
|
+
val = data.get(pct_field)
|
|
83
|
+
if not _is_num(val) or not (0 <= float(val) <= 100):
|
|
84
|
+
errors.append(f"'{pct_field}' must be a number in [0, 100], got {val!r}.")
|
|
85
|
+
|
|
86
|
+
if not isinstance(data.get("judge_active"), bool):
|
|
87
|
+
errors.append("'judge_active' must be a boolean.")
|
|
88
|
+
|
|
89
|
+
dur = data.get("duration_seconds")
|
|
90
|
+
if dur is not None and (not _is_num(dur) or float(dur) < 0):
|
|
91
|
+
errors.append(f"'duration_seconds' must be a non-negative number or null, got {dur!r}.")
|
|
92
|
+
|
|
93
|
+
evaluators = data.get("evaluators")
|
|
94
|
+
if not isinstance(evaluators, dict):
|
|
95
|
+
errors.append("'evaluators' must be an object.")
|
|
96
|
+
else:
|
|
97
|
+
for ev_name, ev_obj in evaluators.items():
|
|
98
|
+
if not isinstance(ev_obj, dict):
|
|
99
|
+
errors.append(f"evaluators.{ev_name} must be an object.")
|
|
100
|
+
continue
|
|
101
|
+
if ev_obj.get("type") not in ("deterministic", "llm_judge"):
|
|
102
|
+
errors.append(f"evaluators.{ev_name}.type must be 'deterministic' or 'llm_judge'.")
|
|
103
|
+
for f in ("passed", "total"):
|
|
104
|
+
if not _is_int(ev_obj.get(f)) or ev_obj[f] < 0:
|
|
105
|
+
errors.append(f"evaluators.{ev_name}.{f} must be a non-negative integer.")
|
|
106
|
+
if not _is_num(ev_obj.get("pass_rate_pct")):
|
|
107
|
+
errors.append(f"evaluators.{ev_name}.pass_rate_pct must be a number.")
|
|
108
|
+
fc = ev_obj.get("failed_cases")
|
|
109
|
+
if not isinstance(fc, list) or not all(isinstance(x, str) for x in fc):
|
|
110
|
+
errors.append(f"evaluators.{ev_name}.failed_cases must be a list of strings.")
|
|
111
|
+
|
|
112
|
+
jof = data.get("judge_only_failures")
|
|
113
|
+
if not isinstance(jof, list) or not all(isinstance(x, str) for x in jof):
|
|
114
|
+
errors.append("'judge_only_failures' must be a list of strings.")
|
|
115
|
+
|
|
116
|
+
cases = data.get("cases")
|
|
117
|
+
if not isinstance(cases, list):
|
|
118
|
+
errors.append("'cases' must be a list.")
|
|
119
|
+
else:
|
|
120
|
+
for idx, c in enumerate(cases):
|
|
121
|
+
prefix = f"cases[{idx}]"
|
|
122
|
+
if not isinstance(c, dict):
|
|
123
|
+
errors.append(f"{prefix} must be an object.")
|
|
124
|
+
continue
|
|
125
|
+
if not isinstance(c.get("id"), str) or not c["id"]:
|
|
126
|
+
errors.append(f"{prefix}.id must be a non-empty string.")
|
|
127
|
+
if not isinstance(c.get("category"), str):
|
|
128
|
+
errors.append(f"{prefix}.category must be a string.")
|
|
129
|
+
if c.get("status") not in ("PASS", "FAIL"):
|
|
130
|
+
errors.append(f"{prefix}.status must be 'PASS' or 'FAIL'.")
|
|
131
|
+
for f in ("checks_passed", "checks_total"):
|
|
132
|
+
if not _is_int(c.get(f)) or c[f] < 0:
|
|
133
|
+
errors.append(f"{prefix}.{f} must be a non-negative integer.")
|
|
134
|
+
if not isinstance(c.get("failed_evaluators"), list):
|
|
135
|
+
errors.append(f"{prefix}.failed_evaluators must be a list.")
|
|
136
|
+
if not isinstance(c.get("failures"), list):
|
|
137
|
+
errors.append(f"{prefix}.failures must be a list.")
|
|
138
|
+
else:
|
|
139
|
+
for f_idx, f_item in enumerate(c["failures"]):
|
|
140
|
+
if (
|
|
141
|
+
not isinstance(f_item, dict)
|
|
142
|
+
or not isinstance(f_item.get("evaluator"), str)
|
|
143
|
+
or not isinstance(f_item.get("reason"), str)
|
|
144
|
+
):
|
|
145
|
+
errors.append(
|
|
146
|
+
f"{prefix}.failures[{f_idx}] must have string 'evaluator' and 'reason'."
|
|
147
|
+
)
|
|
148
|
+
if c.get("final_response") is not None and not isinstance(c.get("final_response"), str):
|
|
149
|
+
errors.append(f"{prefix}.final_response must be string or null.")
|
|
150
|
+
if c.get("domain_tool_calls") is not None and not isinstance(c.get("domain_tool_calls"), str):
|
|
151
|
+
errors.append(f"{prefix}.domain_tool_calls must be string or null.")
|
|
152
|
+
if c.get("skill_loaded") is not None and not isinstance(c.get("skill_loaded"), bool):
|
|
153
|
+
errors.append(f"{prefix}.skill_loaded must be boolean or null.")
|
|
154
|
+
|
|
155
|
+
return errors
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def main(argv: list[str] | None = None) -> int:
|
|
159
|
+
parser = argparse.ArgumentParser(description="Validate parsed.json against Evoloop schema.")
|
|
160
|
+
parser.add_argument("parsed_json", type=Path, help="Path to parsed.json file.")
|
|
161
|
+
args = parser.parse_args(argv)
|
|
162
|
+
|
|
163
|
+
if not args.parsed_json.is_file():
|
|
164
|
+
print(f"ERROR: File not found: {args.parsed_json}", file=sys.stderr)
|
|
165
|
+
return 2
|
|
166
|
+
|
|
167
|
+
data = json.loads(args.parsed_json.read_text(encoding="utf-8"))
|
|
168
|
+
errors = validate_parsed_report(data)
|
|
169
|
+
if errors:
|
|
170
|
+
for e in errors:
|
|
171
|
+
print(f"SCHEMA ERROR: {e}", file=sys.stderr)
|
|
172
|
+
return 1
|
|
173
|
+
print(f"OK: {args.parsed_json} conforms to {SCHEMA_PATH.name} (v1.0).")
|
|
174
|
+
return 0
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if __name__ == "__main__":
|
|
178
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Agentic Flow Evaluation Analysis: <TIMESTAMP>
|
|
2
|
+
|
|
3
|
+
## 1. Execution Summary and Metrics
|
|
4
|
+
|
|
5
|
+
| Metric | Value |
|
|
6
|
+
| :--- | :--- |
|
|
7
|
+
| **Timestamp** | `<TIMESTAMP>` |
|
|
8
|
+
| **Git HEAD** | `<SHORT_SHA>` (`<COMMIT_SUBJECT>`) |
|
|
9
|
+
| **Command** | `<COMMAND>` |
|
|
10
|
+
| **Scenarios** | `<TOTAL>` total: **`<PASSED>` passed**, **`<FAILED>` failed** (`<PASS_PCT>%` pass rate) |
|
|
11
|
+
| **Individual Checks** | **`<CHECKS_PASSED>/<CHECKS_TOTAL>` passed (`<CHECKS_PCT>%`)** |
|
|
12
|
+
| **Deterministic Checks** | **`<DET_PASSED>/<DET_TOTAL>`** |
|
|
13
|
+
| **Total Duration** | `<DURATION_HUMAN>` (`<DURATION_SECONDS>s`) |
|
|
14
|
+
| **Raw Output** | [report](./report) |
|
|
15
|
+
| **Progress Comparison** | [progress.md](./progress.md) |
|
|
16
|
+
| **Proposed Tasks** | [tasks.md](./tasks.md) |
|
|
17
|
+
|
|
18
|
+
### Scenario Breakdown
|
|
19
|
+
|
|
20
|
+
| # | Scenario | Category | Status | Failed Evaluators |
|
|
21
|
+
| :---: | :--- | :--- | :---: | :--- |
|
|
22
|
+
| 1 | `<case_id>` | `<category>` | **PASS or FAIL** | None |
|
|
23
|
+
|
|
24
|
+
### Evaluator Pass Rates
|
|
25
|
+
|
|
26
|
+
| Evaluator | Type | Pass Rate | Failed Scenarios |
|
|
27
|
+
| :--- | :--- | :---: | :--- |
|
|
28
|
+
| `trajectory_match` | Deterministic | `<X/N>` | None |
|
|
29
|
+
| `tool_policy` | Deterministic | `<X/N>` | None |
|
|
30
|
+
| `efficiency_budget` | Deterministic | `<X/N>` | None |
|
|
31
|
+
| `groundedness` | Deterministic | `<X/N>` | None |
|
|
32
|
+
| `trajectory_quality` | LLM Judge | `<X/N>` | None |
|
|
33
|
+
| `response_quality` | LLM Judge | `<X/N>` | None |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 2. Root-Cause Analysis (Four-Bucket Triage)
|
|
38
|
+
|
|
39
|
+
> Assign every failing scenario to one primary bucket. Check `skill_loaded` and inspect judge-formatted inputs whenever all deterministic checks pass and only a judge fails.
|
|
40
|
+
|
|
41
|
+
### Bucket 1: Code, Harness, and Agent Runtime Bugs
|
|
42
|
+
- None (or list specific case IDs, evidence from `report`, and the root cause)
|
|
43
|
+
|
|
44
|
+
### Bucket 2: Evaluator and Judge Bugs
|
|
45
|
+
- None (or list specific case IDs, the exact formatted-input defect, and the required offline unit test)
|
|
46
|
+
|
|
47
|
+
### Bucket 3: Skill and Agent Memory Gaps
|
|
48
|
+
- None (or list specific case IDs, `skill_loaded` status, and the missing or ambiguous rule)
|
|
49
|
+
|
|
50
|
+
### Bucket 4: Scenario Definition Issues
|
|
51
|
+
- None (or list specific case IDs and objective evidence that proves a scenario defect instead of an agent bug)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Evaluation Progress Report: <CURRENT_TS> Compared with <PREV_TS>
|
|
2
|
+
|
|
3
|
+
## 1. Overall Verdict
|
|
4
|
+
|
|
5
|
+
- **Summary:** `<Net improvement, regression, or plateau>`: `<cur_passed>/<total>` compared with `<prev_passed>/<total>` scenarios, and `<cur_checks>/<checks_total>` compared with `<prev_checks>/<checks_total>` checks.
|
|
6
|
+
- **Key Wins:** ...
|
|
7
|
+
- **Regressions and Remaining Gaps:** ...
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 2. High-Level Metric Comparison
|
|
12
|
+
|
|
13
|
+
| Metric | Baseline (`<BASE_TS>`) | Previous (`<PREV_TS>`) | Current (`<CURRENT_TS>`) | Delta (Against Previous) |
|
|
14
|
+
| :--- | :---: | :---: | :---: | :---: |
|
|
15
|
+
| **Scenarios Passed** | `<B>` | `<P>` | **`<C>`** | `<DELTA>` |
|
|
16
|
+
| **Individual Checks** | `<B>` | `<P>` | **`<C>`** | `<DELTA>` |
|
|
17
|
+
| **Wall-Clock Time** | `<B>` | `<P>` | **`<C>`** | `<DELTA>` |
|
|
18
|
+
|
|
19
|
+
### Evaluator Pass Rate Comparison
|
|
20
|
+
|
|
21
|
+
| Evaluator | Previous | Current | Delta |
|
|
22
|
+
| :--- | :---: | :---: | :---: |
|
|
23
|
+
| `trajectory_match` | `<P>` | `<C>` | `<D>` |
|
|
24
|
+
| `tool_policy` | `<P>` | `<C>` | `<D>` |
|
|
25
|
+
| `efficiency_budget` | `<P>` | `<C>` | `<D>` |
|
|
26
|
+
| `groundedness` | `<P>` | `<C>` | `<D>` |
|
|
27
|
+
| `trajectory_quality` (Judge) | `<P>` | `<C>` | `<D>` |
|
|
28
|
+
| `response_quality` (Judge) | `<P>` | `<C>` | `<D>` |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 3. Scenario-by-Scenario Diff
|
|
33
|
+
|
|
34
|
+
| Scenario | Previous (`<PREV_TS>`) | Current (`<CURRENT_TS>`) | Impact of Last Changes |
|
|
35
|
+
| :--- | :---: | :---: | :--- |
|
|
36
|
+
| `<case_id>` | PASS or FAIL | PASS or FAIL | Stable, **Fixed**, or **Regression** |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 4. Assessment of Each Commit
|
|
41
|
+
|
|
42
|
+
1. **`<SHORT_SHA>` (`<commit subject>`):** `<Clean win, Half win, Zero runtime effect, or Regression>`: concrete evidence from `report`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Proposed Improvement Tasks: <TIMESTAMP>
|
|
2
|
+
|
|
3
|
+
Derived from [analysis.md](./analysis.md) and [progress.md](./progress.md) (raw output: [report](./report)).
|
|
4
|
+
|
|
5
|
+
**Goal:** `<Concise target outcome for this iteration>`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Code Fixes
|
|
10
|
+
|
|
11
|
+
<!-- Include agent runtime, system_prompt, harness, fakes, and offline tests.
|
|
12
|
+
If any task modifies `evals/evaluators/**`, tag it `[REQUIRES APPROVAL: EVALUATOR]`
|
|
13
|
+
and specify the offline regression unit test in `tests/test_eval_framework.py`. -->
|
|
14
|
+
|
|
15
|
+
- [ ] **<Task summary>** (`<file_path>`):
|
|
16
|
+
- *Constitutional check:* Upholds `<Invariant #>`. Respects `max_system_prompt_words` budget. Violates zero invariants.
|
|
17
|
+
- *Verification:* `<Offline unit test or targeted check>`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. Skill and Agent Memory Updates
|
|
22
|
+
|
|
23
|
+
<!-- Edits to AGENTS.md and skills/**/SKILL.md. -->
|
|
24
|
+
|
|
25
|
+
- [x] **No skill or `AGENTS.md` changes required:** `<Rationale>`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 3. Scenario Updates
|
|
30
|
+
|
|
31
|
+
<!-- PROTECTED IN EVOLVE MODE: Any active `- [ ]` item here triggers mandatory human approval.
|
|
32
|
+
Present raw `report` evidence and the exact proposed YAML diff before any edit. -->
|
|
33
|
+
|
|
34
|
+
- [x] **No scenario changes required:** `<Rationale>`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evoloop-evolve
|
|
3
|
+
description: Orchestrate a bounded, safeguarded self-evolving optimization loop (`evaluate` → circuit breakers & approval gates → `implement` → re-`evaluate`) by dispatching each iteration to fresh subagents to avoid context-window rot.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Evoloop Evolve
|
|
7
|
+
|
|
8
|
+
Orchestrate the iterative evaluation-driven improvement loop with **defense-in-depth** safeguards: constitutional budgets, protected-path lock, circuit breakers, mandatory human-approval pauses for Scenario and Evaluator changes, and fresh subagent dispatch per phase.
|
|
9
|
+
|
|
10
|
+
## Architecture: Subagent-Dispatched Coordinator Loop
|
|
11
|
+
|
|
12
|
+
To prevent context-window rot from raw pytest logs across multi-iteration runs, the coordinator **never reads raw `evaluations/<ts>/report` files directly** unless presenting an approval diff to the user. Instead:
|
|
13
|
+
- The coordinator tracks state via `scripts/evolve_state.py` (`.evoloop/.evolve-lock` and `.evoloop/.evolve-state.json`).
|
|
14
|
+
- Each **Evaluate** phase is dispatched to a fresh subagent (`evoloop-evaluate`) that returns only the timestamp, parsed metrics JSON path, and a 5-line summary.
|
|
15
|
+
- Each **Implement** phase is dispatched to a fresh subagent (`evoloop-implement`) that receives only `.evoloop/constitution.md`, `.evoloop/config.yaml`, and `evaluations/<ts>/tasks.md`, applies safe sections, runs offline tests + `commit_section.py`, and returns the commit SHA(s).
|
|
16
|
+
|
|
17
|
+
## Writing Style Requirement
|
|
18
|
+
|
|
19
|
+
Read [`../evoloop-constitution/references/writing-guide.md`](../evoloop-constitution/references/writing-guide.md) (`.agents/skills/evoloop-constitution/references/writing-guide.md`) and enforce it throughout the loop:
|
|
20
|
+
- Follow `writing-guide.md` in every human-approval request, status report, and final summary produced by the coordinator.
|
|
21
|
+
- Explicitly instruct every dispatched Evaluate and Implement subagent to follow `.agents/skills/evoloop-constitution/references/writing-guide.md` in all generated documents (`analysis.md`, `progress.md`, `tasks.md`, `README.md`, `AGENTS.md`, `SKILL.md`) and in all added or edited code comments, docstrings, Javadocs, and YAML comments.
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
### Step 1: Initialize Evolve Session
|
|
26
|
+
1. Read `.evoloop/constitution.md` and `.evoloop/config.yaml`.
|
|
27
|
+
2. Verify the working tree is clean (`git status --short`) and offline tests pass (`uv run pytest`).
|
|
28
|
+
3. Start the evolve session and activate `.evoloop/.evolve-lock`:
|
|
29
|
+
```bash
|
|
30
|
+
uv run .agents/skills/evoloop-evolve/scripts/evolve_state.py start --config .evoloop/config.yaml
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Step 2: Iterative Loop (Bounded by `evolve.max_iterations`)
|
|
34
|
+
For each iteration `1 .. max_iterations`:
|
|
35
|
+
|
|
36
|
+
1. **Dispatch Evaluate Subagent:**
|
|
37
|
+
Invoke a fresh subagent (`self` / coding subagent) with instructions to execute the `evoloop-evaluate` skill:
|
|
38
|
+
- Run the configured live (+ judge) evaluation command, save raw output to `evaluations/<ts>/report`.
|
|
39
|
+
- Parse the report with `parse_pytest_report.py --out evaluations/<ts>/parsed.json`.
|
|
40
|
+
- Write `analysis.md`, `progress.md` (comparing against previous run), and `tasks.md`.
|
|
41
|
+
- Update `evaluations/README.md`.
|
|
42
|
+
- Return: `timestamp`, `git_head`, `evaluations/<ts>/parsed.json`, `evaluations/<ts>/tasks.md`, and a concise summary.
|
|
43
|
+
|
|
44
|
+
2. **Evaluate Circuit Breakers & Approval Gates:**
|
|
45
|
+
Run `evolve_state.py record` deterministically:
|
|
46
|
+
```bash
|
|
47
|
+
uv run .agents/skills/evoloop-evolve/scripts/evolve_state.py record \
|
|
48
|
+
--config .evoloop/config.yaml \
|
|
49
|
+
--timestamp <ts> \
|
|
50
|
+
--head <git_head> \
|
|
51
|
+
--report-json evaluations/<ts>/parsed.json \
|
|
52
|
+
--tasks evaluations/<ts>/tasks.md
|
|
53
|
+
```
|
|
54
|
+
Inspect the JSON `decision` returned by `evolve_state.py`:
|
|
55
|
+
- **`GOAL_REACHED`**: Stop the lock (`evolve_state.py stop`) and present the final summary (100% pass rate achieved).
|
|
56
|
+
- **`MAX_ITERATIONS_REACHED`**, **`UNRECOVERED_REGRESSION`**, or **`OSCILLATION_DETECTED`**: Stop the lock (`evolve_state.py stop`), report the exact trigger + best-so-far commit SHA (offering `git revert` if regressed), and halt for human review.
|
|
57
|
+
- **`APPROVAL_REQUIRED_SCENARIO`** or **`APPROVAL_REQUIRED_EVALUATOR`**:
|
|
58
|
+
- **Halt immediately** before editing any protected/evaluator path.
|
|
59
|
+
- Present a structured approval request to the user containing:
|
|
60
|
+
1. Which scenario(s) and evaluator(s) failed
|
|
61
|
+
2. Objective evidence from `evaluations/<ts>/report` proving why it is a scenario or evaluator defect rather than an agent bug
|
|
62
|
+
3. The exact proposed diff (and required offline unit test if touching `evals/evaluators/**`)
|
|
63
|
+
- Only after explicit user approval, dispatch an Implement subagent with the corresponding `--allow-scenario-edits` / `--allow-evaluator-edits` flag.
|
|
64
|
+
- **`CONTINUE`**:
|
|
65
|
+
- If `advisories` includes `JUDGE_ONLY_AUDIT`, instruct the Implement subagent to audit the judge input formatter first rather than blindly mutating `system_prompt`.
|
|
66
|
+
|
|
67
|
+
3. **Dispatch Implement Subagent (Safe Code & Skill Sections):**
|
|
68
|
+
Invoke a fresh subagent to execute `evoloop-implement` on `evaluations/<ts>/tasks.md`:
|
|
69
|
+
- Apply only approved sections (Code Fixes outside `evals/evaluators/**`, and Skill/Memory Updates).
|
|
70
|
+
- Respect `budgets.max_system_prompt_words` and refactor-over-append rules.
|
|
71
|
+
- Commit each section atomically via `commit_section.py` (which enforces `check_scope.py` and `uv run pytest`).
|
|
72
|
+
- Optionally run a targeted `-k <failing_case_id>` smoke check if `evolve.targeted_rerun_before_full: true` before returning to the coordinator for the next full evaluation cycle.
|
|
73
|
+
- Return: list of edited files and commit SHAs (pass edited files to the next `evolve_state.py record --edited-files ...` call for thrash detection).
|
|
74
|
+
|
|
75
|
+
### Step 3: Clean Up
|
|
76
|
+
Always run `evolve_state.py stop` when the loop terminates (whether on success, circuit breaker, or user cancel) so `.evoloop/.evolve-lock` is removed.
|