feat: recover interrupted installation preparation safely

This commit is contained in:
Codex
2026-10-06 19:02:01 +02:00
parent 5c05778614
commit af6cf88b5a
32 changed files with 497 additions and 37 deletions
@@ -153,6 +153,30 @@ Core admission requires all of the following:
Failure leaves the workspace unavailable to the core. There is no rollback: fix the cause and run
the complete command again.
## Interrupted owner recovery
Current preprocessing runs also hold a kernel writer lock on the shared workspace
volume. Every mutating worker inherits a separate shared kernel lock and validates
an owner generation before starting. Recovery takes both locks exclusively before
rotating that generation: a surviving orphan worker blocks recovery, while a delayed
worker from the old generation cannot start. These guards establish process ownership;
PostgreSQL remains the readiness authority.
A repeated `preprocess run` can mark an orphaned current-protocol Catalog lease as
`preprocessing_interrupted` through the version/fingerprint/run-identity-checked completion
operation, then restart the entire pipeline. It does not resume internal stages or
clear Memory, sessions, curated descriptions or canonical Evidence. Older running jobs
without this ownership protocol are not automatically adopted; inspect their original
owner during upgrade instead of deleting data or resetting leases speculatively.
Each attempt records its unique run identity in PostgreSQL (migration 015). A late
completion from the previous attempt cannot finish its replacement, even when the
metadata revision and input fingerprint are unchanged.
The installer requests this guarded recovery when status remains running. An active
owner returns a conflict and the installer waits. A pending destructive Catalog Sync
Run is preserved for human review, including when its reservation temporarily blocks
binding import. Interrupted synchronization is retried through the existing domain API.
## Administration sidebar
The Administration sidebar exposes the same one-shot operation for the workspace selected in the