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.
@@ -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
- rm -rf "$target_dir"
940
- mkdir -p "$target_dir"
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" "$target_dir/$name"; fi
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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-hitch",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Content-addressed version control and evidence storage for agent harnesses",
5
5
  "keywords": [
6
6
  "ai-agents",