<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Light</title>
    <description>The latest articles on DEV Community by Light (@light5566).</description>
    <link>https://dev.to/light5566</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4263793%2F099d517d-28e4-456f-8e4c-9d86b359bc16.png</url>
      <title>DEV Community: Light</title>
      <link>https://dev.to/light5566</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/light5566"/>
    <language>en</language>
    <item>
      <title>Six traps I found by mapping five open-source codebases</title>
      <dc:creator>Light</dc:creator>
      <pubDate>Wed, 25 Nov 2026 04:08:21 +0000</pubDate>
      <link>https://dev.to/light5566/six-traps-i-found-by-mapping-five-open-source-codebases-3l4g</link>
      <guid>https://dev.to/light5566/six-traps-i-found-by-mapping-five-open-source-codebases-3l4g</guid>
      <description>&lt;p&gt;I've been building maps of codebases: one short note per module, saying what it owns, how it works, and where it bites. To test the idea on code I didn't write, I mapped five open-source apps: Mastodon, Gitea, Excalidraw, Paperless-ngx and BookStack.&lt;/p&gt;

&lt;p&gt;The most useful part of each map turned out to be the "where it breaks" lines. Here are six of them. None is a bug. Each is a deliberate choice by the maintainers, and each is invisible from a function signature, a type, or a quick read of the happy path.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Mastodon can answer "posted" and save nothing
&lt;/h2&gt;

&lt;p&gt;You post a status through the API. You get a status back, with an id. Nothing was saved and nothing was delivered.&lt;/p&gt;

&lt;p&gt;Mastodon's spam check raises &lt;code&gt;Antispam::SilentlyDrop&lt;/code&gt; when the text matches the server's spam list and nobody the post replies to or mentions follows the author. The exception builds a status object with a freshly generated id and deletes the record, and &lt;code&gt;PostStatusService&lt;/code&gt; rescues it and returns that object as if the post had gone through.&lt;/p&gt;

&lt;p&gt;The silence is the point: a spammer shouldn't learn they were caught. But if you're writing a client, a bot or a test, "I got an id back" does not mean "the post exists".&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/mastodon/mastodon/blob/7f90e0fd72457065096d13cdcbfd0713c88de933/app/lib/antispam.rb#L19-L44" rel="noopener noreferrer"&gt;&lt;code&gt;app/lib/antispam.rb&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/mastodon/mastodon/blob/7f90e0fd72457065096d13cdcbfd0713c88de933/app/services/post_status_service.rb#L76" rel="noopener noreferrer"&gt;&lt;code&gt;app/services/post_status_service.rb&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. On Mastodon, following someone on another server is only a request
&lt;/h2&gt;

&lt;p&gt;You press Follow on an account that isn't locked. If the account lives on another server, you are not following it yet.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FollowService&lt;/code&gt; sends every remote target down the follow-request path, locked or not. The request becomes a real follow only when the other server answers with an &lt;code&gt;Accept&lt;/code&gt;. If that answer never comes, the relationship stays pending, and no error is raised anywhere.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/mastodon/mastodon/blob/7f90e0fd72457065096d13cdcbfd0713c88de933/app/services/follow_service.rb#L41-L42" rel="noopener noreferrer"&gt;&lt;code&gt;app/services/follow_service.rb&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/mastodon/mastodon/blob/7f90e0fd72457065096d13cdcbfd0713c88de933/app/lib/activitypub/activity/accept.rb" rel="noopener noreferrer"&gt;&lt;code&gt;app/lib/activitypub/activity/accept.rb&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. In Gitea, everything after a push is best effort
&lt;/h2&gt;

&lt;p&gt;Your &lt;code&gt;git push&lt;/code&gt; succeeds. Your CI run, your webhooks and your activity feed entry are a separate matter.&lt;/p&gt;

&lt;p&gt;By the time the post-receive hook runs, git already has the commits. The code says so itself: nothing can be stopped or undone at that point, so errors are skipped. The follow-up work is pushed onto a queue, and a failure there is written to the server log. The person who pushed sees a normal, successful push.&lt;/p&gt;

&lt;p&gt;So "the push went through" and "the pipeline was triggered" are two different facts, and only the first one is reported to you.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/go-gitea/gitea/blob/458eda0f1d49f9413afdb353c561402b18267d43/routers/private/hook_post_receive.go#L100-L111" rel="noopener noreferrer"&gt;&lt;code&gt;routers/private/hook_post_receive.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/go-gitea/gitea/blob/458eda0f1d49f9413afdb353c561402b18267d43/services/repository/push.go#L43-L57" rel="noopener noreferrer"&gt;&lt;code&gt;services/repository/push.go&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Excalidraw doesn't merge two people's edits to the same shape
&lt;/h2&gt;

