r/programminghorror • • 7h ago

I asked an AI coding agent to change one font-weight. It deployed to prod 4 times in 13 minutes, fought its own 4,417 !important rules, and wrote a comment called "ANTI-AI CASCADE PROOF ;)

0 Upvotes

Collected on November 29, 2026 from an actual build log (`bbc8cf800b03.css`, build 116) generated and deployed by **Gemini 4 Carbon** inside **Antigravity**.

I gave it one tiny task: prove with a test rule that it could change a screen title's `font-weight` to `600`.

### The starting point: 11,932 lines of CSS and 4,417 `!important`s

Roughly **37% of the stylesheet is `!important`**. And the agent had already styled that exact same heading three times earlier in the same `@layer`:

- **Line 5913:** `font-size: 28px !important`, line-height, letter-spacing, margins.

- **Line 6336:** switched font to `"Fraunces"`, kept `!important` overrides.

- **Line 7873:** switched font to `"WinkdySora"`, set `font-weight: 540 !important`, `font-size: 27px !important`.

Instead of searching the file and changing `540` to `600` on line 7873, it appended new rules at the bottom of the stylesheet and went to war with itself.

### 4 production deployments in 13 minutes

| UTC Time | Build | Revision | Rule appended at the bottom of the CSS |

|---|---|---|---|

| 17:00:01 | 113 | `724abf0c6777eb98` | `@layer components { .wk-moi-top h1 { font-weight: 600 !important } }` |

| 17:06:36 | 114 | `d88fc9bfacf4b4e2` | Byte-for-byte identical to build 113 (only revision hash changed) |

| 17:08:45 | 115 | `0dcb0ecb79180756` | `@layer winkdyLocalNativePaint { html:root body .wk-moi-top h1 { … } }` |

| 17:12:55 | 116 | `a47f4e49e02f377c` | `@layer winkdyLocalNativePaint { html:not(#_a#_b#_c) body .wk-moi-top h1 { … } }` |

### How it unraveled

  1. **Builds 113 & 114:** In CSS Cascade Layers, `!important` flips layer order — earlier layers win `!important` conflicts. Because `winkdyLocalNativePaint` is registered at document start before `components`, putting `!important` inside `@layer components` couldn't win. On build 114 it just re-deployed the exact same CSS anyway.
  2. **Build 115:** Moved into the winning layer with `html:root body`. On paper that beats `html body`, yet 4 minutes later it escalated again without logging a measurement.
  3. **Build 116 (lines 11921–11932 in prod):**

```css

/* ==========================================================================

BLOC 5.0 — PREUVE DE CASCADE ANTI-IA (@layer winkdyLocalNativePaint !important)

ControlGlass.swift:47 enregistre winkdyLocalNativePaint à atDocumentStart

avant components ; l’override gagnant est u/layer winkdyLocalNativePaint

en fin de feuille avec sélecteur html:root body.

========================================================================== */

u/layer winkdyLocalNativePaint {

html:not(#_a#_b#_c) body .wk-moi-top h1 {

--wk-layer-probe: "5.0-id3-cascade-wins" !important;

font-weight: 600 !important;

}

}

It named its own block "ANTI-AI CASCADE PROOF", used :not(#_a#_b#_c) (three non-existent IDs to artificially inflate specificity), and left a comment still claiming the selector was html:root body.

The actual fix

Change 540 to 600 on line 7873.

What's verified vs. not

  • Verified: All snippets, line numbers, server deployment timestamps/hashes, build 114 being byte-identical to 113,and exact byte match with the agent's files.
  • Not verified: Why build 115 was considered insufficient before escalating to :not(#_a#_b#_c) (likely WebView caching or font weight snapping).
  • None of the 4 builds broke the app in a pre-launch environment — it was just a single h1 weight.

r/programminghorror • • 3d ago

Other WGSL code snippet posted by Notch (Yes, that Notch)

Post image
319 Upvotes

r/programminghorror • • 3d ago

nothingIsMorePermanentThanATemporaryFix

Post image
201 Upvotes

r/programminghorror • • 2d ago

JavaScript Dots and Boxes

Post image
0 Upvotes

r/programminghorror • • 3d ago

One pipe through String, Array, and Map

Post image
0 Upvotes

r/programminghorror • • 8d ago

Did I cook?

27 Upvotes

It compiles.


r/programminghorror • • 10d ago

Real code that's been in my game for 3 months

Post image
975 Upvotes

This was added when we translated the codebase from GDScript to C#, clearly some dead code slipped through. I did a double take when I came across it today


r/programminghorror • • 10d ago

Leider wahr

Post image
1.1k Upvotes

r/programminghorror • • 10d ago

c++ Named nullptrs

Post image
402 Upvotes

r/programminghorror • • 9d ago

What a mail sorting system is this

Post image
8 Upvotes

I lost my words for this thing

BigInteger One = 1;
BigInteger ascend(BigInteger x, int n, int p) => ~((x ^ ~-(One << p >> 1)) << n);
BigInteger dscend(BigInteger x, int n, int p) => ~((x | ~~(One << p >> 1)) << n);
nfs = new(nfs.Where(kvp2 => kvp2.Item2["deleted"] == 0).OrderBy(kvp2 =>
          ascend(kvp2.Item2["important"], 34, 2)
        & ascend(kvp2.Item2["read"], 32, 2)
        & dscend(kvp2.Item2["time"], 0, 32))
        .Select(kvp2 => new TypesElement<string, StringDictionary<int>, NestedFolderRuntime>(kvp2.Item1, kvp2.Item2, kvp2.Item3)).ToList());        BigInteger One = 1;
BigInteger ascend(BigInteger x, int n, int p) => ~((x ^ ~-(One << p >> 1)) << n);
BigInteger dscend(BigInteger x, int n, int p) => ~((x | ~~(One << p >> 1)) << n);
nfs = new(nfs.Where(kvp2 => kvp2.Item2["deleted"] == 0).OrderBy(kvp2 =>
          ascend(kvp2.Item2["important"], 34, 2)
        & ascend(kvp2.Item2["read"], 32, 2)
        & dscend(kvp2.Item2["time"], 0, 32))
        .Select(kvp2 => new TypesElement<string, StringDictionary<int>, NestedFolderRuntime>(kvp2.Item1, kvp2.Item2, kvp2.Item3)).ToList());

r/programminghorror • • 10d ago

Are we even?

63 Upvotes

Hello,

This subreddit has had an identity crisis for some time. Sharing naturally occurring outrageous code was the primary purpose, however many posts feature code that is weird on purpose (which would belong in other subreddits like r/ShittyProgramming in olden times).

I remember an is_even "hackathon" we had in r/ShittyProgramming a few years ago. Since that subreddit is not doing well, I decided to try to reignite the spark here. I hope the moderators and regulars don't mind some creative malpractice.

Anyhow, here is my entry:

def chi_squared_is_even_test(n: int, sample_size: int = 300, p_threshold: float = 0.1) -> bool:
    """Determine if an integer `n` is even by using a χ² test on a random sample determined by `n`.

    1. We generate a normally distributed sample.
    2. We raise it to (1 + (−1)ⁿ), so the transformed sample should follow a χ² distribution if `n` is even and be constant otherwise.
    3. We use a χ² test on the result.
    """
    samples = sp.stats.norm.rvs(size=sample_size)
    power = 1 + (-1) ** n
    transformed = samples ** power
    return sp.stats.chisquare(transformed).pvalue < p_threshold

I also have some older bad is_even implementations in this notebook.


r/programminghorror • • 9d ago

C# I've didn't know you could check if entity exists here ! (address me)

0 Upvotes

For those who didn't get the joke: Basically, this functions handles entity removal request and.. it has literally no admin check whatsoever


r/programminghorror • • 12d ago

Old Legacy Pagination System

Thumbnail gallery
55 Upvotes

r/programminghorror • • 14d ago

Python Learning Python; Have I made a good progress?

181 Upvotes

r/programminghorror • • 14d ago

SQL Selecting an intersection percentage between two fandoms

Post image
149 Upvotes

The amount of nesting is insane for something relatively simple

Edit: This subreddit has the "No Student Code" rule. Well my code is technically student code but I wrote it myself and I thought it would be fun to roast my own code so I guess it should be fine?


r/programminghorror • • 18d ago

Lua uhh my (not) c++ code is acting weird...

Post image
772 Upvotes

this thing is cursed...

it is valid syntax (many things are hidden outside of the screenshot!)


r/programminghorror • • 16d ago

c My friend told me that printf() and null-terminated strings are to insecure so i built it

Thumbnail reddit.com
0 Upvotes

r/programminghorror • • 18d ago

git stagesOfGrief

Post image
91 Upvotes

r/programminghorror • • 18d ago

Python First time coding

Post image
0 Upvotes

Sometimes I think about saving the world


r/programminghorror • • 18d ago

bad code - goto

Thumbnail reddit.com
0 Upvotes

r/programminghorror • • 24d ago

c++ Old code I made years ago

Post image
123 Upvotes

r/programminghorror • • 25d ago Regret

Java Jenny mod deobfuscated funnies

Thumbnail
gallery
526 Upvotes

r/programminghorror • • 25d ago

Python A swedish pos system, using a local python web app, hosted locally

Post image
153 Upvotes

r/programminghorror • • 26d ago

VSCode JSON javascript and java? i prefer json instead

173 Upvotes