Prevent a second release process from using the same checkout
Two terminals started preparation within a second and both used the same temporary filenames. Add an exclusive lease for mutation commands with inspectable ownership.
- Focused work estimate
- 2h + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Process coordination · Race conditions · Operational tooling
Estimated field mix
- Developer tooling100%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A team maintains six related packages. Release notes, version changes, and tags are copied between a spreadsheet and a terminal; a failed upload recently left two packages ahead of their dependents. The exercise uses temporary repositories and a fake registry.
Setup prerequisites
- Create a temporary Git repository with three related fixture packages.
- Use a local registry double; no publishing credentials are required.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- CLI-101 · Print package versions without depending on the current directory
- CLI-103 · Include dependent packages in the proposed version bump
- CLI-104 · Make a dirty checkout a deliberate release decision
- CLI-105 · Turn change fragments into package-specific release notes
- CLI-106 · Prepare manifests and notes as one recoverable file operation
Acceptance criteria
- Exactly one of two concurrent preparation commands obtains the repository lease.
- The loser exits before replacing a file and reports the existing operation ID.
- Stale-lease recovery is an explicit command that verifies the recorded operation is no longer active.
Implementation constraints
- Do not decide lease ownership from a PID alone; include an operation token.
- Read-only commands remain usable while a lease exists.
Verification to include
- Start two local fixture processes behind a barrier and count successful mutations.
- Simulate a stale lease and verify ordinary preparation refuses it until explicit recovery.
Deliverables
- Lease implementation and concurrent-process test
Rollout and recovery
Require leases for all mutation commands together; rollback by disabling mutations until both versions agree on the lease format.
Value of the work
For the engineer: Practice CLI contracts, graph reasoning, filesystem safety, and recovery from partial work.
For the team: Review how an engineer makes release changes inspectable and recoverable before they affect consumers.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.