Creative planning tooling / 2026 / In progress · Anonymized work
Media Job Compiler.
A tool that turns a creative brief into a job for a media provider, with approval tied to exactly what was reviewed
- The hard part
- Making sure an approval of a paid media job still means the same thing if the provider’s rules or the tool’s translation change later.
- Works today
- On its own branch, the tool checks and prepares jobs, and saved tests cover how it turns a provider’s field list into rules.
- Role
- Software engineering
- Built with
- Python · JSON Schema · PyYAML · CLI · Filesystem manifests · Typer · Pydantic · MCP · Pillow · JSON · Markdown · SHA-256 · JSONL · Decimal
01What I built
The problem.
Someone approves a paid media job, but what did they approve? The prompt is only part of it. The provider describes the inputs it accepts, and the tool translates that description into rules. If either one changes afterwards, the same job data can mean something different and still pass every check.
What I built.
Media Job Compiler is a Python tool that runs from the command line. First it checks the creative records. Then it picks a provider connector that it supports, the code that writes a job in that provider’s format. It turns the provider’s list of fields into rules written in A technical wordJSONA common text format that programs use to send each other structured data., a common text format for data. It checks the job’s data against these rules, then saves the job with fingerprints of everything that was reviewed. A fingerprint is a short code that changes when the content changes. It also reserves places on disk for the job’s files. It does not upload media or send anything to the provider. A separate program does that.
The compiler
Python, JSON Schema, PyYAML
- Record checks
- Checks the creative records first, and keeps their restrictions out of the provider’s format.
- Connector choice
- Picks a provider connector only when what the provider can do, how jobs are sent and the price all match one the tool supports.
- Field list translator
- Turns the flat list of fields from the lookup tool, which fetches each provider’s rules, into rules the checker supports. It writes them in the 2020-12 draft of a published standard for data rules.The storyTurning a provider’s list of fields into strict rules
- Data check
- Checks the job’s data against those rules before the approval step is built.
- Job fingerprints
- Saves a fingerprint of the raw field list and of the translated rules with the job. It also records the connector and the translator version.The storyTurning a provider’s list of fields into strict rules
- Execution checks
- Compares the saved fingerprints, and checks each media file is matched exactly, before the job goes to the program that runs it.
The intake service
Python, Typer, Pydantic, MCP
Media Intake Service- Scan first
- Shows the accepted files, duplicates and filename clashes before anything is changed.
- Request identity
- Turns the whole request into one fingerprint, used as its ID. It covers the product, the source type and the rights reference. It also covers the file paths and contents.The storyRecovering a media import that stopped before it finished
- Path checks
- Refuses file paths and shortcuts that lead outside the media folder. It also refuses rights references that belong to another product.
- Safe copying
- Copies to a temporary file and makes sure it is fully written to disk. Then it compares the fingerprint and swaps the file into place in one step.The storyRecovering a media import that stopped before it finished
- Rights check
- Keeps usage conditions on the asset. Blockers, expired rights and unsorted restrictions still prevent use.
- Approval check
- Compares the required reviews and a person’s final decision with the current fingerprints in the asset records.
The command-line tool
Python standard library, JSON Schema, SHA-256
Asset Release Registry- Release lookup
- Finds the release from its registry entry and keeps the path inside the local folder.
- Release pin
- Compares the release list’s fingerprint with the one the asking tool reviewed, so a moved marker shows up.The storyFollowing a finished creative back to its source files
- Structure checks
- A small rule checker and some Python rules confirm that the chosen assets exist and the edit steps run in order.
- File checks
- Checks every listed file against the size and fingerprint it should have.
- Dependency walk
- Follows the chosen output back through each required input, visiting every asset once.The storyFollowing a finished creative back to its source files
- Readiness
- Combines the file results with the technical review and content eligibility. It also takes in any blocking claims and the reuse limits.
The command-line tool
Python, JSON Schema, JSONL, SHA-256
Campaign Record Validator- Record lookup
- Builds the paths to campaign and review files from IDs that do not change, and keeps them inside the workspace.
- Fingerprint rebuild
- Writes the details as compact text, with field names sorted and lists kept in order. Then it makes a fingerprint of that text.The storyChecking a campaign still matches what was approved
- Media check
- Follows the pinned release list and creative. It compares the release and the asset they name. It also compares the filename and the content fingerprint.
- Approval and events
- Checks the fingerprint’s kind, its method and whether it was rebuilt. It also checks that events are numbered without gaps and IDs are unique.The storyChecking a campaign still matches what was approved
- Sensitive-data scan
- Refuses obvious sign-in details, card details and long platform IDs outside the one private file.
Confidential work. Names and identifying business details have been changed.
02The journey
What broke, and what changed.
Broke, then fixedA decisionA milestone
- 01 of 13DecidedMedia Intake Service
Know a file by its content, not its name
The questionTwo files with the same name can hold different material. The same material can also arrive twice.
What I choseMatching content keeps the asset ID it already has. Different content aimed at a place that must not change raises a conflict instead of overwriting it.
- 02 of 13DecidedMedia Intake Service
Two ways to recover an import
The questionThe receipt, the saved result of a finished import, is written last. So an import can finish and then be asked for again. Or it can stop before its receipt exists and leave good assets behind.
What I choseA finished request gets its saved receipt back. The service looks the receipt up again once it holds the lock on that product. With no receipt, the service rebuilds the lists it uses to find assets. It rebuilds them from the asset records still on disk, before copying anything new, so those assets keep their IDs.
ProofRecovery tests cover a repeated request, asset records left on disk and clashes of content.
Read the full story - 03 of 13BrokeMedia Intake Service
A usage condition was treated as a ban
What went wrongAll rights restrictions sat in one list. The check refused any record where that list had text. So a condition on an allowed use was blocked the same way as a ban.
What changedThe rights checkMedia Job Compiler · Media Intake Service · The intake serviceRights checkKeeps usage conditions on the asset. Blockers, expired rights and unsorted restrictions still prevent use.See it in the map above now sorts usage conditions from blockers. Then it checks the intended purpose, the asset and the scope of use. Conditions and the required credit stay on the asset record. Blockers, expired rights and older restrictions that were never sorted still prevent use.
ProofThe test definitions follow both cases through to the intake status.
- 04 of 13DecidedMedia Job Compiler
Keep the creative restrictions apart from the provider’s format
The questionEach provider has its own format for jobs. A provider connectorMedia Job Compiler · The compilerConnector choicePicks a provider connector only when what the provider can do, how jobs are sent and the price all match one the tool supports.See it in the map above rewrites a job into that format. If the restrictions went through that rewrite too, changing the connector could quietly change what was reviewed.
What I choseThe restrictions stay with the creative recordsMedia Job Compiler · The compilerRecord checksChecks the creative records first, and keeps their restrictions out of the provider’s format.See it in the map above. The connector only changes how the job is written.
- 05 of 13DecidedMedia Job Compiler
Give the lookup tool its own translator
The questionThe compiler expected rules it could check a job against. The lookup tool, which fetches the provider’s rules, sent a flat list of fields instead. It marked each required field with a true or false. It wrote each type as plain text, even types that allow a field to have no value.
What I choseOne translatorMedia Job Compiler · The compilerField list translatorTurns the flat list of fields from the lookup tool, which fetches each provider’s rules, into rules the checker supports. It writes them in the 2020-12 draft of a published standard for data rules.See it in the map above, made for that lookup tool, turns the list into rules the checker supports. It also keeps the raw reply. Shapes it does not support stay blocked. The general checkerMedia Job Compiler · The compilerData checkChecks the job’s data against those rules before the approval step is built.See it in the map above is unchanged and still strict.
ProofSaved tests cover required fields and fields that may have no value. They also cover list items and forbidden fields.
Read the full story - 06 of 13DecidedMedia Job Compiler
Unknown list items mean the field is forbidden
The questionSome optional fields hold lists, but they arrive with no rules for their items. Accepting them would let any object through.
What I choseSuch a field is forbidden in the job data, but it is still shown in the saved field listMedia Job Compiler · The compilerJob fingerprintsSaves a fingerprint of the raw field list and of the translated rules with the job. It also records the connector and the translator version.See it in the map above. Missing detail from the provider does not become permission.
- 07 of 13DecidedMedia Job Compiler
Approve the translation, not just the job data
The questionTwo translations of a provider’s rules can accept the same job data. They can still stand for different reviewed inputs.
What I choseThe approval fingerprint includes the raw field listMedia Job Compiler · The compilerJob fingerprintsSaves a fingerprint of the raw field list and of the translated rules with the job. It also records the connector and the translator version.See it in the map above and the translator version. The execution checksMedia Job Compiler · The compilerExecution checksCompares the saved fingerprints, and checks each media file is matched exactly, before the job goes to the program that runs it.See it in the map above run just before the job goes out. They compare the saved translation instead of fetching the rules again, so a changed translation can call for a new approval.
- 08 of 13DecidedAsset Release Registry
Let a tool pin the exact release it reviewed
The questionTools need a marker for the current releaseMedia Job Compiler · Asset Release Registry · The command-line toolRelease lookupFinds the release from its registry entry and keeps the path inside the local folder.See it in the map above so they can find it. But that marker can move. A tool that follows it would quietly switch to new material.
What I choseThe registry that finds releases is kept apart from the release lists, and each list has its own version. A tool can pinMedia Job Compiler · Asset Release Registry · The command-line toolRelease pinCompares the release list’s fingerprint with the one the asking tool reviewed, so a moved marker shows up.See it in the map above the fingerprint of the release list it reviewed. Then a moved marker shows up as a mismatch.
- 09 of 13DecidedAsset Release Registry
A matching final file is not enough
The questionA fingerprint on the finished file says nothing about an unfinished review. It says nothing about a broken input the file was made from either.
What I choseThe file checksMedia Job Compiler · Asset Release Registry · The command-line toolFile checksChecks every listed file against the size and fingerprint it should have.See it in the map above and the technical review stay separate. So do content eligibilityMedia Job Compiler · Asset Release Registry · The command-line toolReadinessCombines the file results with the technical review and content eligibility. It also takes in any blocking claims and the reuse limits.See it in the map above and reuse limits. The tool goes from the chosen output back through every required inputMedia Job Compiler · Asset Release Registry · The command-line toolDependency walkFollows the chosen output back through each required input, visiting every asset once.See it in the map above. A failed input blocks the output. A broken file elsewhere is still reported as a release error.
- 10 of 13DecidedAsset Release Registry
Check the record rules with Python’s built-in tools only
The questionA ready-made library for checking data rules would handle any rules. But it would make a small tool depend on outside code.
What I choseThe records are A technical wordJSONA common text format that programs use to send each other structured data. files, a common text format for data. The tool supports only the parts of a standard rule format that those records use. It is written with Python’s built-in tools. Any new kind of rule has to be added on purpose.
- 11 of 13DecidedCampaign Record Validator
Rebuild the details before trusting the fingerprint
The questionA fingerprint someone supplies can be worked out correctly and still belong to different material. Comparing two fingerprints alone would let a changed campaign pass on an old approval.
What I choseThe checker first rebuilds the fingerprintMedia Job Compiler · Campaign Record Validator · The command-line toolFingerprint rebuildWrites the details as compact text, with field names sorted and lists kept in order. Then it makes a fingerprint of that text.See it in the map above from the campaign’s current details. Then it compares the result with the approval and confirmation records. A changed detail no longer matches.
- 12 of 13DecidedCampaign Record Validator
Pin the release list and the creative, not just one
The questionA campaign could name its media through the registry’s current-release markerMedia Job Compiler · Asset Release Registry · The command-line toolRelease lookupFinds the release from its registry entry and keeps the path inside the local folder.See it in the map above. But that marker can move.
What I choseThe campaign pins both the release list and the chosen creativeMedia Job Compiler · Campaign Record Validator · The command-line toolMedia checkFollows the pinned release list and creative. It compares the release and the asset they name. It also compares the filename and the content fingerprint.See it in the map above. The release record and the media file’s contents each help identify the material. So a moved marker cannot swap in another asset.
- 13 of 13DecidedCampaign Record Validator
A fingerprint rebuilt later must say so
The questionA fingerprint rebuiltMedia Job Compiler · Campaign Record Validator · The command-line toolFingerprint rebuildWrites the details as compact text, with field names sorted and lists kept in order. Then it makes a fingerprint of that text.See it in the map above after publication can give a consistent account. It could then be mistaken for proof that the approval existed beforehand.
What I choseA rebuilt fingerprint has to state what it covers. It does not prove an earlier fingerprint, and it grants no new permission to publish or reuse. The checker reads that status when it compares the approval filesMedia Job Compiler · Campaign Record Validator · The command-line toolApproval and eventsChecks the fingerprint’s kind, its method and whether it was rebuilt. It also checks that events are numbered without gaps and IDs are unique.See it in the map above.
03Today
Where it stands.
This is the V3.3.3 branch, a separate line of the code. It has not yet been moved into the working installation. It prepares jobs and reserves places on disk, but it uploads and sends nothing. It still needs fresh information about what the provider can do and what it costs. Its own checks say nothing about whether the provider is available or whether the result is any good.