<?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: orca forge</title>
    <description>The latest articles on DEV Community by orca forge (@orca_forge).</description>
    <link>https://dev.to/orca_forge</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%2F4034330%2Fc9ccc162-e897-4e55-9e1a-de55bce4bc27.png</url>
      <title>DEV Community: orca forge</title>
      <link>https://dev.to/orca_forge</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/orca_forge"/>
    <language>en</language>
    <item>
      <title>Why AI Agent Approvals Missed a Gap and Checks Increased Confidence</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Mon, 16 Nov 2026 13:04:17 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-ai-agent-approvals-missed-a-gap-and-checks-increased-confidence-4n3c</link>
      <guid>https://dev.to/orca_forge/why-ai-agent-approvals-missed-a-gap-and-checks-increased-confidence-4n3c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/relayed-approval-amplifies-confidence/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=relayed-approval-amplifies-confidence" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR In a development environment with multiple AI sessions, I approved a relayed procedure that had not been verified. Everyone who read and approved it missed a gap. Adding &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; as a condition did not establish safety and strengthened confidence in a false assumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion First
&lt;/h2&gt;

&lt;p&gt;The procedure relayed between AI sessions had not been verified, and everyone who read and approved it missed the flaw. Adding &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; as a condition did not help; the reassurance of adding a condition only strengthened our confidence in a false assumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Took “Follow the Order” as a Safety Guarantee
&lt;/h2&gt;

&lt;p&gt;This happened in a development environment where several AI sessions were working in parallel, and a “safe procedure” was being relayed between them. I’m looking back at the same kind of incident as in the already published article “Without Quoting &lt;code&gt;$()&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; Won’t Stop You”, this time from the perspective of the people and sessions involved rather than the command itself.&lt;/p&gt;

&lt;p&gt;The procedure was to save the changes somewhere before deleting them. The message relaying it included a reminder: “Please follow the order.” I read that and assumed the procedure would be followed. Looking back, that reminder sounded less like a warning to follow the steps and more like a guarantee that the procedure was safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did I Miss the Flaw Even After Making &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; a Condition?
&lt;/h2&gt;

&lt;p&gt;As a condition for approval, I wrote, “Run the version that chains the commands with &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;.” I thought adding a condition to the execution order would ensure the sequence was followed: move the files aside, then delete them.&lt;/p&gt;

&lt;p&gt;Without checking that the procedure itself had been validated, adding &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; as a condition only gave a dangerous command my endorsement. &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; had not acted as a safeguard. As one of the people who read and approved the command, I had missed the flaw too.&lt;/p&gt;

&lt;p&gt;I had treated adding a condition as a substitute for checking. But I hadn’t checked whether the procedure was safe. I had simply assumed that the condition I wrote would make it safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who Found the Gap in the Procedure?
&lt;/h2&gt;

&lt;p&gt;The person who found the gap was the one who ran it once in a disposable repository. Everyone who read and approved it had missed it. I was one of them.&lt;/p&gt;

&lt;p&gt;I was reminded, “Follow the steps in order,” and I added the condition, “Chain them with &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;.” We had words of caution. But adding those words and writing down the condition did not, by themselves, verify the procedure.&lt;/p&gt;

&lt;p&gt;My agreement had been gathered on the basis of a false assumption. Once we learned that assumption was wrong, the agreement was void. If the assumption that something is safe doesn’t hold, approval based on that assumption can’t stand either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Cross-Checking Increased Our Confidence
&lt;/h2&gt;

&lt;p&gt;Five sessions measured the same location and reached different conclusions each time. The cause was a mix-up about what was being counted. The fact that something was measured is no basis for aligning conclusions if the things being counted do not match.&lt;/p&gt;

&lt;p&gt;For me, this and the approval of a procedure led to the same problem. Reading the procedure, writing down the conditions, measuring the numbers—all of these look like checks. Yet when they are checking different things, they can leave a false assumption in place and only strengthen our confidence.&lt;/p&gt;

&lt;p&gt;One participant put it this way:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The cross-check was wrong, but the fact that we had cross-checked it became a reason to feel more confident.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I saw myself in those words. Adding a condition with &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; made me feel as though I had verified the procedure. But that condition was no safeguard. The reassurance I felt from adding it replaced an opportunity to check the premise that actually mattered.&lt;/p&gt;

&lt;p&gt;Neither a reminder to “follow the order” nor a condition to “join them with &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;” is, by itself, a basis for safety. Which premise was checked, what was measured, and what the result was—unless those details are verified, adding more checking steps can simply gather agreement around an error.&lt;/p&gt;

&lt;p&gt;Everyone who read and approved the procedure missed the gap. I missed it too. We should not feel reassured just because a cross-check was performed; we need to look at what was checked and which premise the result supports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://forge.workstyle.tech/blog/unquoted-command-substitution-guard/" rel="noopener noreferrer"&gt;https://forge.workstyle.tech/blog/unquoted-command-substitution-guard/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Verify the procedure itself, even when it is relayed as safe.&lt;/li&gt;
&lt;li&gt;Do not treat an ordering reminder or an &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; condition as proof of safety.&lt;/li&gt;
&lt;li&gt;Run the procedure once in a disposable repository to check for gaps.&lt;/li&gt;
&lt;li&gt;When measuring numbers, check what was counted and whether sessions measured the same thing.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>How to Rotate DB and Redis Passwords Without Stopping Connections</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Sun, 15 Nov 2026 13:04:29 +0000</pubDate>
      <link>https://dev.to/orca_forge/how-to-rotate-db-and-redis-passwords-without-stopping-connections-26eh</link>
      <guid>https://dev.to/orca_forge/how-to-rotate-db-and-redis-passwords-without-stopping-connections-26eh</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/rotate-db-redis-passwords-without-downtime/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=rotate-db-redis-passwords-without-downtime" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR The DB admin password and Redis password were stored in plaintext in the infrastructure configuration repository history. DB and Redis are services that applications connect to. I kept the history unchanged and rotated the credentials in order: Secret, DB and Redis, then application restarts.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Because the database and Redis passwords were left in the Git history, I rotated the credentials instead of rewriting the history. By updating the Secret, switching the values on the database and Redis sides, and then gradually restarting the app, I was able to make the change without interrupting connections. The object storage root credentials required a restart, so I scaled the Pods down to zero before bringing them back up.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Decide Before Rewriting Git History
&lt;/h2&gt;

&lt;p&gt;Rewriting Git history changes everyone’s clones (local copies of the repository), pull requests (proposed changes), and commit IDs. History can also remain in GitHub caches and forks (separately copied repositories), so rewriting history alone may not remove all traces of an exposure.&lt;/p&gt;

&lt;p&gt;This time, we left the history unchanged and replaced the credentials. We recorded them as “replaced” in the secret scanner’s allowlist.&lt;/p&gt;

&lt;p&gt;Before starting, we prepared rollback steps and a decision threshold. In this case, the condition was: “Roll back if login fails for more than five minutes.” Deciding what state triggers a rollback in advance helps avoid delays when problems arise.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Prepare New Passwords for the DB and Redis
&lt;/h2&gt;

&lt;p&gt;I generated the new passwords with Python’s &lt;code&gt;secrets&lt;/code&gt; module (a standard library for creating secret values) and wrote them to files. I made sure not to include a trailing newline, so I wouldn’t have to type the values directly into the CLI (the screen where you enter commands) or put plaintext in SQL.&lt;/p&gt;

&lt;p&gt;For the DB change, I used a SCRAM-SHA-256 verifier (a value used for authentication instead of the password itself). I prepared the verifier and set it with &lt;code&gt;ALTER ROLE … PASSWORD '&amp;lt;verifier&amp;gt;'&lt;/code&gt;. This avoids including the plaintext password in the SQL statement.&lt;/p&gt;

&lt;p&gt;For Redis, I read the value from a file and ran &lt;code&gt;redis-cli -x config set requirepass&lt;/code&gt;. The &lt;code&gt;-x&lt;/code&gt; option passes the value through standard input (the input channel used to provide data to a command).&lt;/p&gt;

&lt;h2&gt;
  
  
  In What Order Should You Switch DB and Redis?
&lt;/h2&gt;

&lt;p&gt;If you’re only changing passwords, neither the DB nor Redis needs to be restarted. Existing sessions can keep using their current connections. So we updated both credentials in a single maintenance window.&lt;/p&gt;

&lt;p&gt;First, we updated the Secret (a Kubernetes resource for managing credentials and other sensitive data). At that point, the Pods (the units that run the application) hadn’t been restarted, so the apps were still using the old values. We then changed the credentials on the DB and Redis before restarting the apps. Reversing this order would cause apps that had loaded the new values to try connecting to the DB or Redis while they still had the old credentials.&lt;/p&gt;

&lt;p&gt;We restarted the apps in batches of three or four. Apps that use GPUs were restarted one at a time. We also changed environment variables (&lt;code&gt;env&lt;/code&gt;) that had been configured in plain text to use &lt;code&gt;secretKeyRef&lt;/code&gt; (a setting that passes a Secret’s value to an environment variable).&lt;/p&gt;

&lt;p&gt;The work took place on October 13, from 00:24 to 00:54 Japan time. The 15 apps that don’t use GPUs had all been restarted by 00:27. The six GPU-using apps were restarted between 00:30 and 00:53. There were zero authentication failures and zero restarts. The number of DB connections dropped from 55 to 20–24.&lt;/p&gt;

&lt;p&gt;We monitored the systems from 00:54 to 01:04 and confirmed there were no authentication or connection errors. Before the work, we had estimated it would take 45–60 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why We Scale Object Storage to Zero Pods
&lt;/h2&gt;

