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: resolve stale cleanup-only card handoffs from verified state

[._.]/ Adam Eivya66b7673d27f
diff --git a/client/src/components/cos/AgentResultLine.jsx b/client/src/components/cos/AgentResultLine.jsx
index 1bd7a8b6dd..0c896b4d2f 100644
--- a/client/src/components/cos/AgentResultLine.jsx
+++ b/client/src/components/cos/AgentResultLine.jsx
@@ -9,8 +9,6 @@ export default function AgentResultLine({ agent, className = '' }) {
if (!agent?.result) return null;
const handoff = isAgentHandoff(agent);
const outcome = normalizeTaskOutcome(agent.result.taskOutcome);
- const deliveryHeld = ['blocked', 'incomplete'].includes(outcome?.status);
- const deliveryComplete = isTaskDeliveryComplete(agent);
const executionSuccess = agent.result.executionSuccess ?? agent.result.success;
const assessment = [agent.metadata?.auditAssessment, agent.result.auditAssessment]
.find(value => value?.status === 'recorded') || agent.metadata?.auditAssessment || agent.result.auditAssessment;
@@ -26,6 +24,11 @@ export default function AgentResultLine({ agent, className = '' }) {
const cleanupTracked = cleanupRecovery || cleanup || agent.result.cleanupPending === true;
const cleanupPending = cleanupTracked && cleanup?.status !== 'verified';
const merged = cleanup?.committedIntegrationVerified === true;
+ // A completed cleanup audit supersedes the old cleanup-only handoff, while
+ // unrelated delivery decisions and execution failures keep their own verdict.
+ const cleanupResolved = cleanup?.status === 'verified' && merged && outcome?.recovery?.mode === 'cleanup';
+ const deliveryHeld = ['blocked', 'incomplete'].includes(outcome?.status) && !cleanupResolved;
+ const deliveryComplete = isTaskDeliveryComplete(agent) || cleanupResolved;
const incomplete = cleanupPending || interruption || scanIncomplete || assessmentUnverified || validationFailed || publicationIncomplete;
const tone = handoff ? 'text-port-accent' : !executionSuccess ? 'text-port-error' : incomplete || deliveryHeld ? 'text-port-warning'
: deliveryComplete ? 'text-port-success' : executionSuccess ? 'text-port-text-muted' : 'text-port-error';
@@ -44,7 +47,7 @@ export default function AgentResultLine({ agent, className = '' }) {
)}
</span>
{!handoff && cleanupTracked && <div>{merged ? 'Code merged.' : deliveryComplete ? 'Delivery verified.' : 'Code delivery still needs verification.'}</div>}
- {!handoff && outcome?.reason && !cleanupTracked && <div>{outcome.reason}</div>}
+ {!handoff && outcome?.reason && (!cleanupTracked || outcome.recovery?.mode === 'approval') && <div>{outcome.reason}</div>}
{interruption && <div>Execution interrupted: {interruption.category === 'content-refusal' ? 'provider safety refusal; automatic retry stopped' : interruption.category}</div>}
{!handoff && cleanupTracked && <CleanupStatus cleanup={cleanup} outcome={outcome} />}
<SecurityScanEvidence scanner={scanner} control={agent.metadata?.securityScanControl} />
diff --git a/client/src/components/cos/AgentResultLine.test.jsx b/client/src/components/cos/AgentResultLine.test.jsx
index f69ddae9f9..e084aea214 100644
--- a/client/src/components/cos/AgentResultLine.test.jsx
+++ b/client/src/components/cos/AgentResultLine.test.jsx
@@ -171,3 +171,19 @@ it('does not infer merged delivery or backup existence from successful execution
expect(screen.queryByText('Code merged.')).not.toBeInTheDocument();
expect(screen.queryByText('Local cleanup confirmed; preservation verified.')).not.toBeInTheDocument();
});
+
+it('lets verified current cleanup supersede only a stale cleanup-only handoff', () => {
+ const record = { result: { success: false, executionSuccess: true, cleanupPending: true,
+ taskOutcome: { status: 'incomplete', reason: 'Historical cleanup queued.', recovery: { mode: 'cleanup' } } },
+ metadata: { cleanupOutcome: { status: 'verified', reason: 'retirement-receipt-verified', committedIntegrationVerified: true } } };
+ const view = render(<AgentResultLine agent={record} />);
+ expect(screen.getByText('Completed successfully')).toBeInTheDocument();
+ expect(screen.getByText('Code merged.')).toBeInTheDocument();
+ expect(screen.getByText('Local cleanup confirmed; preservation verified.')).toBeInTheDocument();
+ expect(screen.queryByText('Task incomplete')).not.toBeInTheDocument();
+ view.rerender(<AgentResultLine agent={{ ...record, result: { ...record.result,
+ taskOutcome: { status: 'blocked', reason: 'Choose whether to publish the release.', recovery: { mode: 'approval' } } } }} />);
+ expect(screen.getByText('Task blocked')).toBeInTheDocument();
+ expect(screen.getByText('Choose whether to publish the release.')).toBeInTheDocument();
+ expect(screen.queryByText('Completed successfully')).not.toBeInTheDocument();
+});