skip to content

What should a provisioning call hand back so an automated case can prove which records it created?

level: seniorimportance: nice to knowfreq 24%

answer

  1. Creating one thing creates several
  2. Return a handle, not a number
  3. Tag every record with who asked
  4. A run can list what it made
  5. Ownership must outlive the process

basics

~20 s

A handle rather than a bare identifier: the record asked for, the identities of everything created alongside it, and a tag naming the case and run that asked. That tag is what makes ownership answerable after the run has ended.

solid answer

~50 s

Provisioning usually creates more than the one thing a case asked for — an account brings a profile, a default payment method, an audit entry. If the call returns only the account identifier, the rest is anonymous and nobody can later say which case produced it. A useful seam returns a **handle**: the primary record, the identities of what was created with it, and a correlation tag naming the case, the run and the parallel test worker. Two things follow. The case can refer to the records it actually got instead of guessing at them, and the run can emit a manifest of everything it created, which is a list any later question about a shared target can be answered from. The tag matters more than it looks — on a target several runs share, ownership is the only way to tell your leftovers from someone else's.

code

pseudocode · 16 lines
pseudocode
handle = provisioning.account(plan = "paid")

# the handle names everything the call created, not only the account
handle.primary     -> { kind: "account", id: "acc_9f31" }
handle.collaterals -> [ { kind: "profile",        id: "prf_22a" },
                        { kind: "payment_method", id: "pm_71c"  } ]
handle.owner       -> { case:   "paid account sees the invoice tab",
                        run:    "run-7f2c",
                        worker: 3,
                        at:     "2026-09-06T11:04:22Z" }

# the run appends each handle as it is issued, not at the end
manifest.append(handle)

# and the tag is also written where the target itself can be queried
api.set_metadata(handle.primary.id, owner = handle.owner)

go deeper

for a junior

Be ready to say what your case created while it ran, and to notice that asking for one record often causes several to appear.

for a middle

Explain what a provisioning call should return beyond an identifier, and why a case cannot safely guess at the records created alongside the one it requested.

for a senior

Show that you have had to answer which case created a stray record and could not. An interviewer expects you to describe the tag and the manifest you would add so the question becomes a lookup.

for a principal

Own ownership as a suite-wide contract rather than a per-case habit. Every provisioning path returns a handle in the same shape, or the manifest has holes in exactly the places that leak.

Ask a provisioning seam for an account and you get an account. Ask what else appeared in the store while it was doing that, and most suites cannot tell you. Recording ownership at the moment of creation is a small design decision with a long tail: it is the difference between a shared target you can reason about and one where every unexplained record is somebody's guess. ## Creating one thing creates several A single provisioning request rarely produces a single record. Creating an account may also produce a profile row, a default preference set, an audit entry, a search index document and an outbound welcome record. If the seam returns only the account identifier, everything else is orphaned at birth — present in the store, attributable to nothing. That matters in three practical situations: - **The case wants to assert on a collateral.** It cannot refer to a record it was never told about, so it either re-queries the store by guesswork or asserts on the account and hopes. - **Somebody asks who created this.** Weeks later, on a target several runs share, an unexplained record is either a leak, a product defect or ordinary traffic. Without attribution the three are indistinguishable. - **A run has to account for itself.** A run that cannot enumerate what it created cannot report it, cannot hand it to any downstream policy, and cannot answer whether it grew the target. ## What a handle carries | Returned value | What the case can do | What a later reader can answer | | --- | --- | --- | | A bare identifier | Refer to the one record it asked for | Nothing about anything else created | | Identifier plus collaterals | Refer to and assert on everything created | Which records belong together | | Handle with a correlation tag | The above, plus name itself as the owner | Which case, which run, which worker created each record | The correlation tag is the cheap part and the valuable part. Three fields do most of the work: the case name, a run identifier, and the parallel test worker index. The case name says which behaviour produced the record; the run identifier says which execution; the worker index is what makes an interleaved, parallel run readable at all. ## Making the tag survive A tag that lives only in the runner's memory is gone the moment the process exits, which is exactly when the questions start. Ownership has to be recorded somewhere that outlives the run. Two placements, usually combined: 1. **In the record itself**, where the product's data model has room for it — a naming convention on a field the case controls, an address-style value carrying the run identifier, a metadata field the product exposes. Durable, queryable from the target, and it survives even a run that crashed before writing anything of its own. 2. **In a manifest the run emits**, appended to as each handle is issued and written out alongside the run's other artefacts. Complete and structured, but only as good as the run's ability to finish writing it, which is why an append-as-you-go manifest beats one assembled at the end. ## The manifest A manifest is an ordinary artefact: one entry per provisioning call, each naming what was created, when, by which case and run. It is worth keeping boring — a flat list of records with their kinds and identities — because its whole value is that anyone can read it without knowing the suite. What it buys is attribution after the fact. When a shared target starts behaving oddly, the manifest turns a forensic exercise into a lookup. When a provisioning path leaks records, the manifest shows which one and how fast. And when someone claims the suite is filling the target, the manifest either supports or refutes them with a count. ## Where ownership stops Recording ownership is deliberately separate from deciding what to do with what you own. The seam's job is to make the question answerable: these records exist, this case made them, at this time. What policy consumes that record is a different decision, and coupling the two is how a seam grows into something nobody can reimplement. There is also a boundary on what to claim. A handle should carry records the case may need to refer to or account for. Side effects the product generates on its own schedule, and would generate for any real user, are the product's business rather than the case's. The practical test is whether a later reader would need to attribute the record to a case at all; if the product produces it during ordinary use, it usually fails that test. ## The habit that makes it work Uniformity. Ownership only pays off when every provisioning path returns a handle in the same shape, because a manifest with holes has them exactly where the undisciplined path is — which, reliably, is the path that leaks.

  • Why tag a created record with the case name rather than only the run identifier?
    A run identifier tells you which execution made the record; the case name tells you which behaviour did. When a shared target fills up, the case name is what narrows a thousand stray records to the one provisioning path that leaks, while the run identifier only tells you that some execution somewhere was responsible. Both are cheap to carry, so carry both.
  • The seam creates records through the product's own interface, which also fires side effects the product owns. Should the handle claim those?
    Claim what the case may need to refer to or account for, and no more. Records the product generates on its own schedule for any real user are the product's business. The test is whether a later reader would need to attribute the record to a case; if ordinary use produces it anyway, it usually fails that test and claiming it makes the manifest noisier without making it more useful.
  • Where should the ownership tag live so it is still readable after the run's process has exited?
    In two places, ideally. In a field of the record itself where the data model allows it, so the target can be queried directly and the tag survives a run that crashed; and in a manifest the run appends to as each handle is issued, so there is a complete, structured list alongside the run's other artefacts. Memory-only tags are gone precisely when the questions begin.

A hotel gives you a key card rather than just a room number, and the card records which booking opened which door. That record is how the front desk answers questions the next morning.

saying these in an interview costs you the question

  • Returning only the primary identifier from a provisioning call
  • Expecting the case to guess what else was created
  • Recording ownership only in the runner's memory
  • Tagging records with the run but never the case
  • Treating collateral records as nobody's responsibility
  • Assembling the manifest only after the run finishes