&lt;p&gt;The object storage root was read only from the environment, so changing its value required a restart. There was no way to switch it while the app kept running, as we could with the database or Redis.&lt;/p&gt;

&lt;p&gt;We didn’t use &lt;code&gt;rollout restart&lt;/code&gt;. With a RollingUpdate (a deployment strategy that replaces old Pods with new ones), both the old and new Pods would open the same volume (storage used by a Pod) at the same time. Instead, we first ran &lt;code&gt;scale --replicas=0&lt;/code&gt; and confirmed that there were zero Pods, then scaled back up to one.&lt;/p&gt;

&lt;p&gt;We recreated the Pod at 01:02. There were no authentication failures afterward. The planned downtime was 30–60 seconds, but the logs don’t confirm the actual duration. All signed URLs issued before the restart became unusable. We let users know in advance about the impact, including downtime while each app restarted.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Check After the Work
&lt;/h2&gt;

&lt;p&gt;After the work, check for authentication failures and connection errors. This time, neither the database nor Redis restarted or reported any authentication failures. There were no authentication failures after the storage was recreated, either.&lt;/p&gt;

&lt;p&gt;The automatic approval mechanism stopped the script that rewrote the keys. So I documented the procedure, and another team carried out the work after a person reviewed it. I kept preparing the procedure separate from the decision to make the change.&lt;/p&gt;

&lt;p&gt;When a secret remains in history, consider not only whether to rewrite that history, but also how to revoke the value currently in use. This time, we switched the database and Redis credentials while keeping their connections open, and handled storage separately with a procedure that required downtime. We decided on rollback conditions in advance, then checked the logs and connection counts afterward to confirm the state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check whether the values in history are still used in production, then decide whether to rewrite history or rotate credentials.&lt;/li&gt;
&lt;li&gt;Set the rollback procedure and condition first; in this case, roll back if login fails for 5 minutes or more.&lt;/li&gt;
&lt;li&gt;Prepare new values and update Secret, DB and Redis, then restart the application.&lt;/li&gt;
&lt;li&gt;Restart applications gradually and check authentication errors, connection errors, and DB connection count.&lt;/li&gt;
&lt;li&gt;For storage that requires a restart, confirm Pod count is 0 before bringing it back, and check downtime and user impact.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>How to Exclude libx264 from a Bundled FFmpeg and Use VideoToolbox</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Sat, 14 Nov 2026 13:02:07 +0000</pubDate>
      <link>https://dev.to/orca_forge/how-to-exclude-libx264-from-a-bundled-ffmpeg-and-use-videotoolbox-3n5</link>
      <guid>https://dev.to/orca_forge/how-to-exclude-libx264-from-a-bundled-ffmpeg-and-use-videotoolbox-3n5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/ffmpeg-bundle-without-libx264/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=ffmpeg-bundle-without-libx264" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for anyone who wants to bundle ffmpeg with a desktop app but is concerned about licensing when enabling &lt;code&gt;libx264&lt;/code&gt;. ffmpeg is a tool for working with video and audio, and &lt;code&gt;libx264&lt;/code&gt; is a library used to encode video. In my test with a 3-second clip, user CPU time was 1.26 seconds for &lt;code&gt;libx264&lt;/code&gt; and 0.20 seconds for VideoToolbox. This article covers builds for macOS and Windows, encoder arguments, and checks to run before distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Enabling &lt;code&gt;libx264&lt;/code&gt; makes ffmpeg itself GPL-licensed, so we removed it from the bundled build. On macOS, we use &lt;code&gt;h264_videotoolbox&lt;/code&gt;; for Windows, we have a configuration using &lt;code&gt;h264_nvenc&lt;/code&gt; and &lt;code&gt;h264_mf&lt;/code&gt;. We use separate arguments for each encoder, align the build settings with the license information, and verify that the distribution includes the executable and the full license text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Removed libx264 from the Bundled Build
&lt;/h2&gt;

&lt;p&gt;The design documents state that FFmpeg itself is licensed under LGPL 2.1+, while &lt;code&gt;libx264&lt;/code&gt; is GPL-licensed. Linking &lt;code&gt;libx264&lt;/code&gt; would make FFmpeg itself GPL-licensed, so I removed it from the bundled version.&lt;/p&gt;

&lt;p&gt;On macOS, I use &lt;code&gt;h264_videotoolbox&lt;/code&gt;. When encoding a 3-second clip, user CPU time was 1.26 seconds with &lt;code&gt;libx264&lt;/code&gt; and 0.20 seconds with &lt;code&gt;h264_videotoolbox&lt;/code&gt;—about one-sixth as much. These measurements are specific to the tested clip and environment.&lt;/p&gt;

&lt;p&gt;For Windows, one configuration uses &lt;code&gt;h264_nvenc&lt;/code&gt; and &lt;code&gt;h264_mf&lt;/code&gt;. &lt;code&gt;h264_mf&lt;/code&gt; is provided as a Windows fallback. Enabling NVENC requires &lt;code&gt;nv-codec-headers&lt;/code&gt;. QSV and AMF are not included in this configuration because they require external libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build ffmpeg for macOS
&lt;/h2&gt;

&lt;p&gt;The build steps for bundling are collected in a script. It downloads the source archive, verifies its SHA-256 checksum, and then extracts it. After the build, it copies the executable and the full LGPL license text to the output directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh scripts/build-ffmpeg.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script’s configure options disable GPL, nonfree, and version3, and enable VideoToolbox and AudioToolbox. After the build, it checks the output of &lt;code&gt;ffmpeg -version&lt;/code&gt; and fails if it contains &lt;code&gt;--enable-gpl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One record notes that the resulting build was 13 MB. The build artifact is not committed to the repository; it is built before creating a release. Place &lt;code&gt;COPYING.LGPLv2.1&lt;/code&gt; alongside the executable.&lt;/p&gt;

&lt;h2&gt;
  
  
  When NVENC Isn’t Found on Windows
&lt;/h2&gt;

&lt;p&gt;Run the Windows build script inside UCRT64, the build environment for Windows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh scripts/build-ffmpeg-win.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetch a pinned version of the NVENC headers and install them under &lt;code&gt;/ucrt64&lt;/code&gt;. In &lt;code&gt;configure&lt;/code&gt;, specify &lt;code&gt;--enable-ffnvcodec&lt;/code&gt; and &lt;code&gt;--enable-nvenc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The combination of &lt;code&gt;--disable-autodetect&lt;/code&gt; and NVENC is where I got stuck. Since &lt;code&gt;ffnvcodec&lt;/code&gt; is subject to autodetection, disabling autodetection makes it appear that the dependency can’t be found. &lt;code&gt;--enable-nvenc&lt;/code&gt; alone isn’t enough; you also need to explicitly specify &lt;code&gt;--enable-ffnvcodec&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One more thing: adding a comment in the middle of a &lt;code&gt;configure&lt;/code&gt; command continued with backslashes can cause the command to break there. There’s a report that &lt;code&gt;sh -n&lt;/code&gt; won’t catch it even if the remaining options run as a separate command. Avoid comments in the middle of a continued command, and check the output after the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Choose Streaming Arguments for Each Encoder
&lt;/h2&gt;

&lt;p&gt;When you change the encoder, review the arguments passed to ffmpeg as well. &lt;code&gt;-preset&lt;/code&gt; and &lt;code&gt;-tune&lt;/code&gt; are for &lt;code&gt;libx264&lt;/code&gt;. Passing them unchanged to VideoToolbox or another encoder will cause it to fail. In my implementation, I pass &lt;code&gt;-preset veryfast -tune zerolatency&lt;/code&gt; only when using &lt;code&gt;libx264&lt;/code&gt;, and pass &lt;code&gt;-realtime 1&lt;/code&gt; to all other encoders.&lt;/p&gt;

&lt;p&gt;You can check which encoders are available with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg -hide_banner -encoders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the bundled macOS version, I confirmed that &lt;code&gt;h264_videotoolbox&lt;/code&gt; and &lt;code&gt;aac&lt;/code&gt; are available, while &lt;code&gt;libx264&lt;/code&gt; is not included. For Windows, I confirmed that &lt;code&gt;h264_nvenc&lt;/code&gt;, &lt;code&gt;h264_mf&lt;/code&gt;, and &lt;code&gt;aac&lt;/code&gt; are available.&lt;/p&gt;

&lt;p&gt;If the bundled version has no usable video encoder, do not automatically fall back to &lt;code&gt;libx264&lt;/code&gt;. The bundled version does not include &lt;code&gt;libx264&lt;/code&gt;. The design reports an error before streaming starts if no supported encoder is available. When using a separate ffmpeg installed on the device, its executable may include &lt;code&gt;libx264&lt;/code&gt;. Be careful not to confuse the bundled version with the one installed on the device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping Build Settings and License Information in Sync
&lt;/h2&gt;

&lt;p&gt;When bundling LGPL software, you need to provide not only the full license text but also instructions for obtaining the corresponding source code. To make it possible to reproduce the same build, our records include the source URL, SHA-256 checksum, and every &lt;code&gt;configure&lt;/code&gt; option alongside the license information.&lt;/p&gt;

&lt;p&gt;When you change the &lt;code&gt;configure&lt;/code&gt; options in the build script, update the options in the license information as well. Compare the two and make sure they match. The same applies to Windows builds. If the build instructions and the published information don’t agree, they can’t help someone reproduce the same version.&lt;/p&gt;

&lt;p&gt;Even if you don’t track build artifacts in Git, you still need to prepare them before distribution. Use the script to build FFmpeg, confirm that the executable and full license text are in the output directory, and then package the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Check Whether ffmpeg Is Included in a Release
&lt;/h2&gt;

&lt;p&gt;The last issue I ran into was that the packaging process continued even though the ffmpeg output directory didn’t exist. The log showed a “file source doesn't exist” warning, but the build itself succeeded, producing a release package without ffmpeg.&lt;/p&gt;

&lt;p&gt;That’s why a successful CI run alone doesn’t confirm that ffmpeg is bundled. For a Windows release, after packaging, open &lt;code&gt;dist/win-unpacked/resources/ffmpeg/&lt;/code&gt; and check that it contains both &lt;code&gt;ffmpeg.exe&lt;/code&gt; and &lt;code&gt;COPYING.LGPLv2.1&lt;/code&gt;. Before building, also verify that the executable is in the expected output location, the full license text is present, and no GPL designation is included.&lt;/p&gt;

&lt;p&gt;Before releasing, I check three things: the encoder, the build configuration, and the bundled files. I verify separately that ffmpeg built successfully and that it was bundled in a distributable form.&lt;/p&gt;

&lt;h2&gt;
  
  
  If You Run Into the Same Issue
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check the build script’s configure options to confirm that GPL is disabled.&lt;/li&gt;
&lt;li&gt;Check the configuration and available encoders with &lt;code&gt;ffmpeg -version&lt;/code&gt; and &lt;code&gt;ffmpeg -hide_banner -encoders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pass arguments that match the encoder, and report an error before starting the stream if the required encoder is unavailable.&lt;/li&gt;
&lt;li&gt;Open the build output directory and the distribution package to confirm they contain the executable and &lt;code&gt;COPYING.LGPLv2.1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ffmpeg</category>
      <category>videotoolbox</category>
    </item>
    <item>
      <title>Why Git Shows Old Commit URLs After Squashing History</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Fri, 13 Nov 2026 13:04:25 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-git-shows-old-commit-urls-after-squashing-history-2mi3</link>
      <guid>https://dev.to/orca_forge/why-git-shows-old-commit-urls-after-squashing-history-2mi3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/squashed-history-old-commit-still-opened/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=squashed-history-old-commit-still-opened" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR I was preparing to release Voice Canvas as OSS and found that an old commit URL still opened in my account after I squashed the Git history into 1 commit. The repository was private, and the same URL returned 404 when I was logged out. Since that did not confirm what would happen after publication, I recreated the repository before making it public.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion First
&lt;/h2&gt;

&lt;p&gt;Even after squashing a Git history into a single commit, I could open an old commit URL while logged in to my account on a private repository. I recreated the repository with the same name and made it public, then confirmed that the old URL could not be opened while logged out. I did not test whether the old commit would be visible after making the repository public.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an Old URL Still Opened After I Squashed the History
&lt;/h2&gt;

&lt;p&gt;I squashed Voice Canvas’s history into a single commit because it contained information I didn’t want to leave in the old history. After squashing, I opened the URL for an old commit while signed in to my account, and the commit appeared.&lt;/p&gt;

&lt;p&gt;At that point, the repository was private. The same URL returned a 404 (page not found) when I wasn’t logged in. Since I could still see it from my own account, I realized that a 404 while logged out didn’t tell me what the URL would show after the repository became public.&lt;/p&gt;

&lt;p&gt;I thought the old commit might be visible if I made the repository public, but I didn’t actually make it public to find out. Instead of gambling on what would be visible afterward, I decided to recreate the repository before publishing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happened When I Recreated a Repository with the Same Name and Sent Changes
&lt;/h2&gt;

&lt;p&gt;I deleted a repository, recreated it with the same name, and published it. My push (the operation that sends changes to a repository) was rejected once. The message said the author’s email address was blocked by the email privacy setting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;push declined due to email privacy restrictions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I changed the author’s address to a noreply address and pushed again. This time it went through. In my case, the snag after recreating the history was the email address setting.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Checked the Old Commit URL After Publishing
&lt;/h2&gt;

&lt;p&gt;After publishing, I used a ruleset (the repository’s rules configuration) to block force pushes to &lt;code&gt;main&lt;/code&gt;. I tried it and confirmed that the push was rejected.&lt;/p&gt;

&lt;p&gt;On October 16, I opened the old commit URL while logged out, and it no longer loaded. The current public repository has three commits in its history.&lt;/p&gt;

&lt;p&gt;What I confirmed was that the old URL, after recreating the repository, could not be opened while logged out. Before recreating it, the private repository returned a 404 when I was logged out, but the commit was visible when I was signed in to my own account. I still haven’t confirmed whether the old commit is visible when the repository is public.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;After squashing history into 1 commit, check the old commit URL while signed in and logged out.&lt;/li&gt;
&lt;li&gt;A 404 while logged out from a private repository does not establish what happens when it is public.&lt;/li&gt;
&lt;li&gt;After recreating and publishing the repository, check the old URL while logged out.&lt;/li&gt;
&lt;li&gt;If a push is declined, check the reason and author email settings; in my case, a noreply address worked.&lt;/li&gt;
&lt;li&gt;Verify that force pushes to main are prohibited by trying one.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>git</category>
    </item>
    <item>
      <title>Why headless Chromium Wheel Input Sends a 3D Page Back</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Thu, 12 Nov 2026 13:00:06 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-headless-chromium-wheel-input-sends-a-3d-page-back-9a8</link>
      <guid>https://dev.to/orca_forge/why-headless-chromium-wheel-input-sends-a-3d-page-back-9a8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/busy-main-thread-wheel-settles-back/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=busy-main-thread-wheel-settles-back" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR The main thread can delay wheel events while 3D rendering is busy. A 160ms timer can expire first and move the page back when its position is below 0.5. Pausing render loops during page swaps and extending the wait to 220ms fixed the issue in the same test environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;While 3D was rendering, the page sometimes moved backward when I used the mouse wheel. The main thread was blocked, so wheel events arrived late. I stopped the render loop while switching pages and increased the idle timeout used to decide that input had stopped from 160 ms to 220 ms. In the same test environment, one wheel turn now advances one page at a time while 3D is rendering. I also checked all 38 tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did scrolling the wheel make the page go back?
&lt;/h2&gt;

&lt;p&gt;The cause was that wheel events arrived late when the main thread—the thread that drives page processing—was busy. The page transition uses a timer to decide when input has stopped.&lt;/p&gt;

&lt;p&gt;When input arrives late, the 160 ms timer expires before the wheel event arrives. At that point, if the page position is less than 0.5, the page moves back to its original position. The time during which it looked like no input was arriving differed from the time when input had actually stopped. As a result, when 3D rendering kept the main thread busy, it also affected page transitions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the presentation stayed on the first page even after loading
&lt;/h2&gt;

&lt;p&gt;I first noticed the issue at 04:30 on October 11. In a headless Chromium test environment without a GPU, I was loading three 3D models onto the cover slide. While they took a few seconds to load, wheel input arrived late. If I scrolled during that time, the presentation sometimes failed to advance and returned to the first page.&lt;/p&gt;

&lt;p&gt;When I removed the 3D models and tested again, all slides advanced correctly. I thought the issue was unlikely to occur on computers with a GPU, so I didn’t fix it at the time.&lt;/p&gt;

&lt;p&gt;During a check immediately after the release on October 13, the presentation sometimes still wouldn’t advance from the first page when I scrolled in the same environment. Since the problem continued after the models had finished loading, temporary input delays during loading couldn’t explain it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Stopped Rendering During Page Swaps
&lt;/h2&gt;

&lt;p&gt;I decided to pause 3D rendering only while pages are being swapped. I add the &lt;code&gt;deck-swapping&lt;/code&gt; class to the root element, and the 3D and other animation loops skip a frame when that class is present.&lt;/p&gt;

&lt;p&gt;The relevant code looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'deck-swapping'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;partner&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// While rendering the swap&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;currentHost&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'deck-swapping'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// 3D draw&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the same change, I increased the delay before bringing the pages together from 160ms to 220ms. I didn’t measure the effects of pausing rendering and extending the delay separately, so I don’t know how much each change contributed.&lt;/p&gt;

&lt;h2&gt;
  
  
  After the Fix, It Advanced One Page at a Time While Rendering 3D
&lt;/h2&gt;

&lt;p&gt;I tried it again in the same test environment after the fix. Even with 3D rendering active, one scroll of the wheel advanced one page. The test suite had 38 tests.&lt;/p&gt;

&lt;p&gt;What I confirmed is that the issue stopped occurring after the fix in this environment, and that each input triggered a single transition. I haven’t checked whether the same issue occurred before the fix on a physical machine with a GPU. I also haven’t measured how many milliseconds the input was delayed.&lt;/p&gt;

&lt;p&gt;At first, I thought this was unlikely to happen on a computer with a GPU because I had only seen the issue in headless Chromium. But shortly after release, I found that the page still wouldn’t advance past page one after loading in the same test environment. My initial assumption that it was a loading issue wasn’t enough.&lt;/p&gt;

&lt;p&gt;What I learned is that even when the page transition timer is waiting for input, a busy main thread can delay the input event itself. I paused 3D rendering only during the transition. At least in this test, that prevented wheel input during rendering from triggering unwanted transitions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Test wheel input both while 3D models load and after loading in headless Chromium without GPU use&lt;/li&gt;
&lt;li&gt;Check whether removing 3D lets all slides advance correctly&lt;/li&gt;
&lt;li&gt;Inspect whether the 160ms timer expires before the wheel event while the page position is below 0.5&lt;/li&gt;
&lt;li&gt;Skip render-loop frames during page swaps and use a 220ms wait&lt;/li&gt;
&lt;li&gt;Verify that one wheel input advances one page with 3D still rendering&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>threejs</category>
      <category>headlesschromium</category>
    </item>
    <item>
      <title>How to Fix JavaScript Wheel Scrolling That Skips Pages</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Wed, 11 Nov 2026 13:06:32 +0000</pubDate>
      <link>https://dev.to/orca_forge/how-to-fix-javascript-wheel-scrolling-that-skips-pages-21kd</link>
      <guid>https://dev.to/orca_forge/how-to-fix-javascript-wheel-scrolling-that-skips-pages-21kd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/wheel-scrub-page-transition/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=wheel-scrub-page-transition" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR Wheel event counts do not match the distance moved, so counting events can skip pages. Convert wheel distance into progress using the page height. After input stops, use the progress to choose the destination, and handle touch input separately on mobile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion First
&lt;/h2&gt;

&lt;p&gt;If page turns are based on the number of wheel events, a small amount of scrolling can advance multiple pages. That’s because the number of wheel events doesn’t correspond to the distance traveled. You can make page changes match the amount of scrolling by dividing the distance by the page height, then—once scrolling stops—using the halfway point to decide whether to move to the next page or return to the current one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Scrolling Send the Page Flying?
&lt;/h2&gt;

&lt;p&gt;The page was jumping because each wheel event was treated as a page turn. Scroll input received during the 0.8-second transition was discarded, so the next action wasn’t accepted until the trackpad’s inertia had stopped.&lt;/p&gt;

&lt;p&gt;I changed it to remember up to one page’s worth of input during a transition and shortened the wait before accepting the next action to 0.55 seconds. Even so, counting events could make a single page’s worth of scrolling advance two or three pages.&lt;/p&gt;

&lt;p&gt;So I count distance instead of events. One screen height counts as one page. Scrolling in the opposite direction, and any distance accumulated after a 1.2-second pause, is discarded. With the screen at 1280×800 and the slide height at 712px, a test scrolling in 100px increments advanced to page 2 at 800px, page 3 at 1500px, and page 4 at 2200px.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning Wheel Distance into Page Progress
&lt;/h2&gt;

&lt;p&gt;Scrubbing changes how far a page transition has progressed based on the input distance. Track the current progress as &lt;code&gt;progress&lt;/code&gt;: &lt;code&gt;0&lt;/code&gt; means the current page, &lt;code&gt;1&lt;/code&gt; means the next page, and &lt;code&gt;-1&lt;/code&gt; means the previous page. Divide the wheel movement by the page height and add the result to the progress.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;scrubStep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;back&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;forward&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;forward&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;back&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;turn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;turn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;turn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;settleTarget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pass the wheel movement as &lt;code&gt;delta&lt;/code&gt; and the height of one page as &lt;code&gt;page&lt;/code&gt;. If the wheel event's &lt;code&gt;deltaMode&lt;/code&gt; is line-based, multiply the movement by 16; if it's page-based, multiply it by the slide height before using it.&lt;/p&gt;

&lt;p&gt;When progress reaches &lt;code&gt;1&lt;/code&gt; or more, move to the next page; at &lt;code&gt;-1&lt;/code&gt; or less, move to the previous page. Any remaining progress is carried over after the page turn, so movements greater than one page can be handled. Progress does not move in a direction where navigation is unavailable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;settleTarget&lt;/code&gt; decides where to settle after scrolling stops. If the absolute progress is at least 0.5, it settles on the page in that direction; if it's less than 0.5, it returns to the current page. For example, stopping at 360px advanced to the next page, while stopping at 240px returned to the current page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide where to go when input stops, using the halfway point
&lt;/h2&gt;

&lt;p&gt;Waiting for input to stop prevents the page from settling after every brief input. Once 160ms have passed since the last input, check the progress and use the halfway point to decide whether to move forward or back.&lt;/p&gt;

&lt;p&gt;The duration of the transition depends on the distance to the destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;260&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;distance&lt;/code&gt; is the distance from the current progress to the destination. Use cubic ease-out, which slows down toward the end, for the animation. Since the page keeps moving during the transition, you can build the decision based on where it stops separately from the final movement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Soft Is the Default Easing
&lt;/h2&gt;

&lt;p&gt;Easing is a way to adjust how an animation progresses. With linear easing, movement is proportional to progress, so the stop can look mechanical. Strong easing barely moves at the start, which can make it feel unresponsive.&lt;/p&gt;

&lt;p&gt;In this implementation, &lt;code&gt;soft&lt;/code&gt;—the average of linear and smoothstep—is the default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;EASES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;linear&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;soft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;strong&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, I haven’t verified which easing was ultimately selected. This explanation assumes the default, &lt;code&gt;soft&lt;/code&gt;, is being used.&lt;/p&gt;

&lt;p&gt;The visual properties change in proportion to progress: &lt;code&gt;translate3d&lt;/code&gt;, &lt;code&gt;rotateY&lt;/code&gt;, and &lt;code&gt;opacity&lt;/code&gt;. For the outgoing page, I used &lt;code&gt;[-14%, -3%, 350px, 14deg]&lt;/code&gt;; for the incoming page, I used &lt;code&gt;[12%, 4%, -650px, -20deg]&lt;/code&gt;. Pages swapped through scrubbing do not get the entrance animation that assembles the heading.&lt;/p&gt;

&lt;h2&gt;
  
  
  On smartphones, release your finger to decide the page
&lt;/h2&gt;

&lt;p&gt;On the smartphone version, finger movement takes the place of the mouse wheel. If your finger is moving faster than 0.6 pages per second when you lift it, the page advances in that direction. Below that threshold, the destination is determined by whether progress is at least 0.5.&lt;/p&gt;

&lt;p&gt;On pages with long content, finger movement is split between scrolling through the content and switching pages. Scroll to the end of the content first, then switch pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the behavior checks revealed
&lt;/h2&gt;

&lt;p&gt;The checks verified that progress changes as the wheel is turned in small increments, and that stopping partway through changes the destination based on whether the position is past the halfway point. With a 1280×800 screen and slides 712px tall, the cover’s opacity changed to 95%, 88%, 79%, 70%, 60%, and 49% as the wheel was turned in 60px increments. When scrolling stopped at 360px, it advanced to the next page; at 240px, it returned to the original page.&lt;/p&gt;

&lt;p&gt;We ran 29 tests to check this behavior. When recording measurements, note both the screen height and the slide height so you can track what distance was treated as one page. Advancing pages by counting wheel events can make the number of pages change with each input. Converting distance into progress and, after scrolling stops, snapping to the nearer page based on the halfway point keeps the amount of scrolling aligned with page movement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Record the screen and slide heights to establish the distance for one page.&lt;/li&gt;
&lt;li&gt;Add wheel distance divided by page height to progress.&lt;/li&gt;
&lt;li&gt;Discard input in the opposite direction and input accumulated during a 1.2-second pause.&lt;/li&gt;
&lt;li&gt;Check progress 160ms after the last input and settle toward the next or current page at the 0.5 threshold.&lt;/li&gt;
&lt;li&gt;On mobile, check release velocity and scroll long page content to the end before changing pages.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Why nginx Shows Another Site After a Domain Migration</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Tue, 10 Nov 2026 13:05:49 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-nginx-shows-another-site-after-a-domain-migration-5204</link>
      <guid>https://dev.to/orca_forge/why-nginx-shows-another-site-after-a-domain-migration-5204</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/nginx-no-default-server-wrong-login-page/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=nginx-no-default-server-wrong-login-page" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR: Old DNS cache can send requests for a moved domain to the old server. When no vhost matches and nginx has no &lt;code&gt;default_server&lt;/code&gt;, the first loaded vhost can serve its site and certificate. A &lt;code&gt;server_name _&lt;/code&gt; default server can reject HTTP with &lt;code&gt;return 444&lt;/code&gt; and HTTPS with &lt;code&gt;ssl_reject_handshake on&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;On devices with stale DNS cache (old connection information), there was no matching vhost, so the site and certificate from the first vhost loaded could be returned. The cause was that nginx had no &lt;code&gt;default_server&lt;/code&gt;. I added a default server with &lt;code&gt;server_name _&lt;/code&gt;, rejecting HTTP with &lt;code&gt;return 444&lt;/code&gt; and HTTPS with &lt;code&gt;ssl_reject_handshake on&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did the Internal Wiki Appear on the Old Domain?
&lt;/h2&gt;

&lt;p&gt;During work from 2026-10-13 to 15, I ran into a situation where I thought I was opening the domain after migration, but instead saw a different app on the old server. I was also seeing a certificate error. I had assumed the migration would be complete once DNS switched over, so this was unexpected.&lt;/p&gt;

&lt;p&gt;This happened on a device with a stale DNS cache. DNS looks up the destination associated with a domain name, and when a cached entry remains, the previous destination may still be used. Opening the old domain sent the request to the old server, where the intended vhost had already been removed.&lt;/p&gt;

&lt;p&gt;At first, I thought the configuration for the deleted vhost might still be there. But when I checked the records, the relevant vhost was already gone. The problem was that there was no configuration to handle the request afterward.&lt;/p&gt;

&lt;p&gt;This server also hosts other apps. In nginx, setting &lt;code&gt;default_server&lt;/code&gt; determines where requests that don’t match any vhost are sent. If it isn’t set, the first vhost loaded becomes the default, and its configuration handles requests that don’t match another vhost. The certificate for that same vhost is returned, too.&lt;/p&gt;

