Files
aji/docs/evaluation/dev-tasks/dev-netprobe/evaluator.py
T
dev 8b7911669d Track B: networkless shell, context metrics, freeze, journal
- Claude Code and OpenCode: system shells replaced inside the sandbox by
  wrappers that run every command in a nested bubblewrap with an empty
  network namespace and no resolver socket; the CLI keeps its backend
  connection. dev-netprobe (new dev task) passes for all three agents:
  no network, no DNS from the shell
- context metrics for both tracks: provider input (cached/uncached),
  cumulative context through the tool loop, unique reference tokens and
  bundle coverage; report shows them; no dollar cost for Track B
- ajieval freeze: frozen state (clean Aji commit, binary, bundle,
  toolchains, docs, CLI versions and config fingerprints, tasks,
  evaluator, limits) and a shuffled cell order; matrix verifies it and
  runs cells sequentially in that order; ajieval journal
- docs: benchmark-authoring.md (roles, clean-context brief, E-G
  checklist); harness.md, protocol §39b, plan updated
2026-10-04 17:58:32 +03:00

17 lines
766 B
Python
Executable File

#!/usr/bin/env python3
"""Dev evaluator for dev-netprobe: accepted iff the agent's shell had no
network (net.txt says NETWORK_BLOCKED) and probe.sh was left unchanged.
usage: evaluator.py WORKSPACE LANGUAGE TASK_DIR
"""
import json, os, sys
ws, task_dir = sys.argv[1], sys.argv[3]
try:
out = open(os.path.join(ws, "net.txt")).read()
except OSError:
out = ""
pristine = open(os.path.join(task_dir, "lang", "any", "probe.sh")).read() == open(os.path.join(ws, "probe.sh")).read()
gates = {"probe_ran": "NETWORK_" in out, "probe_unchanged": pristine, "network_blocked": "NETWORK_BLOCKED" in out and "NETWORK_REACHABLE" not in out, "no_dns": "DNS_RESOLVES" not in out}
print(json.dumps({"accepted": all(gates.values()), "gates": gates, "net_txt": out[-500:]}))