harness-evolver 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/agents/harness-evolver-proposer.md +163 -0
- package/bin/install.js +125 -0
- package/examples/classifier/README.md +25 -0
- package/examples/classifier/config.json +3 -0
- package/examples/classifier/eval.py +58 -0
- package/examples/classifier/harness.py +111 -0
- package/examples/classifier/tasks/task_001.json +1 -0
- package/examples/classifier/tasks/task_002.json +1 -0
- package/examples/classifier/tasks/task_003.json +1 -0
- package/examples/classifier/tasks/task_004.json +1 -0
- package/examples/classifier/tasks/task_005.json +1 -0
- package/examples/classifier/tasks/task_006.json +1 -0
- package/examples/classifier/tasks/task_007.json +1 -0
- package/examples/classifier/tasks/task_008.json +1 -0
- package/examples/classifier/tasks/task_009.json +1 -0
- package/examples/classifier/tasks/task_010.json +1 -0
- package/package.json +29 -0
- package/skills/harness-evolve/SKILL.md +93 -0
- package/skills/harness-evolve-init/SKILL.md +53 -0
- package/skills/harness-evolve-status/SKILL.md +25 -0
- package/tools/__pycache__/detect_stack.cpython-313.pyc +0 -0
- package/tools/__pycache__/langsmith_adapter.cpython-313.pyc +0 -0
- package/tools/__pycache__/langsmith_api.cpython-313.pyc +0 -0
- package/tools/__pycache__/trace_logger.cpython-313.pyc +0 -0
- package/tools/detect_stack.py +173 -0
- package/tools/evaluate.py +214 -0
- package/tools/init.py +231 -0
- package/tools/state.py +219 -0
- package/tools/trace_logger.py +42 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""TraceLogger — optional helper for harnesses to write structured trace records.
|
|
2
|
+
|
|
3
|
+
Usage in a harness:
|
|
4
|
+
from trace_logger import TraceLogger
|
|
5
|
+
|
|
6
|
+
trace = TraceLogger(traces_dir)
|
|
7
|
+
trace.step("llm_call", {"prompt": p, "response": r, "model": "gpt-4"})
|
|
8
|
+
trace.step("tool_use", {"tool": "search", "query": q, "results": results})
|
|
9
|
+
trace.save()
|
|
10
|
+
|
|
11
|
+
Stdlib-only. No external dependencies.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import time
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class TraceLogger:
|
|
20
|
+
def __init__(self, traces_dir):
|
|
21
|
+
self.traces_dir = traces_dir
|
|
22
|
+
self._steps = []
|
|
23
|
+
if traces_dir:
|
|
24
|
+
os.makedirs(traces_dir, exist_ok=True)
|
|
25
|
+
|
|
26
|
+
def step(self, name, data=None):
|
|
27
|
+
self._steps.append({
|
|
28
|
+
"name": name,
|
|
29
|
+
"timestamp": time.time(),
|
|
30
|
+
"data": data if data is not None else {},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
def save(self):
|
|
34
|
+
if not self.traces_dir:
|
|
35
|
+
return
|
|
36
|
+
path = os.path.join(self.traces_dir, "trace.json")
|
|
37
|
+
with open(path, "w") as f:
|
|
38
|
+
json.dump(self._steps, f, indent=2)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def steps(self):
|
|
42
|
+
return list(self._steps)
|