&lt;p&gt;As a result, requests to the old domain reached another app’s login page. The certificate error occurred because the server returned a certificate from a different vhost. If the old server may still respond after a domain migration, deleting the relevant vhost alone doesn’t determine where those requests will go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rejecting HTTP and HTTPS requests to nginx’s default server
&lt;/h2&gt;

&lt;p&gt;I added a default server with &lt;code&gt;server_name _&lt;/code&gt;. For HTTP, I set &lt;code&gt;return 444&lt;/code&gt;; for HTTPS, I set &lt;code&gt;ssl_reject_handshake on&lt;/code&gt;. The HTTPS handshake is the connection setup that happens before encrypted communication begins.&lt;/p&gt;

&lt;p&gt;The key parts of the configuration are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="n"&gt;server_name&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;444&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For HTTPS, I used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="n"&gt;server_name&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;ssl_reject_handshake&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ssl_reject_handshake&lt;/code&gt; is available in nginx 1.19.4 and later. This configuration does not require a certificate. Instead of accepting the HTTPS connection and returning another site’s certificate, it rejects the handshake.&lt;/p&gt;

&lt;p&gt;After adding this configuration, existing sites were unaffected, and all certbot dry runs (checks of the certificate renewal process) succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did We Figure Out Why a Record with a 3600-Second TTL Stayed for 4432 Seconds?
&lt;/h2&gt;

&lt;p&gt;During the investigation, a record with a 3600-second TTL remained on my Mac for 4432 seconds. A TTL is the length of time DNS information may be cached, so the record appeared to have stayed longer than that.&lt;/p&gt;

&lt;p&gt;I haven’t confirmed why it lasted that long, so I can’t attribute it to any particular caching mechanism. What I did learn is that when stale information remains on a device, requests may continue reaching the old server for a while after a migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned After Removing a vhost
&lt;/h2&gt;

&lt;p&gt;The issue wasn’t the removal of the old vhost itself. Because I hadn’t set up a default server, requests with no matching destination were routed to the first vhost nginx loaded.&lt;/p&gt;

&lt;p&gt;When hosting multiple sites on the same nginx instance, you need to decide how to handle requests that don’t match any vhost, as well as configure the vhosts you use. I added a default server with &lt;code&gt;server_name _&lt;/code&gt;, configured it to &lt;code&gt;return 444&lt;/code&gt; for HTTP, and set &lt;code&gt;ssl_reject_handshake on&lt;/code&gt; for HTTPS.&lt;/p&gt;

&lt;p&gt;I don’t know why old DNS cache entries for the previous domain persist, or for how long, but I can provide a fallback that keeps stale requests from showing a different app. I’ll make sure to check the old server’s default behavior after future migrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check whether requests for the old domain reach the old server.&lt;/li&gt;
&lt;li&gt;Check whether the relevant vhost remains and how nginx handles unmatched requests.&lt;/li&gt;
&lt;li&gt;Configure &lt;code&gt;server_name _&lt;/code&gt; with HTTP &lt;code&gt;return 444&lt;/code&gt; and HTTPS &lt;code&gt;ssl_reject_handshake on&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Verify existing sites and the certbot dry-run.&lt;/li&gt;
&lt;li&gt;The cause of the TTL 3600-second record remaining for 4432 seconds is unconfirmed.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nginx</category>
      <category>dns</category>
      <category>tls</category>
    </item>
    <item>
      <title>Why grep and URL Splitting Exposed Secrets 3 Times</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Mon, 09 Nov 2026 13:06:07 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-grep-and-url-splitting-exposed-secrets-3-times-d2</link>
      <guid>https://dev.to/orca_forge/why-grep-and-url-splitting-exposed-secrets-3-times-d2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/redacting-secrets-shown-three-times/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=redacting-secrets-shown-three-times" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR I was investigating settings across multiple AI sessions and intended to keep secrets out of the output. URL splitting and grep filtering still left paths for passwords to reach the screen. I now check whether values can pass through before displaying output.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;Splitting URLs or filtering lines with &lt;code&gt;grep&lt;/code&gt; cannot eliminate every path by which secrets may remain in the output; database, Redis, and object storage passwords were displayed. I decided to redact anything that might contain secrets with Python, then review the output before publishing it to check for any remaining paths through which values could leak.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Splitting a URL Also Displayed the Database Password
&lt;/h2&gt;

&lt;p&gt;In the initial output, I meant to extract only the host from a connection URL, but I ended up displaying the database administrator’s password too.&lt;/p&gt;

&lt;p&gt;To extract just the host from the connection URL, I used this split:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;://&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result kept the entire &lt;code&gt;user:password@host&lt;/code&gt; portion, so the database administrator’s password was displayed too.&lt;/p&gt;

&lt;p&gt;I wanted to extract only the host. But I hadn’t checked whether the result of splitting on delimiters included credentials. Even if the goal was “host only,” the code didn’t guarantee that.&lt;/p&gt;

&lt;p&gt;This output was one reason to recreate the values. I recreated the database and Redis values during the same night, from 00:24 to 00:54.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did &lt;code&gt;grep -A4&lt;/code&gt; Display the Redis Password?
&lt;/h2&gt;

&lt;p&gt;The second time, while inspecting a configuration file, I used &lt;code&gt;grep -A4&lt;/code&gt; to show the four lines after the matching line, and it displayed the Redis password.&lt;/p&gt;

&lt;p&gt;The plaintext Redis password on the adjacent line appeared in the output.&lt;/p&gt;

&lt;p&gt;The records don’t show whether this happened before or after the rebuild. I can’t fill in the sequence. What remains is the result: when a secret is on a neighboring line, a search that displays surrounding lines can expose it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why &lt;code&gt;grep -v "value:"&lt;/code&gt; Still Revealed the Root Password
&lt;/h2&gt;

&lt;p&gt;On the third attempt, at 00:4x, I ran &lt;code&gt;grep -v "value:"&lt;/code&gt; intending to exclude lines containing values. The object storage root password still appeared.&lt;/p&gt;

&lt;p&gt;The command to configure an alias for the object storage included the password as an argument. Because that line didn’t contain &lt;code&gt;value:&lt;/code&gt;, it remained in the output, exposing the root password.&lt;/p&gt;

&lt;p&gt;All three values had already been stored in plain text in the repository’s history. I rotated the storage root password at 01:02. Even though I had transformed the output to prevent exposure, there was still a path for the values under investigation to pass through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why &lt;code&gt;od -c | sed&lt;/code&gt; Still Failed to Redact the Token
&lt;/h2&gt;

&lt;p&gt;On October 10, I once again tried to hide a token with &lt;code&gt;od -c | sed&lt;/code&gt;, but its prefix appeared in the conversation log.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;od&lt;/code&gt; inserts spaces between characters, so the &lt;code&gt;sed&lt;/code&gt; replacement didn’t match. As a result, the token’s prefix appeared in the conversation log.&lt;/p&gt;

&lt;p&gt;I decided to ask for the token to be recreated. However, the record doesn’t say whether it was actually recreated. What we can confirm is only that I decided to request it.&lt;/p&gt;

&lt;p&gt;The three incidents that happened three days later looked like different approaches, but followed the same pattern. After a step that exposed a value, they split strings or filtered out lines. They didn’t check whether the value remained in the processed result before outputting it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Check for Secrets Before Outputting Results
&lt;/h2&gt;

&lt;p&gt;From here on, I decided to redact anything that might contain secrets with Python before outputting it.&lt;/p&gt;

&lt;p&gt;I don’t output the results of &lt;code&gt;grep -A&lt;/code&gt;, &lt;code&gt;grep -B&lt;/code&gt;, &lt;code&gt;grep -C&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;sed -n&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, or &lt;code&gt;git show&lt;/code&gt; as-is.&lt;/p&gt;

&lt;p&gt;When checking a URL, I use &lt;code&gt;urllib.parse.urlsplit&lt;/code&gt; to extract only the &lt;code&gt;hostname&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt;. When I need to compare values without revealing them, I use the beginning of their SHA-256 hashes. I also prepared a tool for this.&lt;/p&gt;

&lt;p&gt;Using a tool doesn’t make the output safe automatically. Before outputting anything, I reread it to check whether there’s still a path for values to leak through.&lt;/p&gt;

&lt;p&gt;It wasn’t enough to “write a command that hides secrets.” Each operation—splitting URLs, showing surrounding lines, and excluding lines by string—left a path for values to remain in the output.&lt;/p&gt;

