Skip to content

fix(rust): keep changelog/migration fragments out of the crate archive - #976

Merged
thekevinscott merged 3 commits into
mainfrom
claude/tackle-939-l9fh3b
Aug 20, 2026
Merged

thekevinscott merged 3 commits into
mainfrom
claude/tackle-939-l9fh3b

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #939

packages/rust/Cargo.toml's [package].exclude covers tests/ and the VitePress tooling under docs/, but not the fragment dirs. cargo ships everything not excluded, so the published .crate carried 60 fragment files — more than half its 119 entries — none of them read by a crate consumer.

npm keeps its fragments out structurally ("files": ["dist/", "docs/", "README.md", "LICENSE"] is an allowlist) and maturin's wheel layout does the same, so this is a cargo-only gap. release-ci.yml's path filters already treat every package's changelog.d/ / migrations.d/ as non-shipping (!packages/rust/changelog.d/**, …) — the crate manifest was the one place that hadn't been told.

before: 119 files, 60 under changelog.d/ + migrations.d/
after:   59 files,  0

Test

tests/crate_contents.rs asserts cargo package --list — the archive's own manifest — rather than the exclude patterns, so a pattern that parses but matches nothing still fails. A third case pins src/lib.rs as present so a --list returning nothing can't satisfy the two absence checks vacuously. --allow-dirty is passed deliberately: without it cargo aborts on the VCS check the moment a packaged file is uncommitted, so editing exclude to try a fix would stop the test reporting on its own assertions.

RED is in this PR's history on purpose, per AGENTS.md — the failing test was pushed and observed red in CI before the fix:

commit CI result
7a73e31 test run 32401685972 RED — 1 passed; 2 failed, both fragment assertions
a446c70 test hardening run 32401935265 RED — same two, everything else green
6e78117 fix this run expected GREEN

Note on the pointer stubs

packages/rust/CHANGELOG.md / MIGRATIONS.md still ship, and their relative links into changelog.d/ are now dead inside the archive (their link to the repo-root CHANGELOG.md already was). Left deliberately: they're 13-line signposts to where history lives, which is still useful in a vendored crate, and excluding them is outside this issue.

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: N/A — packages/python untouched; its e2e --scope is packages/python/dirsql + packages/rust/src, neither of which this diff touches
  • TypeScript SDK e2e: N/A — same, scope is packages/ts/src + packages/rust/src + packages/ts/napi
  • Rust core e2e (if applicable): pass (1 pre-existing sandbox failure, below)
  • packages/python/e2e-attestation.json refreshed if packages/python changed — N/A, unchanged
  • packages/ts/e2e-attestation.json refreshed if packages/ts changed — N/A, unchanged
  • Command(s) run: cargo test --manifest-path packages/rust/Cargo.toml --features cli --tests
  • Result summary: every suite green except vtab::unreadable_file_yields_null_content_without_erroring_the_row, which chmods a file unreadable and asserts NULL content. The hosted sandbox runs as uid 0, and root bypasses the permission bits, so the read succeeds and returns Some("classified"). Pre-existing and environmental — this diff touches no src/; the same test passes in CI's non-root runner (both RED runs' only integration failures were the two new assertions).

Manual exercise (AGENTS.md — tests aren't sufficient): built the real archive rather than trusting the listing.

$ cargo package -p dirsql --no-verify --allow-dirty
    Packaged 59 files, 799.3KiB (207.1KiB compressed)

$ tar -tzf target/package/dirsql-0.2.7.crate | sed 's|^dirsql-0.2.7/||' \
    | grep -cE '^(changelog|migrations)\.d/'
0

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package — packages/rust/changelog.d/2026-08-20-crate-excludes-fragment-dirs.md
  • Migration fragment added under <root>/<pkg>/migrations.d/ (or: not required — additive/bugfix only) — not required: no public API break, no deprecation removed, no runtime behavior change. Only files that never should have shipped stop shipping.

PARITY.md: not updated — no SDK public API surface changes, so this neither introduces nor restores parity drift.

claude added 3 commits August 20, 2026 18:09
RED. `packages/rust/Cargo.toml`'s `[package].exclude` covers `tests/` and the
VitePress tooling under `docs/`, but not the fragment dirs, so `cargo package`
ships all 57 of them -- roughly half the archive's 118 files. npm's `files`
allowlist and maturin's wheel layout keep their fragments out structurally;
cargo ships everything not excluded, so the crate needs the patterns named.

Asserted against `cargo package --list` (the archive's own manifest) rather
than against the exclude patterns, so a pattern that parses but matches
nothing still fails. A third case pins `src/lib.rs` as present, so a `--list`
that returned nothing cannot satisfy the two absence checks vacuously.

Refs #939

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8dwtBuYy6sjaEYwNusb4z
Still RED. `cargo package --list` aborts outright when a packaged file is
uncommitted, so the moment you edit `[package].exclude` to try a fix the test
stops reporting on its assertions and fails on the VCS check instead -- all
three cases, including the sanity anchor. `--allow-dirty` asks the question
the assertions actually mean: what would the working tree ship.

The two fragment cases still fail against the unmodified manifest.

Refs #939

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8dwtBuYy6sjaEYwNusb4z
GREEN. `cargo package` drops from 119 files to 59: the 60 fragment files no
longer ship. Verified on the real archive, not just the listing --
`tar -tzf target/package/dirsql-0.2.7.crate` has zero entries under either
dir, and `Packaged 59 files, 799.3KiB (207.1KiB compressed)`.

npm's `files` allowlist and maturin's wheel layout already dropped their
fragments structurally, and release-ci.yml's path filters treat every
package's fragment dirs as non-shipping. The crate manifest was the one place
that had not been told.

Fixes #939

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8dwtBuYy6sjaEYwNusb4z
@thekevinscott
thekevinscott merged commit 248d293 into main Aug 20, 2026
77 checks passed
@thekevinscott
thekevinscott deleted the claude/tackle-939-l9fh3b branch August 20, 2026 18:28
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.

Crate archive ships changelog.d/ and migrations.d/ fragments

3 participants