Skip to content

Commit b0e186a

Browse files
authored
Fix proxied Harbor Codex observations (#574)
* Fix proxied Harbor Codex observations * Fix selected-task workflow validation * Make Harbor observations runtime-authoritative * Correlate Harbor MCP runtime telemetry
1 parent fb884b3 commit b0e186a

26 files changed

Lines changed: 911 additions & 60 deletions

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ UV_RUN := uv run --locked
44
HARBOR_VERSION ?= 0.20.0
55
HARBOR_RUNNER ?= uvx --from harbor==$(HARBOR_VERSION) harbor
66
HARBOR_PYTHON ?= uvx --from harbor==$(HARBOR_VERSION) --with tomli-w==1.2.0 --with jsonschema python
7+
HARBOR_PROJECT_PYTHON ?= uv run --locked --with harbor==$(HARBOR_VERSION) --with tomli-w==1.2.0 --with jsonschema python
78
# Validation pytest is process-isolated under xdist; Path monkeypatches stay
89
# worker-local. Oracle/adapter Make targets remain serial.
910
HARBOR_VALIDATION_WORKERS ?= 2
@@ -447,7 +448,7 @@ endif
447448

448449
CODEX_WEB_SEARCH ?= disabled
449450
JACOBIAN_EVAL_PROXY ?= 0
450-
JACOBIAN_EVAL_CODEX_BINARY ?= $(shell command -v codex 2>/dev/null | xargs -r readlink -f)
451+
JACOBIAN_EVAL_CODEX_BINARY ?= $(shell command -v codex 2>/dev/null)
451452
define _jacobian_eval_container_proxy
452453
$(subst localhost,host.docker.internal,$(subst 127.0.0.1,host.docker.internal,$1))
453454
endef
@@ -487,6 +488,7 @@ endif
487488

488489
agent-eval: ## Run a Harbor evaluation (JACOBIAN_ENABLED=0|1, JACOBIAN_EVAL_PROXY=0|1, DATASET=mathematical-benchmarks-v1, EVAL_EXECUTE=1).
489490
@set -e; \
491+
CODEX_BINARY="$(JACOBIAN_EVAL_CODEX_BINARY)"; \
490492
if [ "$(EVAL_EXECUTE)" != "1" ]; then \
491493
echo "Model execution is opt-in. Review the job, then run: make agent-eval DATASET=mathematical-benchmarks-v1 EVAL_EXECUTE=1"; \
492494
exit 0; \
@@ -496,10 +498,7 @@ agent-eval: ## Run a Harbor evaluation (JACOBIAN_ENABLED=0|1, JACOBIAN_EVAL_PROX
496498
exit 2; \
497499
fi; \
498500
if [ "$(JACOBIAN_EVAL_PROXY)" = "1" ]; then \
499-
test -x "$(JACOBIAN_EVAL_CODEX_BINARY)" || { \
500-
echo "JACOBIAN_EVAL_CODEX_BINARY must resolve to a Linux standalone Codex binary when JACOBIAN_EVAL_PROXY=1" >&2; \
501-
exit 2; \
502-
}; \
501+
CODEX_BINARY="$$( $(UV_RUN) python -m benchmarks.tooling.codex_binary --candidate "$$CODEX_BINARY" )"; \
503502
JACOBIAN_EVAL_UPSTREAM_PROXY="$(JACOBIAN_EVAL_UPSTREAM_PROXY)" \
504503
$(UV_RUN) python -m benchmarks.tooling.harbor_proxy \
505504
--output "$(JACOBIAN_EVAL_GOST_CONFIG)"; \
@@ -514,7 +513,7 @@ agent-eval: ## Run a Harbor evaluation (JACOBIAN_ENABLED=0|1, JACOBIAN_EVAL_PROX
514513
JACOBIAN_EVAL_HTTPS_PROXY="$(JACOBIAN_EVAL_HTTPS_PROXY)" \
515514
JACOBIAN_EVAL_ALL_PROXY="$(JACOBIAN_EVAL_ALL_PROXY)" \
516515
JACOBIAN_EVAL_NO_PROXY="$(JACOBIAN_EVAL_NO_PROXY)" \
517-
JACOBIAN_EVAL_CODEX_BINARY="$(JACOBIAN_EVAL_CODEX_BINARY)" \
516+
JACOBIAN_EVAL_CODEX_BINARY="$$CODEX_BINARY" \
518517
JACOBIAN_EVAL_GOST_CONFIG="$(JACOBIAN_EVAL_GOST_CONFIG)" \
519518
$(HARBOR_RUNNER) run \
520519
-c "$(EVAL_CONFIG)" \
@@ -527,7 +526,7 @@ agent-eval: ## Run a Harbor evaluation (JACOBIAN_ENABLED=0|1, JACOBIAN_EVAL_PROX
527526

528527
agent-eval-validate: ## Normalize one observation (RESULTS=..., JOB=..., CONDITION=..., OUTPUT=...).
529528
@test -n "$(RESULTS)" -a -n "$(JOB)" -a -n "$(CONDITION)" -a -n "$(OUTPUT)" || { echo "RESULTS, JOB, CONDITION, and OUTPUT are required" >&2; exit 2; }
530-
$(UV_RUN) python -m benchmarks.tooling.observation_results validate \
529+
$(HARBOR_PROJECT_PYTHON) -m benchmarks.tooling.observation_results validate \
531530
--dataset "$(or $(DATASET),mathematical-benchmarks-v1)" --condition "$(CONDITION)" \
532531
--job "$(JOB)" --jobs-dir "$(RESULTS)" --output "$(OUTPUT)" \
533532
$(if $(RESULT),--result "$(RESULT)",) \

benchmarks/config/agent-eval-egress-proxy.compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
services:
22
main:
33
environment:
4-
HTTP_PROXY: ""
5-
HTTPS_PROXY: ""
4+
HTTP_PROXY: http://127.0.0.1:12346
5+
HTTPS_PROXY: http://127.0.0.1:12346
66
ALL_PROXY: ""
77
NO_PROXY: ${JACOBIAN_EVAL_NO_PROXY:-localhost,127.0.0.1,jacobian}
8-
http_proxy: ""
9-
https_proxy: ""
8+
http_proxy: http://127.0.0.1:12346
9+
https_proxy: http://127.0.0.1:12346
1010
all_proxy: ""
1111
no_proxy: ${JACOBIAN_EVAL_NO_PROXY:-localhost,127.0.0.1,jacobian}
1212
harbor-docker-egress-control-sidecar:

benchmarks/config/mathematical-benchmarks-v1-control-proxy.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"jobs_dir": "benchmarks/results/mathematical-benchmarks-v1-control-proxy",
33
"n_attempts": 3,
44
"timeout_multiplier": 1,
5+
"artifacts": [
6+
"/logs/agent/trajectory.json"
7+
],
58
"orchestrator": {
69
"type": "local",
710
"n_concurrent_trials": 1,

benchmarks/config/mathematical-benchmarks-v1-control.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"jobs_dir": "benchmarks/results/mathematical-benchmarks-v1-control",
33
"n_attempts": 3,
44
"timeout_multiplier": 1,
5+
"artifacts": [
6+
"/logs/agent/trajectory.json"
7+
],
58
"orchestrator": {
69
"type": "local",
710
"n_concurrent_trials": 1,

benchmarks/datasets/mathematical-benchmarks-v1/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ Jacobian affordance, so include negative controls and tasks that discriminate
9292
tool adoption. Public-suite observations remain directional workflow evidence,
9393
not a causal performance claim.
9494

95+
Jacobian-enabled jobs collect both Codex ATIF and the Jacobian sidecar's MCP
96+
runtime log. The runtime log is authoritative for `math.find`, `math.run`, and
97+
`reasoning.write` counts and failed capability attempts; the normalizer does
98+
not infer executions from JavaScript source text. A missing configured trace or
99+
sidecar log makes the observation incomplete. Control jobs collect ATIF only
100+
because they do not start the Jacobian sidecar.
101+
95102
Five tasks have an operator-authorized verification record and may accept
96103
`VERIFIED`; the remaining tasks are capped at `COMPUTED`. A wrong result or an
97104
unsupported certification claim forces reward to zero. These are workflow

benchmarks/datasets/mathematical-benchmarks-v1/jacobian-observation.compose.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ services:
55
condition: service_healthy
66
jacobian:
77
image: ${JACOBIAN_IMAGE:-jacobian:local}
8+
entrypoint:
9+
- /bin/sh
10+
- -c
811
command:
12+
- |
13+
mkdir -p /logs/jacobian
14+
exec uv run --no-sync jacobian-mcp "$@" > /logs/jacobian/mcp.log 2>&1
15+
- jacobian-mcp
916
- --transport
1017
- streamable-http
1118
- --host

benchmarks/datasets/mathematical-benchmarks-v1/jobs/jacobian-observation-proxy.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"jobs_dir": "benchmarks/results/mathematical-benchmarks-v1-proxy",
33
"n_attempts": 3,
44
"timeout_multiplier": 1,
5+
"artifacts": [
6+
"/logs/agent/trajectory.json",
7+
{
8+
"source": "/logs/jacobian/mcp.log",
9+
"service": "jacobian"
10+
}
11+
],
512
"orchestrator": {
613
"type": "local",
714
"n_concurrent_trials": 1,

benchmarks/datasets/mathematical-benchmarks-v1/jobs/jacobian-observation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"jobs_dir": "benchmarks/results/mathematical-benchmarks-v1",
33
"n_attempts": 3,
44
"timeout_multiplier": 1,
5+
"artifacts": [
6+
"/logs/agent/trajectory.json",
7+
{
8+
"source": "/logs/jacobian/mcp.log",
9+
"service": "jacobian"
10+
}
11+
],
512
"orchestrator": {
613
"type": "local",
714
"n_concurrent_trials": 1,

benchmarks/schemas/harbor-job.schema.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@
1414
"jobs_dir": {"type": "string", "minLength": 1},
1515
"n_attempts": {"type": "integer", "minimum": 1},
1616
"timeout_multiplier": {"type": "number", "exclusiveMinimum": 0},
17+
"artifacts": {
18+
"type": "array",
19+
"minItems": 1,
20+
"uniqueItems": true,
21+
"items": {
22+
"oneOf": [
23+
{"type": "string", "pattern": "^/.+$"},
24+
{
25+
"type": "object",
26+
"additionalProperties": false,
27+
"required": ["source", "service"],
28+
"properties": {
29+
"source": {"type": "string", "pattern": "^/.+$"},
30+
"destination": {"type": "string", "minLength": 1},
31+
"exclude": {
32+
"type": "array",
33+
"items": {"type": "string", "minLength": 1}
34+
},
35+
"service": {"type": "string", "minLength": 1}
36+
}
37+
}
38+
]
39+
},
40+
"description": "Absolute container paths collected by Harbor for observation evidence, optionally from a named Compose sidecar."
41+
},
1742
"orchestrator": {
1843
"type": "object",
1944
"additionalProperties": false,

benchmarks/tooling/benchmark_contracts.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ def _observation_pair_failures() -> list[str]:
228228
def normalized(value: dict[str, Any]) -> dict[str, Any]:
229229
copy: dict[str, Any] = json.loads(json.dumps(value))
230230
copy.pop("jobs_dir", None)
231+
artifacts = copy.get("artifacts")
232+
if isinstance(artifacts, list):
233+
copy["artifacts"] = [
234+
entry
235+
for entry in artifacts
236+
if entry != {"source": "/logs/jacobian/mcp.log", "service": "jacobian"}
237+
]
231238
environment = copy.get("environment")
232239
if isinstance(environment, dict):
233240
compose = environment.get("extra_docker_compose")
@@ -242,7 +249,7 @@ def normalized(value: dict[str, Any]) -> dict[str, Any]:
242249
if normalized(treatment) != normalized(control):
243250
return [
244251
"agent workflow control/treatment jobs differ outside the allowed "
245-
"jobs_dir and Jacobian sidecar composition"
252+
"jobs_dir, Jacobian sidecar composition, and sidecar telemetry artifact"
246253
]
247254
return []
248255

0 commit comments

Comments
 (0)