Repository navigation
[zed-lock] Extract event-driven cross-platform process locking into a standalone crate #180
Description
Objective
Complete github.com/zed-pkg/zed-lock as the canonical runtime-neutral Rust library for local cross-process file locking and migrate zed-cli without weakening recursive-install, immutable-store, transaction, or recovery contracts.
Canonical Linear issue: DEN-2076
Canonical Linear architecture: zed-lock event-driven cross-platform locking architecture
Canonical GitHub architecture: zed-docs document 31
Landed library baseline
zed-pkg/zed-lockrepository and crate exist.- Kernel-backed blocking/evented architecture is implemented.
- Linux, macOS, and Windows fixed-OS conformance exists.
- Descriptor/handle non-inheritance regression landed through
zed-pkg/zed-lock#5; current evidence commit:f8add411c28c888a28abdcbc7fa9dcdb5ba0e745. - Independent inheritance certification landed in
zed-pkg-test/concurrent-install-locking#11.
Current zed-cli migration
Draft PR zed-pkg/zed-cli#246 migrates the remaining four direct fs2 owners and removes the direct manifest dependency.
Exact candidate:
base 0ecd5b00cdd4c5df66824bd9ffdeb079b592a651
head 7897b7f82df13729672c4b12dbb7934ed47a024a
Exact six-file boundary:
Cargo.lockCargo.tomlsrc/auth.rssrc/global.rssrc/install_graph.rssrc/managed_install.rs
The candidate has 24/24 green product workflows and independent Windows Server 2025 certification:
- run
31272111594 - artifact
9025997603 - digest
sha256:f2dd3a4c5adc14d204d0df6154f69ceb327bab125634bfb18f1ee277d8df6344
The independent run proved every excluded Windows test on unchanged main before passing the candidate's locked all-target build, all remaining tests including process locks, and strict Clippy.
Serial promotion gate
Do not merge #246 yet. It is intentionally draft and serially blocked behind:
zed-pkg/zed-cli#131zed-pkg-test/zed-pkg-e2e#49
After that predecessor lands, #246 must be semantically rebased, retain only its intended migration, and rerun complete exact-head product plus independent certification.
Proven separate baseline defects
The Windows attribution work created focused, non-lock-regression trackers:
zed-pkg/zed-cli#249— self-update executable replacement baseline;zed-pkg/zed-cli#252/ Linear DEN-3090 — symlink-dependent E2E tests must certify Windows copy mode;zed-pkg/zed-cli#253/ Linear DEN-3097 — frozen remotefile:authority rejection must be stable and redacted cross-platform.
Remaining zed-lock security hardening
zed-pkg/zed-lock#6 / Linear DEN-3091 owns private lock-directory/file permissions or ACLs, symlink/reparse-resistant rendezvous opening, race-resistant path validation, and unsafe-existing-path errors. This remains separate from #246.
AI-agent bridge
Immutable exact-SHA adversarial review packets are queued on ORESoftware/ai-agent-bridge.rs#104. Provider execution remains unavailable because of credit/plan exhaustion, so no live AI-agent approval is claimed.
Remaining acceptance criteria
- Standalone repository/crate exists and builds without a Zed-registry bootstrap dependency.
- Blocking, async/helper-thread, and explicit immediate acquisition APIs exist.
- Cross-platform process/crash/non-inheritance conformance exists.
- Remaining direct
zed-clilock owners are migrated in a certified exact-head candidate. - Declared serial predecessor lands.
- refactor: move remaining local locks behind zed-lock #246 is rebased and fully recertified on the resulting main.
- Secure rendezvous-opening policy in
zed-lock#6lands and is certified. - Final docs/releases point to immutable shipped commits and evidence.
Activity
linear-code commentedon Aug 5, 2026
DEN-2076
docs: clarify helper-thread evented locking and zed-lock extraction
ORESoftware commentedon Aug 5, 2026
Implementation PR: #183.
This increment creates the independently packageable
crates/zed-lockworkspace crate, migratesStoreproject/install, artifact, and build locks to it, retains compatibility re-exports, and adds bounded evented waiting, reentrancy policy, deterministic lock-set ordering, diagnostics, package/security files, examples, and cross-process conformance.Pre-PR Linux validation passed all crate tests, migrated Store/process tests, formatting, and strict workspace Clippy. The permanent PR workflows are now certifying Linux, macOS, and Windows.
The issue remains open after this PR because the final history-preserving split to an actual
zed-pkg/zed-lockrepository, native Windows overlapped cancellation, inheritance certification, and the larger fault/soak matrix are still outstanding.ORESoftware commentedon Aug 5, 2026
Merged implementation increment: #183 landed on
mainas74b16a16b5d1d36d56110ccd8161aac21b175edb.Landed now:
crates/zed-lockwith Cargo and Zed package metadata, README, license, security policy, and example;zed-cli::Storemigration for project/install, artifact, and build locks;cargo install --lockedcertification with all internal path dependencies constrained to the checkout;This issue remains open for the actual history-preserving split to
github.com/zed-pkg/zed-lock, native Windows overlapped cancellation, descriptor/handle inheritance certification, filesystem capability classification, larger soak/fault injection, and migration of the remaining directfs2users.ORESoftware commentedon Aug 5, 2026
Independent test-org coverage is now merged in zed-pkg-test/concurrent-install-locking#9 as
f65fa47f5006404828e1f2bf069267bd81a1365a.The
zed-pkg-testharness resolves the productionzed-lockpackage fromzed-pkg/zed-climain rather than copying its implementation. Green Linux, macOS, and Windows acceptance coverage now includes:A scheduled/manual release-mode soak expands this to 48 threads, 20 processes, 12 shards, and thousands of protected acquisitions. The broader inheritance, filesystem-capability, and transaction-boundary fault matrix remains open.
ORESoftware commentedon Aug 5, 2026
Standalone publication is complete.
Shipped repository and release:
0fc100afc3cd60b5ce091b4207f910bf08f2cfb7zed-lock-0.1.0.crate(17,106 bytes)2850b39d1906433ea584fb649934936137dae873eaecf127666f5d88740b3f20Repository CI is green on Ubuntu, macOS, and Windows for formatting, all-target tests, and strict Clippy.
zed-pkg/zed-lock#1merged the self-publishing workflow.Independent immutable evidence:
zed-pkg-test/concurrent-install-locking#10merged asaeb181db48cc38fec9ff7fcf09b8c0194a293a5b.zed-pkg/zed-lockat exact commit0fc100afc3cd60b5ce091b4207f910bf08f2cfb7rather than importing the in-tree package from a mutablezed-clibranch.Security cleanup performed during publication: an incorrectly generated initial workflow expanded an ephemeral Actions expression. The invalid run was deleted and the public repository root history was rewritten to a clean parentless commit before PR #1; the current history and workflow contain no embedded token.
This issue remains open for the still-unfinished acceptance items: descriptor/handle inheritance certification, deeper Windows overlapped cancellation, NFS/SMB capability classification, remaining direct lock-user migration, and the larger mutation/fault-injection matrix.
ORESoftware commentedon Aug 5, 2026
The standalone repository split and CLI consumption are now complete.
Final migration:
506106798e3fb3d23804f544dd41b020e9f7f8df.zed-clinow pinszed-pkg/zed-lock@0fc100afc3cd60b5ce091b4207f910bf08f2cfb7in bothCargo.tomland generatedCargo.lock.crates/zed-lockworkspace package is removed.zed-pkg/zed-lock.cargo install --lockedpath verifies the same immutable source and asserts the in-tree copy is absent.Pre-merge validation performed by the authenticated control runner passed formatting, all Store tests, project-lock tests, install-graph tests, evented process-lock integration, recursive HTTP concurrency, and strict Clippy for all zed-cli targets. Repository-native Linux/macOS/Windows and isolated-install jobs were also started against the merged source and had already verified the immutable dependency boundary before merge.
The extraction/repository/publication acceptance criteria are satisfied. This issue remains open only for the broader items already moved to zed-pkg/zed-lock#3: refs/shared-metadata migration, native Windows cancellation, descriptor/handle inheritance, NFS/SMB capability classification, deeper aliasing, and expanded fault/soak evidence.