Skip to content

Accept Cargo-owned Windows hardlinks - #1620

Merged
TheGreenCedar merged 1 commit into
dev/codestory-nextfrom
codex/1618-windows-cargo-hardlinks
Jul 30, 2026
Merged

Accept Cargo-owned Windows hardlinks#1620
TheGreenCedar merged 1 commit into
dev/codestory-nextfrom
codex/1618-windows-cargo-hardlinks

Conversation

@TheGreenCedar

Copy link
Copy Markdown
Owner

Context

The exact-head Windows package job in run 30537929769 completed its single release Cargo graph in 20m17s, then rejected the first CLI executable because the selector required every output to have one native link. Cargo deliberately builds local MSVC binaries under release/deps and hardlinks the user-facing copy into the release root.

Base: b0e9250
Reviewed head: ef17d6e

What changed

  • Require every selected artifact to be newly emitted by the exact Cargo invocation.
  • Record native device, inode, link count, and exact link paths in a v2 artifact manifest.
  • Accept only Cargo's two valid production shapes: a single-link copy fallback, or the release-root executable paired with its normalized release/deps hardlink.
  • Keep release test executables single-linked under release/deps.
  • Recheck topology and identity after hashing and again before execution or packaging.
  • Preserve exact source SHA/tree, target, package, profile, path, size, digest, and required-artifact checks.

No workflow job or claim edge changed, so workflow policy and release-claims.json are intentionally unchanged.

Independent attack

A live Windows Cargo probe disproved the first same-basename implementation: cargo-hardlink-probe.exe is linked to deps/cargo_hardlink_probe.exe. The reviewed head uses Cargo's hyphen-to-underscore normalization.

The verifier then rejected:

  • duplicate Cargo builds and debug/release substitutions;
  • external, debug, cross-target, arbitrary-name, third-link, and junction aliases;
  • stale fresh outputs and cross-SHA/source-tree records;
  • single-path and full-pair identical-byte inode replacements.

Verification

  • node --test .github/scripts/cargo-build-artifacts.test.mjs: 30/30
  • Protected Windows: current suite plus junction attack, 61/61
  • Native Windows probe: root and deps peer shared device/inode with nlink=2
  • Workflow-policy mutations: 21/21 rejected
  • Candidate-store source identity mutations: 11/11 rejected
  • node .github/scripts/check-workflow-policy.mjs
  • git diff --check

No broad source or package proof was rerun, and the failed 04605eb head will not be rerun.

Closes #1618

@TheGreenCedar
TheGreenCedar marked this pull request as ready for review July 30, 2026 12:03
@TheGreenCedar TheGreenCedar added the review-accepted Exact PR head accepted for full workspace tests and clippy label Jul 30, 2026
@TheGreenCedar
TheGreenCedar merged commit 5e7b14c into dev/codestory-next Jul 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-accepted Exact PR head accepted for full workspace tests and clippy

Projects

Development

Successfully merging this pull request may close these issues.

1 participant