Skip to content

chore: read the fold version from the linked crate, not the lockfile - #4

Merged
yuanhao merged 1 commit into
mainfrom
chore/version-from-const
Aug 28, 2026
Merged

chore: read the fold version from the linked crate, not the lockfile#4
yuanhao merged 1 commit into
mainfrom
chore/version-from-const

Conversation

@yuanhao

@yuanhao yuanhao commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

yoagent-state 0.5.2 exports VERSION, baked in at its own compile time — so it reports what the checker linked, not what a lockfile resolved. Strictly stronger, and it needs no build script.

Deletes build.rs, which shipped three bugs in a day

bug effect
looked one level up for Cargo.lock every packaged/installed build printed unknowncargo package puts the lockfile beside build.rs, so it worked in the workspace and failed where it ships
first-match on a two-version lockfile reported the lowest — naming 0.4.0 while linking 0.5.1, the exact skew the line exists to expose, asserted backwards
collect-all (the fix for the above) over-collected [[patch.unused]], so a local [patch.crates-io] override reported one resolved version as ambiguous(...)

Fifty lines of string parsing over a format we don't own, replaced by one const. The lockfile approach also had a subtler flaw: it reports what resolved, which can differ from what was compiled until someone runs cargo update.

Verified where build.rs failed

Extracted .crate, built standalone:

conformance-check 0.1.0 — folding with yoagent-state 0.5.2

Previously unknown.

Real store (yoyo-gasp, 8,882 events) still 7/7 with the skip named in the certificate. 23 tests pass.

Floors the dependency at 0.5.2, since VERSION lands there.

🤖 Generated with Claude Code

yoagent-state 0.5.2 exports VERSION, baked in at its own compile time.
That reports what the checker actually LINKED rather than what a lockfile
resolved — strictly stronger, since a stale lockfile entry cannot drift
from it — and it needs no build script.

Deletes build.rs, which shipped three bugs in a day:

  - packaged builds printed "unknown": cargo package puts Cargo.lock
    beside build.rs, not one level up, so it worked in the workspace and
    failed in every installed build
  - a two-version lockfile reported the LOWEST, naming 0.4.0 while
    linking 0.5.1 — the exact skew the line exists to expose, backwards
  - collecting every match over-collected [[patch.unused]], so a local
    [patch.crates-io] override reported a single resolved version as
    ambiguous

Fifty lines of string parsing over a format we do not own, replaced by
one const. Verified where build.rs failed: an extracted .crate now
reports 0.5.2 rather than "unknown".

Floors the dependency at 0.5.2, since VERSION lands there.

23 passed. Real store still 7/7 with the skip named.
@yuanhao
yuanhao merged commit 795bb93 into main Aug 28, 2026
2 checks passed
@yuanhao
yuanhao deleted the chore/version-from-const branch August 28, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant