r/ModSupport • • 27d ago

Admin Replied I was told mods are tasked with migrating their automod config someplace.

This is r/YUROP automod config.

From the look of it, rules 2.4.α, 3.1.α, 3.1.β, 3.6.θ, 5.4.ζ and 5.5 α may be eligible to Rules Hub.

I don’t have one single slot left in automations.

Automod Neo doesn’t want it (invalid regex pattern).

What do I do.

18 Upvotes

41 comments sorted by

34

u/thepottsy 💡 Top 10% Helper 💡 27d ago

I applaud the use of github, but what in the crack cocaine is going on with that automod code?

7

u/CitoyenEuropeen 27d ago

We do have a user guide.

It is very good at making just everything worse.

5

u/thepottsy 💡 Top 10% Helper 💡 26d ago

Haha, you sure as shit do. Wow!!!

8

u/FFS_IsThisNameTaken2 💡Top 25% Helper 💡 27d ago

It's all crack cocaine to me.

This too 😭

https://old.reddit.com/r/ModSupport/comments/1xntssy/i_was_told_mods_are_tasked_with_migrating_their/19s50rbsmfmxx/

I've tried reading the documentation for regex that's supposedly in automoderator, but my brain just doesn't work this way. It might as well be Cantonese.

When do you think they're unaliving automoderator?

5

u/CitoyenEuropeen 27d ago

ModNews says they will be ready in two months.

2

u/shhhhh_h 💡Top 25% Helper 💡 26d ago

Jfc that’s soon

3

u/shhhhh_h 💡Top 25% Helper 💡 26d ago

Omg and I thought mine was overly organised wow

27

u/fsv 27d ago • Bravo

Automod Neo developer here. It will work with your ruleset but you will need to tweak some of your regexes due to the strict YAML and Regex engines I'm using.

For example, take the first validation error with the regex b(u\/)?remindme(bot)?|u\/((pixel\-counter\-|bot\-sleuth\-|audd)bot|recognizesong|savevideo|spambotswatter|thesunflowerseeds|whynotcollegeboard)\b.

The escapes on the hyphens are unnecessary and cause it to break. If you replace the \- with simply - it will be fine with that regex. You need to do the same with the _ and \" too. A find-replace on the whole yaml document fixed a lot.

Then there are UNICODE character classes that differ between Python and JS regex. For example this check:

~body(regex): ['(\p{Armenian}|\p{Georgian}|\p{Greek}|[¡ªº¿ÀÁÂÃÄÆÇÈÉÊËĞÌÍÎÏÐÑÒÓÔÕÖØŞÙÚÛÜÝÞßàáâãäæçèéêëğìíîïðñòóôõöøşùúûüýþÿŒœŸ])']

You need to include Script= e.g. \p{Script=Armenian}.

Next, there's a regex that's included a really rather high number of times that's vulnerable to Regex Denial of Servicethat will need to be fixed. Not sure why it's in your ruleset around 20 times. It's the one that starts ((?=.*\bchocolate\b)(?=.*\b(cup)?cake\b)(?=.*\brecipes?\b).*|. This is also vulnerable to ReDoS: (?=.*count)(?=.*\bthree\b).*

