harness-evolver 0.5.0 → 0.5.1
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.
|
@@ -106,6 +106,8 @@ Append a summary to `PROPOSER_HISTORY.md`.
|
|
|
106
106
|
|
|
107
107
|
6. **Prefer readable harnesses over defensive ones.** If the harness has grown past 2x the baseline size without proportional score improvement, consider simplifying. Accumulated try/catch blocks, redundant fallbacks, and growing if-chains are a code smell in evolved harnesses.
|
|
108
108
|
|
|
109
|
+
7. **Use available API keys from environment.** Check `config.json` field `api_keys` to see which LLM APIs are available (Anthropic, OpenAI, Gemini, OpenRouter, etc.). Always read keys via `os.environ.get("KEY_NAME")` — never hardcode values. If an evolution strategy requires an API that isn't available, note it in `proposal.md` and choose an alternative.
|
|
110
|
+
|
|
109
111
|
## Documentation Lookup (if Context7 available)
|
|
110
112
|
|
|
111
113
|
- Read `config.json` field `stack.detected` to see which libraries the harness uses.
|
package/bin/install.js
CHANGED
|
@@ -16,7 +16,8 @@ const PLUGIN_ROOT = path.resolve(__dirname, "..");
|
|
|
16
16
|
const HOME = process.env.HOME || process.env.USERPROFILE;
|
|
17
17
|
|
|
18
18
|
// ANSI colors
|
|
19
|
-
const
|
|
19
|
+
const MAGENTA = "\x1b[35m";
|
|
20
|
+
const BRIGHT_MAGENTA = "\x1b[95m";
|
|
20
21
|
const GREEN = "\x1b[32m";
|
|
21
22
|
const YELLOW = "\x1b[33m";
|
|
22
23
|
const RED = "\x1b[31m";
|
|
@@ -25,13 +26,13 @@ const BOLD = "\x1b[1m";
|
|
|
25
26
|
const RESET = "\x1b[0m";
|
|
26
27
|
|
|
27
28
|
const LOGO = `
|
|
28
|
-
${
|
|
29
|
+
${BRIGHT_MAGENTA} ██╗ ██╗ █████╗ ██████╗ ███╗ ██╗███████╗███████╗███████╗
|
|
29
30
|
██║ ██║██╔══██╗██╔══██╗████╗ ██║██╔════╝██╔════╝██╔════╝
|
|
30
31
|
███████║███████║██████╔╝██╔██╗ ██║█████╗ ███████╗███████╗
|
|
31
32
|
██╔══██║██╔══██║██╔══██╗██║╚██╗██║██╔══╝ ╚════██║╚════██║
|
|
32
33
|
██║ ██║██║ ██║██║ ██║██║ ╚████║███████╗███████║███████║
|
|
33
34
|
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝╚══════╝
|
|
34
|
-
${BOLD}███████╗██╗ ██╗ ██████╗ ██╗ ██╗ ██╗███████╗██████╗
|
|
35
|
+
${MAGENTA}${BOLD}███████╗██╗ ██╗ ██████╗ ██╗ ██╗ ██╗███████╗██████╗
|
|
35
36
|
██╔════╝██║ ██║██╔═══██╗██║ ██║ ██║██╔════╝██╔══██╗
|
|
36
37
|
█████╗ ██║ ██║██║ ██║██║ ██║ ██║█████╗ ██████╔╝
|
|
37
38
|
██╔══╝ ╚██╗ ██╔╝██║ ██║██║ ╚██╗ ██╔╝██╔══╝ ██╔══██╗
|
|
@@ -194,7 +195,7 @@ async function main() {
|
|
|
194
195
|
// Install for each selected runtime
|
|
195
196
|
for (const runtime of selectedRuntimes) {
|
|
196
197
|
const target = scope === "local" ? `./${runtime.dir}` : `~/${runtime.dir}`;
|
|
197
|
-
console.log(` Installing for ${
|
|
198
|
+
console.log(` Installing for ${BRIGHT_MAGENTA}${runtime.name}${RESET} to ${target}`);
|
|
198
199
|
console.log();
|
|
199
200
|
installForRuntime(runtime.dir, scope);
|
|
200
201
|
}
|
|
@@ -209,7 +210,7 @@ async function main() {
|
|
|
209
210
|
fs.writeFileSync(versionPath, VERSION);
|
|
210
211
|
console.log(` ${GREEN}✓${RESET} Wrote VERSION (${VERSION})`);
|
|
211
212
|
|
|
212
|
-
console.log(`\n ${GREEN}Done!${RESET} Open a project in Claude Code and run ${
|
|
213
|
+
console.log(`\n ${GREEN}Done!${RESET} Open a project in Claude Code and run ${BRIGHT_MAGENTA}/harness-evolver:init${RESET}`);
|
|
213
214
|
console.log(`\n ${DIM}Quick start with example:${RESET}`);
|
|
214
215
|
console.log(` cp -r ~/.harness-evolver/examples/classifier ./my-project`);
|
|
215
216
|
console.log(` cd my-project && claude`);
|
|
@@ -39,7 +39,7 @@ def classify_mock(text):
|
|
|
39
39
|
def classify_llm(text, config):
|
|
40
40
|
import urllib.request
|
|
41
41
|
|
|
42
|
-
api_key =
|
|
42
|
+
api_key = os.environ.get("ANTHROPIC_API_KEY", "")
|
|
43
43
|
model = config.get("model", "claude-haiku-4-5-20251001")
|
|
44
44
|
|
|
45
45
|
prompt = (
|
package/package.json
CHANGED
package/tools/init.py
CHANGED
|
@@ -89,6 +89,30 @@ def _auto_detect(search_dir):
|
|
|
89
89
|
return harness, eval_script, tasks, config
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
def _detect_api_keys():
|
|
93
|
+
"""Detect which LLM/service API keys are available in the environment."""
|
|
94
|
+
KNOWN_KEYS = {
|
|
95
|
+
"ANTHROPIC_API_KEY": "Anthropic (Claude)",
|
|
96
|
+
"OPENAI_API_KEY": "OpenAI (GPT)",
|
|
97
|
+
"GOOGLE_API_KEY": "Google (Gemini)",
|
|
98
|
+
"GEMINI_API_KEY": "Google Gemini",
|
|
99
|
+
"OPENROUTER_API_KEY": "OpenRouter",
|
|
100
|
+
"LANGSMITH_API_KEY": "LangSmith",
|
|
101
|
+
"TOGETHER_API_KEY": "Together AI",
|
|
102
|
+
"GROQ_API_KEY": "Groq",
|
|
103
|
+
"MISTRAL_API_KEY": "Mistral",
|
|
104
|
+
"COHERE_API_KEY": "Cohere",
|
|
105
|
+
"FIREWORKS_API_KEY": "Fireworks AI",
|
|
106
|
+
"DEEPSEEK_API_KEY": "DeepSeek",
|
|
107
|
+
"XAI_API_KEY": "xAI (Grok)",
|
|
108
|
+
}
|
|
109
|
+
detected = {}
|
|
110
|
+
for env_var, display_name in KNOWN_KEYS.items():
|
|
111
|
+
if os.environ.get(env_var):
|
|
112
|
+
detected[env_var] = {"name": display_name, "status": "detected"}
|
|
113
|
+
return detected
|
|
114
|
+
|
|
115
|
+
|
|
92
116
|
def _detect_langsmith():
|
|
93
117
|
"""Auto-detect LangSmith API key and return config section."""
|
|
94
118
|
if os.environ.get("LANGSMITH_API_KEY"):
|
|
@@ -252,9 +276,19 @@ def main():
|
|
|
252
276
|
"harnesses": "harnesses/",
|
|
253
277
|
},
|
|
254
278
|
}
|
|
279
|
+
# Detect API keys available in environment
|
|
280
|
+
api_keys = _detect_api_keys()
|
|
281
|
+
config["api_keys"] = api_keys
|
|
282
|
+
|
|
255
283
|
with open(os.path.join(base, "config.json"), "w") as f:
|
|
256
284
|
json.dump(config, f, indent=2)
|
|
257
285
|
|
|
286
|
+
if api_keys:
|
|
287
|
+
print("API keys detected:")
|
|
288
|
+
for env_var, info in api_keys.items():
|
|
289
|
+
print(f" {info['name']} ({env_var})")
|
|
290
|
+
print()
|
|
291
|
+
|
|
258
292
|
ls_config = config["eval"].get("langsmith", {})
|
|
259
293
|
if ls_config.get("enabled"):
|
|
260
294
|
print(" LangSmith tracing enabled (LANGSMITH_API_KEY detected)")
|