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

+21 -6
View File
@@ -75,11 +75,20 @@ class Agent:
if not self.docs:
raise ToolError("no documentation is mounted")
rel = p[len("/docs"):].lstrip("/")
if os.path.isfile(self.docs):
if rel not in ("", os.path.basename(self.docs)):
if len(self.docs) == 1 and self.docs[0][0] == "":
base, kind = self.docs[0][1], "documentation"
else:
if rel == "":
raise ToolError("/docs is a directory")
head, _, rest = rel.partition("/")
match = [m for m in self.docs if m[0] == head]
if not match:
raise ToolError(f"no such file: {p}")
return self.docs, "documentation"
base, kind = self.docs, "documentation"
if os.path.isfile(match[0][1]):
if rest:
raise ToolError(f"no such file: {p}")
return match[0][1], "documentation"
base, rel, kind = match[0][1], rest, "documentation"
else:
raise ToolError("paths must be under /work or /docs")
full = os.path.realpath(os.path.join(base, rel))
@@ -90,11 +99,17 @@ class Agent:
# ---------------------------------------------------------------- tools
def tool_list_files(self, inp):
path = os.path.normpath(inp.get("path") or "/work")
if path == "/docs" and self.docs and not (len(self.docs) == 1 and self.docs[0][0] == ""):
return "\n".join("/docs/" + n for n, _ in self.docs)
full, kind = self.host_path(inp.get("path"))
if os.path.isfile(full):
return os.path.basename(full)
root_virtual = "/docs" if kind == "documentation" else "/work"
base = self.docs if kind == "documentation" else self.workspace
root_virtual, base = "/work", self.workspace
if kind == "documentation":
for n, p in self.docs:
if full == p or full.startswith(p + os.sep):
root_virtual, base = ("/docs/" + n if n else "/docs"), p
out = []
for root, dirs, files in os.walk(full):
dirs[:] = sorted(d for d in dirs if d not in (".git", "target", "zig-cache", ".zig-cache", "zig-out"))