allow absent base during addressed recovery

This commit is contained in:
2026-08-12 00:23:43 +02:00
parent a3e2276bef
commit e5c081e55f
+2 -3
View File
@@ -439,9 +439,8 @@ export class WorkspaceRegistry {
if (state.phase === "publication_intent_durable") {
const activeBefore = await this.#tryActiveState();
const activeDigest = activeBefore ? registryDigest(activeBefore) : undefined;
const baseAllowed = operation === "registry_bootstrap"
? activeBefore === undefined
: (activeBefore !== undefined && activeBefore.head === state.baseCommit && activeDigest === state.baseManifestSha256);
const baseAllowed = activeBefore === undefined
|| (operation === "registry_pull" && activeBefore.head === state.baseCommit && activeDigest === state.baseManifestSha256);
const targetAllowed = activeBefore !== undefined && activeBefore.head === target && activeDigest === state.targetManifestSha256;
if (!baseAllowed && !targetAllowed) throw new WorkspaceRegistryError("registry_bootstrap_recovery_conflict", "Active registry identity conflicts with addressed publication");
if (targetAllowed) publication = operation === "registry_pull" && state.baseCommit === target ? "unchanged" : "reconciled_target";