Skip to content

Should identical output bytes cause my app to merge two generation attempts?

No. Keep separately approved generation attempts and their receipts distinct even if their output files have identical hashes. Your application may deduplicate stored bytes under an appropriate access design, but byte identity does not establish the same request, charge, approval or creative history.

PRESERVE API DATA ACCURATELYAISwapLab team · Editorial methodUpdated 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Model separate entities; Deduplicate at the storage layer; Test independent lifecycle.
Workflow diagram: Model separate entities → Deduplicate at the storage layer → Test independent lifecycle. Read the article for evidence and limits.

Content identity differs from action identity

A repeated request might coincidentally return identical bytes, and two projects might intentionally use the same file. Merging their action records can erase accounting or attach the wrong review. Storage optimization must not rewrite business evidence.

What to do next

  1. 01

    Model separate entities

    Keep action, remote job, asset version and physical blob identity as distinct concepts. Multiple asset records may reference one verified blob, but each retains its own authorized project association and attempt evidence.

  2. 02

    Deduplicate at the storage layer

    If deduplication is worthwhile, use a verified digest and byte count for blob identity under a reviewed privacy design. Avoid revealing cross-customer matches or making blob knowledge sufficient to bypass asset authorization.

  3. 03

    Test independent lifecycle

    Create two synthetic attempts with identical bytes. Delete or unselect one application's asset association and verify the other remains valid, while both original attempt receipts and review histories stay distinguishable.

A concrete example

Illustrative example: attempts A and B produce byte-identical PNGs. The application can store one physical blob, yet keeps two action records and their separate receipts. Rejecting A creatively does not automatically reject B's project use.

Before you call it ready

  • Attempts retain separate receipts.
  • Blob references have safe lifecycle rules.
  • Hash matches never bypass authorization.

A locally executed, reproducible check

Two task records can point to one content-addressed blob without merging the actions.

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,hashlib
c=sqlite3.connect(':memory:')
c.executescript('CREATE TABLE blob(digest TEXT PRIMARY KEY); CREATE TABLE action(id TEXT PRIMARY KEY,digest TEXT);')
digest=hashlib.sha256(b'synthetic output').hexdigest()
for action in ('a1','a2'):
    c.execute('INSERT OR IGNORE INTO blob VALUES(?)',(digest,))
    c.execute('INSERT INTO action VALUES(?,?)',(action,digest))
print('blob rows:',c.execute('SELECT count(*) FROM blob').fetchone()[0])
print('action rows:',c.execute('SELECT count(*) FROM action').fetchone()[0])

Recorded output and interpretation

No generated file was involved. Matching bytes in your own storage do not establish equal prompts, ownership, charge entitlement or authorization to merge task histories. Access control and reference-counted deletion are not exercised.

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
blob rows: 1
action rows: 2

When to stop or choose another method

Stop merging paid action history or user review decisions solely because the result files have equal digests.

Sources

One task. A recoverable workflow.

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

Open API documentation