Skip to content

The agent that grows with you

fix(bundle): show progress while verifying the prepared payload

ethernet36c70d31c7b6
diff --git a/scripts/bundles/native.py b/scripts/bundles/native.py
index 20fd8f17113..7636c615417 100644
--- a/scripts/bundles/native.py
+++ b/scripts/bundles/native.py
@@ -297,6 +297,7 @@ def finish_native(prepared: Path, frontends: dict[str, Path]) -> int:
inputs = load_prepared(prepared)
values = asdict(inputs)
values["frontends"] = {name: Path(path).absolute() for name, path in frontends.items()}
+ print("assembling verified payload", flush=True)
assemble(AgentInputs.from_dict(values), out)
print(f"✓ manifest ({out / 'manifest.json'})")
return 0
diff --git a/scripts/bundles/native_prepared.py b/scripts/bundles/native_prepared.py
index 89b26adf6ca..2af0ea2c652 100644
--- a/scripts/bundles/native_prepared.py
+++ b/scripts/bundles/native_prepared.py
@@ -129,13 +129,17 @@ def load_prepared(prepared: Path) -> AgentInputs:
required = {path.relative_to(out).as_posix() for path in _input_paths(inputs, out)}
if set(data["digests"]) != required:
raise ValueError("native preparation inventory changed")
- for name, digest in data["digests"].items():
+ for index, (name, digest) in enumerate(data["digests"].items(), start=1):
+ progress = f"payload verification [{index}/{len(data['digests'])}]: {name}"
+ print(f"{progress} — checking paths and links", flush=True)
path = out / name
_owned(path, out)
_check_links(path, out)
+ print(f"{progress} — hashing files", flush=True)
actual = _source_digest(path) if path == inputs.code else _digest(path)
if actual != digest:
raise ValueError(f"prepared bytes changed: {name}")
+ print("payload verification complete", flush=True)
return inputs
except (OSError, ValueError, KeyError, TypeError) as exc:
raise ValueError(f"invalid native preparation; run preparation again: {exc}") from exc
\ No newline at end of file