E0-3/E0-4 groundwork: provider options, pinned docs, Track A/B in the protocol

- providers: per-model request extras (e.g. reasoning_effort), key_env,
  token_param (max_completion_tokens on api.openai.com); recorded
- docs pinned to the toolchain being run: Rust offline docs from the
  sysroot, Zig langref and std source of the same installation; several
  mounts under a read-only /docs; hashes recorded (cached for big trees)
- protocol: neutral model labels and calibration before classes (§2);
  smoke gates, fixed Aji commit, fixed per-model reasoning mode, slope of
  degradation (§39a); Track A controlled vs Track B native agents (§39b)
- plan: E-C calibration, E-G gates, E-N native-agent run
This commit is contained in:
dev committed 2026-10-04 17:28:15 +03:00
1 parent b49003bdb9
commit d7bb9273f3
14 files changed
+250 -60

No files matched your search

+4 -2
View File
@@ -37,13 +37,15 @@ class SandboxTest(unittest.TestCase):
@unittest.skipUnless(SANDBOX == "bwrap", "bubblewrap unavailable")
def test_isolation(self):
ws = tempfile.mkdtemp()
sb = sandbox.Sandbox("bwrap", ws, [], [], docs=TASK)
sb = sandbox.Sandbox("bwrap", ws, [], [], docs=[("", TASK), ("prompt.md", os.path.join(TASK, "prompt.md"))])
code, out, _ = sb.run("echo hi > f && cat f", 30, 1000)
self.assertEqual((code, out.strip()), (0, "hi"))
code, out, _ = sb.run("getent hosts example.com || echo NO_NET", 30, 1000)
self.assertIn("NO_NET", out)
code, _, _ = sb.run("touch /docs/x", 30, 1000)
self.assertNotEqual(code, 0)
code, out, _ = sb.run("cat /docs/prompt.md/../task.json >/dev/null 2>&1; head -c 6 /docs/prompt.md", 30, 1000)
self.assertIn("# Task", out)
code, out, _ = sb.run("ls " + os.path.expanduser("~") + " 2>&1 || echo NO_HOME", 30, 1000)
self.assertIn("NO_HOME", out)
self.assertTrue(os.path.exists(os.path.join(ws, "f")))
@@ -60,7 +62,7 @@ class SandboxTest(unittest.TestCase):
class PathTest(unittest.TestCase):
def test_confinement(self):
ws = tempfile.mkdtemp()
a = agent.Agent(None, {"instructions": ""}, None, {}, None, ws, None, None, {"tool_calls": 1, "total_tokens": 1, "output_chars": 100})
a = agent.Agent(None, {"instructions": ""}, None, {}, None, ws, [], None, {"tool_calls": 1, "total_tokens": 1, "output_chars": 100})
for bad in ["/etc/passwd", "../x", "/work/../etc/passwd", "/docs/x"]:
with self.assertRaises(agent.ToolError):
a.host_path(bad)