agent-hitch 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/backends/harbor/backend.js +84 -35
- package/dist/src/backends/harbor/backend.js.map +1 -1
- package/dist/src/backends/harbor/dataset-config.js +36 -0
- package/dist/src/backends/harbor/dataset-config.js.map +1 -0
- package/dist/src/cli/commands/eval.js +39 -3
- package/dist/src/cli/commands/eval.js.map +1 -1
- package/dist/src/cli/output.js +2 -1
- package/dist/src/cli/output.js.map +1 -1
- package/dist/src/evals/index.js +4 -2
- package/dist/src/evals/index.js.map +1 -1
- package/dist/src/evals/progress.js +195 -0
- package/dist/src/evals/progress.js.map +1 -0
- package/dist/src/evals/request.js +37 -1
- package/dist/src/evals/request.js.map +1 -1
- package/dist/src/evals/rerun.js +398 -0
- package/dist/src/evals/rerun.js.map +1 -0
- package/dist/src/evals/service.js +98 -6
- package/dist/src/evals/service.js.map +1 -1
- package/dist/src/evals/trial-import.js +113 -59
- package/dist/src/evals/trial-import.js.map +1 -1
- package/docs/schemas/eval-progress.schema.json +61 -0
- package/integrations/harbor/hitch_harbor_agent.py +16 -4
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import shutil
|
|
|
13
13
|
import stat as stat_module
|
|
14
14
|
import tempfile
|
|
15
15
|
import uuid
|
|
16
|
-
from datetime import datetime
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
17
|
from pathlib import Path, PurePosixPath
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
@@ -931,16 +931,28 @@ git -C {LOCAL_GIT_REMOTE_ROOT}/repo.git update-ref refs/heads/hitch-local {commi
|
|
|
931
931
|
)
|
|
932
932
|
if result.return_code == 0 and result.stdout:
|
|
933
933
|
hitch_result = json.loads(result.stdout)
|
|
934
|
+
bundle_stage = f"/logs/agent/.hitch-run-bundle.{uuid.uuid4().hex}"
|
|
935
|
+
bundle_marker = json.dumps({
|
|
936
|
+
"schema_version": "1",
|
|
937
|
+
"run_id": run_id,
|
|
938
|
+
"eval_id": self.eval_id,
|
|
939
|
+
"trial_id": trial_id,
|
|
940
|
+
"completed_at": datetime.now(timezone.utc).isoformat(),
|
|
941
|
+
}, separators=(",", ":"))
|
|
934
942
|
export = await environment.exec(
|
|
935
943
|
f"""
|
|
936
944
|
set -eu
|
|
937
945
|
source_dir={shlex.quote(f'/tmp/hitch-state/runs/{run_id}')}
|
|
938
946
|
target_dir=/logs/agent/hitch-run-bundle
|
|
939
|
-
|
|
940
|
-
|
|
947
|
+
stage_dir={shlex.quote(bundle_stage)}
|
|
948
|
+
rm -rf "$stage_dir"
|
|
949
|
+
mkdir -p "$stage_dir"
|
|
941
950
|
for name in request.json resolution.json manifest.json result.json events.jsonl stdout.log stderr.log trajectory.ref.json trajectory; do
|
|
942
|
-
if [ -e "$source_dir/$name" ]; then cp -a "$source_dir/$name" "$
|
|
951
|
+
if [ -e "$source_dir/$name" ]; then cp -a "$source_dir/$name" "$stage_dir/$name"; fi
|
|
943
952
|
done
|
|
953
|
+
printf '%s\n' {shlex.quote(bundle_marker)} > "$stage_dir/bundle.complete.json"
|
|
954
|
+
rm -rf "$target_dir"
|
|
955
|
+
mv "$stage_dir" "$target_dir"
|
|
944
956
|
""".strip()
|
|
945
957
|
)
|
|
946
958
|
if export.return_code != 0:
|