Skip to content

How can my app stop a late completion from recreating a project the user deleted?

Keep a project deletion marker long enough for outstanding application work to reconcile, and require late-result attachment to check it. A worker holding an old project snapshot must not recreate a deleted project. Deleting local project data does not cancel AISwapLab generation or establish provider-side deletion.

MAKE API WORK RECOVERABLEAISwapLab team · Editorial methodUpdated 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Mark lifecycle changes durably; Condition late attachment; Separate cleanup responsibilities.
Workflow diagram: Mark lifecycle changes durably → Condition late attachment → Separate cleanup responsibilities. Read the article for evidence and limits.

Deletion is a concurrent event

A completion can arrive after a project disappears from the user's workspace. A naive upsert may recreate the project or restore a selected asset. Your application needs an explicit policy for paid results that finish after local deletion.

What to do next

  1. 01

    Mark lifecycle changes durably

    Record a tombstone or deletion generation for the project before removing editable records. Include outstanding action references needed for reconciliation, under your declared retention policy and restricted operational access.

  2. 02

    Condition late attachment

    Before attaching a completed result, compare the project's lifecycle marker with the action's destination generation. If deleted, follow the declared orphan-result policy rather than upserting the old project from a worker snapshot.

  3. 03

    Separate cleanup responsibilities

    Schedule local asset cleanup and metadata retention deliberately. Explain provider-side storage and deletion separately, and avoid telling users that a local delete button cancelled remote generation or removed all upstream copies.

A concrete example

Illustrative example: project P is deleted while task J runs. J later completes, but its attachment transaction finds P's tombstone. The application records the late outcome for reconciliation without bringing P back into the workspace.

Before you call it ready

  • Deleted projects cannot be upserted by completion.
  • Outstanding actions remain reconcilable.
  • Local and provider deletion claims stay separate.

A locally executed, reproducible check

A retained tombstone blocks a late write that would recreate deleted content.

We executed this exact synthetic fixture on November 16, 2026 with Python 3.12.10 and SQLite 3.49.1. It ran locally with no network requests, account data or model generation. The recorded output below is an observation from that environment, not a platform benchmark. Copy the code into a separate Python file to repeat it in a suitable local environment; compare the mechanism and check your runtime version.

python
import sqlite3
c=sqlite3.connect(':memory:')
c.executescript('CREATE TABLE tombstone(project TEXT PRIMARY KEY); CREATE TABLE asset(project TEXT PRIMARY KEY, value TEXT);')
c.execute("INSERT INTO tombstone VALUES('p1')")
unguarded=c.execute("INSERT INTO asset VALUES('p1','late')").rowcount
c.execute('DELETE FROM asset')
guarded=c.execute("INSERT INTO asset SELECT 'p1','late' WHERE NOT EXISTS(SELECT 1 FROM tombstone WHERE project='p1')").rowcount
print('unguarded late insert:',unguarded)
print('guarded late insert:',guarded)
print('stored assets:',c.execute('SELECT count(*) FROM asset').fetchone()[0])

Recorded output and interpretation

This single database statement checks a retained marker. It does not delete remote media or prove safe garbage collection of tombstones. All relevant late writers and external stores need the same ownership policy.

A matching local output establishes only the illustrated library or database behavior under these inputs. It does not certify a production integration. Preserve the approved action, authorization boundaries and current AISwapLab request contract when applying the idea.

text
unguarded late insert: 1
guarded late insert: 0
stored assets: 0

When to stop or choose another method

Stop hard-deleting every coordination record while remote work remains unresolved; preserve the minimal lifecycle evidence your recovery policy requires.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation