Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: preserve completion contracts after cleanup rebase

[._.]/ Adam Eivya31aaefaa481
diff --git a/server/services/agentFinalization.js b/server/services/agentFinalization.js
index 89ec4a590d..31ab3b96a6 100644
--- a/server/services/agentFinalization.js
+++ b/server/services/agentFinalization.js
@@ -1,3 +1,4 @@
+import { isClaimAgentMetadata } from '../lib/claimFlowTaskTypes.js';
import { storeCompletionData, completionReplayInput } from './agentCompletionData.js';
import { prepareCompletionTaskHandoff, recoverCompletionTaskHandoff } from './agentCompletionTaskHandoff.js';
import { hasClaimCheckoutBindings } from './completedCheckoutEvidence.js';
diff --git a/server/services/agentRepoStateVerification.js b/server/services/agentRepoStateVerification.js
index 79eedbd9d9..df5969d676 100644
--- a/server/services/agentRepoStateVerification.js
+++ b/server/services/agentRepoStateVerification.js
@@ -1,3 +1,4 @@
+import { isClaimAgentMetadata } from '../lib/claimFlowTaskTypes.js';
import { recoverCompletionTaskHandoff } from './agentCompletionTaskHandoff.js';
import { MANAGED_WORKTREE_CLEANUP_CONTRACT } from '../lib/mergeGateContract.js';
import { processAuditFingerprint } from '../lib/persistentMindProcessAudit.js';
diff --git a/server/services/completedCheckoutEvidence.test.js b/server/services/completedCheckoutEvidence.test.js
index cf94e340ff..dde38d95d8 100644
--- a/server/services/completedCheckoutEvidence.test.js
+++ b/server/services/completedCheckoutEvidence.test.js
@@ -28,9 +28,10 @@ describe('completed claim checkout evidence', () => {
});
afterEach(async () => { await rm(scratch, { recursive: true, force: true, maxRetries: 3 }); });
- it('captures the exact ordinary checkout before completion without granting claim authority', async () => {
+ it.each([false, true])('captures the registered checkout without granting unbound claim authority (pinned=%s)', async pinned => {
agent.metadata = { isWorktree: true, sourceWorkspace: repoPath, workspacePath: path, worktreeBranch: branch,
- claimBranches: ['claim/reserved-other-checkout'] };
+ claimBranches: ['claim/reserved-other-checkout'],
+ ...(pinned ? { claimBranch: branch, claimPicksOwnBranch: false } : {}) };
const receipts = await captureCompletedCheckouts(agent, { success: true });
expect(receipts).toHaveLength(1);
expect(receipts[0]).toMatchObject({ branch, head, incarnation: { pointer: { ino: expect.any(String) } } });
diff --git a/server/services/cosAgentLifecycle.js b/server/services/cosAgentLifecycle.js
index 00633795fe..174e73c712 100644
--- a/server/services/cosAgentLifecycle.js
+++ b/server/services/cosAgentLifecycle.js
@@ -1,4 +1,3 @@
-import { isClaimAgentMetadata } from '../lib/claimFlowTaskTypes.js';
/**
* CoS Agent Lifecycle Module
*