Files
ARCADIA-Studio/harness/experiments/text-navigation-followup-20260911/build_gui.py
T
sorokin.oleg.edu 36db9356cc Add bounded definition and reference navigation for current source drafts
Preserve loaded draft bytes and model history, reject stale workspace and input events, and keep captured Escape under modal priority. Verified 181 focused Windows tests and strict desktop Clippy on exact inputs4; earlier full737 scope and component/native preparation evidence are archived separately. Native navigation acceptance remains pending.
2026-09-11 11:23:20 -07:00

48 lines
2.4 KiB
Python

"""Build one identified Windows GUI and bind its Cargo artifact to frozen inputs."""
import datetime
import hashlib
import json
import os
from pathlib import Path
import subprocess
root = Path(__file__).resolve().parents[2]
evidence = Path(__file__).resolve().parent
manifest = json.loads((evidence / "inputs2.json").read_text(encoding="utf-8"))
def sha(path):
return hashlib.sha256(path.read_bytes()).hexdigest()
def verify():
for entry in manifest["files"]:
path = (root / entry["path"]).resolve()
assert path.is_relative_to(root) and sha(path) == entry["sha256"], entry["path"]
def now():
return datetime.datetime.now(datetime.timezone.utc).isoformat()
verify()
os.environ["CARGO_BUILD_JOBS"] = "1"
args = ["cargo", "build", "--locked", "--offline", "-p", "oa-desktop", "--bin", "arcadia-studio", "--message-format=json-render-diagnostics"]
started = now()
with (evidence / "gui-build-messages.jsonl").open("xb") as out, (evidence / "gui-build-stderr.log").open("xb") as err:
result = subprocess.run(args, cwd=root, stdout=out, stderr=err)
receipt = {"started": started, "finished": now(), "exitCode": result.returncode,
"args": args, "buildJobs": 1, "head": manifest["head"], "branch": manifest["branch"],
"rawInputs": "inputs2.json", "rawInputArchiveSha256": manifest["archiveSha256"],
"scope": "Windows development GUI from identified uncommitted navigation inputs; native evaluation pending"}
if result.returncode == 0:
verify()
messages = [json.loads(line) for line in (evidence / "gui-build-messages.jsonl").read_text(encoding="utf-8").splitlines()]
artifacts = [m for m in messages if m.get("reason") == "compiler-artifact" and m.get("target", {}).get("name") == "arcadia-studio" and m.get("executable") and not m.get("profile", {}).get("test")]
assert len(artifacts) == 1, len(artifacts)
binary = Path(artifacts[0]["executable"]).resolve()
assert binary.is_relative_to(root / ".local/target-gnullvm")
receipt.update(binary=str(binary), sha256=sha(binary), bytes=binary.stat().st_size,
cargoArtifact=artifacts[0], inputsUnchanged=True)
with (evidence / "gui-build.json").open("x", encoding="utf-8", newline="\n") as out:
json.dump(receipt, out, indent=2)
out.write("\n")
print(json.dumps({k: receipt[k] for k in ("started", "finished", "exitCode", "sha256", "bytes") if k in receipt}))
raise SystemExit(result.returncode)