Campaign Asset Handoff Auditor (CAHI)
A dual-runtime n8n and Python delivery engine that audits commercial asset handoffs, enforcing a strict 0.20 AI score contribution cap and a ≥ 0.76 delivery threshold to eliminate pre-launch delivery panics.
Campaign Handoff Failures
Campaign asset handoffs between creative agencies and media buyers are a known failure point. A package of 40 ad creatives ships to the media buyer. The brief specified: “16:9 at 1920x1080, H.264, max 30s, broadcast safe, caption file required.”
What actually arrives: 3 files at wrong aspect ratios, 2 videos over 30 seconds, and 1 missing caption track.
The media buyer’s ad ops team catches this at upload time, shortly before the global campaign goes live. This leads to emergency re-renders and potential penalty fees for the creative agency.
Separating Deterministic Checks from AI Inspection
Most handoff rejections come from deterministic checks like missing metadata or wrong resolution. Codec, dimensions, duration, bitrate, and file hashes can be verified locally. AI models shouldn't be used to ask: “Is this video 1080p?”
The second rule addresses AI confidence. If an AI vision model is asked which render is final, its score contribution is capped at 0.20.
The delivery threshold is ≥ 0.76. An asset needs to pass both deterministic metadata checks and human review to ship — AI confidence alone isn't enough.
The system separates deterministic file science from bounded AI visual inspection, ending with an n8n human sign-off form for borderline edge cases before files are staged.
Deterministic Pre-Flight and Bounded Vision
CAHI combines an n8n orchestration workflow with Python CLI workers. It mounts the project directory in read-only mode, extracts SHA-256 and DCT perceptual hashes to eliminate duplicate renders locally, and normalizes messy filename version stems (_v2, _final_FINAL). It invokes Claude 3.5 Sonnet on ambiguous clusters under a 0.20 contribution cap, verifies the ≥ 0.76 score rule, and stages verified files into organized output folders with a hash-based delivery receipt.
This process reduces media buyer rejections and emergency re-renders before launch.
{ "campaign": "SS26_Global_Launch", "assets_audited": 184, "exact_duplicates_purged": 42, "spec_failures_blocked": 6, "delivered_count": 64, "delivery_threshold_min": 0.76, "max_ai_score_contribution": 0.198, "manifest_sha256": "8f4e2ba4..." }
6-Stage Dual-Runtime Delivery Engine
n8n coordinates orchestration while Python CLI workers execute byte hashing and stream probing. AI confidence contributes up to 0.198 points, so passing the threshold requires deterministic metadata checks and human sign-off. Click any stage card to inspect its implementation, input state, and output state.
Read-Only Mount ($0.00) → SHA-256 + DCT pHash ($0.00) → Version Stemming ($0.00) → Claude Vision (0.20 cap, ~$0.01) → Score & Sign-off (≥ 0.76) → Copy-Only Bundle ($0.00)
Stage 01 — Manual Kickoff & Ingestion
Mounts target campaign export folder in read-only mode. Reads media buyer delivery manifest and initializes immutable execution state ledger in assets.json.
Three Decisions That Define the Architecture
Deterministic File Science (SHA-256 & Perceptual DCT Hashing)
Creative agencies frequently re-export files under panicked names: Promo_v3.mp4, Promo_v3_fixed.mp4, Promo_FINAL_FINAL.mp4. Sending both renders to a multimodal vision API burns budget rating identical pixels.
CAHI runs a Python worker that computes full SHA-256 byte hashes and 64-bit DCT perceptual hashes. Exact duplicates are eliminated instantly at zero API cost; near-duplicate renders (differing only by export container flags) are flagged locally. Zero cloud tokens spent on duplicate renders.
def phase_file_science(file_path: Path) -> AssetFingerprint: sha = compute_sha256(file_path) phash = compute_dct_phash(extract_keyframe(file_path)) meta = probe_stream_metadata(file_path) return AssetFingerprint(sha256=sha, phash=phash, metadata=meta)
Bounded AI Score and ≥ 0.76 Delivery Threshold
Multimodal vision models can be overly confident, claiming a video is compliant even when a required disclaimer frame is missing. Letting AI make delivery decisions on its own is unreliable.
CAHI caps the maximum AI score contribution at 0.198. The passing threshold for automated delivery is set at ≥ 0.76. This means an asset must accumulate sufficient points from deterministic metadata checks (exact naming pattern, resolution match, recency) before AI confidence can tip it into delivery. AI alone is not enough to approve an asset.
// AI score is multiplied by 0.20 and strictly capped
const aiPoints = Math.min(0.20, (response.confidence || 0) * 0.20);
let score = 0.0;
if (matchesNamingPattern(asset)) score += 0.35;
if (isMostRecent(asset)) score += 0.20;
if (matchesManifestSpecs(asset)) score += 0.15;
score += Math.min(0.198, aiPoints);
const passesDelivery = (score >= 0.76);
Copy-Only Non-Destructive Packaging
Automated delivery tools that modify files in-place risk altering agency source footage or master project files.
CAHI operates on a read-only mounted volume. During Stage 06, approved files are copied into organized delivery buckets (Social/, Broadcast/, Display/). It generates a delivery_receipt.json containing SHA-256 hashes of every delivered file, providing a delivery record for media buyers.
def stage_delivery_bundle(approved_assets: list[AssetRecord], dest_dir: Path) -> Receipt: dest_dir.mkdir(parents=True, exist_ok=True) for asset in approved_assets: shutil.copy2(asset.source_path, dest_dir / asset.filename) return generate_delivery_receipt(dest_dir)
Run the Full Suite Locally in Under 8 Seconds
The complete test suite runs offline against pre-computed DCT hash tables and synthetic video container fixtures. Zero API keys, zero network connectivity, zero compute spend required to verify.