Export the version the binary was published as, not the manifest

34bb86f89854 · AtlantisPleb · · parent 7cbe78af4f61

Export the version the binary was published as, not the manifest

Every ATIF trajectory exported from a released build claimed to come from
`0.1.0`. Releases have been 0.0.1, 0.0.2 and 0.0.3, and `0.1.0` is the one
version that was published and withdrawn -- so the traces named the single
version that must never be attributed to anything, and named it on every
export.

`openagents_cli::VERSION` already carries the published name:
`ops/release-cli.sh` threads it in through `OPENAGENTS_CLI_RELEASE_VERSION`,
and the crate manifest is the fallback for a build that is not a release.
`main.rs` and both sites in `interactive.rs` read it. `export.rs` was missed
when they were changed, and kept reading `env!("CARGO_PKG_VERSION")`, which
is the manifest's `0.1.0` whatever the binary was shipped as.

The assertion added here is honest about its own limits, which the comment
records. Under a plain `cargo test` both expressions are the same string, so
it passes against the bug as happily as against the fix; it holds the intent
and catches a literal creeping back in. What separates them is a release
build, where they differ by construction:

    OPENAGENTS_CLI_RELEASE_VERSION=9.9.9 cargo test -p coder-lite \
      --test export_atif

Verified adversarially: that run against the old line fails with
left `"0.1.0"`, right `"9.9.9"`, and passes against the new one.

`cargo test -p coder-lite`: 696 passed, 0 failed, 3 ignored.

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

pushed
by user · WAL seq 268 · 2026-08-26T16:01:17.043493Z

Changed files

  • modified crates/coder-lite/src/export.rs
  • modified crates/coder-lite/tests/export_atif.rs

Diff

2 files changed, +25 -1

crates/coder-lite/src/export.rs modified +1 -1

@@ -241,7 +241,7 @@ pub fn export_trajectory(

241 241
        "trajectory_id": format!("{}-{}", repo, at_iso),
242 242
        "agent": {
243 243
            "name": AGENT_NAME,
244
            "version": env!("CARGO_PKG_VERSION"),
244
            "version": openagents_cli::VERSION,
245 245
            "model_name": model,
246 246
        },
247 247
        "steps": steps,
crates/coder-lite/tests/export_atif.rs modified +24

@@ -88,5 +88,29 @@ fn export_writes_an_atif_document_for_a_constructor_built_transcript() {

88 88
    assert_eq!(notices.len(), 1);
89 89
    assert_eq!(notices[0]["text"], "found ACP agents: devin");
90 90
91
    // The trajectory records the version this binary was *published* as, which
92
    // is what `openagents_cli::VERSION` carries: `ops/release-cli.sh` threads
93
    // the published name in through `OPENAGENTS_CLI_RELEASE_VERSION`, and the
94
    // crate manifest is only the fallback for a build that is not a release.
95
    //
96
    // This read `env!("CARGO_PKG_VERSION")` until 2026-08-26, so every trace
97
    // exported from 0.0.1, 0.0.2 and 0.0.3 claimed to come from `0.1.0` -- the
98
    // one version that was withdrawn and must never be attributed to anything.
99
    //
100
    // Note what this assertion can and cannot do. In a normal `cargo test` the
101
    // two expressions are the same string, so it passes against the bug as
102
    // happily as against the fix; it holds the intent and catches someone
103
    // replacing this with a literal. What actually separates them is a release
104
    // build, where they differ by construction:
105
    //
106
    //     OPENAGENTS_CLI_RELEASE_VERSION=9.9.9 cargo test -p coder-lite \
107
    //       --test export_atif
108
    //
109
    // That run fails against the old code and passes against this one.
110
    assert_eq!(
111
        document["agent"]["version"], openagents_cli::VERSION,
112
        "the exported trajectory must name the published version, not the crate manifest"
113
    );
114
91 115
    let _ = std::fs::remove_dir_all(&scratch);
92 116
}

This page updates live while a promote is in flight · changelog