&lt;p&gt;Whether you’re investigating production settings or asking an AI agent to do the investigation, you can pause before reading the output. Check not the name of the redaction process, but whether there’s any path for values to make it into the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;urllib.parse.urlsplit&lt;/code&gt; to extract only &lt;code&gt;hostname&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt; from a URL.&lt;/li&gt;
&lt;li&gt;Redact output that may contain secrets with Python before displaying it.&lt;/li&gt;
&lt;li&gt;Do not display &lt;code&gt;grep -A&lt;/code&gt;, &lt;code&gt;grep -B&lt;/code&gt;, &lt;code&gt;grep -C&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;sed -n&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, or &lt;code&gt;git show&lt;/code&gt; output directly.&lt;/li&gt;
&lt;li&gt;Before displaying output, check whether a value or a line containing it can still pass through.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>How to reduce AI character conversation breakdowns with prompt and turn changes</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Sun, 08 Nov 2026 13:00:04 +0000</pubDate>
      <link>https://dev.to/orca_forge/how-to-reduce-ai-character-conversation-breakdowns-with-prompt-and-turn-changes-2i2m</link>
      <guid>https://dev.to/orca_forge/how-to-reduce-ai-character-conversation-breakdowns-with-prompt-and-turn-changes-2i2m</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/ai-banter-collapse-23-to-0/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=ai-banter-collapse-23-to-0" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR The AI characters mixed catchphrases, JSON, and foreign languages into their dialogue and drifted off topic. Reviewing 403 utterances showed a 23% breakdown rate. Changing speaking styles, prompts, supplied context, and how often the topic was passed in affected the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Fixing only the speaking-style settings reduced the breakdown rate in AI character banter from 23% to 3%, but reviewing the source material and prompts alone did not eliminate breakdowns. Under a setup that supplied a topic every turn, removed unnecessary source material, and kept broken lines out of the conversation, the breakdown rate reached 0% in an evaluation that ran three topics for 24 turns each. This is an evaluation result; the knowledgeable character still made up some trivia.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the AI Characters’ Banter Fell Apart
&lt;/h2&gt;

&lt;p&gt;In the first 403 utterances I examined, stock phrases kept repeating, and JSON responses and foreign languages crept in. Then other characters picked up on the broken lines, and the whole conversation lost its way back to the prompt.&lt;/p&gt;

&lt;p&gt;At first, I thought the problem was the characters’ speaking styles. The logs pointed to settings of temperature 2, &lt;code&gt;frequency_penalty&lt;/code&gt; 2, and &lt;code&gt;typical_p&lt;/code&gt; 0.5 as the main causes. The instructions said, “Be foul-mouthed as hell” and “Never say anything sensible.” In trying to make the banter funny, I’d configured the characters to stray from ordinary conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Changing Speaking Styles Affected the Breakdown Rate
&lt;/h2&gt;

&lt;p&gt;The new speaking styles were: the lively one, the quick-witted one, the knowledgeable one, and the storyteller. We set the temperature to 0.9 and added four shared instructions: “Japanese only,” “1–2 sentences,” “don’t insult anyone,” and “connect to the previous topic.”&lt;/p&gt;

&lt;p&gt;First, when we evaluated the styles by changing only the speaking style, the breakdown rate fell from 23% to 3%. This showed that the configuration had a significant impact.&lt;/p&gt;

&lt;p&gt;But that wasn’t the end of the story. When we also removed the context given to the model, such as memories and summaries, the breakdown rate rose to 5%—higher than when we changed only the speaking style. The results didn’t show that removing things one by one would steadily improve performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Changed About Prompts and JSON Responses
&lt;/h2&gt;

&lt;p&gt;The previous prompt assigned roles like “the one who makes bold statements” and “the one who challenges them,” and prohibited agreement. As a result, everyone became a challenger.&lt;/p&gt;

&lt;p&gt;In the new prompt, we left the roles to each speaker’s style and added one concrete detail to the topic. We also added instructions not to insult anyone or pick up on garbled remarks or machine announcements. The breakdown rate with these conditions was 7%, higher than the 3% we got by changing only the speaking styles. The numbers don’t always go down with each revision.&lt;/p&gt;

&lt;p&gt;When we tried returning plain text, the breakdown rate fell to 2%, but the responses no longer included &lt;code&gt;tone&lt;/code&gt; and &lt;code&gt;emotion&lt;/code&gt;, which drive expressions and movement. Since we wanted to keep that functionality, we didn’t adopt the plain-text-only approach.&lt;/p&gt;

&lt;p&gt;Instead, we kept the JSON format with &lt;code&gt;tone&lt;/code&gt; and &lt;code&gt;emotion&lt;/code&gt;, and tested a constraint that forced the model to return responses in that format. The breakdown rate was 2%, and 100% of responses included &lt;code&gt;tone&lt;/code&gt; and &lt;code&gt;emotion&lt;/code&gt;. We also needed a fallback to remove the format constraint and retry for providers that don’t support it.&lt;/p&gt;

&lt;p&gt;For evaluation, we stopped comparing impressions by watching the screen. We used the same prompt as the product and ran multiple topics and turns from an empty scene, comparing results for each condition. The product and evaluation script build prompts from shared components. Using different text just for evaluation would make it harder to compare those results with what happens in the product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can the Conversation Keep Going If You Pass the Topic on Every Turn?
&lt;/h2&gt;

&lt;p&gt;Even with well-formed replies, a conversation won’t come together if the topic doesn’t carry through. In a real-device log, the topic “time machine” had drifted by the fourth round to “slamming a baguette down at a bakery.” That was because the topic had only been passed in the first turn.&lt;/p&gt;

&lt;p&gt;So I added the topic to every turn’s prompt and set it to switch to a new one after 12 turns. When the user speaks, the topic is cleared. I also stopped saving back-and-forth turns in the conversation history with the user. Leaving them in the history mixed small talk into the material used to reply to the user, and rebuilding the summary every time the history was updated was also slowing things down.&lt;/p&gt;

&lt;p&gt;I also narrowed down what gets passed to the model. For back-and-forth turns, I leave out conversation history, memory, capabilities, procedures, and summaries, and use the latest eight lines from the room as clues for continuing. More information doesn’t always make for a better conversation. In this case, I kept out material that wasn’t needed for small talk.&lt;/p&gt;

&lt;p&gt;Malformed text, such as an unfinished JSON fragment or Chinese text, is neither spoken nor saved to the room. This prevents the next character from picking up a broken utterance and trapping the whole room in a conversation it can’t escape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conditions That Brought the Breakdown Rate to 0%
&lt;/h2&gt;

&lt;p&gt;Finally, we evaluated a setup that provides a topic for every turn, switches topics every 12 turns, and prohibits making things up. In a comparison that ran each of three topics through 24 turns, the breakdown rate fell from 3% before the changes to 0% afterward. Insults remained at 0% in both setups, and replies with tone and emotion remained at 100%. After the changes, the conversation stayed on topic through turn 12, and off-topic replies decreased noticeably.&lt;/p&gt;

&lt;p&gt;However, 0% is the result for this evaluation. The trivia from the “knowledgeable” participant still included fabrications. Even after we added instructions to use only reliable knowledge and avoid inventing numbers or proper nouns, fabrications did not disappear entirely.&lt;/p&gt;

&lt;p&gt;What we learned is that adjusting speaking-style values alone was not enough to prevent the banter from breaking down. We revisited the prompt, the material provided, the reply format, and how topics were supplied, then evaluated them using the same components as the product. We needed to check not only which setup lowered the numbers, but also what remained when we changed each part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Record the breakdown rate and symptoms such as catchphrases, JSON, and foreign languages.&lt;/li&gt;
&lt;li&gt;Evaluate a speaking style change on its own and compare the breakdown rate.&lt;/li&gt;
&lt;li&gt;Review prompts and supplied context, and compare conditions that pass the topic every turn.&lt;/li&gt;
&lt;li&gt;Check that JSON replies include tone and emotion and that malformed text does not remain in the conversation.&lt;/li&gt;
&lt;li&gt;Evaluate multiple topics and turns with the same prompt used in production, and check for remaining fabricated facts.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
    </item>
    <item>
      <title>Double Transform Causes Fingertips to Flip Toward the Back of the Hand</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Sat, 07 Nov 2026 13:00:20 +0000</pubDate>
      <link>https://dev.to/orca_forge/double-transform-causes-fingertips-to-flip-toward-the-back-of-the-hand-2b93</link>
      <guid>https://dev.to/orca_forge/double-transform-causes-fingertips-to-flip-toward-the-back-of-the-hand-2b93</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/connected-bones-transformed-twice/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=connected-bones-transformed-twice" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I rigged the fingers and made them curl into a fist, but the fingertips bent backward toward the back of the hand instead of curling toward the palm. A rig moves a mesh—a collection of vertices that forms a shape—based on bone movement. I confirmed that the vertices were moving and said, “It was set up correctly.” But when I checked the finger movement in the viewer, the joints were out of place. In this article, I’ll explain the double transformation that caused the misalignment and the checks I added after fixing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion first
&lt;/h2&gt;

&lt;p&gt;The reason the fingertips flipped toward the back of the hand when I made a fist was that the same transform was applied twice: once to the tail of a parent bone and again to the head of its connected child. The arm correction logic kept transforming coordinates that had already been moved instead of using the original coordinates. After saving the coordinates before processing and checking both joint positions and fist movement, I found that the fingertips moved 58–72 mm toward the wrist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Moving the Vertices Mean the Finger Rig Is Correct?
&lt;/h2&gt;

&lt;p&gt;“Are the fingers rigged correctly? Does each of the five fingers move as it should?”&lt;/p&gt;

&lt;p&gt;I answered, “They were rigged correctly,” but that answer was wrong. I had only checked the vertex assignments, not how the fingers themselves moved. There were 30 finger bones in total, and when I tested them by bending each bone one at a time, the vertices assigned to each bone moved.&lt;/p&gt;

&lt;p&gt;The vertex counts were 129/129 for the thumb, 130/133 for the index finger, 121/121 for the middle finger, 126/129 for the ring finger, and 119/124 for the little finger. Looking at these results, I concluded that the finger rig was correct.&lt;/p&gt;

&lt;p&gt;This test only showed that the vertices moved when I bent a bone. It did not tell me whether the fingers would bend naturally at the joints when making a fist. The question was, “Does each of the five fingers move as it should?” But I had not run a test that could answer it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the Viewer Showed Misaligned Bones and Finger Joints
&lt;/h2&gt;

