A self-improving RLM agent for coding workflows and long-running autonomous tasks.
Rust
publish install.ps1 on every beta cut and point the windows one-liner at the copy that serves (#3364)
kt7a52276cb173
diff --git a/.changes/windows-install-entry-point-publish.md b/.changes/windows-install-entry-point-publish.mdnew file mode 100644index 0000000000..e1a2c56bf5--- /dev/null+++ b/.changes/windows-install-entry-point-publish.md@@ -0,0 +1 @@+- The Windows one-liner is real again: the release pipeline publishes `install.ps1` (the stable-channel render, the channel's own base + fallback to beta when stable carries no Windows build) on every beta cut instead of waiting for a first Rust stable that has not been cut, and the README's PowerShell command points at the copy that actually serves (the merged repo file, the same route the Windows battery installs from) instead of the domain prefix that 404s.diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex a85e8d0f6e..5582d19526 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -784,8 +784,11 @@ jobs:print(f"channel manifest {out.name}: {document['version']}, {len(rows)} artifacts")PY# THE R2 PUBLISH PHASE (the operator's distribution-model ruling: the- # user path is curl <domain>/install.sh and everything it reads comes- # from the same R2-backed base — nobody fetches a GitHub URL).+ # channel — pointers, manifests, payloads, checksums — lives on the+ # R2-backed base alone. The sh one-liner's route carries no GitHub+ # URL; the Windows one-liner's entry script comes from the repo's raw+ # copy, and that fetch is the only GitHub touch on any user path —+ # everything either installer reads is R2-backed).## THE SECURITY MODEL, in one block for every future reader:# - SEPARATION: the build jobs (build-gnu/build-darwin) produce and@@ -815,7 +818,7 @@ jobs:# so the channel only ever advances forward.# - AUDIT SURFACE: the GitHub release below still attaches every# artifact (the TS order: the R2 publish first, GitHub second).- - name: Publish the R2 channel (the user path never touches GitHub)+ - name: Publish the R2 channel (the channel serves no GitHub URL)env:AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}@@ -998,10 +1001,15 @@ jobs:--endpoint-url "$R2_ENDPOINT_URL" \--content-type text/plain \--cache-control no-cache- # The stable installers (install.sh / install.ps1) move ONLY- # on a stable release — a beta cut never touches the stable- # channel's surface (the TS version serves installs until the- # first Rust stable release replaces it).+ # The beta route also uploads the stable PowerShell render+ # (install.ps1, the Windows entry point — the installer's+ # Windows channel fallback rides the stable channel default).+ # install.sh stays stable-only; a beta cut never overwrites it.+ render_installer_ps1 stable+ aws s3 cp /tmp/install-stable.ps1 "s3://${R2_BUCKET}/install.ps1" \+ --endpoint-url "$R2_ENDPOINT_URL" \+ --content-type text/plain \+ --cache-control no-cacheecho "beta channel advanced to ${RELEASE_VERSION} at ${INSTALL_BASE_URL}"fifidiff --git a/README.md b/README.mdindex 339ae6dcd3..34a2d46718 100644--- a/README.md+++ b/README.md@@ -49,9 +49,11 @@ curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | shOn Windows, install from PowerShell:```powershell-irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex+irm https://raw.githubusercontent.com/PrimeIntellect-ai/prime-agent/main/install.ps1 | iex```+Windows builds ship on the beta channel for now; when the stable channel has no Windows build, the installer falls back to the beta channel and says so. Only this copy of `install.ps1` comes from GitHub — the version pointers, platform tarballs, and checksums it downloads come from the release channel's own base.+## Why Prime AgentPrime Agent combines a persistent Python control environment with durable harness state, so useful working context and reusable operating patterns can outlive a single chat window.diff --git a/crates/pa-cli/tests/release_workflow.rs b/crates/pa-cli/tests/release_workflow.rsindex 7aef3a7909..73b556d34f 100644--- a/crates/pa-cli/tests/release_workflow.rs+++ b/crates/pa-cli/tests/release_workflow.rs@@ -246,6 +246,19 @@ fn write_artifact(dir: &Path, target: &str) -> serde_json::Value {write_artifact_with(dir, target, &[])}+/// Run one workflow step script in `cwd` with extra environment variables+/// (the promote steps read the workflow's `env`; the emission step reads+/// `RELEASE_VERSION`, the tag the release cut runs under).+fn run_step_with_env(cwd: &Path, step: &Step, env: &[(&str, &str)]) -> Output {+ let script = step.run.as_deref().expect("the step carries a run script");+ let mut command = Command::new("bash");+ command.arg("-c").arg(script).current_dir(cwd);+ for (key, value) in env {+ command.env(key, value);+ }+ command.output().expect("bash executes the step script")+}+fn write_artifact_with(dir: &Path, target: &str, extra_members: &[&str]) -> serde_json::Value {fs::create_dir_all(dir).expect("create the artifact directory");// The archive name the channel contract requires: the PLATFORM ALIAS,@@ -278,6 +291,41 @@ fn write_artifact_with(dir: &Path, target: &str, extra_members: &[&str]) -> serdrow}+/// One build-job artifact in `dir`, pinned to `version` (the consume route+/// restamps the continuous artifacts to the beta tag's version, so a+/// fixture tree must be able to carry any tag-shaped version).+fn write_artifact_version(dir: &Path, target: &str, version: &str) -> serde_json::Value {+ fs::create_dir_all(dir).expect("create the artifact directory");+ // The archive name the channel contract requires: the PLATFORM ALIAS,+ // never the target triple (the update reader drops a triple-named row).+ let archive_name = format!("prime-agent-{version}-{}.tar.gz", platform_alias(target));+ write_fixture_tarball(&dir.join(&archive_name), binary_name(target), &[]);+ let sha256 = sha256_file(&dir.join(&archive_name));+ fs::write(+ dir.join("SHA256SUMS"),+ format!("{sha256} {archive_name}\n"),+ )+ .expect("write the checksum line");+ let row = serde_json::json!({+ "version": format!("v{version}"),+ "platform": platform_alias(target),+ "target": target,+ "file": archive_name,+ "sha256": sha256,+ "executableSha256": "0".repeat(64),+ });+ fs::write(+ dir.join("manifest.json"),+ serde_json::to_string_pretty(&serde_json::json!({+ "version": format!("v{version}"),+ "binaries": [row],+ }))+ .expect("serialize the fixture manifest"),+ )+ .expect("write the fixture manifest");+ row+}+/// The merged manifest the merge step must produce for `rows`, with the/// merge script's own ordering (binaries sorted by `file`).fn expected_merged_manifest(rows: &[serde_json::Value]) -> serde_json::Value {@@ -402,7 +450,7 @@ fn windows_build_job_contract() {.iter().find(|step| {step.name.as_deref()- == Some("Publish the R2 channel (the user path never touches GitHub)")+ == Some("Publish the R2 channel (the channel serves no GitHub URL)")}).expect("the R2 publish step exists").run@@ -648,3 +696,242 @@ fn zero_artifacts_fail_loudly_instead_of_verifying_nothing() {"the normalize gate must name the missing artifacts");}++/// The publish's beta route serves install.ps1 (the stable render — the+/// Windows entry point) and never overwrites install.sh (stable-only).+#[test]+fn the_beta_route_publishes_the_windows_entry_point() {+ let text = fs::read_to_string(repo_root().join(".github/workflows/release.yml"))+ .expect("read release.yml");+ let workflow: Workflow = serde_yaml::from_str(&text).expect("release.yml parses as YAML");+ let publish = workflow+ .jobs+ .get("promote")+ .expect("the promote job exists")+ .steps+ .iter()+ .find(|step| {+ step.name.as_deref()+ == Some("Publish the R2 channel (the channel serves no GitHub URL)")+ })+ .expect("the R2 publish step exists")+ .run+ .as_deref()+ .expect("the publish runs a script");+ // The route halves are delimited by their channel markers; each marker+ // names its block exactly once in the publish script.+ let beta_marker = "# THE BETA CHANNEL";+ let stable_marker = "# THE STABLE CHANNEL";+ let beta_start = publish+ .find(beta_marker)+ .expect("the publish names the beta channel block");+ let stable_start = publish+ .find(stable_marker)+ .expect("the publish names the stable channel block");+ let beta_block = &publish[beta_start..stable_start];+ let stable_block = &publish[stable_start..];+ assert!(+ beta_block.contains("render_installer_ps1 stable"),+ "the beta route must render the stable-channel Windows installer"+ );+ assert!(+ beta_block.contains(r#"aws s3 cp /tmp/install-stable.ps1 "s3://${R2_BUCKET}/install.ps1""#),+ "the beta route must upload install.ps1 to the bucket root"+ );+ assert!(+ beta_block.contains("render_installer beta")+ && beta_block.contains("aws s3 cp /tmp/install-beta.ps1")+ && beta_block.contains("aws s3 cp /tmp/install-beta.sh"),+ "the beta route keeps its own installer pair"+ );+ assert!(+ !beta_block.contains("aws s3 cp /tmp/install-stable.sh"),+ "a beta cut must never overwrite install.sh - the TS 0.9.8 funnel bootstraps through it"+ );+ assert!(+ stable_block+ .contains(r#"aws s3 cp /tmp/install-stable.ps1 "s3://${R2_BUCKET}/install.ps1""#),+ "the stable route keeps its install.ps1 upload"+ );+}++/// The channel-manifest emission, executed against a real merged fixture+/// tree (the python-in-workflow step): the win32-x64 row the build-windows+/// job contributed rides `binaries_v2` on BOTH channels, while the v1+/// `binaries` list keeps the TS-parity four (the platforms the TS+/// installer served). The live stable channel stays TS-only until the+/// first Rust stable cut re-publishes latest.json; this pins the+/// emission's half of that contract — when that cut lands, the stable+/// manifest carries the Windows row under `binaries_v2`.+#[test]+fn the_channel_manifest_carries_the_windows_row_on_both_channels() {+ let Some(_python3) = python3_binary((3, 12)) else {+ return;+ };+ let steps = promote_steps();+ let emit = &steps[step_position(+ &steps,+ "Emit the channel manifest (latest.json stable / beta.json nightly)",+ )];++ // The beta cut (the consume route's restamped shape: the artifacts+ // carry the beta tag's version): beta.json carries the Windows row.+ let beta_tag = "v0.9.9-beta.7";+ let cwd = tempfile::tempdir().expect("scratch dir");+ let incoming = cwd.path().join("incoming");+ fs::create_dir_all(&incoming).expect("create incoming");+ let rows: Vec<serde_json::Value> = TARGETS+ .iter()+ .map(|target| {+ write_artifact_version(+ &incoming.join(format!("artifacts-{target}")),+ target,+ beta_tag.trim_start_matches('v'),+ )+ })+ .collect();+ let (.., merged) = run_promote_gates(cwd.path(), &steps);+ let mut expected: Vec<serde_json::Value> = rows.clone();+ expected.sort_by(|a, b| a["file"].as_str().cmp(&b["file"].as_str()));+ assert_eq!(+ merged["binaries"],+ serde_json::json!(expected),+ "the merged manifest must carry all five targets' binaries"+ );+ let stdout = assert_success(+ &run_step_with_env(cwd.path(), emit, &[("RELEASE_VERSION", beta_tag)]),+ "emit the channel manifest",+ );+ assert!(+ stdout.contains("channel manifest beta.json: v0.9.9-beta.7, 5 artifacts"),+ "the emission must report all five artifacts\n{stdout}"+ );+ let document: serde_json::Value = serde_json::from_str(+ &fs::read_to_string(cwd.path().join("release-out/beta.json"))+ .expect("read the emitted beta.json"),+ )+ .expect("parse the emitted beta.json");+ assert_eq!(document["version"], "v0.9.9-beta.7");+ let v2 = document["binaries_v2"]+ .as_array()+ .expect("binaries_v2 rows");+ assert_eq!(v2.len(), 5, "binaries_v2 carries every platform row");+ let win_row = v2+ .iter()+ .find(|row| row["platform"] == "win32-x64")+ .expect("the beta manifest carries the win32-x64 row");+ assert_eq!(+ win_row["file"], "prime-agent-0.9.9-beta.7-win32-x64.tar.gz",+ "the Windows row must use the channel naming contract"+ );+ let windows_row = rows+ .iter()+ .find(|row| row["platform"] == "win32-x64")+ .expect("the fixture carries the windows row");+ assert_eq!(+ win_row["sha256"], windows_row["sha256"],+ "the Windows row must carry the artifact's own checksum"+ );+ let v1 = document["binaries"].as_array().expect("v1 binaries rows");+ assert_eq!(+ v1.len(),+ 4,+ "the v1 binaries list keeps the TS-parity platforms"+ );+ assert!(+ v1.iter().all(|row| row["platform"] != "win32-x64"),+ "the v1 binaries list never carries the Windows row"+ );++ // The stable cut (the build route's shape: the artifacts carry the+ // stable tag's version): latest.json carries the Windows row too.+ let stable_tag = format!("v{VERSION}");+ let cwd = tempfile::tempdir().expect("scratch dir");+ let incoming = cwd.path().join("incoming");+ fs::create_dir_all(&incoming).expect("create incoming");+ let rows: Vec<serde_json::Value> = TARGETS+ .iter()+ .map(|target| {+ write_artifact_version(+ &incoming.join(format!("artifacts-{target}")),+ target,+ VERSION,+ )+ })+ .collect();+ let (.., merged) = run_promote_gates(cwd.path(), &steps);+ let mut expected: Vec<serde_json::Value> = rows;+ expected.sort_by(|a, b| a["file"].as_str().cmp(&b["file"].as_str()));+ assert_eq!(+ merged["binaries"],+ serde_json::json!(expected),+ "the merged manifest must carry all five targets' binaries"+ );+ assert_success(+ &run_step_with_env(+ cwd.path(),+ emit,+ &[("RELEASE_VERSION", stable_tag.as_str())],+ ),+ "emit the channel manifest",+ );+ let document: serde_json::Value = serde_json::from_str(+ &fs::read_to_string(cwd.path().join("release-out/latest.json"))+ .expect("read the emitted latest.json"),+ )+ .expect("parse the emitted latest.json");+ assert_eq!(document["version"], stable_tag.as_str());+ assert!(+ document["binaries_v2"]+ .as_array()+ .expect("binaries_v2 rows")+ .iter()+ .any(|row| row["platform"] == "win32-x64"),+ "the stable manifest carries the win32-x64 row in binaries_v2"+ );+ assert!(+ document["binaries"]+ .as_array()+ .expect("v1 binaries rows")+ .iter()+ .all(|row| row["platform"] != "win32-x64"),+ "the v1 binaries list keeps the TS-parity platforms on stable too"+ );+}++/// A tree that dropped the windows artifact (a skipped build-windows leg, a+/// build-job regression) must never publish a shrunken channel manifest:+/// the completeness gate refuses the release and names the missing+/// platform — a Windows install stranded on the old channel version is+/// worse than a failed cut.+#[test]+fn the_channel_manifest_refuses_a_release_missing_the_windows_row() {+ let Some(_python3) = python3_binary((3, 12)) else {+ return;+ };+ let steps = promote_steps();+ let emit = &steps[step_position(+ &steps,+ "Emit the channel manifest (latest.json stable / beta.json nightly)",+ )];+ let cwd = tempfile::tempdir().expect("scratch dir");+ let incoming = cwd.path().join("incoming");+ fs::create_dir_all(&incoming).expect("create incoming");+ // Four targets: the windows leg never uploaded its artifact.+ for target in TARGETS.iter().take(4) {+ write_artifact(&incoming.join(format!("artifacts-{target}")), target);+ }+ run_promote_gates(cwd.path(), &steps);+ let output = assert_failure(+ &run_step_with_env(+ cwd.path(),+ emit,+ &[("RELEASE_VERSION", format!("v{VERSION}").as_str())],+ ),+ "emit the channel manifest",+ );+ assert!(+ output.contains("the release is missing artifact rows for ['win32-x64']"),+ "the refusal must name the missing win32-x64 row\n{output}"+ );+}diff --git a/install.ps1 b/install.ps1index d2987f5a1a..3e455c0f77 100644--- a/install.ps1+++ b/install.ps1@@ -1,15 +1,15 @@# install.ps1 — the Windows-native installer for Prime Agent (Rust build).#-# THE ONE-LINER (the served copy carries the official domain + the stable-# channel rendered in by the release pipeline's publish step):-#-# irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex-#-# The repo copy's defaults are the same bucket-root base, so the raw form-# works out of the box too (the README's Windows command):+# THE ONE-LINER (the repo copy's defaults are the channel's own bucket-root+# base + the stable channel, so the raw form works out of the box — the+# README's Windows command):## irm https://raw.githubusercontent.com/PrimeIntellect-ai/prime-agent/main/install.ps1 | iex#+# The release pipeline's publish step renders this file to <base>/install.ps1+# (the stable channel) and <base>/install-beta.ps1 (the beta channel), the+# build's download base + channel stamped in.+## The Git Bash route is the same channel through install-rust.sh (the sh# one-liner `curl -fsSL .../install.sh | sh` under Git Bash/MSYS2/Cygwin);# this script is the PowerShell-native form. Both routes publish the SAME@@ -20,8 +20,10 @@# or <base>/beta) gives the version, the channel manifest (<base>/latest.json# or <base>/beta.json) gives this platform's artifact row, and the versioned# release prefix serves the tarball plus its SHA256SUMS; the checksum is-# verified before anything is published. NO GITHUB SURFACE anywhere in the-# user path.+# verified before anything is published. The channel carries no GitHub+# surface: every file this installer READS comes from the base — the one+# GitHub fetch on the Windows route is this script itself (the README's raw+# copy), and the sh route has none.## THE WINDOWS CHANNEL FALLBACK: the stable releases predate Windows# support, so the stable manifest carries no win32-x64 row until the first