Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.
TypeScript ai-sdkclaude-codeclicode-searchcodexcoding-agentscontext-retrievaldeveloper-toolsjevsemantic-searchtypescriptvercel-ai-gateway
Reduce retrieval freshness work and record speed validation
David Zhang2dc1d3c9c9fe
diff --git a/README.md b/README.mdindex f6be6ad..9e09166 100644--- a/README.md+++ b/README.md@@ -109,7 +109,9 @@ This comparison uses ten tuned Python SWE-bench tasks, one frozen installedpackage and the exact public skill in this repository. It measures task successand cost, not a speed improvement or guaranteed savings on every repository.See the [results and methodology](evals/results/relevance-threshold-2026-09-27.md)-for per-task costs, artifact identities and limitations.+for per-task costs, artifact identities and limitations. A separate+[speed study](evals/results/speed-2026-09-28.md) measures the follow-up local+optimizations with Jev’s native TypeSafe endpoint.## Source, credentials, and local statediff --git a/evals/README.md b/evals/README.mdindex 573710c..31ed49c 100644--- a/evals/README.md+++ b/evals/README.md@@ -30,3 +30,5 @@ The [research archive](implementation/swebench/research-archive.md) preserves thsuperseded official experiments in Git without adding obsolete runners to `main`.The [final product research report](results/relevance-threshold-2026-09-27.md) records the neutral-skill cohort and parameter-effect map. The earlier [source-first cohort](results/source-first-2026-09-27.md) retains its separate package and skill identity.++The [speed study](results/speed-2026-09-28.md) compares the frozen local optimizations and native TypeSafe route against that previous cohort and the same saved no-Jev baselines.diff --git a/evals/implementation/swebench/gateway_broker.py b/evals/implementation/swebench/gateway_broker.pyindex ea9e950..dc01a3c 100644--- a/evals/implementation/swebench/gateway_broker.py+++ b/evals/implementation/swebench/gateway_broker.py@@ -31,6 +31,7 @@ class Server(socketserver.ThreadingTCPServer):import http.server,http.client,urllib.request,urllib.error,urllib.parse,pathlib,time,hmacCONFIG_PATH=os.environ.get('JEVGREP_GATEWAY_CONFIG','/run/gateway.json')GATEWAY_ORIGIN='https://ai-gateway.vercel.sh'+TYPESAFE_ORIGIN='https://api.typesafe.ai'TRACE_DIR=os.environ.get('JEVGREP_TRACE_DIR')def capture_jev(request_id,data):if not TRACE_DIR:return None@@ -74,7 +75,11 @@ class Gateway(http.server.BaseHTTPRequestHandler):codex=self.path=='/codex/v1/responses'engine='codex' if codex else 'claude' if claude else 'jev'if (codex or claude) and config.get('agent_engine')!=engine:self.send_error(403);return- jev=self.path=='/typesafe/v1/systemone' and self.headers.get('x-jevgrep-original-url')=='https://ai-gateway.vercel.sh/typesafe/v1/systemone'+ native=config.get('jev_provider')=='typesafe'+ jev_path='/v1/systemone' if native else '/typesafe/v1/systemone'+ jev_origin=TYPESAFE_ORIGIN if native else GATEWAY_ORIGIN+ jev_model='jev-1.13.0' if native else 'typesafe-ai/jev'+ jev=self.path==jev_path and self.headers.get('x-jevgrep-original-url')==('https://api.typesafe.ai/v1/systemone' if native else 'https://ai-gateway.vercel.sh/typesafe/v1/systemone')if jev and config.get('allow_jev') is not True:self.send_error(403);returnif not (claude or codex or jev):self.send_error(403);returnsize=int(self.headers.get('Content-Length','0'))@@ -83,7 +88,7 @@ class Gateway(http.server.BaseHTTPRequestHandler):if jev:try:body=json.loads(data)except ValueError:self.send_error(403);return- if (not isinstance(body,dict) or body.get('model')!='typesafe-ai/jev' or not isinstance(body.get('state'),dict) or not isinstance(body.get('questions'),dict) or+ if (not isinstance(body,dict) or body.get('model')!=jev_model or not isinstance(body.get('state'),dict) or not isinstance(body.get('questions'),dict) orany(not isinstance(question,dict) or question.get('type')!='noul' or not isinstance(question.get('instructions'),str) for question in body['questions'].values())):self.send_error(403);returnresponse_trace=capture_jev(request_id,data)@@ -101,7 +106,8 @@ class Gateway(http.server.BaseHTTPRequestHandler):if self.headers.get(header):headers[header]=self.headers[header]target=GATEWAY_ORIGIN+self.pathelse:- target=GATEWAY_ORIGIN+'/typesafe/v1/systemone'+ target=jev_origin+jev_path+ if native:headers['Authorization']='Bearer '+config['jev_key']with LOG_LOCK:print(json.dumps({'kind':engine+'-request-start','requestId':request_id,'startedAt':time.time(),'operation':'count_tokens' if route.path.endswith('/count_tokens') else 'generation','streamed':bool(body.get('stream')) if claude or codex else False}),flush=True)request=urllib.request.Request(target,data=data,headers=headers)try:response=urllib.request.urlopen(request,timeout=90)diff --git a/evals/implementation/swebench/installed.md b/evals/implementation/swebench/installed.mdindex dff9193..2201bda 100644--- a/evals/implementation/swebench/installed.md+++ b/evals/implementation/swebench/installed.md@@ -10,8 +10,8 @@ Preparation installs the packed npm artifact and dependencies once, then checksthat same installation offline in every selected runtime image. Each checkverifies the original source, agent versions and canonical packaged skill.The coding agent receives the archived prefix and runs the real `jg` executable-on an internal network. The benchmark explicitly invokes `$jevgrep`, as required for the retrieval comparison;-the retained skill begins by requiring retrieval. Retrieval limits come+on an internal network. The benchmark prompt explicitly invokes `$jevgrep`, as required for the retrieval comparison;+the public skill itself teaches CLI usage without prescribing a research workflow. Retrieval limits comefrom the frozen package's default policy.The plan binds one package, installed prefix, skill, safe task export, evaluator@@ -29,10 +29,22 @@ python3 evals/implementation/swebench/installed.py run \```Preparation and dry-run make no model calls. `prepare` defaults to all ten tasks;+`--jev-provider typesafe` selects native Jev for a separately identified provider+experiment. Sol continues through Gateway. The broker holds both real credentials;+the agent receives only its scoped broker token. Native Jev billing is unknown+without Gateway metadata and remains excluded from scored Sol cost.`--task` selects one registered task. `--evidence-root` locates the retainedbaseline and evaluator files when preparing from another checkout. The root`eval:swebench` alias points to this entry point; `--help` lists its arguments.+If a retained Docker image was removed, restore its pinned official base and+archived toolchain, then prepare that one task with `--runtime-image` and the new+immutable image ID. Preparation verifies the base image's filesystem layers,+source identity, tool versions and installed skill. The frozen plan records both+image IDs; baseline receipts remain untouched. Preserve the rebuild recipe and+toolchain checksum verification beside the study and disclose the rebuild when+reporting timing comparisons.+After reviewing the frozen plan, `run --all` without `--dry-run` executes the paidtreatments sequentially. Load the Gateway credential through the authorizedenvironment workflow. Real keys stay out of plans and command arguments. Everydiff --git a/evals/implementation/swebench/installed.py b/evals/implementation/swebench/installed.pyindex 17cafbe..639c907 100644--- a/evals/implementation/swebench/installed.py+++ b/evals/implementation/swebench/installed.py@@ -111,12 +111,32 @@ def check_image(image):return actual+def paired_runtime(baseline, rebuild=None):+ if rebuild is None:+ return baseline['image']+ if (rebuild.get('original_image') != baseline['image'] or+ rebuild.get('source_pinned_ref') != baseline['cell']['source_pinned_ref'] or+ not re.fullmatch(r'sha256:[a-f0-9]{64}', rebuild.get('image', ''))):+ raise ValueError('Rebuilt runtime does not match the retained source/environment pairing')+ return rebuild['image']++def prepare(args):root = args.evidence_root.resolve()selected = [item for item in REGISTRY['tasks'] if args.task in ('all', item['task'])]pairs = [(item, *load_pair(root / item['baseline'], root / REGISTRY['inputs'], item['task'])) for item in selected]baseline = pairs[0][1]- image = check_image(baseline['image'])+ rebuild = None+ if getattr(args, 'runtime_image', None):+ if len(pairs) != 1:+ raise ValueError('A rebuilt runtime must be prepared for one task at a time')+ rebuild = {'original_image': baseline['image'], 'image': args.runtime_image,+ 'source_pinned_ref': baseline['cell']['source_pinned_ref']}+ base_layers = json.loads(text(['docker', 'image', 'inspect', rebuild['source_pinned_ref'], '--format', '{{json .RootFS.Layers}}']))+ actual_layers = json.loads(text(['docker', 'image', 'inspect', rebuild['image'], '--format', '{{json .RootFS.Layers}}']))+ if actual_layers[:len(base_layers)] != base_layers:+ raise ValueError('Rebuilt runtime does not extend the pinned official source image')+ image = check_image(paired_runtime(baseline, rebuild))out = args.output.resolve()out.mkdir(parents=True, exist_ok=False)out.chmod(0o700)@@ -151,7 +171,7 @@ tar -C /opt -cf /tmp/installed-prefix.tar jg-install# Every image gets an offline check using the same installed bytes.cells = []for registered, fixed, _ in pairs:- runtime = check_image(fixed['image'])+ runtime = check_image(paired_runtime(fixed, rebuild))check = 'jg-preflight-' + uuid.uuid4().hex[:12]try:command(['docker', 'create', '--platform', 'linux/amd64', '--network', 'none', '--name', check, runtime, 'sh', '-ec',@@ -165,7 +185,7 @@ tar -C /opt -cf /tmp/installed-prefix.tar jg-installfinally:subprocess.run(['docker', 'rm', '-f', check], capture_output=True)cell = {**fixed['cell'], 'id': 'installed-' + registered['task'] + '-' + uuid.uuid4().hex[:12],- 'arm': 'chunks', 'candidate': str(out / 'installed-prefix.tar')}+ 'arm': 'chunks', 'candidate': str(out / 'installed-prefix.tar'), 'image': runtime}cells.append({'cell': cell, 'baseline': str(root / registered['baseline']),'baseline_cost_usd': registered['cost_usd'], 'baseline_resolved': registered['resolved'],'output': str(out / 'attempts' / registered['task'])})@@ -182,6 +202,9 @@ tar -C /opt -cf /tmp/installed-prefix.tar jg-install'registry': str(frozen / 'fixed-baselines.json'), 'dataset': str(root / REGISTRY['dataset']),'tooling': str(root / REGISTRY['tooling']),'artifacts': {str(path): digest(path) for path in artifacts}}+ plan['jev_provider'] = getattr(args, 'jev_provider', 'vercel')+ if rebuild:+ plan['runtime_rebuild'] = rebuildwrite_json(out / 'plan.json', plan)print(json.dumps({'status': 'prepared', 'plan': str(out / 'plan.json'), 'tasks': len(cells)}))finally:@@ -216,7 +239,8 @@ def load_cohort(path):cell = item['cell']registered = next(row for row in REGISTRY['tasks'] if row['task'] == cell['instance_id'])baseline, _ = load_pair(Path(item['baseline']), Path(plan['inputs']), cell['instance_id'])- expected = {**baseline['cell'], 'id': cell['id'], 'arm': 'chunks', 'candidate': cell['candidate']}+ expected = {**baseline['cell'], 'id': cell['id'], 'arm': 'chunks', 'candidate': cell['candidate'],+ 'image': paired_runtime(baseline, plan.get('runtime_rebuild'))}if cell != expected or not re.fullmatch(r'installed-[A-Za-z0-9_.-]+', cell['id']):raise ValueError('Treatment pairing changed')if cell['candidate'] not in plan['artifacts'] or item['baseline_cost_usd'] != registered['cost_usd'] or item['baseline_resolved'] != registered['resolved']:@@ -398,6 +422,9 @@ def monitor_native(invocation, stdout, stderr, policy):def run(args):plan, row = load_plan(args.plan.resolve(), args.task)cell = plan['cell']+ jev_provider = plan.get('jev_provider', 'vercel')+ if jev_provider not in ('vercel', 'typesafe'):+ raise ValueError('Unsupported Jev provider')image = check_image(cell['image'])if args.dry_run:print(json.dumps({'status': 'validated', 'paid_calls': 0, 'baseline_reused': plan['baseline'], 'image': image, 'cell': cell['id']}))@@ -407,13 +434,15 @@ def run(args):returnif not os.environ.get('AI_GATEWAY_API_KEY'):raise ValueError('AI_GATEWAY_API_KEY is required; load it through the authorized credential workflow')+ if jev_provider == 'typesafe' and not os.environ.get('TYPESAFE_API_KEY'):+ raise ValueError('TYPESAFE_API_KEY is required for native Jev')out = Path(plan['output'])out.mkdir(parents=True, exist_ok=False)out.chmod(0o700)tag = 'jg-native-' + uuid.uuid4().hex[:12]network, proxy = tag + '-net', tag + '-proxy'receipt = {'engine': 'codex', 'cell': cell, 'image': image, 'plan_sha256': digest(args.plan), 'started': time.time(), 'status': 'preparing',- 'provider_route': 'vercel-ai-gateway', 'gateway_model': 'openai/gpt-5.6-sol', 'baseline': plan['baseline'], 'host_pid': os.getpid()}+ 'jev_provider': jev_provider, 'provider_route': 'vercel-ai-gateway', 'gateway_model': 'openai/gpt-5.6-sol', 'baseline': plan['baseline'], 'host_pid': os.getpid()}write_json(out / 'receipt.json', receipt)def dx(argv, user=None):return command(['docker', 'exec', *(['-u', user] if user else []), tag, *argv])@@ -460,11 +489,11 @@ def run(args):(out / 'prompt.txt').write_text(prompt)receipt['prompt_sha256'] = digest(out / 'prompt.txt')token = uuid.uuid4().hex- put(proxy, '/run/gateway.json', json.dumps({'key': os.environ['AI_GATEWAY_API_KEY'], 'token': token, 'agent_engine': 'codex', 'allow_jev': True}).encode(), 'root:root')+ put(proxy, '/run/gateway.json', json.dumps({'key': os.environ['AI_GATEWAY_API_KEY'], 'token': token, 'agent_engine': 'codex', 'allow_jev': True, 'jev_provider': jev_provider, 'jev_key': os.environ.get('TYPESAFE_API_KEY') if jev_provider == 'typesafe' else None}).encode(), 'root:root')dx(['mkdir', '-p', '/home/agent/.config/jevgrep'], 'agent')dx(['chmod', '700', '/home/agent/.config/jevgrep'], 'agent')dx(['mkdir', '-p', '/opt/jg-harness'])- put(tag, '/home/agent/.config/jevgrep/credentials.json', json.dumps({'provider': 'vercel', 'apiKey': token}).encode())+ put(tag, '/home/agent/.config/jevgrep/credentials.json', json.dumps({'provider': jev_provider, 'apiKey': token}).encode())put(tag, '/opt/jg-harness/provider-route.mjs', Path(plan['provider_preload']).read_bytes(), 'root:root', '444')receipt['provider_preload_sha256'] = digest(plan['provider_preload'])config = ('model = "openai/gpt-5.6-sol"\nmodel_provider = "vercel"\nmodel_reasoning_effort = "medium"\n'@@ -738,6 +767,8 @@ def main():prep.add_argument('--task', default='all', choices=['all', *[item['task'] for item in REGISTRY['tasks']]])prep.add_argument('--evidence-root', type=Path, default=ROOT)prep.add_argument('--skill', type=Path, default=ROOT / 'skills/jevgrep/SKILL.md')+ prep.add_argument('--jev-provider', choices=['vercel', 'typesafe'], default='vercel', help='Jev route only; Sol remains on Gateway')+ prep.add_argument('--runtime-image', help='Rebuilt image ID extending the pinned source; source/tool versions still verified, original image recorded')execute = sub.add_parser('run', help='Run the paid coding-agent treatment once, or validate without calls')execute.add_argument('--plan', type=Path, required=True)execute.add_argument('--dry-run', action='store_true')diff --git a/evals/implementation/swebench/test_installed.py b/evals/implementation/swebench/test_installed.pyindex bbc6cab..016c419 100644--- a/evals/implementation/swebench/test_installed.py+++ b/evals/implementation/swebench/test_installed.py@@ -28,6 +28,28 @@ runner = load('installed')broker = load('gateway_broker')class InstalledTests(unittest.TestCase):+ def test_rebuilt_runtime_records_new_identity_without_rewriting_baseline(self):+ with tempfile.TemporaryDirectory() as temporary:+ path, _ = self.fixture(Path(temporary))+ plan = json.loads(path.read_text())+ item = plan['cells'][0]+ baseline_path = Path(item['baseline']) / 'receipt.json'+ original = baseline_path.read_bytes()+ plan['runtime_rebuild'] = {+ 'original_image': item['cell']['image'],+ 'image': 'sha256:' + '1' * 64,+ 'source_pinned_ref': item['cell']['source_pinned_ref'],+ }+ item['cell']['image'] = plan['runtime_rebuild']['image']+ runner.write_json(path, plan)+ restored = runner.load_cohort(path)+ self.assertEqual(restored['cells'][0]['cell']['image'], 'sha256:' + '1' * 64)+ self.assertEqual(baseline_path.read_bytes(), original)+ plan['runtime_rebuild']['source_pinned_ref'] = 'different-source'+ runner.write_json(path, plan)+ with self.assertRaisesRegex(ValueError, 'source/environment pairing'):+ runner.load_cohort(path)+def test_frozen_prompt_and_required_product_call(self):row = {'problem_statement': 'Fix behavior.'}self.assertEqual(hashlib.sha256(runner.baseline_prompt(row).encode()).hexdigest(), '41c7e3cf7acbc19d0b24ab55e6ea29fe3cdbc2b777549d158488c6c55baaa643')@@ -466,34 +488,38 @@ class InstalledTests(unittest.TestCase):self.assertFalse((root/'traces').exists())def test_broker_captures_exact_jev_bodies_without_auth_headers(self):- with tempfile.TemporaryDirectory() as temporary:- root=Path(temporary);config=root/'gateway.json';config.write_text(json.dumps({'key':'REAL_KEY_SENTINEL','token':'BROKER_TOKEN_SENTINEL','allow_jev':True,'agent_engine':'codex'}))- request_body=b'{"model":"typesafe-ai/jev","state":{"source":"public fixture"},"questions":{"q":{"type":"noul","instructions":"matches?"}}}';response_body=b'{"answers":{},"usage":{"input_tokens":11,"output_tokens":3},"provider_metadata":{"gateway":{"cost":"0.04","generationId":"gen_fixture"}}}'- forwarded={}- class Upstream(http.server.BaseHTTPRequestHandler):- def log_message(self,*args):pass- def do_POST(self):- forwarded.update(path=self.path,body=self.rfile.read(int(self.headers['Content-Length'])),headers=dict(self.headers))- self.send_response(200);self.send_header('Content-Type','application/json');self.end_headers();self.wfile.write(response_body)- upstream=http.server.ThreadingHTTPServer(('127.0.0.1',0),Upstream)- upstream_thread=threading.Thread(target=upstream.serve_forever,daemon=True);upstream_thread.start()- self.addCleanup(upstream_thread.join);self.addCleanup(upstream.server_close);self.addCleanup(upstream.shutdown)- with patch.object(broker,'CONFIG_PATH',str(config)),patch.object(broker,'TRACE_DIR',str(root/'traces')),patch.object(broker,'GATEWAY_ORIGIN','http://127.0.0.1:'+str(upstream.server_port)),contextlib.redirect_stdout(io.StringIO()):- server=http.server.ThreadingHTTPServer(('127.0.0.1',0),broker.Gateway)- thread=threading.Thread(target=server.serve_forever,daemon=True);thread.start()- try:- client=http.client.HTTPConnection('127.0.0.1',server.server_port)- client.request('POST','/typesafe/v1/systemone',request_body,{'Authorization':'Bearer BROKER_TOKEN_SENTINEL','x-jevgrep-original-url':'https://ai-gateway.vercel.sh/typesafe/v1/systemone'})- response=client.getresponse();self.assertEqual(response.status,200);self.assertEqual(response.read(),response_body);client.close()- finally:server.shutdown();server.server_close();thread.join()- self.assertEqual(forwarded['path'],'/typesafe/v1/systemone')- self.assertEqual(forwarded['body'],request_body)- self.assertEqual(forwarded['headers']['Authorization'],'Bearer REAL_KEY_SENTINEL')- self.assertNotIn('X-Jevgrep-Original-Url',forwarded['headers'])- requests=list((root/'traces').glob('*.request.json'));responses=list((root/'traces').glob('*.response.json'))- self.assertEqual(requests[0].read_bytes(),request_body);self.assertEqual(responses[0].read_bytes(),response_body)- for file in requests+responses:- self.assertEqual(file.stat().st_mode&0o777,0o600)- self.assertNotIn(b'REAL_KEY_SENTINEL',file.read_bytes());self.assertNotIn(b'BROKER_TOKEN_SENTINEL',file.read_bytes())+ for provider in ('vercel', 'typesafe'):+ with tempfile.TemporaryDirectory() as temporary:+ root=Path(temporary);config=root/'gateway.json';config.write_text(json.dumps({'key':'REAL_KEY_SENTINEL','token':'BROKER_TOKEN_SENTINEL','allow_jev':True,'agent_engine':'codex','jev_provider':provider,'jev_key':'REAL_KEY_SENTINEL'}))+ request_body=b'{"model":"typesafe-ai/jev","state":{"source":"public fixture"},"questions":{"q":{"type":"noul","instructions":"matches?"}}}';response_body=b'{"answers":{},"usage":{"input_tokens":11,"output_tokens":3},"provider_metadata":{"gateway":{"cost":"0.04","generationId":"gen_fixture"}}}'+ if provider == 'typesafe':request_body=request_body.replace(b'typesafe-ai/jev',b'jev-1.13.0')+ path='/v1/systemone' if provider == 'typesafe' else '/typesafe/v1/systemone'+ origin='https://api.typesafe.ai' if provider == 'typesafe' else 'https://ai-gateway.vercel.sh'+ forwarded={}+ class Upstream(http.server.BaseHTTPRequestHandler):+ def log_message(self,*args):pass+ def do_POST(self):+ forwarded.update(path=self.path,body=self.rfile.read(int(self.headers['Content-Length'])),headers=dict(self.headers))+ self.send_response(200);self.send_header('Content-Type','application/json');self.end_headers();self.wfile.write(response_body)+ upstream=http.server.ThreadingHTTPServer(('127.0.0.1',0),Upstream)+ upstream_thread=threading.Thread(target=upstream.serve_forever,daemon=True);upstream_thread.start()+ self.addCleanup(upstream_thread.join);self.addCleanup(upstream.server_close);self.addCleanup(upstream.shutdown)+ with patch.object(broker,'CONFIG_PATH',str(config)),patch.object(broker,'TRACE_DIR',str(root/'traces')),patch.object(broker,'TYPESAFE_ORIGIN' if provider == 'typesafe' else 'GATEWAY_ORIGIN','http://127.0.0.1:'+str(upstream.server_port)),contextlib.redirect_stdout(io.StringIO()):+ server=http.server.ThreadingHTTPServer(('127.0.0.1',0),broker.Gateway)+ thread=threading.Thread(target=server.serve_forever,daemon=True);thread.start()+ try:+ client=http.client.HTTPConnection('127.0.0.1',server.server_port)+ client.request('POST',path,request_body,{'Authorization':'Bearer BROKER_TOKEN_SENTINEL','x-jevgrep-original-url':origin+path})+ response=client.getresponse();self.assertEqual(response.status,200);self.assertEqual(response.read(),response_body);client.close()+ finally:server.shutdown();server.server_close();thread.join()+ self.assertEqual(forwarded['path'],path)+ self.assertEqual(forwarded['body'],request_body)+ self.assertEqual(forwarded['headers']['Authorization'],'Bearer REAL_KEY_SENTINEL')+ self.assertNotIn('X-Jevgrep-Original-Url',forwarded['headers'])+ requests=list((root/'traces').glob('*.request.json'));responses=list((root/'traces').glob('*.response.json'))+ self.assertEqual(requests[0].read_bytes(),request_body);self.assertEqual(responses[0].read_bytes(),response_body)+ for file in requests+responses:+ self.assertEqual(file.stat().st_mode&0o777,0o600)+ self.assertNotIn(b'REAL_KEY_SENTINEL',file.read_bytes());self.assertNotIn(b'BROKER_TOKEN_SENTINEL',file.read_bytes())if __name__=='__main__':unittest.main()diff --git a/evals/results/speed-2026-09-28.json b/evals/results/speed-2026-09-28.jsonnew file mode 100644index 0000000..8893232--- /dev/null+++ b/evals/results/speed-2026-09-28.json@@ -0,0 +1,302 @@+{+ "package_sha256": "8d2f8ad8f15b046cd45479d15e34a4e62db8fb37e8c1df9aeb9bf87a7527af0e",+ "completed": 10,+ "solves": 8,+ "pending": [],+ "rows": [+ {+ "study": "single-validation-xarray",+ "task": "pydata__xarray-3305",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 245.48427745798836,+ "sol_cost_usd": 0.3239844,+ "sol_tokens": 304403+ },+ "previous": {+ "wall_seconds": 300.1971882499638,+ "sol_cost_usd": 0.35288200000000003,+ "sol_tokens": 358775+ },+ "baseline": {+ "wall_seconds": 118.45186395899509,+ "sol_cost_usd": 0.4937066,+ "sol_tokens": 602142+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-xarray/attempts/pydata__xarray-3305",+ "artifact_sha256": {+ "receipt.json": "3d61d7c40edc78df87b5cf749a81579f4e3766e285d5906524ce32cd531dee20",+ "grading-receipt.json": "510d3d8d83421088dc5c1dd0f31a50d8f7e5489dfe5f432a67cd9aea0d4a26d3",+ "generation-accounting.json": "bc59de6bfe47ed670835ecc0747af85eef8ef395b120cda87a18fe5a536b18fe",+ "agent.patch": "d56546a6af80e05c82f296e5e7da31cd3c90083419f384c6189c386f949dfdee"+ }+ },+ {+ "study": "single-validation-sphinx",+ "task": "sphinx-doc__sphinx-8638",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 172.56750995799666,+ "sol_cost_usd": 0.7740684,+ "sol_tokens": 822006+ },+ "previous": {+ "wall_seconds": 545.2917012500111,+ "sol_cost_usd": 0.7048812,+ "sol_tokens": 812374+ },+ "baseline": {+ "wall_seconds": 192.01333883299958,+ "sol_cost_usd": 1.0594724,+ "sol_tokens": 1396272+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-sphinx/attempts/sphinx-doc__sphinx-8638",+ "artifact_sha256": {+ "receipt.json": "efa7355d2f62db19390d0921a70f7efe43183fedeed2010dd15ac3cadd8d1158",+ "grading-receipt.json": "f271101d6e4f5f38c725c37d8154d9a7c7044b37caa8bed4e07e41dd684f2388",+ "generation-accounting.json": "ca4f608ea22df3e3d04f22f716accc26b287690c7986066ad41179b722a30460",+ "agent.patch": "3a8b0160895d51be062e751c668d0c0b96d3b6fb2e37a78ec5346713f7db7a61"+ }+ },+ {+ "study": "single-validation-scikit",+ "task": "scikit-learn__scikit-learn-13124",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 78.83385858300608,+ "sol_cost_usd": 0.24722080000000002,+ "sol_tokens": 210332+ },+ "previous": {+ "wall_seconds": 119.97234287502943,+ "sol_cost_usd": 0.2640736,+ "sol_tokens": 187943+ },+ "baseline": {+ "wall_seconds": 86.36477591699804,+ "sol_cost_usd": 0.29443600000000003,+ "sol_tokens": 271366+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-scikit/attempts/scikit-learn__scikit-learn-13124",+ "artifact_sha256": {+ "receipt.json": "2b6735f8b3adf6e15443c25d207d10a8355065f1df25463c5781355f52df35f0",+ "grading-receipt.json": "ac76aa012535dda39909fe2d4822c9d66a4480bf815bf5343edd8564d6d5c9b2",+ "generation-accounting.json": "c938c3209c001e8fcfb58e5506d3c69089b2283e342629aded6f9acff66fb323",+ "agent.patch": "0affb6b2e5d742d30525c4d19e21ac1e50fcc34601f1e5ac6d5f1810be37073c"+ }+ },+ {+ "study": "single-validation-django",+ "task": "django__django-15629",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 311.91485104197636,+ "sol_cost_usd": 1.1819994,+ "sol_tokens": 1408378+ },+ "previous": {+ "wall_seconds": 408.7809627909446,+ "sol_cost_usd": 1.2286352,+ "sol_tokens": 1492745+ },+ "baseline": {+ "wall_seconds": 402.324371292023,+ "sol_cost_usd": 1.5055472,+ "sol_tokens": 2060603+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-django/attempts/django__django-15629",+ "artifact_sha256": {+ "receipt.json": "c5cd851610e14b4934a4ace619baeaa03f10ed100ac2c612aead30880678f0c5",+ "grading-receipt.json": "73d02f1bfcd51d86f4ee75e86a62d7a76ae67a5e22eda5339e34ba7367fad0bb",+ "generation-accounting.json": "502f886553f59f4b98ffc06507cf91c47b4160dc43aaef04290405c567c7f502",+ "agent.patch": "2c140d3673321c4fd6ef632374127faa955711c9ba039e6dcb5580dfdcd8b691"+ }+ },+ {+ "study": "single-validation-requests",+ "task": "psf__requests-1142",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 142.6549362919759,+ "sol_cost_usd": 0.4151056,+ "sol_tokens": 472718+ },+ "previous": {+ "wall_seconds": 87.99161604198162,+ "sol_cost_usd": 0.2915148,+ "sol_tokens": 224013+ },+ "baseline": {+ "wall_seconds": 139.47062074998394,+ "sol_cost_usd": 0.2685004,+ "sol_tokens": 206136+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-requests/attempts/psf__requests-1142",+ "artifact_sha256": {+ "receipt.json": "e7626505e5b583639fbb7da60e1ca4c4828c2380ea069020c0649cf0cdd10fbe",+ "grading-receipt.json": "4fbb36298a58ded599c7afffdff59d3ef127da763c25ec81d84f7c49f5623f7c",+ "generation-accounting.json": "ffac9e44ba915a212a3b83d2097a959228831a6dfe5c4ad1fbbcea622aef9e91",+ "agent.patch": "98d0173f891449f78c889e6d688b13b8dec31ef4682b21c0cf2a83bd9d4703b0"+ }+ },+ {+ "study": "single-validation-astropy",+ "task": "astropy__astropy-13579",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 207.9371116249822,+ "sol_cost_usd": 0.4576928,+ "sol_tokens": 444882+ },+ "previous": {+ "wall_seconds": 232.20947712502675,+ "sol_cost_usd": 0.4585834,+ "sol_tokens": 399453+ },+ "baseline": {+ "wall_seconds": 127.74519329200848,+ "sol_cost_usd": 0.428631,+ "sol_tokens": 406770+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-astropy/attempts/astropy__astropy-13579",+ "artifact_sha256": {+ "receipt.json": "d31a8837972f8fab493c6e8527997f11bdaca7b4d6854737d7dbecca923fe563",+ "grading-receipt.json": "8e5f42338ddf521ef02d509200a981db973931c55027e7ad9b38976afa2db22c",+ "generation-accounting.json": "0f2de0ce3fc1367d526747f06c427a91a90123810486b304c64a5d6da017d35a",+ "agent.patch": "2e487b531c86451f5d13a552319820b86bd47f43dcb29191e9274226a33ee8da"+ }+ },+ {+ "study": "single-validation-pytest",+ "task": "pytest-dev__pytest-6197",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 237.44561316701584,+ "sol_cost_usd": 0.8906638,+ "sol_tokens": 1077999+ },+ "previous": {+ "wall_seconds": 260.03042308299337,+ "sol_cost_usd": 0.8280682,+ "sol_tokens": 967037+ },+ "baseline": {+ "wall_seconds": 596.4330365410133,+ "sol_cost_usd": 2.344458,+ "sol_tokens": 3660298+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-pytest/attempts/pytest-dev__pytest-6197",+ "artifact_sha256": {+ "receipt.json": "fcba035545c3259d926380823a7dc5890da53abe630654adf47de07d0f9d550c",+ "grading-receipt.json": "1c65251054cbfaf602a57212ff02bb5006542967d2636181822225fc59d65bfd",+ "generation-accounting.json": "53c276230b43c619d77f14aa63a808bb13d5bc3907aa31525dde54e1ebbcb540",+ "agent.patch": "be29ef72cc0e7464f18a9a6a570bcc24b637f4c96cfe9d1452fe03f64e210e27"+ }+ },+ {+ "study": "single-validation-sympy",+ "task": "sympy__sympy-16792",+ "official_resolved": true,+ "candidate": {+ "wall_seconds": 116.85864991595736,+ "sol_cost_usd": 0.2960334,+ "sol_tokens": 263652+ },+ "previous": {+ "wall_seconds": 178.82062245899579,+ "sol_cost_usd": 0.5612792,+ "sol_tokens": 621998+ },+ "baseline": {+ "wall_seconds": 386.5954145830183,+ "sol_cost_usd": 0.547975,+ "sol_tokens": 689425+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-sympy/attempts/sympy__sympy-16792",+ "artifact_sha256": {+ "receipt.json": "d41310764641247124861bdfd91961a5bd17df5a30cb7cb5975f6f3e2d4a1b44",+ "grading-receipt.json": "4c25e982c931eb1e06688f0f469eaad0d494132472edeb676b18d92bb30caa80",+ "generation-accounting.json": "c66cca2b4a78673c211325afa00076766dc52868bb75fc9e773df6d7ced4ca4c",+ "agent.patch": "d66b5b38cca85f5b688dbee91e367dc4b3eed5fb374da115101900e2abc1ae0b"+ }+ },+ {+ "study": "single-validation-matplotlib",+ "task": "matplotlib__matplotlib-26466",+ "official_resolved": false,+ "candidate": {+ "wall_seconds": 290.0717128330143,+ "sol_cost_usd": 0.3605752,+ "sol_tokens": 379539+ },+ "previous": {+ "wall_seconds": 289.18520695803454,+ "sol_cost_usd": 0.2637272,+ "sol_tokens": 209488+ },+ "baseline": {+ "wall_seconds": 106.53679849999025,+ "sol_cost_usd": 0.395716,+ "sol_tokens": 371885+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-matplotlib/attempts/matplotlib__matplotlib-26466",+ "artifact_sha256": {+ "receipt.json": "0061b834d70f8693613942c7af0b402df82ca638efebb777a5ede9c07d5fdda4",+ "grading-receipt.json": "8b7f91e6270f37d9503017be97f85b974aadfda152784c7a58e6e2ac4c42e489",+ "generation-accounting.json": "a76df7d8e6767ac4f276a74fb0444d44c48c4134b7f7223a5fcd32f9af501eb5",+ "agent.patch": "aa1d1b719abaf1cf5db5534b552881b01d6dd2b50329e50a50ac65a38623aa26"+ }+ },+ {+ "study": "single-validation-pylint",+ "task": "pylint-dev__pylint-4604",+ "official_resolved": false,+ "candidate": {+ "wall_seconds": 143.46947737503797,+ "sol_cost_usd": 0.3906136,+ "sol_tokens": 426375+ },+ "previous": {+ "wall_seconds": 326.4146437079762,+ "sol_cost_usd": 0.4860082,+ "sol_tokens": 593103+ },+ "baseline": {+ "wall_seconds": 74.52734654099913,+ "sol_cost_usd": 0.2836264,+ "sol_tokens": 268533+ },+ "evidence": "evals/runs/swebench/speed-research/single-validation-pylint/attempts/pylint-dev__pylint-4604",+ "artifact_sha256": {+ "receipt.json": "3fac92fcb08779e12e20622fdbeb551b82074641293a936ec73cc287b7ad120b",+ "grading-receipt.json": "a0eef6942dbaa5b1316c5c6cfbbbd98ba8d60d04dfc3b77f8b1b0bb6b89992a9",+ "generation-accounting.json": "0ef382029841b2dc13b54a80699cbab1aaa74fea96b54a4463edca1698ab6c86",+ "agent.patch": "8d471bbdd5eca8bcaf8503a41799cb2fefab6e210214c66752efb5fe1f56a3ae"+ }+ }+ ],+ "totals": {+ "candidate": {+ "wall_seconds": 1947.237998248951,+ "sol_cost_usd": 5.3379574000000005,+ "sol_tokens": 5810284+ },+ "previous": {+ "wall_seconds": 2748.894184540957,+ "sol_cost_usd": 5.439653,+ "sol_tokens": 5866929+ },+ "baseline": {+ "wall_seconds": 2230.462760208029,+ "sol_cost_usd": 7.622069,+ "sol_tokens": 9933430+ }+ },+ "limitations": "One first attempt per tuned Python task, not a holdout or variance estimate. Sol cost and input+output tokens exclude Jev. Native TypeSafe routing and local implementation changes were evaluated together; no isolated causal attribution.",+ "model": "openai/gpt-5.6-sol",+ "effort": "medium",+ "jev_provider": "typesafe",+ "public_skill_sha256": "04d4d7b59d122799a863bc399234de171bdb087436075be52ebf3bece1bf3e44",+ "candidate_description": "v0.4.2 plus native binary scan and one source validation per transport attempt/cache return; no lazy-preview change",+ "jev_api_cost": "Unknown: native responses have no price metadata. Excluded from scored cost, not assumed zero."+}diff --git a/evals/results/speed-2026-09-28.md b/evals/results/speed-2026-09-28.mdnew file mode 100644index 0000000..c5f8eb5--- /dev/null+++ b/evals/results/speed-2026-09-28.md@@ -0,0 +1,74 @@+# Faster retrieval with preserved task outcomes++The frozen candidate retained **the same eight official solves out of ten**.+It completed the cohort **29.16% faster than the previous Jevgrep cohort**, with+0.97% fewer Sol tokens and 1.87% lower Sol cost. Against the fixed no-Jev baseline,+it was **12.70% faster, 29.97% cheaper, and used 41.51% fewer Sol tokens**.++| Full ten-task total | Candidate | Previous Jevgrep | No Jevgrep |+| --- | ---: | ---: | ---: |+| Official solves | 8/10 | 8/10 | 8/10 |+| Agent wall time, including retrieval | 1,947.24 s | 2,748.89 s | 2,230.46 s |+| Sol input + output tokens | 5,810,284 | 5,866,929 | 9,933,430 |+| Sol cost | $5.3379574 | $5.4396530 | $7.6220690 |++The [machine-readable report](speed-2026-09-28.json) contains every task,+archive identity, receipt hashes and matched metrics. The+[previous cohort](relevance-threshold-2026-09-27.md) remains a separate result.+All first attempts, including unresolved Matplotlib and Pylint tasks, count.+No coding-agent baselines were rerun. Jev tokens and cost are excluded; returned+context contributes to Sol's bill. Native Jev responses do not provide price+metadata, so its API cost is unknown, not zero.++## What changed and why++Source validation now occurs once immediately before each HTTP attempt or+cached-answer return. Retrieval still serializes those checks, and retries still+check freshness. Removing a duplicate initial read reduces local work without+allowing cached results to bypass changed source or ignore rules. Binary detection+uses a native regular-expression scan with the same byte exclusions.++The earlier ignore-rule identity cache is included through v0.4.2. The candidate+uses TypeSafe's native endpoint for Jev; Sol still uses Vercel Gateway. Provider+choice, local optimizations and sampling all contribute to the measured result;+this cohort does not isolate their individual effects. Existing users' saved+provider choice is unchanged. The exact public retrieval skill is unchanged.++## Experiment findings++| Strategy | Evidence and decision |+| --- | --- |+| Reuse unchanged ignore rules | Recorded replay fell from 82.6 s to 16.7 s with the same output. Fresh identity checks and mutation tests preserve ignore changes. Shipped separately in v0.4.2. |+| Reuse compiled rules after rereading | One isolated replay was slower (108.3 s versus 82.6 s). Not selected. |+| Lower provider concurrency from 32 to 8 | Fewer HTTP failures but slower (29.0 s versus 24.2 s), with incomplete discovery in both diagnostic runs. Kept 32. |+| Defer rich previews until admission | Matching replay output, but no clear incremental live-task gain. Preserved as a deferred experiment; absent from this candidate. |+| Native binary scan | About 6.3× faster in the scan microbenchmark; about 5% faster in alternating full-file reads. Retained, without claiming that microbenchmark gain for whole tasks. |+| Validate once per attempt/cache return | Matching 365-request replay completed in 10.46 s. Cache-mutation falsification and queue/retry freshness tests passed. Retained. |+| Native TypeSafe route | Same-query diagnostic: median 140 ms versus Gateway 330 ms; search 34.3 s versus 43.4 s. Native had no errors; Gateway recovered 64 internal 503s. Used for confirmation. |++Raw traces, replay inputs and retained experiment patches remain in ignored+`evals/runs/swebench/speed-research/`. They are research evidence, not alternate+product implementations.++## Limits and task variation++These are ten tuned Python tasks, with one first attempt per task. The small+aggregate token and cost differences from previous Jevgrep may be sampling+variance. The observations support this measured cohort, not a guarantee of+improvement for every task, language, provider or machine. The reconstructed+Docker runtimes retain pinned official source images and verified archived tools;+runtime reconstruction is recorded in each plan. Host emulation also affects+absolute times.++Requests and Matplotlib cost more than previous Jevgrep. Requests retrieved the+implementation and tests first, but Sol still searched broadly and performed+additional verification. Matplotlib took essentially the same time despite all+815 native requests succeeding (267 ms median, 500 ms p95). Its official+input-copying test remained unresolved, with no official pass-to-pass failures.+Healthy model latency alone does not remove local work or dependent discovery+rounds. SymPy and Pylint substantially reduced time and tokens; Pylint still did+not solve its task.++This completes the planned speed comparison. The adopted candidate preserves+all previous solves and aggregate token savings in this run; no more paid trials+are needed to report this result.diff --git a/packages/core/src/evaluator.ts b/packages/core/src/evaluator.tsindex b3b8722..1ef62fd 100644--- a/packages/core/src/evaluator.ts+++ b/packages/core/src/evaluator.ts@@ -131,6 +131,8 @@ export function createEvaluator(options: {(id) => typeof cached[id] === "number" && cached[id]! >= 0 && cached[id]! <= 1,)) {+ await policy?.beforeAttempt?.();+ assertActive();cacheHits++;return cached;}diff --git a/packages/core/src/filesystem.ts b/packages/core/src/filesystem.tsindex 1dcd122..d0c5b4c 100644--- a/packages/core/src/filesystem.ts+++ b/packages/core/src/filesystem.ts@@ -362,7 +362,7 @@ export async function createFilesystem(options: FilesystemOptions) {const current = await eligibility(path);if (current.status !== "eligible") return current;if (!same(admitted.stat, current.stat)) return issue("changed", admitted.path);- if (read.bytes.some((byte) => (byte < 32 && ![9, 10, 12, 13].includes(byte)) || byte === 127))+ if (/[\x00-\x08\x0b\x0e-\x1f\x7f]/.test(read.bytes.toString("latin1")))return excluded("binary");let source: string;try {diff --git a/packages/core/src/retrieve.ts b/packages/core/src/retrieve.tsindex 36ec52a..850973f 100644--- a/packages/core/src/retrieve.ts+++ b/packages/core/src/retrieve.ts@@ -57,8 +57,6 @@ export async function retrieve(input: SearchInput, evaluator: Evaluator): PromisvalidationQueue = pending.catch(() => {});return pending;};- // Preserve queued request order while checks perform I/O; provider work stays concurrent.- await beforeAttempt();return evaluator.evaluate(request, { navigation, beforeAttempt });}let entriesSeen = 0;diff --git a/packages/core/src/types.ts b/packages/core/src/types.tsindex 5344517..a67cfe5 100644--- a/packages/core/src/types.ts+++ b/packages/core/src/types.ts@@ -58,6 +58,7 @@ export type Evaluator = {readonly requests: number;readonly cacheHits?: number;readonly cacheIssues?: Array<{ kind: string; count: number }>;+ /** Validate sources before each transport attempt and before returning a cached answer. */evaluate(request: EvaluationRequest,policy?: { navigation?: boolean; beforeAttempt?: () => Promise<void> },diff --git a/packages/core/test/filesystem.test.ts b/packages/core/test/filesystem.test.tsindex 8a20aa6..3c22197 100644--- a/packages/core/test/filesystem.test.ts+++ b/packages/core/test/filesystem.test.ts@@ -359,6 +359,12 @@ test("valid UTF-8 control-byte binary and invalid UTF-8 remain excluded under evcontrol: new Uint8Array([1, 2, 3]),invalid: new Uint8Array([255]),plain: "one\ttwo\r\nthree\f",+ unicode: "雪 café 😀",+ ...Object.fromEntries(+ [...Array.from({ length: 32 }, (_, code) => code), 127]+ .filter((code) => ![9, 10, 12, 13].includes(code))+ .map((code) => [`control-${code}`, new Uint8Array([65, code, 66])]),+ ),});const reader = await createFilesystem({root,@@ -369,6 +375,17 @@ test("valid UTF-8 control-byte binary and invalid UTF-8 remain excluded under evstatus: "excluded",reason: "binary",});+ for (const code of [...Array.from({ length: 32 }, (_, code) => code), 127]) {+ if ([9, 10, 12, 13].includes(code)) continue;+ expect(await reader.readSnapshot(`control-${code}`)).toMatchObject({+ status: "excluded",+ reason: "binary",+ });+ }+ expect(await reader.readSnapshot("unicode")).toMatchObject({+ status: "ok",+ snapshot: { source: "雪 café 😀" },+ });expect(await reader.readSnapshot("invalid")).toMatchObject({status: "excluded",reason: "invalid_utf8",diff --git a/test/retrieval-freshness.test.ts b/test/retrieval-freshness.test.tsindex f6007b0..2be061a 100644--- a/test/retrieval-freshness.test.ts+++ b/test/retrieval-freshness.test.ts@@ -6,6 +6,7 @@ import { tmpdir } from "node:os";import { testIfDocker } from "./helpers/docker";import { retrieve } from "../packages/core/src/retrieve";import { createEvaluator } from "../packages/core/src/evaluator";+import { createEvaluationCache } from "../packages/core/src/cache";testIfDocker("queued navigation never uploads source excluded after the first wave",@@ -42,6 +43,7 @@ testIfDocker({ root, query: "sentinel", signal },createEvaluator({apiKey: "fixture",+ concurrency: 8,provider: "vercel",fetch: routeProviderFetch(fetch, `http://127.0.0.1:${server.port}`),signal,@@ -358,3 +360,62 @@ testIfDocker(},120_000,);++testIfDocker("cached navigation revalidates source after cache lookup", async () => {+ const root = await mkdtemp(join(tmpdir(), "jg-cache-freshness-"));+ const directory = await mkdtemp(join(tmpdir(), "jg-cache-answers-"));+ const cache = createEvaluationCache({ directory });+ const signal = new AbortController().signal;+ let calls = 0;+ const requestFetch: typeof fetch = async (_input, init) => {+ calls++;+ const body = JSON.parse(String(init?.body));+ return Response.json({+ answers: Object.fromEntries(+ Object.keys(body.questions).map((id) => [id, { type: "noul", noul: 0.9 }]),+ ),+ });+ };+ try {+ await writeFile(join(root, "sample.txt"), "CACHE_FRESHNESS_SENTINEL");+ const initial = await retrieve(+ { root, query: "sentinel", signal },+ createEvaluator({+ provider: "vercel",+ apiKey: "fixture",+ signal,+ cache,+ fetch: requestFetch,+ }),+ );+ expect(initial.files.some((file) => file.path === "sample.txt")).toBe(true);+ const before = calls;+ let changed = false;+ const result = await retrieve(+ { root, query: "sentinel", signal },+ createEvaluator({+ provider: "vercel",+ apiKey: "fixture",+ signal,+ fetch: requestFetch,+ cache: {+ ...cache,+ get: async (input) => {+ const answer = await cache.get(input);+ if (answer && !changed) {+ await writeFile(join(root, ".ignore"), "sample.txt\n");+ changed = true;+ }+ return answer;+ },+ },+ }),+ );+ expect(changed).toBe(true);+ expect(result.files).toEqual([]);+ expect(calls).toBe(before);+ } finally {+ await rm(root, { recursive: true, force: true });+ await rm(directory, { recursive: true, force: true });+ }+});diff --git a/test/retrieval.test.ts b/test/retrieval.test.tsindex 5a4a8fe..2d68162 100644--- a/test/retrieval.test.ts+++ b/test/retrieval.test.ts@@ -179,7 +179,8 @@ testIfDocker(get requests() {return calls;},- async evaluate(request) {+ async evaluate(request, policy) {+ await policy?.beforeAttempt?.();calls++;const state = request.state as { selectedEvidence?: Array<{ path: string }> };if (state.selectedEvidence) {