Roko's dancing basilisk - The Boston Diaries - Captain Napalm
The Boston Diaries
The ongoing saga of Sean Conner, who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal "The Boston Diaries."
Go figure.
Tuesday, Debtember 02, 2025
Roko's dancing basilisk
Obligatory Sidebar Links
“I told you three times not to use K&R style braces! Get with the program, Copilot!”
Avoiding Roko's basilisk, part II
“Thanks for calling that out. That was bad advice on my part.”
I came across a reference to DeepWiki,<br>a site that will generate “documentation” for any Github repository.<br>I can't say I've been impressed with LLMs generating code,<br>but what about documentation?<br>I haven't tried that yet.<br>Let's see how well Roko's basilisk dances!
Intially,<br>I started with mod_blog.<br>I've been working with the codebase now for 26 years so it should be easy for me to spot inaccuracies in the “documentation.”<br>Even better—there's no interaction with a sycophantic chat bot;<br>just plop in the URL for the repo,<br>supply an email for notification when it's done and as the Brits say,<br>“Bob's your uncle!”
Anyway,<br>email came.<br>I checked,<br>and I was quickly amazed!<br>Nearly 30 pages of documentation,<br>and the overview was impressive.<br>It picked up on tumblers,<br>the storage layout,<br>the typical flows in adding a new entry.<br>It even got the fact that cmd_cgi_get_today() returns all the entries for a given day of the month throughout the years.<br>But there was one bit that was just a tad bit off.<br>It stated “[t]he system consists of three primary layers” but the following diagram showed five layers,<br>which no indication of what three were the “primary layers.”<br>I didn't have a problem with the layers it did identify:
Entry Layer
Processing Layer
Rendering Layer
Storage Layer
Configuration
Just that it seems to have a problem counting to three.
Before I get into a review of the rest of the contents,<br>I'll mention briefly my opinions on the web site as interface: it's meh.<br>The menu on the left is longer than it appears,<br>given that scroll bars seem oh so last century<br>(really! I would love to force “web designers” to use old-fasioned three-button mice and a monitor calibrated to simulate color-blindness,<br>just to see them strugge with their own designs;<br>not everyone has a mouse with a scroll-wheel,<br>nor an Apple Trackpad).<br>Also,<br>the diagrams are very inconsistent,<br>and often times,<br>way too small to view properly,<br>even when selected.<br>Then you'll get the occasionally gigantic diagram.<br>The layouts seem arbitrary—some horizontal,<br>some vertical,<br>and some L-shaped.
And it repeats itself excessively.<br>I can maybe understand that across pages,<br>saving a person excessive navigation,<br>but I found it repeating itself even on a single page.
Other than those issues,<br>it's mostly functional.<br>Even with Javascript off,<br>it's viewable,<br>even if the diagrams are missing and the contrast is low.
One aspect I did like are the links at the end of each section refering to the source.<br>That's a nice touch.
So with that out of the way—the “documentation” itself.
Mostly correct.<br>I have a bunch of small quibbles:
examples of running it on the command line don't need the –config open if $BLOG_CONFIG is set;
$BLOG_CONFIG isn't checked in main.c but in blog.c;
mod_blog outputs RSS 0.91, not RSS 2.0;
“The system is written entirely in C and does not have Perl, Python or other scripting dependencies for the core engine itself.”<br>Perhaps true? I mean,<br>I do use Lua,<br>but only for the configuration file;
missed out how SUID is used (not for root to run, but as the owner of the blog);
the posthook script returning failure doesn't mean the entry wasn't added,<br>it just changes the HTTP status code returned.
I also found two problematic bits of code when reviewing this “documentation”—one is an actual bug in the code<br>(the file locking diagram,<br>while acurate to the code,<br>made a caching issue stand out) and another one where I used a literal constant instead of a defined constant.<br>At least I'm glad for finding those two issues,<br>even if they haven't been an actual exploitable bug yet<br>(as I think I'm the only one using mod_blog).
In the grand scheme of things,<br>not terrible for something that might have taken 10 minutes to generate<br>(I'm not sure—I did other things waiting for the email to arrive).
But one repo does not a trend make.<br>So I decided upon doing this again with a09,<br>my 6809 assembler.<br>It's a similar size<br>(mod_blog is 7,400 lines, a09 is 9,500—same ballpark)<br>but it's a bit more complicated in logic and hasn't had 26 years of successive refinement done on it.<br>As such,<br>I found way more serious issues:
Errors aren't classified. Errors are created as needed,<br>sequentially. I make no attempt to bunch error codes into fixed ranges.
It missed a key element of the dead code detection—it only triggers if the following instruction doesn't have a label.
The listing file isn't kept in the presence of errors.
It also got the removal of generated output files...