forked from jason/echo
ver 0.9
This commit is contained in:
+5
-5
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
"""run_eval.py — A/B eval of echo-memory 0.6 (raw curl, documented recipes) vs
|
||||
0.7 (the shipped echo.sh client) over representative memory operations, with
|
||||
0.7 (the shipped echo.py client) over representative memory operations, with
|
||||
fault injection.
|
||||
|
||||
Design
|
||||
------
|
||||
* A mock Obsidian REST API (mock_olrapi.py) gives deterministic behavior + faults,
|
||||
so no credentials are needed and the real vault is never touched.
|
||||
* The 0.7 side runs the ACTUAL shipped scripts/echo.sh (status-checked, retry, verify,
|
||||
* The 0.7 side runs the ACTUAL shipped scripts/echo.py (status-checked, retry, verify,
|
||||
idempotent append).
|
||||
* The 0.6 side faithfully models the documented raw-curl recipes: it performs the
|
||||
same HTTP but does NOT inspect status, does NOT retry, does NOT verify, and does
|
||||
@@ -32,7 +32,7 @@ import os, sys, json, time, subprocess, tempfile, argparse, urllib.request, urll
|
||||
from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
ECHO = HERE.parent / "echo-memory.plugin.src" / "skills" / "echo-memory" / "scripts" / "echo.sh"
|
||||
ECHO = HERE.parent / "echo-memory.plugin.src" / "skills" / "echo-memory" / "scripts" / "echo.py"
|
||||
KEY = "241265fbe6830934a9a4ad3e69335f64a42153b663aa5b0017cb1ea1217b2bab"
|
||||
|
||||
# ----- tiny HTTP helpers (used for setup, ground truth, and the 0.6 model) -----
|
||||
@@ -59,7 +59,7 @@ class Eval:
|
||||
def toks(self, text): return round(len(text) / self.cpt)
|
||||
def echo(self, *args):
|
||||
env = dict(os.environ, ECHO_BASE=self.base, ECHO_KEY=KEY, ECHO_VERIFY="1", ECHO_LOCK_TTL="900")
|
||||
p = subprocess.run(["bash", str(ECHO), *args], capture_output=True, text=True, env=env)
|
||||
p = subprocess.run([sys.executable, str(ECHO), *args], capture_output=True, text=True, env=env)
|
||||
return p.returncode
|
||||
|
||||
# ---- faithful 0.6 recipe text (what the model emitted), for token accounting ----
|
||||
@@ -163,7 +163,7 @@ def scenarios(ev):
|
||||
http("PUT", f"{ev.base}/vault/{path}", body) # single shot, no retry, status ignored
|
||||
return {"emit": recipe_put(path), "claimed_ok": True, "detected": False}
|
||||
def m07():
|
||||
rc = ev.echo("put", path, tmpfile(body)) # echo.sh retries the 503 once
|
||||
rc = ev.echo("put", path, tmpfile(body)) # echo.py retries the 503 once
|
||||
return {"emit": f'"$ECHO" put {path} /tmp/x.md', "claimed_ok": rc == 0, "detected": rc != 0}
|
||||
def gt():
|
||||
c = ev.ground(path) or ""
|
||||
|
||||
Reference in New Issue
Block a user