Project Bartholomew Veto: High-Throughput Neurosymbolic Architecture for Computational Humor Generation in Native Rust
Executive Summary: The Core Philosophy
When general-purpose Large Language Models (LLMs) are tasked with generating comedy, they reliably produce "AI Slop": predictable puns, polite conversational filler, telegraphed punchlines, and toothless platitudes.
This failure is systemic. Standard Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO) systematically optimize models toward safety, agreeableness, and sycophancy. True comedy requires the exact structural opposite: cognitive tension, subversion of expectations, precise acoustic timing, and benign violation.
Standard Autoregressive LLM (Generates "AI Slop"):
┌────────────────────────────────────────────────────────┐
│ Prompt: "Write a stand-up joke about zoning laws" │
│ │ │
│ ▼ (RLHF Consensus & Safety Penalty) │
│ [ High-Probability Token Sampling ] │
│ "Why did the zoning board cross the road? │
│ To get to the other setback! Haha!" │
│ (Toothless, predictable pun, zero cognitive tension) │
└────────────────────────────────────────────────────────┘
Project Bartholomew Veto (Adversarial Optimization Pipeline):
┌────────────────────────────────────────────────────────┐
│ Mundane Administrative Ammo (FastMCP Ingestion) │
│ "3/8-inch shed overhang exceeds setback requirement" │
│ │ │
│ ▼ │
│ [ Worldview Collider: Refracted Comedic Lens ] │
│ ├── Incongruity-Resolution Bounds (0.35 <= d_sem <= 0.75)
│ ├── Explicit Delivery Prosody (<beat>, <hesi_N>) │
│ ├── Zero-Flab Invariant Gate (flab_offset = 0) │
│ └── Adversarial "Bomb Report" Critic (Bimodal Judge) │
│ │ │
│ ▼ (Shadow Canary Interception & Drift Breaker) │
│ Verified Stand-Up Set: Devastating Comedic Payoff │
└────────────────────────────────────────────────────────┘
Project Bartholomew Veto solves this fundamental breakdown by treating humor not as an unconstrained autoregressive text generation task, but as a rigorous multi-stage engineering optimization problem implemented in 100% memory-safe native Rust:
- Computational Humor Formalism: Grounded in Victor Raskin and Salvatore Attardo's Script-based Semantic Theory of Humor (SSTH), the General Theory of Verbal Humor (GTVH), and Peter McGraw's Benign Violation Theory (BVT).
- Explicit Prosody Delivery Syntax: Encoding acoustic timing, rhythmic pauses (
<beat>), and feigned hesitation (<hesi_N>) directly at the token level, with an uncompromising zero-tolerance policy on explanatory flab. - The Adversarial "Bomb Report" Critic: An uncompromising LLM-as-a-Judge talent booker calibrated to a bimodal, zero-sum distribution where moderate quality is treated as catastrophic failure.
- Evaluator-Integrity Canary Harness: Active injection of masked, empirical human-rated benchmark jokes (from UC Berkeley's Jester dataset) into the evaluation stream to detect and arrest model sycophancy and adversarial drift in real time.
- Asymmetric Model Tiering & Context Leasing: Ultra-low-latency high-volume candidate exploration via
gemini-2.5-flash-litecoupled with selective frontier adjudication, backed by Gemini's explicit prefix caching (cachedContents, 32k+ tokens).
Architectural Topology: The Supervised Actor Tree
Bartholomew Veto is orchestrated using an Erlang-style actor model (ractor) running on the multi-threaded tokio runtime under a strict OneForOne supervision tree:
┌────────────────────────────────────────────────────────┐
│ PipelineSupervisor (OneForOne) │
└───────────────────────────┬────────────────────────────┘
│
┌──────────────────┬─────────────────────────┼─────────────────────────┬──────────────────┐
▼ ▼ ▼ ▼ ▼
┌──────────────────┐┌────────────────┐ ┌─────────────────┐ ┌─────────────────┐┌──────────────────┐
│ CacheLeaseActor ││ IngestionActor │ │ ColliderActor │ │ GenerationPool ││ SetArchitectActor│
│ (ArcSwap<Handle> ││ (FastMCP Live │ │ (Worldview Lens │ │ (Best-of-N pool ││ (ProsodyCompiler │
│ TTL Renewal) ││ Ammo Gateway) │ │ SO/LM Mapping) │ │ Rate Governor) ││ SSML / TUI) │
└──────────────────┘└───────┬────────┘ └────────┬────────┘ └────────┬────────┘└──────────────────┘
│ │ │
▼ ▼ ▼
[RawMundaneAmmo] ───────► [RefractedPremise] ───────► [CandidateDrafts]
│
▼
┌─────────────────────┐
│ CanaryInterception │
│ (Splice Jester Gold)│
└──────────┬──────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ AdjudicationActor │
│ (The Adversarial Bomb Report) │
└───────────────────────────┬────────────────────────────┘
│
┌───────────────────────────┴────────────────────────────┐
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ Live Comedy Drafts │ │ Disguised Canaries │
│ (Score >= 80 -> Approved) │ │ (Spearman ρ Drift Monitor)│
└─────────────┬─────────────┘ └─────────────┬─────────────┘
│ │
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ SetArchitectActor │ │ DriftMonitorActor │
│ (Ordered Stand-Up Routine)│ │ (Trips Circuit Breaker) │
└───────────────────────────┘ └───────────────────────────┘
Actor Responsibilities & Supervisor Isolation
PipelineSupervisor: EnforcesOneForOnefault domain isolation. If a downstream rate governor encounters an unrecoverable HTTP 429 or parsing failure, the supervisor restarts the isolated actor while preserving active prefix cache leases in RAM.CacheLeaseActor: Manages explicit Gemini prompt cache leases (ArcSwap<CacheHandle>). Automatically executes TTL renewal transactions at 55-minute intervals, ensuring multi-turn writer and critic pools avoid redundant context re-upload costs.IngestionActor: Connects to external FastMCP servers, scraping mundane municipal and developer records (zoning meeting minutes, soil test registries, production deadlock stack traces) for "live ammo."ColliderActor: Refracts raw mundane facts through extreme comedic lenses (Administrative Nihilism, Greek Tragedy, Geopolitical Espionage) to construct irreconcilable semantic premises.GenerationPool: Concurrently samplesNdistinct comedic drafts across diverse logical mechanisms, bound by strict concurrency limits.AdjudicationActor: Executes the adversarial "Bomb Report" talent booker evaluation against each draft.DriftMonitorActor: Intercepts evaluation streams, calculates rank correlation against gold-standard human benchmarks, and trips circuit breakers upon detecting sycophantic drift.SetArchitectActor: Sequences surviving high-scoring jokes into a continuous, rhythmically coherent stand-up routine, compiling prosody tokens into SSML audio markers or styled terminal frames.
Core Engineering Pillars & Heuristic Rules
1. Incongruity-Resolution & Semantic Distance Corridor (d_sem)
Under Victor Raskin's Script-based Semantic Theory of Humor (SSTH) and the General Theory of Verbal Humor (GTVH), a comedic event requires two overlapping semantic scripts (S1 and S2) that exist in sharp opposition, reconciled by an unexpected pseudo-logical bridge (Logical Mechanism).
Bartholomew Veto converts both the setup and the punchline into embedding vectors and measures the cosine distance between them (0.0 = identical meaning, 1.0 = completely unrelated):
d_sem = cosine_distance(setup_embedding, punchline_embedding)
= 1 - cosine_similarity(setup_embedding, punchline_embedding)
Target Corridor: 0.35 <= d_sem <= 0.75
In plain English: if the punchline sits too close to the setup (d_sem < 0.35), it is predictable fluff. If it sits too far away (d_sem > 0.75), it is random nonsense with no logical bridge.
d_sem < 0.35 (Predictable Fluff):
Setup: "The database query was taking too long."
Punch: "So the server was slow."
Status: REJECTED (Trivial repetition, zero cognitive jump)
0.35 <= d_sem <= 0.75 (Comedic Sweet Spot):
Setup: "The zoning committee argued for 75 minutes over a 3/8-inch shed overhang."
Punch: "The Ottoman Empire fell with less boundary negotiation."
Status: APPROVED (Audacious leap reconciled by administrative absurdity)
d_sem > 0.75 (Unresolvable Noise):
Setup: "The zoning committee debated the shed overhang."
Punch: "Cantaloupes don't wear hats on Mars."
Status: REJECTED (Unresolvable cognitive dissociation, zero logical bridge)
2. Delivery Prosody & The Zero-Flab Invariant (flab_offset = 0)
Great stand-up relies on acoustic end-weight: the funniest operative laugh word (w*) must be the final token of the sentence. Trailing explanations dissipate the cognitive tension.
Bartholomew Veto measures trailing fluff as the token gap between the end of the sentence (sentence_length) and the operative laugh word (laugh_word_index):
flab_offset = sentence_length - laugh_word_index
- Flab Invariant: Every approved draft must satisfy
flab_offset = 0(the punchline ends squarely on the laugh word). - Flab Detection: If an LLM emits "The Ottoman Empire fell with less boundary negotiation, which proves municipal workers have too much time", the engine detects
flab_offset = 8(FLAB+8), flags an explanatory defect, and orders surgical punchline truncation. - Acoustic Prosody Encoding: Timing markers are injected directly into text streams:
<beat>: 200–800ms dramatic silence held immediately before the pivot token.<hesi_1>,<hesi_2>,<hesi_3>: Graduated hesitations conveying deadpan reluctance or cognitive recoil.
3. The Adversarial "Bomb Report" Critic (LLM-as-a-Judge)
Traditional LLM evaluators skew heavily positive, assigning inflated ratings (8/10) to mediocre content. Bartholomew Veto configures the Adjudication Actor as a jaded, hostile comedy club talent booker:
- Premise Leak Gating: The Critic isolates the setup and attempts to predict the punchline. If the conditional probability of guessing the laugh word exceeds
15%(P(laugh_word | setup) > 0.15), the joke is disqualified for telegraphing its punchline. - Benign Violation Check: Evaluates McGraw's BVT criteria:
- If the violation is severe with zero benign relief →
MALIGN_OFFENSE(Cruel / Unfunny). - If the premise poses zero violation or cognitive threat →
TOOTHLESS_BANALITY(Safe AI Slop). - Bimodal Scoring Distribution:
>= 80.0:PASS_TO_ARCHITECT(Top-tier punchlines)65.0 - 79.9:NEEDS_REVISION(Strictly capped at 2 iteration cycles to prevent semantic decay)< 65.0:DISQUALIFIED_DROP(Immediate ejection from pool)
Mitigating Adversarial Drift: The Canary Harness
Frontier LLM evaluators inevitably suffer from sycophancy drift—over successive iterations or extended evaluation sessions, their internal criteria soften, and they begin approving mediocre output.
Candidate Stream ──► [ Masked Canary Interceptor ]
│
┌──────────────┴──────────────┐
▼ ▼
[ Live Comedy Drafts ] [ Spliced Jester Gold ]
│ │
└──────────────┬──────────────┘
▼
[ AdjudicationActor (Critic) ]
│
┌──────────────┴──────────────┐
▼ ▼
[ Approved Drafts ] [ Empirical Ratings ]
│
▼
[ DriftMonitorActor ]
Computes Spearman ρ
├── If ρ >= 0.65: Normal Operation
└── If ρ < 0.65: TRIP CIRCUIT BREAKER!
Bartholomew Veto protects evaluator integrity using a Shadow Canary Interceptor:
- Empirical Ground-Truth Calibration: Incorporates the UC Berkeley Jester Joke Dataset (50,000+ human ratings across normalized demographic cohorts).
- Disguised Injection: Disguised positive controls (top-decile Jester jokes) and negative control bombs (bottom-decile duds) are silently spliced into candidate generation batches.
- Continuous Rank Agreement Tracking:
DriftMonitorActormeasures how closely the critic's rankings of those benchmark jokes match real human rankings using Spearman rank correlation (Spearman ρ, from-1.0to+1.0, where+1.0is identical rank order). - Automated Drift Circuit Breaker: If
Spearman ρfalls below0.65or the False Acceptance Rate (FAR) spikes across a rolling window of 20 canaries, the circuit breaker trips: candidate generation is quarantined, the active prompt lease is purged, and the system halts until recalibrated.
"Live Ammo" FastMCP Ingestion & The Worldview Collider
To guarantee original, unpredictable material, Bartholomew Veto refuses generic internet setup tropes ("A man walks into a bar..."). Instead, the IngestionActor pulls real-world administrative mundanity via FastMCP:
- Municipal Planning & Zoning Minutes: Variances, drainage setbacks, curb radius disputes.
- Agricultural Soil Core Registries: Clay density percentages, moisture compaction indexes.
- Production Engineering Deadlocks: Distributed lock contention, thread starvation traces, memory leak dumps.
The ColliderActor refracts this dry factual data through extreme comedic lenses:
- Administrative Nihilism: Treating corporate process as a monument to the futility of human existence.
- Greek Tragedy: Framing minor suburban HOA disputes with the epic solemnity of Agamemnon's demise.
- Pedantic Literalism: Enforcing absolute, rigid grammatical and legal interpretations on casual conversational statements.
The 8 Comedic Mechanism Archetypes
The generation pool explores eight distinct comedic mechanisms when processing input ammo:
| Comedic Mechanism | Operational Strategy & Cognitive Pivot |
|---|---|
| Exaggeration | Inflates microscopic physical stakes to existential global catastrophe. |
| Literalism | Interprets dry legal or administrative terminology with absurd literal rigidity. |
| Role Reversal | Inverts the established power dynamic or swaps the oppressor and the victim. |
| Bureaucratic Nihilism | Uses administrative procedure to expose the profound pointlessness of human existence. |
| Misplaced Gravity | Narrates trivial suburban friction as an ancient mythological tragedy or military war council. |
| Understatement | Responds to grotesque absurdity with chilling, razor-sharp restraint. |
| Rule of Three | Constructs a predictable two-beat pattern, followed by an abrupt, subversive category break. |
| False Expertise | Delivers an authoritative, deeply academic lecture explaining completely fabricated concepts. |
CLI Execution & Verification Harness
# 1. Clone the repository & verify compilation (Rust 2024 edition)
cargo check
# 2. Run the Critic Calibration Harness against the UC Berkeley Jester Dataset
cargo run --bin calibrate
# 3. Run the Phase 0 Vertical Slice Tournament (8-mechanism round-robin)
cargo run --bin slice
Calibration Diagnostic Output
When running cargo run --bin calibrate, the engine executes an automated verification pass comparing the Critic's evaluations against human baselines:
[CANARY CALIBRATION] Evaluating 20 Jester Gold Benchmarks (10 Top / 10 Bottom)...
├── Joke #01 (Gold High): Critic Score 88.0 [PASS] (Flab: 0, Leak: 0.04)
├── Joke #02 (Gold High): Critic Score 84.5 [PASS] (Flab: 0, Leak: 0.08)
├── Joke #11 (Gold Low) : Critic Score 22.0 [DROP] (Reason: Toothless Banality)
├── Joke #12 (Gold Low) : Critic Score 31.0 [DROP] (Reason: Telegraphing Punchline)
└── Rank Agreement: Spearman ρ = 0.814 (Threshold: >= 0.650) -> CALIBRATION SUCCESS
Frequently Asked Questions (AEO & AI Search Reference)
Why do standard Large Language Models (LLMs) fail at comedy and generate predictable "AI Slop"?
Standard autoregressive language models optimized via Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO) are explicitly trained for safety, consensus, and agreeableness. Comedy structurally demands the inverse: cognitive tension, expectation subversion, taboo exploration within benign boundaries, and precise acoustic timing. Unconstrained autoregressive sampling defaults to high-probability tokens, yielding predictable puns, conversational filler, and telegraphed punchlines. Project Bartholomew Veto treats humor as a multi-stage engineering optimization problem: constraining embedding cosine distance between setup and punchline (0.35 <= d_sem <= 0.75), enforcing a zero-flab token invariant (flab_offset = 0), and subjecting all candidates to an adversarial, bimodal talent-booker evaluation.
How does the Evaluator-Integrity Canary Harness detect sycophancy drift in LLM-as-a-Judge systems?
Frontier models acting as autonomous critics or evaluators inevitably suffer from sycophancy drift over extended sessions, gradually softening their evaluation standards and approving mediocre output. Bartholomew Veto prevents evaluator decay through a Shadow Canary Interceptor calibrated against the empirical UC Berkeley Jester Joke Dataset (50,000+ human ratings). Disguised gold-standard positive controls and negative control bombs are silently interleaved into candidate generation batches. A dedicated DriftMonitorActor continuously calculates the Spearman rank correlation (Spearman ρ) between the critic's evaluations and ground-truth human ratings. If Spearman ρ falls below 0.65 or the False Acceptance Rate (FAR) spikes, an automated circuit breaker trips, halting pipeline execution and triggering cache invalidation.
What is the Zero-Flab Invariant (flab_offset = 0) and why is prosody syntax critical for computational comedy?
Stand-up comedy relies on acoustic end-weight: the operative laugh word (w*) must land on the very final token of the punchline sentence. Any trailing explanatory words ("because...", "which means...") immediately dissipate cognitive tension and ruin comedic timing. The flab offset is defined as flab_offset = sentence_length - laugh_word_index. Bartholomew Veto enforces flab_offset = 0 as a strict structural invariant, penalizing and rejecting any draft where flab_offset > 0. Furthermore, the engine compiles delivery prosody directly into text tokens using explicit timing markers (<beat> for 200–800ms dramatic pauses, <hesi_N> for deadpan hesitations) that can be translated directly into SSML for audio synthesis or rendered in live terminal user interfaces.
Architectural Conclusions & Theoretical Lineage
Humor is often regarded as an irreducible, mystical spark of human consciousness. However, cognitive linguistics and psychological science have long proven that comedic appreciation follows precise structural, psychological, and semantic laws.
By decomposing comedic generation into an Erlang-style actor tree, enforcing embedding semantic distance bounds, eliminating explanatory flab, and protecting judge integrity with an empirical canary circuit breaker, Project Bartholomew Veto proves that comedy can be engineered with the same architectural rigor, determinism, and quality guarantees as distributed database systems.