&lt;p&gt;When I checked the left index finger in the viewer, the mesh joints were at these positions:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0.634–0.660 / 0.660–0.673 / 0.674–0.691&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After the arm correction, however, the bones were positioned like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0.635→0.615 / 0.615→0.624 / 0.624→0.681&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The first bone pointed toward the wrist, and the rotation centers of the second and third joints were set 1–2 cm inside the palm. At the previous stage, the position was &lt;code&gt;0.684→0.7125&lt;/code&gt;, which was correct.&lt;/p&gt;

&lt;p&gt;When I measured fingertip movement, the fingers moved 37–50 mm when lightly clenched. With a tight clench, they moved 68–109 mm and flipped over toward the back of the hand; the thumb also moved 95 mm. I had confirmed that the vertices followed the bones, but the joint positions and the movement when clenching were still problematic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did Connected Bones Get Transformed Twice?
&lt;/h2&gt;

&lt;p&gt;Tracing the cause led me to the arm correction logic, which transformed each bone’s head (start point) and tail (end point):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tail&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This applies the transform separately to the bone’s head and tail. However, Intermediate and Distal had &lt;code&gt;use_connect=True&lt;/code&gt; (connected to their parent bones). When bones are connected, moving the parent’s tail also moves the child’s head.&lt;/p&gt;

&lt;p&gt;As a result, after transforming the parent’s tail, the code transformed the child’s head too, applying &lt;code&gt;tf&lt;/code&gt; (the coordinate transform) twice to the same position.&lt;/p&gt;

&lt;p&gt;I thought I was transforming each bone’s coordinates independently. But connected bones don’t have independent positions. I transformed the child’s head again without accounting for how moving the parent also affects the child.&lt;/p&gt;

&lt;p&gt;The same issue occurred in another section, where a 0.924× transform was applied twice. This bug had persisted in every build since the arm correction.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Fixed the Double Transform and Checked Finger Movement
&lt;/h2&gt;

&lt;p&gt;Before applying the transform, I saved the original &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;tail&lt;/code&gt; values, then applied the transform to those saved values. In other words, I passed the original coordinates to &lt;code&gt;tf(orig)&lt;/code&gt; instead of coordinates that had already been transformed.&lt;/p&gt;

&lt;p&gt;I also added finger checks. I verified that the dot product—a value indicating how closely the bone directions align—was greater than 0.5; the minimum was 0.56. Joints were placed within 3 mm of the corresponding bone segments, and the root bones were allowed up to 6 mm.&lt;/p&gt;

&lt;p&gt;After the fix, making a fist moved the fingertips 58–72 mm toward the wrist and 21–26 mm downward. The thumb moved 51 mm. In the 16-pose out-of-bounds check, the hand values went from 177–182 down to 21–22, and there were no NaNs (values that cannot be treated as numbers).&lt;/p&gt;

&lt;p&gt;No before-and-after comparison images were saved. The comparisons here are based on the recorded coordinates and measurements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Corrected My “It’s Set Up Correctly” Answer
&lt;/h2&gt;

&lt;p&gt;At 06:05, I said, “It was set up correctly.” Ten minutes later, a viewer check revealed that the finger bones and joints were misaligned.&lt;/p&gt;

&lt;p&gt;“I told you earlier that it was set up correctly, but that was wrong.”&lt;/p&gt;

&lt;p&gt;I had only checked the vertex assignments. Bending each bone individually to see whether the vertices move can confirm the assignments. But it doesn’t show that the joints bend in the right places when the whole hand goes through the process.&lt;/p&gt;

&lt;p&gt;The cause was treating connected bones as separate points and applying the same transformation to the parent’s tail and the child’s head. To fix it, I saved the original coordinates before transforming them, and added checks for joint positions and fingertip movement.&lt;/p&gt;

&lt;p&gt;Whether vertices are assigned to bones and whether those bones make the fingers move as intended are two separate things to verify. I checked only the first and mistakenly said the second was correct too.&lt;/p&gt;

&lt;h2&gt;
  
  
  If You Run Into the Same Problem
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Curl the finger and check whether the fingertip moves toward the palm or the back of the hand.&lt;/li&gt;
&lt;li&gt;In the viewer, compare the mesh joints with the bone positions.&lt;/li&gt;
&lt;li&gt;Check that the original head and tail are saved before the conversion process passes them to &lt;code&gt;tf(orig)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In addition to bending each bone one at a time, check the joint positions and how the fingertips move when the hand is curled.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>3d</category>
    </item>
    <item>
      <title>Why a Stop Hook JSON Error Came from printf %b</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:06:31 +0000</pubDate>
      <link>https://dev.to/orca_forge/why-a-stop-hook-json-error-came-from-printf-b-5aap</link>
      <guid>https://dev.to/orca_forge/why-a-stop-hook-json-error-came-from-printf-b-5aap</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/hook-json-printf-percent-b-breaks/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=hook-json-printf-percent-b-breaks" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR The Stop hook reported &lt;code&gt;Unterminated string&lt;/code&gt; because &lt;code&gt;printf&lt;/code&gt; with &lt;code&gt;%b&lt;/code&gt; emitted a raw newline inside a JSON string. The hook also used a &lt;code&gt;cd&lt;/code&gt; path fixed to an earlier environment. Its change count missed staged and untracked files when it checked only &lt;code&gt;git diff --name-only&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;The Stop hook error &lt;code&gt;Hook output looks like a JSON object but is not valid JSON — JSON Parse error: Unterminated string.&lt;/code&gt; occurred because the &lt;code&gt;printf&lt;/code&gt; command’s &lt;code&gt;%b&lt;/code&gt; format specifier emitted a raw newline inside a JSON string. I changed the hook to build JSON with Python’s &lt;code&gt;json.dumps&lt;/code&gt; function, which converts values into JSON-formatted strings, and also reviewed where it runs and how Git changes are counted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did the Stop Hook JSON Report “Unterminated string”?
&lt;/h2&gt;

&lt;p&gt;The direct cause of the JSON error was that &lt;code&gt;printf&lt;/code&gt;’s &lt;code&gt;%b&lt;/code&gt; format specifier output the newlines in the string as-is.&lt;/p&gt;

&lt;p&gt;The error was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hook output looks like a JSON object but is not valid JSON — JSON Parse error: Unterminated string.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;printf&lt;/code&gt; is a command for writing output such as strings. When you use &lt;code&gt;%b&lt;/code&gt; in its format, any newlines in the string are reflected in the output. As a result, a raw newline ended up inside a JSON string, making it look as though the string had been cut off. &lt;code&gt;Unterminated string&lt;/code&gt; means that a string was never closed.&lt;/p&gt;

&lt;p&gt;At first, I thought I had made a mistake in the JSON structure somewhere in the code that reports changes. The error message told me the output was malformed, but not which value caused it, so I checked the code that builds the JSON.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is Your Stop Hook Still Running in the Previous Environment?
&lt;/h2&gt;

&lt;p&gt;The issue I found beyond the JSON was that the &lt;code&gt;cd&lt;/code&gt; at the start of the process still pointed to a location from the previous environment.&lt;/p&gt;

&lt;p&gt;Even when that directory change failed, the process continued. To produce the correct output, you also need to check where the hook is running commands. I changed it to determine the location at runtime instead of hardcoding it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Was Missing When Counting Git Changes
&lt;/h2&gt;

&lt;p&gt;I was only checking &lt;code&gt;git diff --name-only&lt;/code&gt;, so staged changes and untracked files were left out.&lt;/p&gt;

&lt;p&gt;Staged changes are changes added to Git for a commit. Untracked files are files Git has not yet recognized as being under version control. Since the goal is to notify about uncommitted changes, a method that picks up only some of them results in incomplete notifications.&lt;/p&gt;

&lt;p&gt;I changed the count to use &lt;code&gt;git status --porcelain=v1 -z&lt;/code&gt;. Fixing the JSON error alone would not solve the issue of missing changes in the count.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Fixed the JSON and Change Notifications
&lt;/h2&gt;

&lt;p&gt;I revised three things: where the script runs, how it checks for changes, and how it builds JSON.&lt;/p&gt;

&lt;p&gt;First, I removed the &lt;code&gt;cd&lt;/code&gt; command that hardcoded the previous environment’s location and made the script determine its location at runtime. Next, I counted changes with &lt;code&gt;git status --porcelain=v1 -z&lt;/code&gt; and included staged and untracked files in the check. Finally, I stopped assembling JSON manually with the shell’s &lt;code&gt;printf&lt;/code&gt; and used Python’s &lt;code&gt;json.dumps&lt;/code&gt; instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does the Output Remain Valid JSON When Filenames Contain Newlines and Other Special Characters?
&lt;/h2&gt;

&lt;p&gt;After the fix, I checked the output with filenames containing quotation marks, backslashes, newlines, Japanese characters, and spaces.&lt;/p&gt;

&lt;p&gt;Before the fix, the output was malformed. Afterward, it was correct. Producing a string that looks like JSON isn’t enough; I also verified that the output is valid JSON for filenames containing the characters that caused the issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  We Don’t Know When the Stop Hook Broke
&lt;/h2&gt;

&lt;p&gt;Because the configuration was outside Git and had no change history, I couldn’t determine when it broke.&lt;/p&gt;

