🕵️ FGA 05: The Case of the Copycat Tables 🐶
Every case left a trail. Hercule smelled the same one thirty-two times.

The cases in Fraud Graph Arena are synthetic, but their evidence still needs a disciplined route from authoring to the game.
FGA 04 defined the shared model and showed how source data is translated and checked against it.
Now Hercule follows a qualified case beyond the contract: where should it live, how should it be imported, and which version should the game read?
Our dog raised one ear. The filing system was the first suspect.
Part I — The Next Question at the Desk
A contract is not a filing system
A case begins as authored, synthetic source material. A converter maps that material into the canonical package; the registry and validators check its datasets, headers and declared structure.
That is the data model and qualification path established in FGA 04.
This article starts after that hand-off. A contract tells the office what each record means. Persistence decides where the qualified package lives, how an import is tracked and which complete version the game may read.
Hercule tapped the contract with one paw.
“Same evidence, same meaning,” he said.
The clerk pointed to two desks: the records room and the active investigation.
Hercule would have to decide what belonged in each.
Two jobs, two storage patterns
The records room held the case evidence: versioned tables to preserve, compare and analyse.
That belongs in Delta Lake under Unity Catalog. Delta is the table-storage layer that records versions and transactions. Unity Catalog names and governs those tables.
Delta is strong when evidence behaves like a lakehouse asset. It handles large datasets, reproducible snapshots, batch validation and analytical scans.
That lets Hercule compare publications, rebuild a projection and explain which version supplied a row.
The trade-off is that Delta is not designed for dozens of tiny updates from an active game. A player changing a hypothesis or spending a credit should not have to coordinate with a large evidence write.
The front desk handled that live investigation: whose turn it was, how many credits remained and which clues the player had uncovered.
A publication is the approved, complete version of a case that the game may read. The small, frequent updates around it belong in Lakebase Postgres, Databricks’ managed PostgreSQL service.
Lakebase brings transactions, indexes, constraints and low-latency row access. Its trade-off is that it must not become a second author of canonical evidence.
Copying every case table into it creates another lifecycle and another freshness question.
It also creates another opportunity for the furniture to multiply. A managed synced table can provide a derived, read-only serving copy when measured latency justifies it.
Mutable session state stays in explicitly owned Lakebase tables.
The trade-offs can be summarised in one filing-room note:
| Store | Strong at | Cost or risk | Role in FGA |
|---|---|---|---|
| Delta under Unity Catalog | Versioned evidence, reproducible snapshots, batch validation, large scans and analytical history | Less suitable for many tiny interactive updates; cross-table publication needs an explicit versioning strategy | Canonical case packages, publications and analytical outputs |
| Lakebase / PostgreSQL | Low-latency reads, indexed lookups, constraints and small transactional updates | Mutable copies need ownership and freshness rules; duplicating evidence multiplies lifecycle and topology | Round, player and session state; optional read-only serving copy |
Hercule drew the arrangement before the minions could add another cabinet:
The archive kept the evidence. The front desk kept the conversation with the player. Even our dog could see which desk was allowed to move the furniture.
The filing-room rule is simple:
Delta keeps the case; Lakebase keeps the live round. Evidence may be served from a verified read-only copy, but mutable session state belongs in separate, explicitly owned Lakebase tables.
Hercule wrote the arrangement on the board.
The records room kept the original; the front desk could consult a verified copy. Nobody was allowed to edit the evidence in the corridor while a player was still following the trail.
Part II — The Filing Cabinet Scene
The copycats in the filing room
Hercule laid the Lakebase inventories side by side. The same 32 table names appeared under every case, like paw prints copied from one crime scene to the next.
The coding-agent minions had been working through separate tickets. Each added what its task required; none had been asked to inspect the whole kennel. Delegation made the work quick. It also let the repeated design hide in plain sight, one freshly polished cabinet at a time.
Hercule checked the contract in FGA 04. It defines 32 logical datasets, not a demand for a private set of physical tables for every case.
That distinction had never been written down as a persistence rule.
The contract named the datasets and their headers. It explained what a case package meant, how the converter should shape it and which checks it had to pass.
It did not say whether a dataset should become one shared table, one table per case, a managed sync or a temporary import.
That omission was easy to miss because the first implementation looked perfectly sensible in isolation.
A loader received one package, created the targets it needed and wrote the rows. When the next case arrived, the same helper ran again in a new case context.
Nothing in that local task required it to ask whether the target represented every case, or only the package currently on the desk.
The coding-agent minions made the same reasonable assumption in parallel.
One ticket described the package. Another described the import. Another prepared the Lakebase targets.
Each implementation satisfied its immediate description. Nobody had been given the cross-case invariant: a logical dataset may have many case identities, but it should not acquire a new physical table merely because another case exists.
So the 32 names multiplied quietly. The number came from the model, then the case loop copied the model into storage.
The missing topology rule allowed that copy to become permanent. The minions had not invented new evidence; they had turned logical containers into private filing rooms.
Our dog had found the copycats. Hercule’s next job was to inventory the room, keep the tables that served a purpose and give every case a place in a shared filing system. The minions could fetch the furniture; someone had to count the kennels.
Inventory before judgement
Finding the copycats was not a licence for a midnight cleanup.
The room contained canonical tables, case-specific structures, managed syncs, experiments and temporary objects.
Some were still carrying evidence. Others were only wearing a convincing table name.
Hercule opened a case file for every object before touching a cabinet:
Our dog compared the live Delta and Lakebase inventories with the repository and the running application.
A table created by a sync, a table read by the game and a table left by an old experiment might look identical from the corridor.
Their owners and removal rules are completely different. Only after that map exists can the project decide what to keep, migrate, quarantine or retire.
The inventory, rather than Hercule’s suspicion, decides which objects still have a job.
Part III — Count Before You Clean
Give every object an owner
Hercule pinned a label to each cabinet before opening the next drawer.
The label recorded who owned the object and why it existed: application code, a managed sync, a temporary import or nobody willing to sign the form.
Anything still serving a purpose stayed. Staging received an owner, a cleanup rule and an expiry date, because “temporary” is not a lifecycle.
When the owner or its dependencies could not be established, Hercule moved the object to quarantine.
Anything still needed could be migrated; only confirmed leftovers could leave the building. He would not drop a table merely to make the inventory look tidy.
A counter can report how many cabinets exist. It cannot testify about who needs them.
| Store or area | Keep it there when… |
|---|---|
| Delta under Unity Catalog | It is canonical case evidence, a versioned snapshot or an analytical output |
| Lakebase / PostgreSQL | It is mutable player, session or round state needing transactional reads and writes |
| Synced-table definition and Lakebase copy | Measured application reads justify a managed serving copy |
| Temporary or staging area | A candidate import or experiment has a clear owner and expiry |
A cabinet without an owner was not innocent. It was simply waiting for the next person to misunderstand it.
Remember what cleanup leaves behind
The first drawer was empty. Hercule did not celebrate; an empty drawer is still part of the cabinet.
Removing rows changes the contents of a table. It does not remove the table itself.
It says nothing about the view, schema, permission or managed sync definition attached to it. Those are separate objects with separate owners and cleanup operations.
That distinction matters when a development environment is rebuilt.
A script can report zero rows while leaving behind the same table, its grants and its sync configuration. The next import then finds yesterday’s furniture.
So cleanup checks two inventories: what data remains, and what objects remain. Hercule only called the room clean when both lists matched the approved environment manifest.
Part IV — One Contract, Many Case Files
The case for shared tables
The room did not need another wing for every new case. It needed labels that let several investigations share the same shelves safely.
One table per source file is a convenient landing pattern:
It becomes expensive when every case, experiment and output gets another permanent object. One table per case multiplies the same furniture:
The second diagram was the warning: a new case should bring new rows and identities, not a new architecture.
Give each row a case file
A shared shelf solved the furniture problem, but it created a new question: how would Hercule know which investigation each row belonged to?
FGA 04’s Canonical Model defines 32 datasets with exact headers. Its 13 supported packages—3 Academy, 3 Puppy, 4 Adult and 3 Senior—share those shapes.
-
Keep one shared physical table for each canonical dataset. The table name says what kind of evidence it holds; a storage envelope says which case and snapshot each row belongs to.
-
Keep FGA 04’s registered package headers unchanged: the envelope belongs to persistence, not to the canonical payload.
Hercule gave the envelope the identity needed to scope every read and write:
An empty dataset still keeps its registered header. The envelope supplies storage identity without changing the canonical package.
Every query and write must scope itself to the right case, definition and snapshot. Otherwise Hercule has exchanged too many cabinets for one very large evidence-mixing incident.
Part V — Fence the Scene
Three rooms, three sets of rules
The next door opened onto three rooms with the same furniture and different rules.
Cases share a contract. Development, test and production have different owners, permissions and lifecycles. Give each environment an explicit namespace and an approved resource manifest.
For a disposable development environment, compare the live inventory with that manifest before rebuilding anything:
If an object is outside the allowlist or has no known owner, stop and investigate.
Production needs controlled migrations and a rollback plan; “drop everything and rerun” is not a deployment strategy. It is a confession with a progress bar.
The same case could cross the rooms. Its objects could not cross them without an invitation.
Read the loader’s statement
Before proposing the replacement, Hercule read the loader’s statement at the scene.
The FGA 04 Lakehouse loader preflights sources and creates missing targets.
It clears planned targets and appends rows in sequence. It tags written rows with a run_id and load time, which helps trace successful writes.
That loader does not reconcile every object in an environment or provide a durable record of failed attempts and active publication state. Those need explicit owners in the design; the importer should never delete an object it does not own.
It had a useful alibi: it could explain successful writes. It could not yet explain the whole room.
Part VI — Inspect the Package at the Door
Validate before writing
At the import desk, Hercule stopped the parcel before it reached the shelves.
The converter has already translated source dialects into the FGA 04 package.
The importer should validate that package, not guess its meaning a second time.
Before loading, check:
- The expected 32 datasets and exact headers, including empty datasets.
- The manifest, canonical model version and file hashes.
- Row counts, keys, references and declared relationship rules.
- Consistent case and snapshot identity.
- A player-safe projection that excludes protected evaluator truth.
Only a package that passes the whole checklist earns a place in the records room.
Reject a different package wearing the same name
A familiar label can still conceal a different parcel. Hercule checked the seal before accepting it.
Identify an import with its case, case version, snapshot version, canonical model version and manifest hashes.
If the identity and hashes match a previous import, it is the same evidence arriving again. If the identity matches but the hashes differ, reject it as a retry; issue a new snapshot version for changed content.
The name matched. The fingerprints decided.
Part VII — Make the Retry Boring
Idempotence, in detective terms
Importing the same immutable package twice should leave authoritative rows and permanent object inventory unchanged. The attempt log gets another entry; the evidence does not get duplicated.
That is the practical meaning of an idempotent import. Hercule can be called back to the scene without finding the same body filed twice.
Keep two kinds of receipts
The clerk kept two ledgers on the desk: one for what arrived, another for what happened to it.
The package manifest says what arrived. The import record says what the system did with it. Keep them separate.
Record the attempt before loading begins, then record its result. Keep status, hashes, retry links and publication details in that import ledger, separate from canonical facts.
In the proposed design, keep run status, hashes and retry links in the import record. If row-level provenance is required, retain only a minimal link to that record in the storage envelope.
That moves operational history out of the canonical facts and preserves FGA 04’s registered headers.
The evidence kept its shape. The incident acquired its own receipt.
Part VIII — Stage the Evidence
Do not replace the live case halfway through
Hercule had seen enough half-finished imports to distrust a progress bar.
The current loader clears planned targets and appends rows sequentially. If an import stops midway, some targets may contain new rows while others have already been emptied.
The safer design is to prepare a candidate snapshot while the current publication remains active.
This is a recommended next step, not a capability delivered by the FGA 04 loader.
The active case stays on the board while the candidate is being questioned in the back room.
A failed candidate stayed in the back room. The active case kept its alibi, and the player never received half a mystery.
Give the application one version to read
The application did not need to know every box in the archive. It needed one trustworthy pointer to the case it was allowed to read.
By default, a Delta transaction commits atomically against one table.
Unity Catalog-managed Delta tables with Catalog commits enabled can support a transaction across multiple tables when the runtime and workload meet Databricks’ requirements.
See the Databricks documentation and check that option first if the case is published entirely in Delta.
When that multi-table transaction is unavailable—or the game reads a separately synced Lakebase copy—stage a candidate snapshot and describe it in a publication manifest: a small record of the expected datasets, version, row counts and hashes.
The application should read only a complete version. Activate the candidate after validation; if serving from Lakebase, wait until its sync is verified before moving the operational pointer, the small piece of mutable state that tells the application which publication is active.
Keep the previous version available for active sessions and rollback. Expire abandoned candidates under a retention policy.
One pointer, one complete case file. That was enough authority for the next scene.
Part IX — Serve the Evidence Without Altering It
Sync only what the game needs
The front desk did not need the archive’s entire contents dumped on it. Hercule selected only the evidence the game could justify serving quickly.
If interactive reads need a Lakebase copy, sync a prepared Unity Catalog source and choose a sync mode that matches the required freshness and source capabilities. A view may support snapshot sync without supporting incremental modes.
Before activation, verify the sync status, snapshot identity and expected row counts in the serving copy. Databricks recommends read-only queries on synced tables; keep the mutable publication pointer in a separate Lakebase operational table.
The copy could answer questions quickly. It could not rewrite the case.
Pin the case to the session
Once the player entered the room, Hercule locked the selected file to that investigation.
When a player starts a case, pin that session to its selected snapshot. A later publication switch must not change the evidence halfway through a round.
That means retaining every snapshot still referenced by an active session.
If Lakebase serves a synced copy, its source and serving layout must keep those versions queryable. A refresh that replaces the old snapshot would strand the session.
Give analytical outputs the same case and snapshot identity, and store them in stable, versioned destinations. A new experiment should not leave a new permanent table behind like a paw print at the scene.
The investigation could move forward. The evidence underneath it stayed put.
Part X — Try to Break the Alibi
Run the qualification on disposable development data
Hercule did not test the new filing system in the middle of a public investigation. He chose a disposable room, left the valuables at home and wrote down what a clean alibi would look like before starting:
- Rebuild only objects listed in the development manifest; confirm an unknown object stops cleanup.
- Import all 13 packages and capture row counts, hashes and permanent object inventory.
- Import them again; authoritative contents and permanent topology should match, while the attempt log records the retry.
- Interrupt a candidate load; confirm the active publication stays unchanged, then retry and compare with a clean import.
- Publish two cases; fail or replace one candidate and confirm the other case remains untouched.
- Switch the active publication while a session still uses the previous snapshot; confirm that session can still read its pinned evidence until it ends.
A failed rehearsal was useful evidence. A failed production import would be a different genre of detective story.
Know what a clean result looks like
At the end of the rehearsal, Hercule wrote the verdict before anyone touched the furniture.
Hercule had written the acceptance criteria before he let the system near the evidence:
Track expected inventory separately in Delta and Lakebase. Every persistent object needs an owner, purpose and lifecycle. If one has none, that is the next lead—not permission to delete it.
A clean result left fewer mysteries in the inventory, not more tables to explain.
The Case Is Closed (For Now)
FGA 04 defined the contract. FGA 05 lays out how to carry it into persistence: identify imports, assign ownership and expose only a complete, validated publication.
Those are design rules, not a claim that the recovery path is already implemented. The qualification still has to run. If a candidate fails, the intended behaviour is clear: leave the active version untouched, record the attempt and investigate before retrying.
Our dog keeps his job; the evidence stays on the board.
A new case should add evidence, not another wing of database archaeology.
The persistence design now has its acceptance criteria. Hercule can turn to the next open question: how to draw a case clearly enough to investigate.
Next in the Series
🕵️ FGA 06: Who Let the Graphs Out? 🐶
Choosing the graph-visualisation engine
The next investigation compares Cytoscape.js, Sigma.js, D3, React Flow and commercial graph components. The question is not whether they can draw nodes and edges. It is whether Hercule can understand the network, inspect the evidence and still move the mouse afterward.
Source Code
Browse the source code for FGA 05 on GitHub ↗

One canonical contract, one deliberate publication, and no new table without a reason.