&lt;p&gt;Two people edit the same rectangle at the same moment. You might expect the changes to be merged field by field: her colour, his size.&lt;/p&gt;

&lt;p&gt;They aren't. Reconciliation works on whole elements. If you are editing a shape's text, resizing it or still drawing it, the remote copy of that shape is discarded, whatever its version. Otherwise the higher version wins, and a tie goes to the lower &lt;code&gt;versionNonce&lt;/code&gt;. One side's entire element survives.&lt;/p&gt;

&lt;p&gt;That is a sensible trade for a whiteboard, where a predictable result matters more than a clever one. It also means "collaborative" here does not mean "merged".&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/excalidraw/excalidraw/blob/e1b7aacb356a492aa1e0fc6eb57b8896124027f0/packages/excalidraw/data/reconcile.ts#L23-L44" rel="noopener noreferrer"&gt;&lt;code&gt;packages/excalidraw/data/reconcile.ts&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Paperless-ngx can email you about a document it then rolls back
&lt;/h2&gt;

&lt;p&gt;A workflow sends a "document added" email, or calls a webhook, when a document is consumed. The email can arrive for a document that doesn't exist.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;document_consumption_finished&lt;/code&gt; signal is sent inside the database transaction, and the workflows run on that signal. The files are copied into place afterwards, still inside the same transaction, and the code notes that a failed copy rolls it back. A full disk or a permission problem at that step undoes the database row. It can't undo the email.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/paperless-ngx/paperless-ngx/blob/a8b835fcd023627a6813ac224c1ac028450c8937/src/documents/consumer.py#L607-L700" rel="noopener noreferrer"&gt;&lt;code&gt;src/documents/consumer.py&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/paperless-ngx/paperless-ngx/blob/a8b835fcd023627a6813ac224c1ac028450c8937/src/documents/apps.py#L29" rel="noopener noreferrer"&gt;&lt;code&gt;src/documents/apps.py&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. In BookStack, two people exporting the same book get different files
&lt;/h2&gt;

&lt;p&gt;An admin and a guest both export the same book as a PDF. The files can differ in length.&lt;/p&gt;

&lt;p&gt;Every book export builds its contents with &lt;code&gt;BookContents::getTree&lt;/code&gt;, which loads only the chapters and pages the current user is allowed to see. Pages a reader can't open are left out of that reader's export, with no note that something is missing.&lt;/p&gt;

&lt;p&gt;This is the right behaviour for permissions. It is also a surprise for anyone who treats an export as "the book", for example as a backup or as the copy sent to a client.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/BookStackApp/BookStack/blob/045c6a98cac21ea86906674bb91d01f375460db6/app/Exports/ExportFormatter.php#L134-L136" rel="noopener noreferrer"&gt;&lt;code&gt;app/Exports/ExportFormatter.php&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/BookStackApp/BookStack/blob/045c6a98cac21ea86906674bb91d01f375460db6/app/Entities/Tools/BookContents.php#L44" rel="noopener noreferrer"&gt;&lt;code&gt;app/Entities/Tools/BookContents.php&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What the six have in common
&lt;/h2&gt;

&lt;p&gt;In every case the success signal means less than it appears to: an id, a pressed button, an accepted push, a synced canvas, a sent email, a finished export. And in every case the reason sits two or three files away from where you'd be working.&lt;/p&gt;

&lt;p&gt;A person learns these by being burned once. An AI coding agent doesn't get that chance: it reads the function in front of it, sees a clean return value, and builds on it. That is the reason I keep the maps. Each trap is written on the note for the module that owns it, and a hook points the agent at that note the first time it opens one of the module's files.&lt;/p&gt;

&lt;p&gt;The five maps are public, with every note and every link: &lt;a href="https://light5566.github.io/claude-lightkeeper/" rel="noopener noreferrer"&gt;https://light5566.github.io/claude-lightkeeper/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The tool that builds and maintains them is Lightkeeper, free and open source, for Claude Code, Hermes Agent and Codex: &lt;a href="https://github.com/Light5566/claude-lightkeeper" rel="noopener noreferrer"&gt;https://github.com/Light5566/claude-lightkeeper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you maintain one of these projects and I've read your code wrong, tell me and I'll fix the note.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>programming</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