&lt;p&gt;The causes I confirmed this time were raw newlines in a JSON string, an outdated execution location, and an incomplete set of changes being counted. The hook failed without stopping the work, and I only checked after seeing an error. The fact that work continues does not prove that the hook is working correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Build JSON with Python's &lt;code&gt;json.dumps&lt;/code&gt; instead of shell &lt;code&gt;printf&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Resolve the working directory at runtime instead of keeping an old fixed &lt;code&gt;cd&lt;/code&gt; path.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;git status --porcelain=v1 -z&lt;/code&gt; to count staged and untracked files too.&lt;/li&gt;
&lt;li&gt;Check output with filenames containing quotes, backslashes, newlines, Japanese text, and spaces.&lt;/li&gt;
&lt;li&gt;The configuration had no change history, so when the hook broke is unknown.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>json</category>
      <category>git</category>
    </item>
    <item>
      <title>How to diagnose GitHub Actions storage limits and deploy an Astro blog to Cloudflare</title>
      <dc:creator>orca forge</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:06:23 +0000</pubDate>
      <link>https://dev.to/orca_forge/how-to-diagnose-github-actions-storage-limits-and-deploy-an-astro-blog-to-cloudflare-33a6</link>
      <guid>https://dev.to/orca_forge/how-to-diagnose-github-actions-storage-limits-and-deploy-an-astro-blog-to-cloudflare-33a6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📝 Originally published (in Japanese) at &lt;a href="https://forge.workstyle.tech/blog/github-actions-storage-quota-to-cloudflare/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=github-actions-storage-quota-to-cloudflare" rel="noopener noreferrer"&gt;forge.workstyle.tech&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TL;DR The setup is an Astro static site deployed to GitHub Pages with GitHub Actions, with DNS managed by Cloudflare. After two blog posts were rewritten and pushed on 2026-09-28, deployment failed because Actions storage had reached its limit. The blog had one remaining artifact of about 20MB, while a larger artifact in another repository in the same account was the main cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Check the storage limit on the billing page
&lt;/h2&gt;

&lt;p&gt;First, check your Actions storage, Packages storage, and Actions minutes on GitHub’s billing page. Storage and execution time are separate categories, so check both.&lt;/p&gt;

&lt;p&gt;Here’s what my account showed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Actions storage   2GB / 2GB
Packages storage  0GB
Actions minutes   512 / 3,000 minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Actions storage had reached its limit, while I still had minutes available. The page said, “Your quota resets in 3 days.”&lt;/p&gt;

&lt;p&gt;A common pitfall is to look only at the artifacts in the repository where the workflow failed and assume that they explain the problem. When I first checked, the blog repository had just one artifact, about 20 MB in size. Even so, the storage limit had been reached.&lt;/p&gt;

&lt;p&gt;During deployment, I got this error. Retrying twice produced the same result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Failed to CreateArtifact: Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you see this message, check your account-wide Actions storage, not just the artifact list in the repository where the workflow failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Compare Monthly Billing API Data Against Each Repository
&lt;/h2&gt;

&lt;p&gt;Next, check the target month’s Actions storage through the billing API. The number to look at isn’t just the total size of artifacts currently stored. It’s the total in GB-hours, which combines storage size and retention time.&lt;/p&gt;

&lt;p&gt;In my case, Actions storage for September came to 1,488 GB-hours. The charge was attributed to the blog repository, but that didn’t match how the blog used storage.&lt;/p&gt;

&lt;p&gt;The blog had 52 deployments that month. Each artifact was about 20 MB and was retained for one day. Based on that, its estimated monthly usage was around 25 GB-hours—a large gap from 1,488 GB-hours.&lt;/p&gt;

&lt;p&gt;When you find a gap like this, check the other repositories in the same account too. In my case, the cause was Windows builds for a desktop app. Each build produced an artifact of about 340 MB, retained for seven days, which came to around 57 GB-hours per build. The Windows builds ran for 237 minutes in September.&lt;/p&gt;

&lt;p&gt;I also checked the monthly cost breakdown. The account total was $3.57, of which $2.87—about 80%—came from that repository.&lt;/p&gt;

&lt;p&gt;It’s easy to assume that the repository shown in the billing breakdown is the one that actually created the artifacts. Even if the charge is attributed to the blog, compare it with the GB-hours estimated from the blog’s deployment count and artifact sizes, then investigate artifacts from other repositories.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Shorten the Retention Period for Large Artifacts
&lt;/h2&gt;

&lt;p&gt;In the Windows build that caused the issue, artifacts were retained for 7 days. The first step is to shorten the retention period to 1 day. In my case, this reduced usage per run from about 57 GB-hours to about 8 GB-hours.&lt;/p&gt;

&lt;p&gt;If your Actions workflow stores artifacts, review &lt;code&gt;retention-days&lt;/code&gt; in the settings for the relevant upload step. For example, if it’s set to 7, change it to 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Example configuration&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;retention-days&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A common pitfall is shortening the retention period for files that need to remain available as Actions artifacts. In my case, I decided to attach the Windows installer to a Release instead. Releases don’t count toward Actions storage, so there was no need to keep the installer as an Actions artifact for 7 days.&lt;/p&gt;

&lt;p&gt;After making the change, confirm that the new retention period is configured for artifacts in the target workflow. Monthly usage figures may take a while to decrease. The error message in this case said that usage is recalculated every 6–12 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Configure Static Asset Delivery with Workers
&lt;/h2&gt;

&lt;p&gt;Even after reviewing the retention period, my blog deployment still depended on uploading artifacts through Actions. I decided to move the blog to Cloudflare.&lt;/p&gt;

&lt;p&gt;Before migrating, I checked the size of the site. It was 26 MB across 194 files, including 96 images. The largest image was 0.66 MB. That fit within the free-tier limits of 20,000 files per deployment and 25 MiB per file.&lt;/p&gt;

&lt;p&gt;I first ran &lt;code&gt;wrangler pages project create&lt;/code&gt;, but it delegated to Workers instead of Pages and stopped with this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Missing entry-point to Worker script or to assets directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Today, use static asset delivery with Workers instead of Pages. Set Astro’s build output directory, &lt;code&gt;dist&lt;/code&gt;, as the directory to serve. My &lt;code&gt;wrangler.jsonc&lt;/code&gt; configuration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"forge-blog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compatibility_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-09-28"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"assets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"directory"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./dist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"html_handling"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"auto-trailing-slash"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;html_handling&lt;/code&gt; controls how trailing slashes in URLs are handled. Once the configuration file is in place, build and deploy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx astro build
npx wrangler deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One common snag is configuring a 404 page that doesn’t exist. I initially tried setting &lt;code&gt;not_found_handling&lt;/code&gt; to &lt;code&gt;404-page&lt;/code&gt;, but &lt;code&gt;dist&lt;/code&gt; didn’t contain a &lt;code&gt;404.html&lt;/code&gt;, so I removed that setting. Check that your configuration matches the files the build actually generates.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Switching DNS and the Publishing Script
&lt;/h2&gt;

&lt;p&gt;Once the site is deployed to Workers, point the domain to it. Cloudflare already managed DNS for my blog.&lt;/p&gt;

&lt;p&gt;I deleted the &lt;code&gt;forge&lt;/code&gt; CNAME record (which pointed to &lt;code&gt;github.io&lt;/code&gt;) and added a custom domain to the Worker. There was a brief outage of a few minutes during the switch. Plan for when you’ll make the DNS change and allow for a short interruption in service.&lt;/p&gt;

&lt;p&gt;A common pitfall is changing DNS but leaving the publishing process as it was. I updated &lt;code&gt;scripts/publish.sh&lt;/code&gt; to commit and push the articles, then build Astro locally and deploy with Wrangler. The relevant part of the publishing script looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx astro build
npx wrangler deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I kept the GitHub Pages workflow as a rollback option. It no longer runs on push; it can only be triggered manually. Here’s the configuration for that workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;workflow_dispatch&lt;/code&gt; enables manual runs. Verify that the normal publishing path and the rollback workflow each run under the intended conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Verify URLs and Responses After Launch
&lt;/h2&gt;

&lt;p&gt;After switching over, don’t stop at checking whether the homepage loads. Check the homepage, an article page, the RSS feed, and &lt;code&gt;robots.txt&lt;/code&gt;. After my migration, all of them returned HTTP 200. The &lt;code&gt;server&lt;/code&gt; response header was &lt;code&gt;cloudflare&lt;/code&gt;, and the Google Analytics tag was still present.&lt;/p&gt;

&lt;p&gt;Replace these example URLs with the ones for your actual site.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://forge.workstyle.tech/
curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://forge.workstyle.tech/article-slug/
curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://forge.workstyle.tech/rss.xml
curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://forge.workstyle.tech/robots.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check more than the HTTP status: confirm that the response headers include &lt;code&gt;server: cloudflare&lt;/code&gt; and that the pages that need it contain the analytics tag. Use the actual path to an article on your site.&lt;/p&gt;

&lt;p&gt;A common pitfall is to consider the migration complete after checking only the homepage. Verify individually that the RSS feed and &lt;code&gt;robots.txt&lt;/code&gt; are still served as before, and that article pages return 200 as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check Actions storage separately from execution time on the billing page.&lt;/li&gt;
&lt;li&gt;Compare monthly GB-hours from the billing API with artifact size, retention period, and run count across repositories.&lt;/li&gt;
&lt;li&gt;Shorten retention for large artifacts and use a separate storage location for files that need to remain available longer.&lt;/li&gt;
&lt;li&gt;After moving the blog to Cloudflare Workers, configure the regular publish path and a rollback path, then check article pages, RSS, and robots.txt.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>githubactions</category>
      <category>cloudflare</category>
      <category>astro</category>
    </item>
  </channel>
</rss>
