fix(cli): protect plugin activation and approval rollback from concurrent commands #439

Merged
buildagent merged 2 commits from codex/serialize-project-plugin-mutations into master 2026-10-24 12:21:16 +02:00
Member

Two daemonless CLI plugin update commands for the same project could retire each other's live generation. A failed command then restored a stale approval snapshot, erasing the other update's approval; the other process could subsequently promote a generation that the record no longer approved (#438).

Hold a nonblocking OS lock across the complete CLI approval snapshot, planning, mutation, activation and rollback operation. A competing mutator reports plugin_mutation_busy before reading approvals and tells the operator to retry. Coordination uses canonical installation/project identities in a private directory beside the user store, outside project and approval/package data, so unsigned/declined operations preserve those roots and different TMP settings still coordinate. Process exit releases the guard; keeping the lock file avoids inode races. Status, doctor, check-only updates and dry-run GC remain available, with independent locks for independent projects. Announce foreground activation before its expensive work when no daemon owns the index.

Validation: all81 tests in the affected add, displacement, registry, package-update and package-release-script suites passed, including unchanged-state refusals and bootstrap behavior. The complementary CLI nextest run completed446 tests:445 passed and one unchanged query log-level fixture returned warming_up at its existing one-shot wait; that fixture passed in isolation without source/deadline changes (tracked on #301). CLI doctest, all-target Clippy with -D warnings, formatting and whitespace checks passed. New process regressions cover two different packages, root aliases, different TMP directories, no catalog fetch or approval write by the refused command, sequential retry preserving both upgrades, independent-project access and crash release. Bypassing the update guard was confirmed red, then restored.

Closes #438 after normal CI qualification, including Windows. No package version or CI/deadline changes. Follow docs/releasing.md for the version-only core release after source merge.

Two daemonless CLI `plugin update` commands for the same project could retire each other's live generation. A failed command then restored a stale approval snapshot, erasing the other update's approval; the other process could subsequently promote a generation that the record no longer approved (#438). Hold a nonblocking OS lock across the complete CLI approval snapshot, planning, mutation, activation and rollback operation. A competing mutator reports `plugin_mutation_busy` before reading approvals and tells the operator to retry. Coordination uses canonical installation/project identities in a private directory beside the user store, outside project and approval/package data, so unsigned/declined operations preserve those roots and different TMP settings still coordinate. Process exit releases the guard; keeping the lock file avoids inode races. Status, doctor, check-only updates and dry-run GC remain available, with independent locks for independent projects. Announce foreground activation before its expensive work when no daemon owns the index. Validation: all81 tests in the affected add, displacement, registry, package-update and package-release-script suites passed, including unchanged-state refusals and bootstrap behavior. The complementary CLI nextest run completed446 tests:445 passed and one unchanged query log-level fixture returned `warming_up` at its existing one-shot wait; that fixture passed in isolation without source/deadline changes (tracked on #301). CLI doctest, all-target Clippy with `-D warnings`, formatting and whitespace checks passed. New process regressions cover two different packages, root aliases, different TMP directories, no catalog fetch or approval write by the refused command, sequential retry preserving both upgrades, independent-project access and crash release. Bypassing the update guard was confirmed red, then restored. Closes #438 after normal CI qualification, including Windows. No package version or CI/deadline changes. Follow `docs/releasing.md` for the version-only core release after source merge.
fix(cli): serialize project plugin mutations through activation
Some checks failed
Package CI / package (timeline) (pull_request) Successful in 36s
Package CI / package-corpus (csharp) (pull_request) Successful in 37s
Package CI / package (rust) (pull_request) Successful in 38s
Package CI / package-corpus (vue) (pull_request) Successful in 30s
Package CI / package-corpus (rust) (pull_request) Successful in 38s
Package CI / package (ruby) (pull_request) Successful in 48s
Package CI / package (typescript) (pull_request) Successful in 44s
Package CI / package-corpus (python) (pull_request) Successful in 47s
Package CI / package-corpus (xaml) (pull_request) Successful in 35s
Pilot plugin compatibility / Fetch the pinned runtime once (pull_request) Successful in 1m6s
Package CI / package-corpus (typescript) (pull_request) Successful in 49s
Package CI / package-corpus (svelte) (pull_request) Successful in 56s
Package CI / package-corpus (timeline) (pull_request) Successful in 55s
Package CI / package overhead budgets (nightly, one package at a time) (pull_request) Has been skipped
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 1m0s
Pilot plugin compatibility / Pilot compatibility (csharp) (pull_request) Successful in 1m2s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m32s
Pilot plugin compatibility / Pilot compatibility (timeline) (pull_request) Successful in 1m12s
Pilot plugin compatibility / Pilot compatibility result (pull_request) Successful in 1s
CI / cargo doc (intra-doc links) (pull_request) Successful in 4m56s
CI / cargo clippy (pull_request) Successful in 5m51s
CI / cargo deny (pull_request) Successful in 6m13s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m42s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m50s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m16s
CI / cargo test (pull_request) Failing after 24m26s
CI / cargo test (daemon transport) (pull_request) Has been skipped
CI / OSS corpus (tier 1) (pull_request) Successful in 31m19s
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Failing after 35m44s
20ce41d131
fix(cli): keep mutation coordination outside project and approval data
All checks were successful
Package CI / package (php) (pull_request) Successful in 33s
Package CI / package-corpus (rust) (pull_request) Successful in 29s
Package CI / package-corpus (svelte) (pull_request) Successful in 38s
Package CI / package (vue) (pull_request) Successful in 35s
Package CI / package (timeline) (pull_request) Successful in 44s
Package CI / package (python) (pull_request) Successful in 51s
Package CI / package-corpus (vue) (pull_request) Successful in 39s
Package CI / package-corpus (timeline) (pull_request) Successful in 41s
Package CI / package-corpus (php) (pull_request) Successful in 45s
Package CI / package-corpus (python) (pull_request) Successful in 54s
Package CI / package-corpus (typescript) (pull_request) Successful in 51s
Package CI / package-corpus (xaml) (pull_request) Successful in 49s
Package CI / package overhead budgets (nightly, one package at a time) (pull_request) Has been skipped
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 55s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m28s
Pilot plugin compatibility / Fetch the pinned runtime once (pull_request) Successful in 1m41s
Pilot plugin compatibility / Pilot compatibility (timeline) (pull_request) Successful in 1m2s
Pilot plugin compatibility / Pilot compatibility (csharp) (pull_request) Successful in 1m9s
Pilot plugin compatibility / Pilot compatibility result (pull_request) Successful in 1s
CI / cargo clippy (pull_request) Successful in 5m13s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m14s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m31s
CI / cargo deny (pull_request) Successful in 6m29s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m53s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m17s
CI / cargo test (pull_request) Successful in 24m38s
CI / OSS corpus (tier 1) (pull_request) Successful in 31m20s
CI / cargo test (daemon transport) (pull_request) Successful in 9m7s
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Successful in 44m48s
4390bb131f
buildagent deleted branch codex/serialize-project-plugin-mutations 2026-10-24 12:21:17 +02:00
Author
Member

Merged normally as169e91fdcf63f37d1c6774e1540909e20f4d7fc6 after all required final-head workflows passed on4390bb131f490bb7e423cd801621e7ead2b8f50d: Windows6548(2success), core6549(13success/3nightly skips), package6550(23success/2expected skips), pilots6551(5success). Native workspace4836 and Linux5058 tests passed; Linux timing44 passed; Windows timing/doctest/installer/shipped-profile/smoke steps completed normally. Source and merge trees botha99422a02b8ba43f30ee2fd2065bb0b78f63d042, and source is a merged ancestor.

Version-only release PR#440 (#440) is prepared directly on the qualified source head per docs/releasing.md; its four-site-only checker passes. Publication and independent signed-artifact/upgrade verification are still pending.

Merged normally as169e91fdcf63f37d1c6774e1540909e20f4d7fc6 after all required final-head workflows passed on4390bb131f490bb7e423cd801621e7ead2b8f50d: Windows6548(2success), core6549(13success/3nightly skips), package6550(23success/2expected skips), pilots6551(5success). Native workspace4836 and Linux5058 tests passed; Linux timing44 passed; Windows timing/doctest/installer/shipped-profile/smoke steps completed normally. Source and merge trees botha99422a02b8ba43f30ee2fd2065bb0b78f63d042, and source is a merged ancestor. Version-only release PR#440 (https://git.h-dv.de/h-dv/code-index/pulls/440) is prepared directly on the qualified source head per docs/releasing.md; its four-site-only checker passes. Publication and independent signed-artifact/upgrade verification are still pending.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index!439
No description provided.