Two valid cached-package writers can both observe an absent native destination and then try to rename separate verified candidates into it. A real-filesystem regression produces DirNotEmpty for the losing publisher while its peer succeeds.
The first attempt to serialize publication also exposed a lower-level contract problem: the POSIX createFileAbsolute helper discards requested advisory locks and permission modes. Independent file tests show a requested 0600 file becoming 0644 and a second nonblocking exclusive opener succeeding while the first lock should be held.
Repair the owning native primitives, then serialize only the destination check, commit and rollback with a stable per-destination lock inode. Keep candidates private, preserve immutable shared sources, retain failed rollback backups, and preserve required setup failures. Do not unlink the coordination file while another writer may be waiting on its inode.
Verification must cover concurrent real filesystem publication, requested file permissions, nonblocking lock contention, the existing ownership/rollback/allocation regressions, a normal CLI build and installed native Git consumers. Publish through the normal patch release and consume that maintained release downstream.
Related: https://github.com/pantry-pm/pantry/issues/250, https://github.com/stacksjs/stacks/issues/3067 and https://github.com/stacksjs/hq.training/issues/318.
The exact path responsible for the Git CI PathAlreadyExists report in issue 250 remains unknown. This reproduced transaction race must not be presented as proof of that failed run's root cause.