The one that starts \U0001F1FA\U0001F1F8|\b(2a|(2|seco)nd (also included many many times) needs to be reworked because Python and JS regex uses different syntax for Unicode escapes.

This is invalid JS regex - remove the ? at the end: \b(time ?['‘’i]?s an? illusion)\b?`

I think that's about it. But I am noticing that there's a performance issue validating the (stupendously big) ruleset beyond that that I will look to address in the next version.

2

u/CitoyenEuropeen 26d ago

Thank you so much.

Regexes are repeated to restrict Automod to only one comment. I am not quite sure how I'm going to square this with the Regex Denial of Service issue (i.e. 1.7.ρ check mirrored in tildes 1.7.σ, 1.4, 1.8, 3.3.γδ, 3.5.δ, 2.5, 1.6)

2

u/fsv 26d ago

What I'd probably do is run the regexes by a LLM and ask for advice on how to fix it. I tend to find that helps enormously!

6

u/Bardfinn 27d ago

... are we publicly discussing the details of Regex Denial of Service on Reddit in AutoModerator now?

10

u/fsv 27d ago

I have ReDoS detection built into Neo. I don't want to take down the Dev Platform just because of a shonky Automod Neo config.

14

u/Sephardson 27d ago

The regex can most likely be fixed, it's just needs some translation from python to javascript.

I'd offer some help, but i'm booked through for the next 3 weeks.

2

u/CitoyenEuropeen 27d ago

That's a deal! I'm booked through for the next 3 months.

4

u/Sephardson 27d ago

Alright, shoot me a dm here or on discord and I'll see if sometime next month or in the new year i can dig into it.

4

u/cnycompguy 💡 Top 10% Helper 💡 27d ago

Lol, same. I've been migrating one every few days, one day to rewrite and another 2 days of tuning/bug hunting.

0

u/InGeekiTrust 💡 Top 10% Helper 💡 27d ago

So people have been feeding the documentation found on the devvit app page into AI like copilot and having copilot convert it. Apparently it's been a huge time saver for a lot of people. Might save you a lot of time effort and work as I've heard about some good successes!

2

u/cnycompguy 💡 Top 10% Helper 💡 27d ago

It's useful for converting python to JavaScript, that's true. I have a local model that does that.

2

u/InGeekiTrust 💡 Top 10% Helper 💡 27d ago

So people have been feeding the documentation found on the devvit app page into AI like copilot and having copilot convert it. Apparently it's been a huge time saver for a lot of people. Might save you a lot of time effort and work as I've heard about some good successes!

3

u/Sephardson 27d ago

I'm not busy from automod, i'm busy with other things going on, to be clear!

0

u/InGeekiTrust 💡 Top 10% Helper 💡 27d ago

Ok. I just thought that you are like king of Auto mod and as the time passes and it gets closer to the end you might get completely overwhelmed with requests. It might be too much for you to handle. Since other people have apparently had success with just a single click. It's worth a shot to see how it does!

2

u/SampleOfNone 💡 Top 10% Helper 💡 27d ago

Did you test this yourself as well?

1

u/InGeekiTrust 💡 Top 10% Helper 💡 27d ago edited 27d ago

I did test it on one rule and it worked surprisingly well. Recently in the past three weeks or a month AI has gotten much better at writing this type of code. Someone pointed it out to me and it actually did a really great job. Did you notice we get far far fewer posts about people writing code with ChatGPT and did not saving? Well I guess that's why. It is also phenomenal at catching errors in code. Sometimes I will miss space, or put a comma where I shouldn't or miss a comma and I can input the whole thing and ask it to look for the error and it will find it. It's a really amazing time saver way better than going through by hand

5

u/AssassinOfSouls 27d ago

I love that automod config, please leave the post up, it is absolutely glorious.

3

u/CitoyenEuropeen 27d ago

The American mind cannot comprehend this.

4

u/lift_ticket83 Reddit Admin: Community 26d ago

These configs really are something special (literal works of art). Thanks for sharing them.

As for those six rules, they sound like good candidates to explore with Rules Hub. For now, I'd hang on to your existing Automod setup. Early next year, we're giving Rules Hub more flexibility, including ways to bring in context from existing Automod configs and provide additional enforcement instructions. We'd love to use some of your examples to help test that work. I can follow up with you separately on that front.

Thanks again for sharing - these are exactly the sort of details that are useful for us to see.

1

u/CitoyenEuropeen 25d ago

What about Automations? Everyone here pointed out the priorities mess clogging up CvriaBOT's script. This mess wouldn't even exist within Automations' UI. Automations had a great start. Still got lots of room for improvement. What's next?

3

u/zenpathfinder 25d ago

Please don't take automod away.

37

u/mrekted 27d ago

I don't have an answer, but a question..

Why in gods name is 1/3 of the code commented ascii art???

10

u/QuiteBearish 27d ago

Scrolling through it took me back to my GameFAQs years

2

u/mizmoose 26d ago

Seriously looks like Usenet FAQs.

11

u/camrynbronk 27d ago edited 27d ago

You format your automod like a non-crazy person and use a regex that makes sense??

5

u/Dekamir 27d ago

Reddit should take money parsing that YAML.

7

u/Halaku 💡 Top 10% Helper 💡 27d ago

What do I do.

Set it on fire and start over.

5

u/RS_Someone 27d ago

Is Reddit actually telling people to start dumping AutoMod already? By my estimations, we've got a year at minimum before replacing even half our code is viable, and longer before the more niche stuff is possible.

Auto-enforce has been in beta for well over a year now. There was a period of about 8 months when absolutely nothing happened at all with it, and we still can't even add context. Recent Automation features were 4 months late and under-delivered, and it's been another few months since I heard anything new about that. Out of maybe 40 code blocks, I think I was able to migrate 3 or 4 of them so far.

5

u/camrynbronk 27d ago

People are doing it now so that they don’t have to panic fix it with a deadline later on. Especially when it’s a mess like this.

4

u/RS_Someone 27d ago

Yeah, if it weren't for my own specific limitations, I would also be using AutoMod Neo, but I figure there's no way Reddit is already suggesting it's possible to migrate with the current native Reddit tools.

Unfortunately, 9 of my subs use some shared code, so I use AutoMod Sync, but it's not yet possible to sync with Neo. fsv said it would be coming in the near future, but until then, it's not realistic for me to switch, despite how much I want to.

1

u/magiccitybhm 💡 Top 10% Helper 💡 27d ago

No, they are not suggesting that ... yet.

6

u/juleznailedit 27d ago

I hope you stub your toe for making us scroll through that mess.

2

u/InGeekiTrust 💡 Top 10% Helper 💡 27d ago

Oh so what you want to do is the reason why Neo isn't accepting it is because it is slightly different regex. One is python regex and the other is Java regex. Here's what you need to do you go to the devvit app page for Neo and there you will find the documentation. You feed that documentation into copilot and then you tell it to convert all of your auto mod code to be compliant with the documentation.

6

u/baseballlover723 27d ago

One is python regex and the other is Java regex

Javascript*. Java has it's own flavor as well.