<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Ted Mwai | TedCraft Engineering Ledger</title><description>Field notes on high-assurance platform verification, access governance, production systems, and root-cause engineering post-mortems.</description><link>https://tedcraft.dev/</link><language>en-us</language><managingEditor>ted@tedcraft.dev (Ted Mwai)</managingEditor><webMaster>ted@tedcraft.dev (Ted Mwai)</webMaster><copyright>Copyright 2026 Ted Mwai</copyright><atom:link href="https://tedcraft.dev/rss.xml" rel="self" type="application/rss+xml"/><atom:link href="https://pubsubhubbub.appspot.com/" rel="hub"/><item><title>Dissecting a Phantom Logic Board Short: Live iOS Console Forensics Across BFU, Wi-Fi LQM, and USB-C PD</title><link>https://tedcraft.dev/blog/ios-thermal-charging-forensics/</link><guid isPermaLink="true">https://tedcraft.dev/blog/ios-thermal-charging-forensics/</guid><description>When an iPhone 16 stopped negotiating USB-C Power Delivery and spiked hot over the A18 SoC on boot, isolating BFU vs. AFU states, wifid Link Quality Metrics, and live macOS Console logs uncovered two independent software bugs masquerading as one dead logic board.</description><pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Compound software failures are dangerous because they impersonate catastrophic hardware faults. When two independent subsystem regressions strike at the same time, Occam’s Razor nudges you toward a single physical explanation—often an expensive and wrong one.&lt;/p&gt;
&lt;p&gt;One evening, my iPhone 16 exhibited three symptoms simultaneously:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Zero-watt rejection on USB-C Power Delivery&lt;/strong&gt;: Plugged into a known-good laptop USB-C PD brick, it drew &lt;code&gt;0W&lt;/code&gt; and refused to initiate charging.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Legacy trickle fallback over host USB&lt;/strong&gt;: Connected via USB-C to a MacBook Pro, it barely trickled upward.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Immediate top-third thermal spike&lt;/strong&gt;: Seconds after booting, the upper third of the chassis—directly over the A18 SoC and logic board—grew rapidly hot.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Taken together, failed USB-C PD negotiation on &lt;code&gt;CC1&lt;/code&gt;/&lt;code&gt;CC2&lt;/code&gt; plus localized heat over the main logic board looks exactly like a shorted Power Management IC (PMIC) or damaged USB-C controller dumping current as heat. Before condemning the board or risking battery swelling on high-wattage rails, we treated the device like a black-box production incident and isolated each boundary one layer at a time.&lt;/p&gt;
&lt;h2 id=&quot;symptoms-that-mimicked-a-dead-logic-board&quot;&gt;Symptoms that mimicked a dead logic board&lt;/h2&gt;
&lt;p&gt;A true power-rail short or PMIC fault conducts regardless of whether user-space daemons are running. Conversely, an operating system daemon storm only burns power once its execution context is unlocked and scheduled.&lt;/p&gt;
&lt;p&gt;Rather than guessing or factory-wiping diagnostic evidence, we structured the triage around four strict boundaries:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Physical charging path&lt;/strong&gt;: Inductive MagSafe rails vs. wired USB-C &lt;code&gt;CC1&lt;/code&gt;/&lt;code&gt;CC2&lt;/code&gt; Power Delivery negotiation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cryptographic boot boundary&lt;/strong&gt;: &lt;strong&gt;Before First Unlock (BFU)&lt;/strong&gt; vs. &lt;strong&gt;After First Unlock (AFU)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Radio physical/link layer&lt;/strong&gt;: Airplane Mode vs. Cellular/Bluetooth vs. 5 GHz Wi-Fi Link Quality Metrics (&lt;code&gt;wifid&lt;/code&gt; LQM).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Booted kernel power stack vs. powered-off firmware&lt;/strong&gt;: Wired USB-C charging with iOS booted vs. powered completely off.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;step-1-isolating-power-rails-and-bfu-vs-afu&quot;&gt;Step 1: Isolating power rails and BFU vs. AFU&lt;/h2&gt;
&lt;p&gt;First priority was verifying whether an electrical short existed on the battery or wireless charging rails:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Inductive rail check&lt;/strong&gt;: Placed on a MagSafe puck, the phone charged smoothly up to its &lt;code&gt;90%&lt;/code&gt; limit in normal time with &lt;strong&gt;zero abnormal heat&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Before First Unlock (BFU) soak&lt;/strong&gt;: Next, I powered the iPhone on and left it sitting on the passcode screen—before entering the passcode for the first time since boot—for roughly an hour. In &lt;code&gt;BFU&lt;/code&gt;, Data Protection (&lt;code&gt;NSFileProtectionComplete&lt;/code&gt; / &lt;code&gt;CompleteUntilFirstUserAuthentication&lt;/code&gt;) keeps user-space vaults encrypted and prevents third-party background daemons and sync queues from initializing. &lt;strong&gt;The chassis stayed completely cool.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After First Unlock (AFU) trigger&lt;/strong&gt;: The exact second I entered my passcode (&lt;code&gt;AFU&lt;/code&gt;), the top third over the SoC spiked hot. I powered the phone down immediately and placed it back on MagSafe; it cooled down almost instantly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That three-step test cleared the battery, wireless charging circuitry, and idle standby power rails without opening the enclosure. The heat source was unequivocally an active software workload launching across the &lt;code&gt;BFU -&amp;gt; AFU&lt;/code&gt; decryption boundary.&lt;/p&gt;
&lt;h2 id=&quot;step-2-streaming-live-console-logs-and-filtering-red-herrings&quot;&gt;Step 2: Streaming live Console logs and filtering red herrings&lt;/h2&gt;
&lt;p&gt;Instead of speculating about which process woke up on unlock, I connected the locked iPhone to macOS &lt;strong&gt;Console.app&lt;/strong&gt; over USB-C, started live unified log streaming, and entered the passcode to capture the exact &lt;code&gt;BFU -&amp;gt; AFU&lt;/code&gt; transition.&lt;/p&gt;
&lt;p&gt;Filtering initially on &lt;code&gt;thermal&lt;/code&gt; surfaced an immediate trap—&lt;code&gt;thermalmonitord&lt;/code&gt; throwing two &lt;code&gt;&amp;lt;Error&amp;gt;&lt;/code&gt; lines every 5 seconds on the clock:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  thermalmonitord  &amp;lt;Error&amp;gt; could not find `cpu-avg-limiter-input-w2r property&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  thermalmonitord  &amp;lt;Error&amp;gt; Failed to read `cpu-avg-limiter-input-w2r&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In live triage, periodic error logs from a thermal daemon look like a smoking gun. In reality, missing &lt;code&gt;cpu-avg-limiter-input-w2r&lt;/code&gt; property lookups fire routinely on completely cool, healthy iPhones. Relying on keyword-matched error logs without checking baseline behavior guarantees chasing ghosts.&lt;/p&gt;
&lt;p&gt;Pivoting the Console filter to exclude &lt;code&gt;thermalmonitord&lt;/code&gt; (&lt;code&gt;Process != thermalmonitord&lt;/code&gt;) also let us check &lt;code&gt;IOAccessoryManager&lt;/code&gt; and &lt;code&gt;PortManager&lt;/code&gt;: there was &lt;strong&gt;no hardware interrupt storm&lt;/strong&gt; from the USB-C port controller—ruling out a shorted port spamming the CPU with interrupts—though two isolated power-stack errors appeared during &lt;code&gt;AFU&lt;/code&gt; initialization that would become crucial later:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  accessoryd      Auth timeout setAuthenticationStatus: failed!&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  kernel          AppleSMCFamily::handleSMCResult ERROR in _writeKeyGated. WAFC kSMCBadArgumentError(0x89)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;step-3-peeling-back-layer-one-vpn-enobufs-and-shortcuts&quot;&gt;Step 3: Peeling back layer one (VPN ENOBUFS and Shortcuts)&lt;/h2&gt;
&lt;p&gt;With &lt;code&gt;thermalmonitord&lt;/code&gt; excluded, the &lt;code&gt;AFU&lt;/code&gt; error stream exposed a real user-space collision: a wedged &lt;code&gt;utun&lt;/code&gt; VPN tunnel (&lt;code&gt;Connect On Demand&lt;/code&gt;) failing IPv6 configuration and flooding kernel socket buffer exhaustion (&lt;code&gt;ENOBUFS&lt;/code&gt;, errno &lt;code&gt;55&lt;/code&gt;) while colliding with a recurring &lt;code&gt;BackgroundShortcutRunner&lt;/code&gt; automation and starving system cloud daemons (&lt;code&gt;cloudd&lt;/code&gt;, &lt;code&gt;akd&lt;/code&gt;) into &lt;code&gt;-1001&lt;/code&gt; request timeouts:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  kernel  utun_output - ctl_enqueuembuf failed: 55&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  kernel  Sandbox: BackgroundShortcutRunner(&amp;lt;PID&amp;gt;) deny(1) file-issue-extension ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error  cloudd  NetworkingError NSURLErrorDomain/-1001&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Alongside a looping Home Screen widget hitting &lt;code&gt;chronod&lt;/code&gt; reload watchdogs, this was classic background churn. I disabled &lt;code&gt;Connect On Demand&lt;/code&gt; on the VPN profile, turned off the Shortcuts automations, and removed the looping widget.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;utun_output&lt;/code&gt; &lt;code&gt;ENOBUFS&lt;/code&gt; storm vanished immediately from Console. &lt;strong&gt;Yet the top third of the phone still ran hot.&lt;/strong&gt; Layer one was real noise, not the primary thermal driver.&lt;/p&gt;
&lt;h2 id=&quot;step-4-per-radio-isolation-and-clearing-wi-fi-silicon-via-lqm&quot;&gt;Step 4: Per-radio isolation and clearing Wi-Fi silicon via LQM&lt;/h2&gt;
&lt;p&gt;Next, I isolated the wireless radios one at a time while monitoring chassis heat and the live Console stream:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Airplane Mode (Wi-Fi, Bluetooth, Cellular off)&lt;/strong&gt;: Cool, completely normal idle temperatures.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bluetooth + Cellular on (Wi-Fi off)&lt;/strong&gt;: Slight, expected baseline warmth.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wi-Fi toggled on&lt;/strong&gt;: Instant top-third heat spike accompanied by a burst of Console activity.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At face value, “phone overheats exclusively when Wi-Fi is enabled” points straight to a failing Wi-Fi/Bluetooth module struggling to maintain association or amplifying retransmissions at max TX power.&lt;/p&gt;
&lt;p&gt;Reading the &lt;code&gt;wifid&lt;/code&gt; &lt;strong&gt;Link Quality Metric (LQM)&lt;/strong&gt; telemetry in Console disproved that hardware hypothesis immediately:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;wifid  LQM-WiFi: WeightAvgLQM rssi=-52 snr=35 txRate=866667 rxRate=780000&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;wifid  LQM-WiFi: (HighBand) txRTSFail=0 txPhyError=0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;wifid  WiFiLQAMgrLinkRecommendationNotify: ... txPer=0.0%&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A &lt;code&gt;-52 dBm&lt;/code&gt; RSSI, &lt;code&gt;35 dB&lt;/code&gt; SNR, &lt;code&gt;866 Mbps&lt;/code&gt; 5 GHz link rate, zero PHY errors (&lt;code&gt;txPhyError=0&lt;/code&gt;), zero RTS failures, and &lt;code&gt;0.0%&lt;/code&gt; transmit packet error rate (&lt;code&gt;txPer=0.0%&lt;/code&gt;) is a textbook healthy RF path. The Wi-Fi silicon wasn’t damaged—it was being &lt;strong&gt;saturated&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Looking two lines deeper in &lt;code&gt;wifid&lt;/code&gt; and &lt;code&gt;nsurlsessiond&lt;/code&gt; showed why:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;wifid          LQM-WiFi: TX(&amp;lt;BSSID&amp;gt;) AC&amp;lt;...&amp;gt; BK&amp;lt;2026 0 0 0 0 0 0 0 0 0 0&amp;gt; (5001ms)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;nsurlsessiond  nw_flow_notify [... unsatisfied (Interface type &apos;cellular&apos; is prohibited by parameters)]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every 5 seconds, &lt;code&gt;wifid&lt;/code&gt; was pushing &lt;code&gt;1,176&lt;/code&gt; to &lt;code&gt;2,026&lt;/code&gt; WMM &lt;strong&gt;Background (&lt;code&gt;BK&lt;/code&gt;) access-category transmit frames&lt;/strong&gt; over encrypted 5 GHz Wi-Fi. The moment I toggled Wi-Fi off, &lt;code&gt;nsurlsessiond&lt;/code&gt; aborted six parallel multi-megabyte QUIC/HTTP3 uploads explicitly flagged &lt;code&gt;Interface type &apos;cellular&apos; is prohibited by parameters&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That single constraint explained the entire radio matrix: Airplane Mode and Cellular stayed cool because the runaway background session was forbidden from touching cellular interfaces, waiting silently until high-band Wi-Fi came online to peg the SoC TLS/QUIC encryption pipeline and 5 GHz transmitter.&lt;/p&gt;
&lt;h2 id=&quot;step-5-using-low-data-mode-to-catch-the-130-mb-upload-storm&quot;&gt;Step 5: Using Low Data Mode to catch the 130 MB upload storm&lt;/h2&gt;
&lt;p&gt;Because iOS marks discretionary background &lt;code&gt;NSURLSession&lt;/code&gt; transfers as constrained-network aware, I ran a targeted isolation check: enabling &lt;strong&gt;Low Data Mode&lt;/strong&gt; specifically on the 5 GHz Wi-Fi network (&lt;code&gt;Settings &amp;gt; Wi-Fi &amp;gt; (i) &amp;gt; Low Data Mode&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Temperatures dropped almost immediately. In Console, &lt;code&gt;wifid&lt;/code&gt; background (&lt;code&gt;BK&lt;/code&gt;) transmit frames fell from &lt;code&gt;2,026&lt;/code&gt; per 5-second window straight to &lt;code&gt;0&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;wifid  LQM-WiFi: TX(&amp;lt;BSSID&amp;gt;) AC&amp;lt;...&amp;gt; BK&amp;lt;0 0 0 0 0 0 0 0 0 0 0&amp;gt; (4999ms)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;maild  [01] Task ReSyncMailbox has been running for 353 s. Still running&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;maild  Could not get url for mailboxID 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Quieting the Wi-Fi flood also unmasked a secondary stuck IMAPS (&lt;code&gt;port 993&lt;/code&gt;) &lt;code&gt;maild&lt;/code&gt; task that had been spinning on &lt;code&gt;mailboxID 0&lt;/code&gt; for nearly 6 minutes (&lt;code&gt;353 s&lt;/code&gt;), which we cleared by disabling Mail sync on that account.&lt;/p&gt;
&lt;p&gt;To confirm Low Data Mode was truly gating the heat rather than Low Power Mode masking it, I turned &lt;strong&gt;Low Power Mode off&lt;/strong&gt;. Unthrottling the CPU on &lt;strong&gt;iOS 27.3 beta (&lt;code&gt;24C5049d&lt;/code&gt;)&lt;/strong&gt; surfaced a flurry of beta-seed sandbox denials from &lt;code&gt;biomesyncd&lt;/code&gt;, yet temperatures stayed calm as long as Wi-Fi Low Data Mode remained enabled. The moment I toggled &lt;strong&gt;Low Data Mode off&lt;/strong&gt;, five persistent &lt;code&gt;nsurlsessiond&lt;/code&gt; tasks immediately roared back to life, pushing &lt;strong&gt;~130.7 MB outbound&lt;/strong&gt; (led by an &lt;code&gt;81.1 MB&lt;/code&gt; stream and a &lt;code&gt;37.8 MB&lt;/code&gt; stream) before aborting with &lt;code&gt;-1005 [1:53]&lt;/code&gt; when Low Data Mode was re-engaged:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;kernel         107 duplicate reports for System Policy: biomesyncd(&amp;lt;PID&amp;gt;) deny(1) file-read-metadata /private/var/mobile/Library/Biome/streams/...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;nsurlsessiond  Task &amp;lt;TASK_A&amp;gt;.&amp;lt;71&amp;gt; HTTP load failed, 81136839/0 bytes (error code: -1005 [1:53])&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;nsurlsessiond  Task &amp;lt;TASK_B&amp;gt;.&amp;lt;60&amp;gt; HTTP load failed, 37750596/0 bytes (error code: -1005 [1:53])&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;step-6-pivoting-log-verbosity-to-unmask-the-owning-client&quot;&gt;Step 6: Pivoting log verbosity to unmask the owning client&lt;/h2&gt;
&lt;p&gt;Why hadn’t &lt;code&gt;nsurlsessiond&lt;/code&gt; named the offending app yet? Because &lt;code&gt;nsurlsessiond&lt;/code&gt; executes out-of-process transfers on behalf of client apps, and its &lt;code&gt;&amp;lt;Error&amp;gt;&lt;/code&gt; lines only log the session/task UUIDs (&lt;code&gt;&amp;lt;TASK_A&amp;gt;.&amp;lt;71&amp;gt;&lt;/code&gt;) and byte counts—redacting or omitting the client &lt;code&gt;bundleID&lt;/code&gt; unless &lt;code&gt;Default&lt;/code&gt; and &lt;code&gt;Info&lt;/code&gt; messages are enabled.&lt;/p&gt;
&lt;p&gt;I enabled &lt;strong&gt;Action -&amp;gt; Include Info Messages&lt;/strong&gt; in macOS Console, filtered specifically by the &lt;code&gt;81.1 MB&lt;/code&gt; task prefix (&lt;code&gt;&amp;lt;TASK_A&amp;gt;&lt;/code&gt;), and toggled Wi-Fi Low Data Mode off for just &lt;strong&gt;10 seconds&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Console caught the client red-handed:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;default  nsurlsessiond  NDSession &amp;lt;SESSION_UUID&amp;gt; Task &amp;lt;TASK_A&amp;gt;.&amp;lt;71&amp;gt; current discretionary status for com.google.photos is discretionary (opt-in: 1)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;default  nsurlsessiond  Task &amp;lt;TASK_A&amp;gt;.&amp;lt;71&amp;gt; summary for pending retry {transaction_duration_ms=728516, response_status=-1, request_bytes=81136839, response_bytes=0}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;default  powerd         Process nsurlsessiond.&amp;lt;PID&amp;gt; Created SystemIsActive &quot;NSURLSessionTask &amp;lt;TASK_A&amp;gt;&quot; id:&amp;lt;ASSERTION_ID&amp;gt; [System: PrevIdle SysAct]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;com.google.photos&lt;/code&gt; (Google Photos) owned an orphaned background &lt;code&gt;NDSession&lt;/code&gt; (&lt;code&gt;&amp;lt;SESSION_UUID&amp;gt;&lt;/code&gt;) wedged in a &lt;strong&gt;12-minute (&lt;code&gt;728,516 ms&lt;/code&gt;) &lt;code&gt;response_status=-1&lt;/code&gt; upload retry loop&lt;/strong&gt; pushing &lt;code&gt;81,136,839&lt;/code&gt; bytes (&lt;code&gt;0&lt;/code&gt; bytes acknowledged) under a 7-day (&lt;code&gt;604,800 s&lt;/code&gt;) session timeout—acquiring nonstop &lt;code&gt;powerd&lt;/code&gt; &lt;code&gt;SystemIsActive&lt;/code&gt; wake assertions (&lt;code&gt;[System: PrevIdle SysAct]&lt;/code&gt;) whenever unconstrained Wi-Fi was available.&lt;/p&gt;
&lt;p&gt;Because &lt;code&gt;nsurlsessiond&lt;/code&gt; persists background sessions at the OS level even if you force-quit the app in the switcher, force-closing the app accomplishes nothing. Pausing backup, &lt;strong&gt;uninstalling and reinstalling Google Photos&lt;/strong&gt; (which tears down orphaned &lt;code&gt;NDSession&lt;/code&gt; state in &lt;code&gt;nsurlsessiond&lt;/code&gt;), and disabling &lt;strong&gt;Background App Refresh&lt;/strong&gt; for the app permanently flushed the queue.&lt;/p&gt;
&lt;p&gt;We left the phone online overnight with &lt;strong&gt;Low Power Mode off&lt;/strong&gt; and &lt;strong&gt;Low Data Mode off&lt;/strong&gt;. By morning, it was completely cool.&lt;/p&gt;
&lt;h2 id=&quot;step-7-closing-the-wired-usb-c-pd-mystery-powered-off&quot;&gt;Step 7: Closing the wired USB-C PD mystery powered off&lt;/h2&gt;
&lt;p&gt;With the SoC thermal runaway completely solved, one piece of the initial incident remained: &lt;strong&gt;why had wired USB-C charging failed on the laptop PD brick and crawled on the Mac?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Even with the phone cool and idle the next morning, wired USB-C charging still crawled:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Laptop USB-C PD brick (booted, normal temps)&lt;/strong&gt;: Climbed just &lt;code&gt;+3%&lt;/code&gt; over 25 minutes (&lt;code&gt;63% -&amp;gt; 66%&lt;/code&gt;)—no longer &lt;code&gt;0W&lt;/code&gt;, but stuck in ~5W legacy fallback.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Second independent USB-C wall adapter + fresh cable (booted &amp;amp; idle, cool)&lt;/strong&gt;: Climbed only &lt;strong&gt;&lt;code&gt;+2%&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;66% -&amp;gt; 68%&lt;/code&gt;). That ruled out a faulty charger or damaged cable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MagSafe worked at full speed, while three separate wired USB-C sources crawled. At that point, damaged &lt;code&gt;CC1&lt;/code&gt;/&lt;code&gt;CC2&lt;/code&gt; pins or a degraded USB-C controller IC still looked plausible—until we ran one final boundary test.&lt;/p&gt;
&lt;p&gt;Keeping the iPhone plugged into that exact same second wall adapter and USB-C cable, I &lt;strong&gt;powered the iPhone completely off&lt;/strong&gt; (&lt;code&gt;Volume Up + Side&lt;/code&gt; -&amp;gt; slide to power off) for 25 minutes, letting the hardware PMIC and standalone USB-C controller negotiate Power Delivery without the booted iOS kernel in the loop.&lt;/p&gt;
&lt;p&gt;When booted back to &lt;code&gt;BFU&lt;/code&gt; 25 minutes later, &lt;strong&gt;the battery had jumped from &lt;code&gt;68%&lt;/code&gt; to &lt;code&gt;80%&lt;/code&gt; (&lt;code&gt;+12%&lt;/code&gt; in 25 minutes) while staying completely cool&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;That single A/B comparison (&lt;code&gt;+2%&lt;/code&gt; booted vs. &lt;code&gt;+12%&lt;/code&gt; powered off on identical hardware, brick, and cable) exonerated the physical USB-C port, &lt;code&gt;CC&lt;/code&gt; pins, charging IC, and battery. The wired charging throttle was strictly a booted OS power-stack regression in the &lt;strong&gt;iOS 27.3 developer beta seed (&lt;code&gt;24C5049d&lt;/code&gt;)&lt;/strong&gt;—matching the &lt;code&gt;accessoryd&lt;/code&gt; authentication timeout and &lt;code&gt;AppleSMCFamily&lt;/code&gt; &lt;code&gt;kSMCBadArgumentError(0x89)&lt;/code&gt; write error we captured at &lt;code&gt;AFU&lt;/code&gt; in Step 2 (a seed build Apple subsequently replaced days later with &lt;code&gt;24C5049f&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;diagnostic-checklist-before-condemning-hardware&quot;&gt;Diagnostic checklist before condemning hardware&lt;/h2&gt;
&lt;p&gt;Two completely independent software faults—an orphaned &lt;code&gt;130.7 MB&lt;/code&gt; &lt;code&gt;nsurlsessiond&lt;/code&gt; upload loop in &lt;code&gt;com.google.photos&lt;/code&gt; and an iOS beta &lt;code&gt;accessoryd&lt;/code&gt;/SMC USB-C PD negotiation bug—happened to overlap on the same evening, mimicking a single fatal logic board short.&lt;/p&gt;
&lt;p&gt;Before writing off an overheating, slow-charging iPhone as dead silicon or authorizing a board swap, run four non-destructive isolation checks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Compare &lt;code&gt;BFU&lt;/code&gt; vs. &lt;code&gt;AFU&lt;/code&gt; thermals&lt;/strong&gt;: Reboot and leave the device untouched on the initial passcode screen (&lt;code&gt;BFU&lt;/code&gt;) for 30–60 minutes. If &lt;code&gt;BFU&lt;/code&gt; stays cool and heat spikes only after unlocking (&lt;code&gt;AFU&lt;/code&gt;), your board and battery lack a physical standby short—you are hunting an unlocked daemon or background queue.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check &lt;code&gt;wifid&lt;/code&gt; LQM before blaming the Wi-Fi chip&lt;/strong&gt;: Stream macOS Console over USB and inspect &lt;code&gt;LQM-WiFi&lt;/code&gt;. Zero &lt;code&gt;txPhyError&lt;/code&gt; and &lt;code&gt;txPer=0.0%&lt;/code&gt; alongside thousands of &lt;code&gt;BK&amp;lt;...&amp;gt;&lt;/code&gt; frames means the radio is healthy and being saturated by background &lt;code&gt;NSURLSession&lt;/code&gt; traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Wi-Fi Low Data Mode + &lt;code&gt;Info&lt;/code&gt; logs to unmask &lt;code&gt;nsurlsessiond&lt;/code&gt; clients&lt;/strong&gt;: Enable Low Data Mode on your Wi-Fi SSID to pause discretionary queues (&lt;code&gt;-1005&lt;/code&gt;), switch Console to &lt;strong&gt;Include Info Messages&lt;/strong&gt; (since &lt;code&gt;&amp;lt;Error&amp;gt;&lt;/code&gt; logs omit client bundle IDs), filter by the heavy task UUID, and toggle Low Data Mode off briefly to catch the owning bundle ID (&lt;code&gt;com.google.photos&lt;/code&gt; or similar)—then reinstall that app to purge its OS-managed &lt;code&gt;NDSession&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test wired USB-C charging powered completely off&lt;/strong&gt;: If wired USB-C charging crawls while booted across known-good cables and adapters, power the phone completely off for 20–30 minutes on the same brick. Normal charge gain while powered off clears the USB-C port and PMIC hardware, isolating the fault to booted OS &lt;code&gt;accessoryd&lt;/code&gt;/SMC power management.&lt;/li&gt;
&lt;/ol&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Article</category><category>Debugging</category><category>Operating Systems</category><category>Forensics</category><category>Networking</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Unnest Studio (flatJSON2csv)</title><link>https://tedcraft.dev/works/unnest-studio/</link><guid isPermaLink="true">https://tedcraft.dev/works/unnest-studio/</guid><description>Privacy-first local streaming JSON to tabular CSV and Excel studio: A high-performance, zero-exfiltration JSON flattening engine and interactive web workspace that converts massive nested JSON and NDJSON files into clean tabular CSV and native Excel spreadsheets purely in-browser and via CLI, built with TedCraft UI Mantra and Apple HIG ergonomics.</description><pubDate>Sun, 15 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Security and IAM exports cannot be uploaded to cloud converters without violating data residency, while desktop spreadsheets choke on nested schemas. Unnest Studio streams irregular JSON/NDJSON locally in two linear passes—or single-pass O(1) memory with explicit columns.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Converts multi-gigabyte nested JSON/NDJSON audit exports into deterministic CSV and native .xlsx files locally with zero bytes exfiltrated.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Two-pass streaming Python CLI (ijson + openpyxl) with O(1) per-record memory bounds and a local-first client-side web studio built on TedCraft UI Mantra.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://teddymwai.github.io/unnest-studio/&quot;&gt;Open interactive reference&lt;/a&gt; · &lt;a href=&quot;https://tedcraft.dev/works/unnest-studio/&quot;&gt;Read full production dossier&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;
&lt;p&gt;Security analysts, compliance auditors, and data engineers frequently work with multi-gigabyte nested JSON and newline-delimited JSON (NDJSON) exports—ranging from CloudTrail audit trails, Identity and Access Management (IAM) permissions, to SIEM event dumps.&lt;/p&gt;
&lt;p&gt;Traditional online JSON converters require uploading files to third-party cloud servers, violating strict data residency and corporate non-disclosure requirements. Meanwhile, desktop spreadsheet applications crash or exhaust system RAM when opening nested records containing irregular schemas.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unnest Studio&lt;/strong&gt; (&lt;code&gt;flatJSON2csv&lt;/code&gt;) was engineered to solve this privacy and scalability problem. It provides a local, streaming command-line utility and an in-browser web application that converts deeply nested JSON structures into deterministic tabular CSV and Microsoft Excel (&lt;code&gt;.xlsx&lt;/code&gt;) files without sending a single byte over the network.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;architectural-highlights-two-pass-streaming-engine&quot;&gt;Architectural Highlights: Two-Pass Streaming Engine&lt;/h2&gt;
&lt;p&gt;Unlike naive parsers that deserialize entire JSON payloads into memory (triggering Out-Of-Memory exceptions on large datasets), Unnest Studio operates on a deterministic, streaming two-pass model:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Pass 1: Schema Discovery (Streaming Ingest)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   [ JSON / NDJSON Input ] ──► [ Stream Tokenizer (ijson) ] ──► [ Unique Column Path Registry ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                                                                             │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                                                                             ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Pass 2: Row Emission (Direct-to-Disk)                                 [ Sorted Headers ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   [ JSON / NDJSON Input ] ──► [ Flatten Record ] ──► [ csv.DictWriter ] ──► [ Tabular CSV / XLSX ]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;1-pass-1-schema-discovery&quot;&gt;1. Pass 1 (Schema Discovery)&lt;/h3&gt;
&lt;p&gt;The parser streams the input file from start to finish, dynamically identifying every unique flattened object key across all records:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Nested structures are flattened using period notation (e.g., &lt;code&gt;user.attributes.email&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Array values are indexed or string-serialized to prevent row misalignment.&lt;/li&gt;
&lt;li&gt;Memory consumption during this pass is strictly bounded by the size of the discovered column header set, not the volume of records.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-pass-2-deterministic-writing&quot;&gt;2. Pass 2 (Deterministic Writing)&lt;/h3&gt;
&lt;p&gt;With the global header registry finalized, the engine streams the input file a second time:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each record is flattened on the fly and mapped into a pre-allocated row buffer.&lt;/li&gt;
&lt;li&gt;Values are written directly to disk via standard &lt;code&gt;csv.DictWriter&lt;/code&gt; or appended to an Excel worksheet stream.&lt;/li&gt;
&lt;li&gt;Internal line breaks inside cell values are sanitized to single spaces, guaranteeing that each tabular record occupies exactly one physical line for downstream line-oriented tools (&lt;code&gt;awk&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;cut&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;3-o1-direct-streaming-via---columns&quot;&gt;3. $O(1)$ Direct Streaming via &lt;code&gt;--columns&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;When explicit column headers are supplied via the &lt;code&gt;--columns&lt;/code&gt; parameter, the discovery pass is bypassed entirely. The engine streams records from disk to output in a single linear pass with $O(1)$ memory consumption, determined solely by the single largest JSON object.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;client-side-web-studio-architecture&quot;&gt;Client-Side Web Studio Architecture&lt;/h2&gt;
&lt;p&gt;Alongside the Python CLI, Unnest Studio includes a self-contained, client-side web application deployed to &lt;a href=&quot;https://teddymwai.github.io/unnest-studio/&quot;&gt;GitHub Pages&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero Network Exfiltration:&lt;/strong&gt; All JSON tokenization, key path discovery, object flattening, and CSV generation execute entirely on the client thread using HTML5 File and Blob APIs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TedCraft UI Mantra Design Standard:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Editorial Typography:&lt;/strong&gt; Display typography rendered in optical &lt;code&gt;Newsreader&lt;/code&gt; serif paired with &lt;code&gt;Instrument Sans&lt;/code&gt; body text and &lt;code&gt;JetBrains Mono&lt;/code&gt; for tabular metrics and JSON path tokens.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Luxury Dual-Mode Palette:&lt;/strong&gt; Dark Default (Brushed Champagne Gold &lt;code&gt;#d4a853&lt;/code&gt; over Deep Obsidian &lt;code&gt;#0c0c0e&lt;/code&gt;) and Light Reading Mode (Deep Bronze-Gold &lt;code&gt;#8c6218&lt;/code&gt; over Warm Ivory Parchment &lt;code&gt;#f8f6f1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Apple HIG Action Controls:&lt;/strong&gt; Standalone interactive controls adhere to 44px capsule geometry (&lt;code&gt;border-radius: 9999px&lt;/code&gt;) with tactile &lt;code&gt;:active&lt;/code&gt; press feedback.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dual Delivery Model:&lt;/strong&gt; Launchable locally through the Python package via &lt;code&gt;flatJSON2csv --web&lt;/code&gt; (which spins up a minimal local loopback server at &lt;code&gt;127.0.0.1:8765&lt;/code&gt;) or visited directly on GitHub Pages.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;cli--packaging-features&quot;&gt;CLI &amp;amp; Packaging Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Core CSV Engine:&lt;/strong&gt; Built with Python 3.11+ and &lt;code&gt;ijson&lt;/code&gt; for rapid iterative parsing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Native Excel Workbooks:&lt;/strong&gt; Direct export to native &lt;code&gt;.xlsx&lt;/code&gt; files with automatic column width calculation using &lt;code&gt;openpyxl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integrated JSON Beautifier:&lt;/strong&gt; High-speed syntax-highlighted formatter and validator for inspecting nested structures prior to conversion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated Test Coverage:&lt;/strong&gt; Complete regression suite verifying deep nesting, UTF-8 character encoding, null values, and irregular sparse arrays.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# Convert nested JSON to tabular CSV&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; flatJSON2csv.py&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; input.json&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -o&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; output.csv&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# Export directly to Microsoft Excel&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; flatJSON2csv.py&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; input.json&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -o&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; output.xlsx&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; --sheet-name&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;AuditLog&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# Launch local in-browser studio&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; flatJSON2csv.py&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; --web&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Data Tools &amp; Web</category><category>Python</category><category>JavaScript</category><category>Streaming Parser</category><category>Privacy First</category><category>Client-Side</category><category>Apple HIG</category><category>TedCraft UI Mantra</category><category>Open Source</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Cybersecurity Practitioner &amp; Agentic AI Curriculum (43 Standalone Repositories)</title><link>https://tedcraft.dev/works/cybersecurity-courses-curriculum/</link><guid isPermaLink="true">https://tedcraft.dev/works/cybersecurity-courses-curriculum/</guid><description>The Learned Fellow curriculum: Systems programming, wire-protocol analysis, and autonomous Hackbot / Defense Agent integration across 43 public GitLab projects: A comprehensive 4-tier cybersecurity and systems engineering curriculum spanning 43 standalone public repositories on GitLab. Covers low-level packet craft, binary exploitation, eBPF telemetry, and defensive hardening across C++20, Rust, Go, Zig, and Python, with standardized Model Context Protocol (MCP) tool integration for autonomous offensive and defensive AI agents.</description><pubDate>Fri, 06 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Built on the &amp;#39;Learned Fellow&amp;#39; philosophy for CYBER RANGES, this 43-repo public GitLab curriculum bridges low-level systems engineering (C++20, Rust, Go, Zig, eBPF) with structured MCP schemas for autonomous red- and blue-team AI agents.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Published 43 standalone systems and security repositories across 4 progressive tiers with 100% Model Context Protocol (MCP) agent conformance.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; First-principles packet craft, kernel memory, eBPF telemetry, and cryptography in C++20, Rust, Go, Zig, and Python integrated with Hackbot and Defense AI agents.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;executive-vision-the-hybrid-paradigm&quot;&gt;Executive Vision: The Hybrid Paradigm&lt;/h2&gt;
&lt;p&gt;Traditional academic curricula divide cybersecurity concepts into disconnected silos:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Networking &amp;amp; Systems Tooling&lt;/strong&gt; is isolated to legacy C codebases and theoretical socket tutorials.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Machine Learning &amp;amp; Data Science&lt;/strong&gt; is restricted to synthetic Python notebooks and generic tabular datasets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Autonomous Agents &amp;amp; LLMs&lt;/strong&gt; are treated as ungrounded chatbots without operational security bounds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This 43-repository curriculum shatters those silos by establishing the &lt;strong&gt;Hybrid Systems + Security + Agentic AI Architecture&lt;/strong&gt;. Developed for the &lt;strong&gt;CYBER RANGES&lt;/strong&gt; curriculum and hosted as 43 independent public GitLab repositories under the &lt;code&gt;teddymwai&lt;/code&gt; namespace, each course teaches students how to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Develop from First Principles:&lt;/strong&gt; Build systems-level network tools, security analyzers, and cryptographic utilities from scratch in modern compiled and typed languages (C++20, Rust, Go, Zig, Python, V, Haskell).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Operate Safely in the Threat Landscape:&lt;/strong&gt; Dissect real-world adversary attack surfaces, defense-in-depth boundaries, and safe lab testing methodologies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integrate with Autonomous AI-Agents:&lt;/strong&gt; Configure an offensive &lt;strong&gt;Hackbot&lt;/strong&gt; (for Red Team tools) or a defensive &lt;strong&gt;Defense AI-Agent&lt;/strong&gt; (for Blue Team tools) using structured Model Context Protocol (MCP) tool schemas and deterministic JSON outputs.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;educational-philosophy-the-learned-fellow&quot;&gt;Educational Philosophy: The “Learned Fellow”&lt;/h2&gt;
&lt;p&gt;The curriculum explicitly rejects the passive “tool operator” paradigm—simply running pre-packaged scripts or memorizing CLI flags without understanding underlying mechanics. Instead, the practitioner is treated as a &lt;strong&gt;learned fellow&lt;/strong&gt;—a software and security engineer conversant with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kernel &amp;amp; Memory Layouts:&lt;/strong&gt; Virtual memory addressing, stack frame layouts, buffer allocations, and user-to-kernel context switches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wire Protocols &amp;amp; Packet Mechanics:&lt;/strong&gt; Byte-level offsets, TCP flag sequences, TLS &lt;code&gt;ClientHello&lt;/code&gt; extensions, and RFC state machines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concurrency &amp;amp; Non-Blocking I/O:&lt;/strong&gt; POSIX signals, mutex lock contention, epoll/kqueue event loops, and AF_XDP zero-copy packet rings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cryptographic Primitives:&lt;/strong&gt; Key schedules, block cipher modes (GCM, CBC), message authentication codes (HMAC), and entropy metrics.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;master-4-tier-curriculum-matrix&quot;&gt;Master 4-Tier Curriculum Matrix&lt;/h2&gt;
&lt;p&gt;The curriculum organizes 43 standalone repositories across four progressive difficulty tiers:&lt;/p&gt;
&lt;h3 id=&quot;tier-1-foundations-3-projects&quot;&gt;Tier 1: Foundations (3 Projects)&lt;/h3&gt;
&lt;p&gt;Pre-beginner fundamentals for systems programming, cryptographic hash identification, and protocol inspection.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;hash-identifier&lt;/code&gt; (Python):&lt;/strong&gt; Cryptographic hash pattern decomposition and entropy analysis.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;http-headers-scanner&lt;/code&gt; (Python):&lt;/strong&gt; Defensive audit of modern HTTP security headers (&lt;code&gt;Content-Security-Policy&lt;/code&gt;, &lt;code&gt;Strict-Transport-Security&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;password-manager&lt;/code&gt; (Python):&lt;/strong&gt; Encrypted local credential storage utilizing Argon2id key derivation and AES-GCM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;tier-2-beginner-17-projects&quot;&gt;Tier 2: Beginner (17 Projects)&lt;/h3&gt;
&lt;p&gt;Core networking, reconnaissance, systems auditing, and baseline offense/defense engineering.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;simple-port-scanner&lt;/code&gt; (C++20 / Asio):&lt;/strong&gt; Asynchronous, non-blocking TCP Connect and SYN scanner utilizing C++20 coroutines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;linux-ebpf-security-tracer&lt;/code&gt; (C / eBPF / Python):&lt;/strong&gt; Real-time kernel telemetry hooking &lt;code&gt;sys_enter_execve&lt;/code&gt; to detect unauthorized process execution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;c2-beacon&lt;/code&gt; (Python / Go / React):&lt;/strong&gt; Command-and-control beacon simulation featuring jittered interval sleeps and HTTP egress tunnels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;firewall-rule-engine&lt;/code&gt; (V):&lt;/strong&gt; Custom Layer 4 packet filtering engine written in the V systems language.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;canary-token-generator&lt;/code&gt; (Go / React):&lt;/strong&gt; DNS and HTTP decoy tokens triggering real-time alerting on unauthorized access.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;linux-cis-hardening-auditor&lt;/code&gt; (Bash / ShellCheck):&lt;/strong&gt; Automated compliance verification against Center for Internet Security (CIS) Linux benchmarks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;systemd-persistence-scanner&lt;/code&gt; (Go):&lt;/strong&gt; Inspecting Linux daemon units and timer hooks to uncover adversary persistence.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;prompt-injection-firewall&lt;/code&gt; (Python / FastAPI):&lt;/strong&gt; Reverse-proxy inspecting input prompts for jailbreak patterns and token anomalies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional Beginner Projects:&lt;/strong&gt; &lt;code&gt;network-traffic-analyzer&lt;/code&gt;, &lt;code&gt;hash-cracker&lt;/code&gt;, &lt;code&gt;keylogger&lt;/code&gt;, &lt;code&gt;simple-vulnerability-scanner&lt;/code&gt;, &lt;code&gt;steganography-multi-tool&lt;/code&gt;, &lt;code&gt;base64-tool&lt;/code&gt;, &lt;code&gt;caesar-cipher&lt;/code&gt;, &lt;code&gt;deserialization-gadget-lab&lt;/code&gt;, &lt;code&gt;dns-lookup&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;tier-3-intermediate-12-projects&quot;&gt;Tier 3: Intermediate (12 Projects)&lt;/h3&gt;
&lt;p&gt;Application security, identity orchestration, binary analysis, and security engineering.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ja3-ja4-tls-fingerprinting&lt;/code&gt; (Rust):&lt;/strong&gt; Wire-level passive TLS client fingerprinting directly parsing cipher suites, elliptic curves, and extension orders.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;secrets-scanner&lt;/code&gt; (Go):&lt;/strong&gt; High-throughput Shannon entropy scanner detecting leaked API tokens, private keys, and passwords across code repositories.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;sbom-generator-vulnerability-matcher&lt;/code&gt; (Go):&lt;/strong&gt; Ingesting Software Bill of Materials (SBOM) and cross-referencing vulnerability CVE databases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;docker-security-audit&lt;/code&gt; (Go):&lt;/strong&gt; Automated daemon inspection evaluating container privileges, capabilities, and namespace isolation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;siem-dashboard&lt;/code&gt; (Python / TypeScript):&lt;/strong&gt; High-velocity security event correlation dashboard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dlp-scanner&lt;/code&gt; (Python):&lt;/strong&gt; Pattern-matching engine detecting sensitive exfiltration vectors across outgoing data streams.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional Intermediate Projects:&lt;/strong&gt; &lt;code&gt;api-security-scanner&lt;/code&gt;, &lt;code&gt;binary-analysis-tool&lt;/code&gt;, &lt;code&gt;chaos-engineering-tool&lt;/code&gt;, &lt;code&gt;credential-enumeration&lt;/code&gt;, &lt;code&gt;credential-rotation-enforcer&lt;/code&gt;, &lt;code&gt;security-news-scraper&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;tier-4-advanced-11-projects&quot;&gt;Tier 4: Advanced (11 Projects)&lt;/h3&gt;
&lt;p&gt;Deep systems exploitation, hardware security, machine learning threat hunting, and honeynets.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ai-threat-detection&lt;/code&gt; (Python / PyTorch / React):&lt;/strong&gt; Machine learning classifier trained on anomalous network telemetry and process graphs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;hsm-emulator&lt;/code&gt; (Zig):&lt;/strong&gt; Hardware Security Module (HSM) software emulator implementing the PKCS#11 cryptographic token interface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;zig-stateless-scanner&lt;/code&gt; (Zig / AF_XDP):&lt;/strong&gt; High-speed stateless network scanner bypassing kernel network stacks via Linux XDP sockets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;zero-day-vulnerability-scanner&lt;/code&gt; (Rust / Clang / AFL++):&lt;/strong&gt; Coverage-guided fuzzing harness orchestrating American Fuzzy Lop (AFL++) against compiled binaries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;haskell-reverse-proxy&lt;/code&gt; (Haskell / WAI / Warp):&lt;/strong&gt; Formally typed, memory-safe reverse proxy enforcing strict request sanitation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;honeypot-network&lt;/code&gt; (Go / React / Docker):&lt;/strong&gt; Low-interaction distributed honeynet mimicking vulnerable database and SSH services.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;rveng&lt;/code&gt; (Reverse Engineering Engine) (Python / Capstone / React):&lt;/strong&gt; Disassembly and control-flow-graph (CFG) analysis suite.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional Advanced Projects:&lt;/strong&gt; &lt;code&gt;api-rate-limiter&lt;/code&gt;, &lt;code&gt;bug-bounty-platform&lt;/code&gt;, &lt;code&gt;encrypted-p2p-chat&lt;/code&gt;, &lt;code&gt;monitor-the-situation-dashboard&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;standardized-autonomous-ai-agent-integration&quot;&gt;Standardized Autonomous AI-Agent Integration&lt;/h2&gt;
&lt;p&gt;Every repository in the curriculum incorporates a dedicated autonomous AI-Agent configuration adhering to the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[ Security Tool CLI / Daemon ] ──► [ Structured JSON Telemetry ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                                             │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                                             ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; [ Agentic Workflow ] ◄── [ MCP Tool Schema / System Prompt ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   • Red Team: Hackbot Recon &amp;amp; Exploitation&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   • Blue Team: Defense Agent Triage &amp;amp; Alert Correlation&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Red Team Tools (Hackbot Configuration):&lt;/strong&gt; Each offensive tool includes an MCP tool definition enabling an autonomous Hackbot agent to plan reconnaissance phases, invoke scans, parse open port schemas, and orchestrate follow-up probing safely.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blue Team Tools (Defense Agent Configuration):&lt;/strong&gt; Each defensive tool includes an MCP tool definition allowing an AI Defense Agent to ingest streaming logs, calculate anomaly scores, recommend firewall rules, and generate executive incident summaries.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;live-gitlab-deployment-directory&quot;&gt;Live GitLab Deployment Directory&lt;/h2&gt;
&lt;p&gt;All 43 projects are deployed as individual public repositories under the &lt;code&gt;teddymwai&lt;/code&gt; namespace on GitLab. Each project contains its own git history, automated GitLab CI pipeline, theory documentation, and standalone test harness:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Standalone Repository&lt;/th&gt;
&lt;th&gt;Primary Language&lt;/th&gt;
&lt;th&gt;Curriculum Tier&lt;/th&gt;
&lt;th&gt;GitLab Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;01&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ai-threat-detection&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / PyTorch&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/ai-threat-detection&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;02&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api-rate-limiter&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / FastAPI&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/api-rate-limiter&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;03&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api-security-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / React&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/api-security-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04&lt;/td&gt;
&lt;td&gt;&lt;code&gt;base64-tool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/base64-tool&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;05&lt;/td&gt;
&lt;td&gt;&lt;code&gt;binary-analysis-tool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Rust / React&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/binary-analysis-tool&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;06&lt;/td&gt;
&lt;td&gt;&lt;code&gt;bug-bounty-platform&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / Postgres&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/bug-bounty-platform&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;07&lt;/td&gt;
&lt;td&gt;&lt;code&gt;c2-beacon&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / Go / React&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/c2-beacon&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;08&lt;/td&gt;
&lt;td&gt;&lt;code&gt;caesar-cipher&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/caesar-cipher&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;09&lt;/td&gt;
&lt;td&gt;&lt;code&gt;canary-token-generator&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go / React&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/canary-token-generator&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;&lt;code&gt;chaos-engineering-tool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/chaos-engineering-tool&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;&lt;code&gt;credential-enumeration&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Nim&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/credential-enumeration&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;&lt;code&gt;credential-rotation-enforcer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Crystal&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/credential-rotation-enforcer&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deserialization-gadget-lab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ruby&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/deserialization-gadget-lab&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dlp-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/dlp-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dns-lookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/dns-lookup&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker-security-audit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/docker-security-audit&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;&lt;code&gt;encrypted-p2p-chat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / Cryptography&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/encrypted-p2p-chat&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firewall-rule-engine&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;V&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/firewall-rule-engine&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hash-cracker&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;C++20&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/hash-cracker&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hash-identifier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 1: Foundations&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/hash-identifier&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;&lt;code&gt;haskell-reverse-proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Haskell / WAI&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/haskell-reverse-proxy&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;&lt;code&gt;honeypot-network&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go / Docker&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/honeypot-network&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hsm-emulator&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Zig / PKCS#11&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/hsm-emulator&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http-headers-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 1: Foundations&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/http-headers-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ja3-ja4-tls-fingerprinting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/ja3-ja4-tls-fingerprinting&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;&lt;code&gt;keylogger&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / C&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/keylogger&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;&lt;code&gt;linux-cis-hardening-auditor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bash / ShellCheck&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/linux-cis-hardening-auditor&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;&lt;code&gt;linux-ebpf-security-tracer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;C / eBPF / Python&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/linux-ebpf-security-tracer&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;&lt;code&gt;monitor-the-situation-dashboard&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go / WebGL&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/monitor-the-situation-dashboard&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;&lt;code&gt;network-traffic-analyzer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;C++20 / Python&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/network-traffic-analyzer&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;&lt;code&gt;password-manager&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Tier 1: Foundations&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/password-manager&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32&lt;/td&gt;
&lt;td&gt;&lt;code&gt;prompt-injection-firewall&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / FastAPI&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/prompt-injection-firewall&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rveng&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / Capstone&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/rveng&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sbom-generator-vulnerability-matcher&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/sbom-generator-vulnerability-matcher&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;td&gt;&lt;code&gt;secrets-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/secrets-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;&lt;code&gt;security-news-scraper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/security-news-scraper&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;37&lt;/td&gt;
&lt;td&gt;&lt;code&gt;siem-dashboard&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Python / TypeScript&lt;/td&gt;
&lt;td&gt;Tier 3: Intermediate&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/siem-dashboard&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simple-port-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;C++20 / Asio&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/simple-port-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simple-vulnerability-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/simple-vulnerability-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;&lt;code&gt;steganography-multi-tool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/steganography-multi-tool&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemd-persistence-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Tier 2: Beginner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/systemd-persistence-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;&lt;code&gt;zero-day-vulnerability-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Rust / AFL++&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/zero-day-vulnerability-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;td&gt;&lt;code&gt;zig-stateless-scanner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Zig / AF_XDP&lt;/td&gt;
&lt;td&gt;Tier 4: Advanced&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gitlab.com/teddymwai/zig-stateless-scanner&quot;&gt;GitLab Project&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Automated Provisioning &amp;amp; Release Engine&lt;/strong&gt;: All 43 standalone repositories above were provisioned, branched, promoted, and merged onto GitLab with zero merge conflicts via the &lt;a href=&quot;https://tedcraft.dev/works/resilient-orchestrator&quot;&gt;GitLab Resilient Bulk CI/CD Orchestrator&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;safety--educational-governance&quot;&gt;Safety &amp;amp; Educational Governance&lt;/h2&gt;
&lt;p&gt;All tools in the curriculum carry an enforced operational safety boundary:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!WARNING] Educational &amp;amp; Research Testing Boundary
These tools, packet generators, and AI-agent integration patterns are designed strictly for academic study, authorized penetration testing, and defense-in-depth engineering within isolated virtual environments or private testbeds. Unauthorized execution or traffic transmission against third-party systems without prior written consent is illegal. To practice safely with pre-configured targets, attack simulations, and live-fire exercises, visit &lt;strong&gt;CYBER RANGES&lt;/strong&gt; to access purpose-built tools and interactive lab infrastructure.&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Cybersecurity &amp; Systems</category><category>GitLab CI/CD</category><category>C++20</category><category>Rust</category><category>Go</category><category>Python</category><category>eBPF</category><category>Zig</category><category>Haskell</category><category>MCP</category><category>AI Agents</category><category>CYBER RANGES</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>GitLab Resilient Bulk CI/CD Orchestrator</title><link>https://tedcraft.dev/works/resilient-orchestrator/</link><guid isPermaLink="true">https://tedcraft.dev/works/resilient-orchestrator/</guid><description>Automated, fault-tolerant bulk repository provisioning, staging promotion, and merge request lifecycle engine: An enterprise-grade automation engine built with the Python standard library and low-level Git plumbing that provisioned, configured, branched, promoted, and merged 43 standalone cybersecurity project repositories onto GitLab with 100% success and zero merge conflicts.</description><pubDate>Fri, 06 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Migrating 43 standalone curriculum codebases by hand risks GitLab branch SHA collisions, CI rate-limit drops, and merge conflicts. This zero-dependency Python orchestrator executes unattended tree staging, merge-request polling, and atomic manifest tracking at 100% completion.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Provisioned, promoted, and merged 43 of 43 standalone CYBER RANGES repositories onto GitLab with zero merge conflicts or manual interventions.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Zero-dependency Python standard library engine using low-level Git plumbing (synthetic two-commit trees), GitLab REST API v4 polling, and geometric jitter backoff.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;executive-overview--provenance&quot;&gt;Executive Overview &amp;amp; Provenance&lt;/h2&gt;
&lt;p&gt;When managing large curriculum expansions or distributed micro-services, migrating dozens of standalone Git repositories by hand is slow, error-prone, and hazardous. Manual branch pushing, opening Merge Requests (MRs), waiting on CI pipelines, and resolving merge status collisions across 40+ independent codebases inevitably triggers API rate limits and network drops.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;GitLab Resilient Bulk CI/CD Orchestrator&lt;/strong&gt; was engineered to solve this operational bottleneck. It executes unattended bulk repository provisioning, staging promotion, and automated merge lifecycles across standalone repository clusters.&lt;/p&gt;
&lt;p&gt;This engine was battle-tested during the platform migration of the &lt;strong&gt;43 Standalone Cybersecurity Projects&lt;/strong&gt; developed for the &lt;strong&gt;CYBER RANGES&lt;/strong&gt; curriculum under the &lt;code&gt;teddymwai&lt;/code&gt; namespace:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scope Executed:&lt;/strong&gt; 43 independent repositories migrated simultaneously from local development environments to dedicated public GitLab projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workflow Executed:&lt;/strong&gt; Standalone project provisioning -&amp;gt; Synthetic two-commit tree staging -&amp;gt; Branch push -&amp;gt; Merge Request creation -&amp;gt; Asynchronous mergeability polling -&amp;gt; Automated merge into &lt;code&gt;main&lt;/code&gt; -&amp;gt; Fast-forward local synchronization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; 43 of 43 repositories successfully provisioned and merged with zero merge conflicts, zero manual interventions, and zero data loss.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;architectural-breakthrough-the-synthetic-two-commit-tree&quot;&gt;Architectural Breakthrough: The Synthetic Two-Commit Tree&lt;/h2&gt;
&lt;p&gt;A fundamental challenge in automating GitLab Merge Requests via API is branch identity:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the source (&lt;code&gt;staging&lt;/code&gt;) and target (&lt;code&gt;main&lt;/code&gt;) branches point to identical commit SHAs, GitLab rejects Merge Request creation with HTTP 400 (&lt;code&gt;&quot;Cannot create a merge request when the source and target branches are identical&quot;&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Conversely, committing throwaway placeholder files or dummy commits produces divergent branch histories, messy commit logs, and frequent merge conflicts during subsequent updates.&lt;/p&gt;
&lt;p&gt;The orchestrator solves this deterministically through low-level Git plumbing:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[ Universal Empty Tree SHA: 4b825dc... ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                  │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                  ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   [ Commit 1: Empty Root Base ] ──────► Ref: origin/main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                  │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                  ▼ (Parent reference)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; [ Commit 2: Full Codebase Child ] ────► Ref: origin/staging&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;1-empty-root-base-commit&quot;&gt;1. Empty Root Base Commit&lt;/h3&gt;
&lt;p&gt;The orchestrator synthesizes an empty root commit referencing Git’s universal empty tree SHA (&lt;code&gt;4b825dc642cb6eb9a060e54bf8d69288fbee4904&lt;/code&gt;):&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; commit-tree&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; 4b825dc642cb6eb9a060e54bf8d69288fbee4904&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;chore: initial repository setup&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;2-standardized-codebase-child-commit&quot;&gt;2. Standardized Codebase Child Commit&lt;/h3&gt;
&lt;p&gt;It then resolves the full project tree SHA and synthesizes a child commit that points directly to the complete project tree, using the empty root commit as its exact parent:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; commit-tree&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;FULL_TREE_SH&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;EMPTY_ROOT_COMMI&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;feat: standardize project for CYBER RANGES curriculum&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;3-clean-merge-guarantees&quot;&gt;3. Clean Merge Guarantees&lt;/h3&gt;
&lt;p&gt;Because &lt;code&gt;staging&lt;/code&gt; is a direct descendant of &lt;code&gt;main&lt;/code&gt;, Git performs a clean fast-forward or non-conflicting merge. The Merge Request reflects an exact 100% diff representation of the project, completely eliminating merge conflicts while preserving commit history hygiene.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;resilience--distributed-error-boundaries&quot;&gt;Resilience &amp;amp; Distributed Error Boundaries&lt;/h2&gt;
&lt;p&gt;Bulk automation against public cloud APIs inevitably encounters network volatility and rate limiting. The orchestrator incorporates four core resilience mechanisms:&lt;/p&gt;
&lt;h3 id=&quot;i-exponential-backoff-with-geometric-jitter&quot;&gt;I. Exponential Backoff with Geometric Jitter&lt;/h3&gt;
&lt;p&gt;All GitLab REST API v4 calls run through a retry handler:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rate Limit Defense (HTTP 429):&lt;/strong&gt; Implements geometric backoff ($2^n \times \text{base_delay}$) upon encountering API throttling.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gateway &amp;amp; Proxy Resiliency (HTTP 500, 502, 503, 504):&lt;/strong&gt; Automatically retries transient upstream reverse-proxy drops and GitLab infrastructure delays.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Socket Timeouts:&lt;/strong&gt; Recovers gracefully from TCP socket resets without aborting the overall batch execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;ii-isolated-execution-boundaries&quot;&gt;II. Isolated Execution Boundaries&lt;/h3&gt;
&lt;p&gt;Each repository in the batch executes within an isolated error boundary. If an unrecoverable failure occurs on repository &lt;code&gt;N&lt;/code&gt; (e.g. disk corruption or corrupted local ref):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The error is isolated and recorded in the state manifest.&lt;/li&gt;
&lt;li&gt;Protected branch rules on GitLab are restored to prevent exposure.&lt;/li&gt;
&lt;li&gt;The orchestrator safely advances to repository &lt;code&gt;N+1&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;iii-atomic-state-manifest--immediate-resumability&quot;&gt;III. Atomic State Manifest &amp;amp; Immediate Resumability&lt;/h3&gt;
&lt;p&gt;After each project operation, the release manifest (&lt;code&gt;release_manifest.json&lt;/code&gt;) is atomically written to disk. If execution is halted by an operator interrupt or machine reboot, running the tool again parses the manifest, skips all already-merged projects in under one second, and resumes work precisely where it stopped.&lt;/p&gt;
&lt;h3 id=&quot;iv-zero-third-party-dependencies&quot;&gt;IV. Zero Third-Party Dependencies&lt;/h3&gt;
&lt;p&gt;The entire orchestrator is built strictly with the Python 3.8+ standard library (&lt;code&gt;urllib.request&lt;/code&gt;, &lt;code&gt;subprocess&lt;/code&gt;, &lt;code&gt;json&lt;/code&gt;, &lt;code&gt;pathlib&lt;/code&gt;, &lt;code&gt;dataclasses&lt;/code&gt;). It requires zero &lt;code&gt;pip install&lt;/code&gt; dependencies, ensuring immediate portability across air-gapped workstations, CI containers, and minimal developer hosts.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;core-operations-workflow&quot;&gt;Core Operations Workflow&lt;/h2&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;mermaid&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;flowchart&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; TD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    A&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Standalone Repo Directory&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; --&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; B&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Git Plumbing: Resolve Codebase Tree SHA&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    B &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; C&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Synthetic Two-Commit Generator&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    C &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;|&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;Commit 1: Empty Root&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; D&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Ref: main&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    C &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;|&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;Commit 2: Full Codebase Child&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; E&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Ref: staging&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    D &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; F&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;GitLab API: Ensure Project Exists&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    E &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; F&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    F &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; G&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Temporary Unlock: Protected Branch Force-Push&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    G &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; H&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Push: origin main &amp;amp; origin staging&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    H &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; I&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;GitLab API: Open Merge Request (staging -&amp;gt; main)&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    I &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; J&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Poll Mergeability (detailed_merge_status)&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    J &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;|&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;mergeable / ci_still_running&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; K&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;GitLab API: Merge MR&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    K &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; L&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Re-lock Protected Branch Push Rules&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    L &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; M&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Local Fast-Forward Pull (main)&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    M &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt; N&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Atomic Manifest Checkpoint (release_manifest.json)&quot;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;measurable-results&quot;&gt;Measurable Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;43 of 43 Repositories Merged:&lt;/strong&gt; 100% automated completion across all curriculum repositories under &lt;code&gt;teddymwai&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero Merge Conflicts:&lt;/strong&gt; The synthetic tree architecture eliminated 100% of branch collision errors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Under 15 Minutes Runtime:&lt;/strong&gt; Complete batch provisioning, branching, and automated merge lifecycle across 43 repositories completed in under 15 minutes unattended.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deterministic Checkpointing:&lt;/strong&gt; Atomic manifest logging guaranteed that network drops during bulk operations required zero duplicate requests.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Orchestrated Payload:&lt;/strong&gt; Provisioned and promoted the complete &lt;a href=&quot;https://tedcraft.dev/works/cybersecurity-courses-curriculum&quot;&gt;Cybersecurity Practitioner &amp;amp; Agentic AI Curriculum (43 Standalone Repositories)&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>DevOps &amp; Infrastructure</category><category>Python</category><category>Git Plumbing</category><category>GitLab REST API</category><category>CI/CD</category><category>Distributed Automation</category><category>CYBER RANGES</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Why I Publicly Document My Learning Curves (Not Just Finished Projects)</title><link>https://tedcraft.dev/blog/why-document-learning-curves/</link><guid isPermaLink="true">https://tedcraft.dev/blog/why-document-learning-curves/</guid><description>Most portfolios show polished end results and hide the messy struggles. Here is why chronicling the steep climbs has made me a substantially sharper engineer.</description><pubDate>Sun, 01 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When browsing developer portfolios, you almost always see the same pattern: immaculate hero images, flawless live demos, and a laundry list of modern technologies. Everything looks effortless.&lt;/p&gt;
&lt;p&gt;Yet anyone who has actually built software knows the real truth: &lt;strong&gt;90% of genuine engineering happens in the moments where you have no clue why something is failing.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-problem-with-traditional-showcases&quot;&gt;The Problem with Traditional Showcases&lt;/h2&gt;
&lt;p&gt;When we only showcase the final shiny artifact, we strip away all the most valuable insights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which initial architectural assumptions were completely wrong?&lt;/li&gt;
&lt;li&gt;Which subtle edge cases or OS abstractions caused days of confusion?&lt;/li&gt;
&lt;li&gt;What mental model shift was required to unlock the real solution?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sharing only the end product creates an illusion that clean code springs fully formed from competent developers. It also means you lose a personal archive of hard-won debugging reflexes.&lt;/p&gt;
&lt;h2 id=&quot;the-learning-curve-ledger&quot;&gt;The Learning Curve Ledger&lt;/h2&gt;
&lt;p&gt;This site includes a dedicated &lt;a href=&quot;https://tedcraft.dev/learning-curves&quot;&gt;Learning Curves&lt;/a&gt; section for this exact reason. For every challenging project or system obstacle, I document three things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; The initial roadblock, false hypotheses, and why intuitive fixes failed—such as diagnosing intermittent &lt;a href=&quot;https://tedcraft.dev/learning-curves/openstack-stack-lock-contention&quot;&gt;OpenStack stack lock contention&lt;/a&gt; masquerading as 60-second browser timeouts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Turning Point:&lt;/strong&gt; The specific RFC, source code inspection, or mental model breakthrough—like separating &lt;code&gt;spawn()&lt;/code&gt; stream backpressure from &lt;code&gt;exec()&lt;/code&gt; buffer caps in &lt;a href=&quot;https://tedcraft.dev/learning-curves/async-process-deadlocks&quot;&gt;Node.js child process deadlocks&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Durable Rule:&lt;/strong&gt; An actionable heuristic carried forward into production systems—such as replacing quarterly snapshot checklists with continuous &lt;a href=&quot;https://tedcraft.dev/learning-curves/privilege-revocation-latency-gap&quot;&gt;privilege revocation latency metrics&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;benefits-in-practice&quot;&gt;Benefits in Practice&lt;/h2&gt;
&lt;p&gt;Documenting what went wrong forces you to understand &lt;em&gt;why&lt;/em&gt; the fix worked rather than celebrating that the tests turned green and moving on.&lt;/p&gt;
&lt;p&gt;If you are an engineer or creator building tools, I encourage you to document your learning curves too. The community has enough tutorials on the basics—what we truly need are honest field notes from the trenches.&lt;/p&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Article</category><category>Philosophy</category><category>Career</category><category>Learning</category><category>Engineering</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>The Silent Deadlock: Diagnosing Node.js Child Process Buffer Starvation</title><link>https://tedcraft.dev/learning-curves/async-process-deadlocks/</link><guid isPermaLink="true">https://tedcraft.dev/learning-curves/async-process-deadlocks/</guid><description>Why our background runner froze without logging an error, and how separating spawn() stream consumption from exec() cured it — Obstacle: Long-running automation runners spawned with piped stdio hung indefinitely when high-volume output went unconsumed or descendant processes kept inherited pipe descriptors open. | Breakthrough: Distinguishing spawn() unmanaged pipe backpressure from exec() maxBuffer termination—and consuming stdout/stderr asynchronously on spawn() with detached stdio boundaries—eliminated the silent hang.</description><pubDate>Wed, 28 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Why our background runner froze without logging an error, and how separating spawn() stream consumption from exec() cured it&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; Long-running automation runners spawned with piped stdio hung indefinitely when high-volume output went unconsumed or descendant processes kept inherited pipe descriptors open.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Distinguishing spawn() unmanaged pipe backpressure from exec() maxBuffer termination—and consuming stdout/stderr asynchronously on spawn() with detached stdio boundaries—eliminated the silent hang.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;the-situation&quot;&gt;The Situation&lt;/h2&gt;
&lt;p&gt;While orchestrating headless end-to-end test suites across parallel Docker containers, our runner scripts started hanging silently near test completion. CPU utilization dropped to 0%, processes remained visible in the process table (&lt;code&gt;ps aux&lt;/code&gt;), and no error or exit code was emitted.&lt;/p&gt;
&lt;h2 id=&quot;the-mental-model-trap&quot;&gt;The Mental Model Trap&lt;/h2&gt;
&lt;p&gt;Our runner initially used &lt;code&gt;child_process.exec()&lt;/code&gt; for short commands and &lt;code&gt;child_process.spawn()&lt;/code&gt; with &lt;code&gt;stdio: &apos;pipe&apos;&lt;/code&gt; for verbose suites, without consistently distinguishing how Node.js handles their output streams:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;child_process.exec(cmd, { maxBuffer })&lt;/code&gt;&lt;/strong&gt;: Node.js actively consumes &lt;code&gt;stdout&lt;/code&gt; and &lt;code&gt;stderr&lt;/code&gt; into memory and invokes the callback on exit. If output exceeds &lt;code&gt;maxBuffer&lt;/code&gt; (default 1 MB), Node.js &lt;strong&gt;terminates the child process&lt;/strong&gt; with &lt;code&gt;ERR_CHILD_PROCESS_STDIO_MAXBUFFER&lt;/code&gt; and truncates output—it does not silently hang waiting for &lt;code&gt;maxBuffer&lt;/code&gt; to drain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;child_process.spawn(cmd, args, { stdio: &apos;pipe&apos; })&lt;/code&gt;&lt;/strong&gt;: Node.js exposes &lt;code&gt;Readable&lt;/code&gt; streams (&lt;code&gt;child.stdout&lt;/code&gt;, &lt;code&gt;child.stderr&lt;/code&gt;). If the parent does not attach a consumer (&lt;code&gt;&apos;data&apos;&lt;/code&gt; listener or &lt;code&gt;.pipe()&lt;/code&gt;), or pauses consumption while awaiting another condition, the OS pipe buffer fills up and the child’s &lt;code&gt;write()&lt;/code&gt; syscall blocks indefinitely.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inherited pipe descriptors&lt;/strong&gt;: Even after the direct child exits, if a spawned background helper or container wrapper inherits open &lt;code&gt;stdout&lt;/code&gt;/&lt;code&gt;stderr&lt;/code&gt; file descriptors, Node.js waits for all pipe writers to close before emitting &lt;code&gt;&apos;close&apos;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because some runners awaited an external readiness promise before reading &lt;code&gt;child.stdout&lt;/code&gt;, and others spawned descendants that inherited stdio, bumping &lt;code&gt;maxBuffer&lt;/code&gt; on &lt;code&gt;exec()&lt;/code&gt; calls had no effect on the hangs.&lt;/p&gt;
&lt;h2 id=&quot;minimal-reproducible-experiment&quot;&gt;Minimal Reproducible Experiment&lt;/h2&gt;
&lt;p&gt;Observed on &lt;strong&gt;Node.js v22.x (Linux x86_64 &amp;amp; macOS arm64)&lt;/strong&gt;. Note that POSIX pipe capacity is platform-specific (e.g., default 64 KB on many Linux configurations, or dynamically resized on macOS), not a universal constant:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// Reproduces pipe backpressure hang with spawn() when stdout is not consumed&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; { spawn } &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &apos;node:child_process&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; child&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; spawn&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(process.execPath, [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;  &apos;-e&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;  // Write 512 KB to stdout without parent consumption&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;  &apos;process.stdout.write(&quot;x&quot;.repeat(512 * 1024)); console.error(&quot;done&quot;);&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;], {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  stdio: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;ignore&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;pipe&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;pipe&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// Bug: waiting for &apos;close&apos; without draining child.stdout / child.stderr&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;child.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;close&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  console.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;Exited:&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, code); &lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// Never reached once OS pipe buffer fills&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By contrast, running the same 512 KB output through &lt;code&gt;exec()&lt;/code&gt; with &lt;code&gt;{ maxBuffer: 256 * 1024 }&lt;/code&gt; immediately fails with &lt;code&gt;RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded&lt;/code&gt; rather than hanging.&lt;/p&gt;
&lt;h2 id=&quot;the-breakthrough--fix&quot;&gt;The Breakthrough &amp;amp; Fix&lt;/h2&gt;
&lt;p&gt;We standardized all verbose subprocess invocations on &lt;code&gt;spawn()&lt;/code&gt; with immediate, bounded stream consumption, explicit timeout escalation, and isolated &lt;code&gt;stdin&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; { spawn } &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &apos;node:child_process&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; runProcessSafely&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;  command&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;  args&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;  timeoutMs&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; 120_000&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;resolve&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;reject&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; child&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; spawn&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(command, args, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;      stdio: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;ignore&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;pipe&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;pipe&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; stdoutChunks&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Buffer&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; stderrChunks&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Buffer&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;    // Attach stream consumers immediately so OS pipe buffers never stall&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    child.stdout.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;data&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Buffer&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; stdoutChunks.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(chunk));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    child.stderr.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;data&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Buffer&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; stderrChunks.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(chunk));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; timer&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; setTimeout&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;      child.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;kill&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;SIGTERM&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;      setTimeout&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; child.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;kill&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;SIGKILL&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;5_000&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;unref&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;      reject&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;`Process timed out after ${&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;timeoutMs&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;}ms`&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    }, timeoutMs);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    child.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;error&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;      clearTimeout&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(timer);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;      reject&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(err);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;    // Listen to &apos;exit&apos; or ensure descendants do not hold pipe FDs open&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    child.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;close&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;      clearTimeout&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(timer);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;      if&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (code &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;        resolve&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(Buffer.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;concat&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(stdoutChunks).&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;utf-8&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;      } &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        const&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; stderr&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Buffer.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;concat&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(stderrChunks).&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&apos;utf-8&apos;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;        reject&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;`Exited with status ${&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;}: ${&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;stderr&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;500&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;}`&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;takeaway--retrospective&quot;&gt;Takeaway &amp;amp; Retrospective&lt;/h2&gt;
&lt;p&gt;When an asynchronous process runner hangs at 0% CPU without errors, inspect the exact &lt;code&gt;child_process&lt;/code&gt; primitive and its file-descriptor boundary. Never treat &lt;code&gt;exec()&lt;/code&gt; and &lt;code&gt;spawn()&lt;/code&gt; as interchangeable: &lt;code&gt;exec()&lt;/code&gt; enforces a &lt;code&gt;maxBuffer&lt;/code&gt; ceiling, while &lt;code&gt;spawn()&lt;/code&gt; requires immediate stream consumption and clean descriptor boundaries across descendant processes.&lt;/p&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Learning Curve</category><category>Concurrency &amp; OS Pipes</category><category>Node.js</category><category>Operating Systems</category><category>Debugging</category><category>Streams</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Architecting Developer Tools for High-Latency Environments</title><link>https://tedcraft.dev/blog/building-resilient-dev-tools/</link><guid isPermaLink="true">https://tedcraft.dev/blog/building-resilient-dev-tools/</guid><description>Key design heuristics for building CLIs, daemons, and browser extensions that degrade gracefully when networks stutter.</description><pubDate>Sat, 10 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Developer tools operate in hostile environments: intermittent Wi-Fi at conferences, rate-limited CI runners, memory-constrained containers, and erratic packet jitter.&lt;/p&gt;
&lt;p&gt;When building developer infrastructure, resilience cannot be bolted on as an afterthought.&lt;/p&gt;
&lt;h2 id=&quot;1-local-first-by-default&quot;&gt;1. Local-First by Default&lt;/h2&gt;
&lt;p&gt;Never make a local workflow hostage to an API ping. If a CLI or browser tool needs to format text, compute diffs, or validate schemas, that logic belongs entirely on the client—the pattern driving &lt;a href=&quot;https://tedcraft.dev/works/markdown-viewer&quot;&gt;In-Browser Markdown Studio&lt;/a&gt; and &lt;a href=&quot;https://tedcraft.dev/works/unnest-studio&quot;&gt;Unnest Studio&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cache schemas in local storage or SQLite.&lt;/li&gt;
&lt;li&gt;Queue remote synchronization tasks asynchronously.&lt;/li&gt;
&lt;li&gt;Ensure all read operations succeed even when &lt;code&gt;navigator.onLine&lt;/code&gt; is false.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;2-predictable-degradation&quot;&gt;2. Predictable Degradation&lt;/h2&gt;
&lt;p&gt;When external dependencies fail, fail visibly with actionable remedy instructions instead of throwing cryptic stack traces—whether profiling loaded packet jitter in &lt;a href=&quot;https://tedcraft.dev/works/speed-my-net&quot;&gt;SpeedMyNet CLI&lt;/a&gt; or applying geometric jitter backoff in the &lt;a href=&quot;https://tedcraft.dev/works/resilient-orchestrator&quot;&gt;GitLab Resilient Bulk CI/CD Orchestrator&lt;/a&gt;. Tell the user:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What operation was attempted.&lt;/li&gt;
&lt;li&gt;Why it stopped.&lt;/li&gt;
&lt;li&gt;The command or flag needed to proceed offline (e.g. &lt;code&gt;--offline&lt;/code&gt; or &lt;code&gt;--skip-telemetry&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;3-respecting-machine-resources&quot;&gt;3. Respecting Machine Resources&lt;/h2&gt;
&lt;p&gt;Modern dev machines may have 64GB of RAM, but CI runners often have 2GB or less. Design your data ingestion pipelines around &lt;code&gt;O(1)&lt;/code&gt; streaming buffers—like the two-pass &lt;code&gt;ijson&lt;/code&gt; pipeline in &lt;a href=&quot;https://tedcraft.dev/works/unnest-studio&quot;&gt;Unnest Studio&lt;/a&gt;—and drain child-process stdio pipes explicitly to prevent &lt;a href=&quot;https://tedcraft.dev/learning-curves/async-process-deadlocks&quot;&gt;silent OS pipe buffer starvation&lt;/a&gt; rather than slurping gigabytes into memory at once.&lt;/p&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Article</category><category>Architecture</category><category>Tooling</category><category>Performance</category><category>Offline First</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>SpeedMyNet CLI &amp; Network Monitor</title><link>https://tedcraft.dev/works/speed-my-net/</link><guid isPermaLink="true">https://tedcraft.dev/works/speed-my-net/</guid><description>High-precision telemetry tool for bandwidth, bufferbloat, and latency profiling: A developer-focused diagnostic tool that profiles local and ISP connection quality, detecting bufferbloat and packet jitter that traditional speed tests overlook.</description><pubDate>Wed, 02 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Peak download numbers from standard speed tests hide why SSH sessions lag or calls drop during heavy uplinks. SpeedMyNet measures latency under load in a single 6.2 MB Go binary and exports time-series telemetry for Prometheus.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Profiles loaded bufferbloat, packet jitter, and multi-hop stability with ±0.4ms precision in under 8 seconds.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Lightweight 6.2 MB compiled Go CLI and companion WebSocket visualizer streaming microsecond-accurate TCP/UDP socket stages with Prometheus metrics.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Conventional browser speed tests optimize for a single vanity metric—peak download throughput—while ignoring &lt;strong&gt;bufferbloat&lt;/strong&gt; (latency spikes when router queues saturate under concurrent upload/download load). Engineers troubleshooting sluggish SSH sessions, dropped WebRTC audio, or VPN tunnel instability during large &lt;code&gt;git push&lt;/code&gt; or container-image uploads needed deterministic, scriptable loaded-latency diagnostics without browser overhead.&lt;/p&gt;
&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero Runtime Bloat&lt;/strong&gt;: Had to ship as a single static binary (&lt;code&gt;&amp;lt; 10 MB&lt;/code&gt;) with zero external runtime dependencies for quick deployment on Linux jump hosts, edge routers, and developer laptops.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measurement Fidelity&lt;/strong&gt;: Garbage-collection pauses or UI rendering stalls could not skew sub-millisecond socket round-trip timestamps.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;High-Frequency UI Streaming&lt;/strong&gt;: The companion live browser dashboard had to ingest up to &lt;code&gt;2,500&lt;/code&gt; packet-telemetry events per second over WebSockets without dropping below &lt;code&gt;60fps&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;my-contribution&quot;&gt;My Contribution&lt;/h2&gt;
&lt;p&gt;I designed and implemented the Go probe engine, built the staged unloaded-vs-loaded latency scheduler, added the Prometheus metrics exporter mode, and re-architected the WebSocket dashboard rendering pipeline to eliminate layout thrashing.&lt;/p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Three-Phase Probe Pipeline (Go)&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Baseline Idle Phase&lt;/strong&gt;: Samples unloaded ICMP/TCP handshake RTT and baseline jitter using monotonic clock timestamps.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saturated Load Phase&lt;/strong&gt;: Opens bounded worker pools to saturate downlink and uplink channels while concurrently running a dedicated latency-probe goroutine on an isolated socket to quantify queue-induced bufferbloat delta.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Path Stability &amp;amp; Daemon Exporter&lt;/strong&gt;: Exposes &lt;code&gt;/metrics&lt;/code&gt; histograms (&lt;code&gt;rtt_idle_ms&lt;/code&gt;, &lt;code&gt;rtt_loaded_ms&lt;/code&gt;, &lt;code&gt;jitter_p99_ms&lt;/code&gt;, &lt;code&gt;packet_loss_ratio&lt;/code&gt;) for Prometheus and Grafana alerting.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decoupled WebSocket Visualizer&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Ingests raw socket frames into a fixed-size &lt;code&gt;TypedArray&lt;/code&gt; circular ring buffer and flushes DOM/SVG path updates strictly on &lt;code&gt;requestAnimationFrame&lt;/code&gt; ticks rather than per-packet callbacks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Controlled &lt;code&gt;tc-netem&lt;/code&gt; Calibration&lt;/strong&gt;: Validated reported RTT and jitter deltas against deterministic Linux &lt;code&gt;tc qdisc netem delay 25ms 4ms&lt;/code&gt; traffic-shaping rules, confirming &lt;code&gt;±0.4ms&lt;/code&gt; agreement with kernel baselines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Browser Frame-Budget Profiling&lt;/strong&gt;: Profiled sustained &lt;code&gt;2,500 msg/s&lt;/code&gt; WebSocket bursts in Chrome DevTools, verifying frame commit times stayed at ~&lt;code&gt;2.1ms&lt;/code&gt; (&lt;code&gt;60fps&lt;/code&gt;) with zero forced synchronous layouts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast, Actionable Bufferbloat Isolation&lt;/strong&gt;: Completes idle + loaded uplink/downlink profiling in &lt;strong&gt;under 8 seconds&lt;/strong&gt; from a &lt;strong&gt;6.2 MB&lt;/strong&gt; standalone Go binary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sustained Telemetry Observability&lt;/strong&gt;: Enables continuous ISP and VPN link SLA tracking via native Prometheus scraping without third-party agents.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;evidence&quot;&gt;Evidence&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Engineering Post-Mortem&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/learning-curves/websocket-layout-thrashing&quot;&gt;Taming Real-Time Layout Thrashing in Live Telemetry Dashboards&lt;/a&gt; &lt;em&gt;(documents the &lt;code&gt;48ms -&amp;gt; 2.1ms&lt;/code&gt; frame-time remediation inside the companion visualizer)&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Author Engineering Profile&lt;/strong&gt;: &lt;a href=&quot;https://github.com/teddymwai&quot;&gt;teddymwai on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Networking &amp; Developer Tools</category><category>Go</category><category>CLI</category><category>WebSockets</category><category>Prometheus</category><category>Network Telemetry</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>In-Browser Markdown Studio</title><link>https://tedcraft.dev/works/markdown-viewer/</link><guid isPermaLink="true">https://tedcraft.dev/works/markdown-viewer/</guid><description>Instant-render offline workspace for documentation writers and technical bloggers: A zero-latency, local-first browser extension and web workspace enabling technical authors to draft, format, and export formatted documentation with live AST inspection.</description><pubDate>Tue, 11 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Long technical specifications with dense math lag on main-thread editors and drift during scrolling. This local-first Markdown studio moves AST and KaTeX rendering off the main thread into Web Workers and exports clean static HTML bundles.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Maintains sub-4ms input-to-paint authoring latency across 10,000+ line technical documents with 100% offline PWA availability.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; TypeScript Web Components workspace offloading Markdown AST parsing and KaTeX math compilation to Web Workers with proportional line-anchor scroll sync.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Technical authors writing long-form runbooks, RFCs, and security post-mortems hit two recurring friction points in standard web Markdown editors: keystrokes lag once documents exceed several thousand lines with embedded LaTeX/KaTeX equations, and naive percentage-based scroll synchronization drifts badly whenever code blocks or diagrams have different source-vs-rendered heights.&lt;/p&gt;
&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Strict Local-First Privacy&lt;/strong&gt;: Draft runbooks and pre-disclosure post-mortems could never leave the browser over network API calls; storage, parsing, and HTML export had to operate &lt;code&gt;100%&lt;/code&gt; offline.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sub-Frame Input Budget&lt;/strong&gt;: Main-thread keystroke handling had to stay well under the &lt;code&gt;16.6ms&lt;/code&gt; (&lt;code&gt;60Hz&lt;/code&gt;) frame budget even on &lt;code&gt;10,000+&lt;/code&gt; line documents.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero-Script Export Hygiene&lt;/strong&gt;: Exported standalone &lt;code&gt;.html&lt;/code&gt; artifacts had to be safe to archive or share without external CDN or runtime &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;my-contribution&quot;&gt;My Contribution&lt;/h2&gt;
&lt;p&gt;I architected and built the TypeScript Web Components editor shell, implemented the off-main-thread Web Worker AST and KaTeX pipeline, wrote the AST source-line proportional scroll synchronizer, and configured Service Worker offline caching.&lt;/p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Off-Main-Thread Worker Pipeline&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Main thread handles raw text input and cursor state only, posting debounced document diffs to a dedicated &lt;strong&gt;Web Worker&lt;/strong&gt; that executes Markdown tokenization, AST transformation, and KaTeX math layout off the UI thread.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AST Line-Anchor Scroll Synchronization&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Injects lightweight &lt;code&gt;data-source-line&lt;/code&gt; block markers during AST compilation and interpolates viewport offsets between adjacent block anchors—preventing preview drift across tall fenced code blocks and tables.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-Contained Static Bundle Exporter&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Serializes rendered HTML alongside scoped typography/theme CSS variables into a clean, single-file &lt;code&gt;.html&lt;/code&gt; download with zero external scripts.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;10,000-Line Stress Profiling&lt;/strong&gt;: Recorded Chrome DevTools Performance traces under sustained typing and rapid scrolling on a &lt;code&gt;10,000+&lt;/code&gt; line corpus containing fenced code blocks, tables, and KaTeX formulas, confirming &lt;code&gt;&amp;lt; 4ms&lt;/code&gt; P95 input-to-paint latency and zero long tasks (&lt;code&gt;&amp;gt; 50ms&lt;/code&gt;) on the main thread.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Offline Airplane-Mode Validation&lt;/strong&gt;: Verified cold reload, IndexedDB draft persistence, math rendering, and HTML bundle export with network interfaces disabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero Typing Lag at Scale&lt;/strong&gt;: Eliminated main-thread parser stalls on multi-thousand-line technical specifications.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deterministic Offline Authoring&lt;/strong&gt;: Enabled air-gapped and travel-ready technical writing with one-click archival HTML output.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;evidence&quot;&gt;Evidence&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Author Repositories &amp;amp; Tooling&lt;/strong&gt;: &lt;a href=&quot;https://github.com/teddymwai&quot;&gt;teddymwai on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related UI Performance Notes&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/learning-curves/websocket-layout-thrashing&quot;&gt;Taming Real-Time Layout Thrashing in Live Telemetry Dashboards&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Web &amp; Productivity</category><category>TypeScript</category><category>Web Components</category><category>Astro</category><category>Web Workers</category><category>WASM</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Taming Real-Time Layout Thrashing in Live Telemetry Dashboards</title><link>https://tedcraft.dev/learning-curves/websocket-layout-thrashing/</link><guid isPermaLink="true">https://tedcraft.dev/learning-curves/websocket-layout-thrashing/</guid><description>Recovering sustained 60fps rendering under 2,500 WebSocket messages/sec — Obstacle: Our network telemetry viewer dropped from 60fps to under 18fps whenever testing high-throughput network bursts. | Breakthrough: Decoupling network ingest from DOM updates using an in-memory ring buffer with `requestAnimationFrame` render throttling.</description><pubDate>Tue, 04 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Recovering sustained 60fps rendering under 2,500 WebSocket messages/sec&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; Our network telemetry viewer dropped from 60fps to under 18fps whenever testing high-throughput network bursts.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Decoupling network ingest from DOM updates using an in-memory ring buffer with `requestAnimationFrame` render throttling.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;the-bottleneck&quot;&gt;The Bottleneck&lt;/h2&gt;
&lt;p&gt;Our network benchmarking dashboard receives packet-level telemetry over WebSockets at rates up to 2,500 messages per second. Initially, each socket message immediately updated reactive UI state and triggered DOM writes.&lt;/p&gt;
&lt;p&gt;During sustained throughput tests, the browser profiler looked like a mountain range of red bars: &lt;strong&gt;Forced Synchronous Layout&lt;/strong&gt; and &lt;strong&gt;Excessive Garbage Collection&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-diagnosis&quot;&gt;The Diagnosis&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Every incoming message read an element’s &lt;code&gt;.scrollTop&lt;/code&gt; or &lt;code&gt;.getBoundingClientRect()&lt;/code&gt; to compute whether the user had scrolled away.&lt;/li&gt;
&lt;li&gt;It then immediately appended a DOM node or updated an inline SVG path.&lt;/li&gt;
&lt;li&gt;This read-then-write pattern in rapid succession caused the browser to recalculate layout thousands of times per second.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;the-solution&quot;&gt;The Solution&lt;/h2&gt;
&lt;p&gt;We instituted a strict separation of concerns:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[ WebSocket Influx (2.5k/s) ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; [ In-Memory Ring Buffer (Zero GC) ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  (Read on screen tick)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; [ requestAnimationFrame (60Hz / 120Hz) ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   [ Batched Canvas / DOM Update ]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;result&quot;&gt;Result&lt;/h3&gt;
&lt;p&gt;Measured over a &lt;strong&gt;60-second sustained 2,500 messages/sec&lt;/strong&gt; synthetic WebSocket stream in &lt;strong&gt;Chrome 128 (macOS, Apple M2 Pro, 120Hz display)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Average frame render time dropped from &lt;strong&gt;48ms&lt;/strong&gt; (~20fps) to &lt;strong&gt;2.1ms&lt;/strong&gt; (sustained 60fps+ within the 8.3ms/16.6ms budget).&lt;/li&gt;
&lt;li&gt;Zero dropped frames during sustained 60-second bursts on 120Hz ProMotion displays.&lt;/li&gt;
&lt;li&gt;Heap allocation churn minimized by reusing pre-allocated &lt;code&gt;Float64Array&lt;/code&gt; ring-buffer slices.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Learning Curve</category><category>Browser Rendering &amp; Performance</category><category>Performance</category><category>WebSockets</category><category>CSS</category><category>Browser Internals</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Critical Infrastructure Threat-eX Simulation Scenarios</title><link>https://tedcraft.dev/works/threat-emulation-scenarios/</link><guid isPermaLink="true">https://tedcraft.dev/works/threat-emulation-scenarios/</guid><description>High-fidelity industrial control (SCADA/ICS) and ransomware attack scenarios for CYBER RANGES: Architected complex simulation environments including Silverthorn Power Plant (multi-tier SOC simulation against ICS/SCADA infrastructure) and Wizard Spider (ransomware campaign emulation).</description><pubDate>Sun, 15 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Enterprise defense teams need realistic high-pressure drills rather than isolated toy VMs. Architected Silverthorn Power Plant (ICS/SCADA) and Wizard Spider ransomware scenarios across Tier 1 triage, Tier 2 investigation, and Tier 3 forensics.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Delivered live-fire SOC Tier 1–3 threat emulation environments modeling industrial control (SCADA/ICS) attacks and Wizard Spider ransomware campaigns.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Realistic CYBER RANGES scenario blueprints integrating PLC/HMI substation telemetry, Active Directory lateral movement, and blue-team incident containment scoring.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Enterprise Security Operations Center (SOC) teams cannot prepare for critical infrastructure sabotage or coordinated ransomware campaigns using flat, single-VM capture-the-flag labs. Real incidents span IT corporate directories, network segmentation boundaries, and operational technology (OT) telemetry—requiring coordinated handoffs across Tier 1 triage analysts, Tier 2 incident responders, and Tier 3 forensic investigators.&lt;/p&gt;
&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Strict Adversary Quarantine&lt;/strong&gt;: Emulated ransomware routines, Cobalt Strike-style command-and-control beacons, and SCADA command injection scripts had to behave authentically on the wire while remaining air-gapped inside &lt;strong&gt;CYBER RANGES&lt;/strong&gt; OpenStack networks with zero host or external egress.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deterministic Blue-Team Scoring&lt;/strong&gt;: Every attack stage had to produce reproducible SIEM alerts, packet captures, and host forensic artifacts so defending blue teams could be evaluated objectively without scripted flakiness.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-Stack Resource Efficiency&lt;/strong&gt;: Complex multi-subnet topologies (corporate AD + DMZ + OT substation zone) had to boot, initialize background traffic, and tear down cleanly within strict hypervisor quotas.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;my-contribution&quot;&gt;My Contribution&lt;/h2&gt;
&lt;p&gt;I architected scenario blueprints and baseline infrastructure topologies, authored multi-stage adversary TTP chains, calibrated SIEM telemetry and competence evaluation gates across SOC Tiers 1–3, and enforced pre-release provisioning and teardown verification standards.&lt;/p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Silverthorn Power Plant Threat-eX (IT/OT Convergence)&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Corporate &amp;amp; DMZ Perimeters&lt;/strong&gt;: Simulated enterprise identity and jump-host infrastructure bridging into operational substation subnets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ICS / SCADA Control Plane&lt;/strong&gt;: Programmable Logic Controller (PLC) and Human-Machine Interface (HMI) nodes emitting realistic substation telemetry targeted by unauthorized command injection and credential harvesting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Segregated SOC Progression&lt;/strong&gt;: Structured investigation tracks for &lt;strong&gt;Tier 1&lt;/strong&gt; (SIEM alert triage &amp;amp; IOC scoping), &lt;strong&gt;Tier 2&lt;/strong&gt; (lateral-movement tracing &amp;amp; segmentation containment), and &lt;strong&gt;Tier 3&lt;/strong&gt; (memory/disk forensics &amp;amp; PLC recovery).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wizard Spider Adversary Emulation&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Models the end-to-end intrusion chain of the syndicate behind Conti and Ryuk campaigns: spear-phishing initial foothold, simulated C2 beaconing, Active Directory domain enumeration, privilege escalation, and volume shadow copy (&lt;code&gt;vssadmin&lt;/code&gt;) deletion triggers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Quarantine &amp;amp; Route Isolation Checks&lt;/strong&gt;: Verified router security groups and OpenVPN bridge rules prior to scenario publication so simulated malware payloads cannot traverse outside tenant sandboxes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Telemetry &amp;amp; Scoring Determinism&lt;/strong&gt;: Executed end-to-end dry runs across all three SOC tiers to confirm every adversary milestone reliably triggers its corresponding SIEM correlation event and NIST NICE skill tag.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Teardown Hygiene&lt;/strong&gt;: Validated clean OpenStack Heat stack deletion and volume release across repeated multi-team exercise cycles.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Production Live-Fire Readiness&lt;/strong&gt;: Delivered repeatable, multi-tier ICS/SCADA and enterprise ransomware drills capable of evaluating L1, L2, and L3 defenders simultaneously in a shared crisis topology.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Objective Competency Mapping&lt;/strong&gt;: Standardized scenario telemetry tags so defender actions feed directly into automated NIST NICE Knowledge, Skills, and Abilities (KSA) matrices.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;evidence&quot;&gt;Evidence&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Platform Context&lt;/strong&gt;: Deployed within commercial enterprise and defense cyber drill catalogs on &lt;a href=&quot;https://cyberranges.com&quot;&gt;CYBER RANGES&lt;/a&gt; &lt;em&gt;(scenario binaries and tenant templates remain proprietary under client confidentiality)&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related Infrastructure Post-Mortem&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/learning-curves/openstack-stack-lock-contention&quot;&gt;OpenStack Stack Lock Contention &amp;amp; Teardown Mismatches&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Companion Competency Tooling&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/works/nice-framework-mapper&quot;&gt;Automated NIST NICE Framework Mapping Engine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Threat Emulation &amp; CYBER RANGES</category><category>SCADA / ICS</category><category>Ransomware</category><category>Threat-eX</category><category>CYBER RANGES</category><category>Red Teaming</category><category>Blue Teaming</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>RangeMaster Cockpit (CYBER RANGES Operator Panel)</title><link>https://tedcraft.dev/works/rangemaster-cockpit/</link><guid isPermaLink="true">https://tedcraft.dev/works/rangemaster-cockpit/</guid><description>High-assurance QA verification, wire contract enforcement, and CloudTemplate provisioning harness: A production QA platform built with Python, Playwright, and asynchronous network tooling driving automated regression testing across 50+ enterprise and staging environments for CYBER RANGES.</description><pubDate>Mon, 10 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Manual QA and DOM-only assertions missed silent backend contract drifts and OpenStack teardown locks across CYBER RANGES&amp;#39; 200+ client organizations. RangeMaster Cockpit verifies live HTTP Archive (HAR) wire contracts, blocks mutating calls in production-mirror envs, and gates CloudTemplate L3/L4 reachability before release.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Zero critical regressions reached production across 5 consecutive major platform releases while cutting production API anomalies by 40%.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Playwright + HAR wire-contract verification against Golden Baselines, deterministic mutation guards, and OpenStack/OpenVPN CloudTemplate stack validation across 50+ environments.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://tedcraft.dev/demo/rangemaster-cockpit/&quot;&gt;Open interactive reference&lt;/a&gt; · &lt;a href=&quot;https://tedcraft.dev/works/rangemaster-cockpit/&quot;&gt;Read full production dossier&lt;/a&gt;&lt;/p&gt;</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Security &amp; Test Infrastructure</category><category>Python</category><category>Playwright</category><category>OpenStack</category><category>OpenVPN</category><category>HAR Wire Capture</category><category>RBAC</category><category>Docker</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Automated NIST NICE Framework Mapping Engine</title><link>https://tedcraft.dev/works/nice-framework-mapper/</link><guid isPermaLink="true">https://tedcraft.dev/works/nice-framework-mapper/</guid><description>Correlating scenario telemetry and assessment artifacts directly to NIST NICE cybersecurity work roles: An automated analytics tool that maps scenario tags, participant answers, and platform telemetry to the National Initiative for Cybersecurity Education (NICE) Knowledge, Skills, and Abilities (KSA) taxonomy.</description><pubDate>Thu, 25 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Manually aligning hundreds of simulation assessment questions to NIST NICE Knowledge, Skills, and Abilities (KSAs) was slow and inconsistent. This Python mapper resolves weighted domain-and-action rules into repeatable Excel competence matrices.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Maps cyber drill telemetry and assessment tags to 100+ NIST NICE work roles and KSAs in under 2 seconds per assessment.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Python weighted taxonomy rule resolver ingesting scenario assessment metadata and scoring JSON exports to generate deterministic Excel competence heatmaps.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://teddymwai.github.io/nice-framework-mapper/&quot;&gt;Open interactive reference&lt;/a&gt; · &lt;a href=&quot;https://tedcraft.dev/works/nice-framework-mapper/&quot;&gt;Read full production dossier&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Cyber drills and workforce assessments must demonstrate measurable skill progression aligned with industry standards. Manually categorizing hundreds of hands-on simulation questions and telemetry artifacts against the NIST NICE Knowledge, Skills, and Abilities (KSA) taxonomy was slow and produced inconsistent mappings across authors.&lt;/p&gt;
&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Taxonomy Granularity&lt;/strong&gt;: The NIST NICE framework spans 100+ work roles and hundreds of granular Task/Knowledge/Skill statements, where keyword-only matching creates false positives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deterministic Outputs&lt;/strong&gt;: Training leads and enterprise clients required repeatable, auditable Excel/JSON competence matrices without external SaaS dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;my-contribution&quot;&gt;My Contribution&lt;/h2&gt;
&lt;p&gt;I designed and built the Python mapping engine, authored the weighted taxonomy rule resolver, and created the automated competence heatmap exporter.&lt;/p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Dynamic Tag Ingestion&lt;/strong&gt;: Parses scenario metadata, challenge tags, and participant scoring telemetry JSON exports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weighted KSA Rule Resolution&lt;/strong&gt;: Resolves observed challenge milestones against normalized NIST NICE work-role and TKS dictionaries using domain + action weighting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Executive Skills Heatmap&lt;/strong&gt;: Generates multi-sheet Excel competence matrices highlighting team coverage and skill gaps.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;sample-input--mapped-output&quot;&gt;Sample Input &amp;amp; Mapped Output&lt;/h3&gt;
&lt;p&gt;Input scenario artifact:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;scenario_id&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;soc-triage-04&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;tags&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;siem&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;pcap-analysis&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;lateral-movement&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;milestones&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;identify-c2-beacon&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;isolate-compromised-host&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Resolved NICE mapping output:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;scenario_id&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;soc-triage-04&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;work_roles&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;PR-CDA-001 (Cyber Defense Analyst)&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;IN-FOR-002 (Cyber Defense Forensics Analyst)&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;mapped_ksas&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;K0046 (Network traffic analysis)&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;S0057 (Detecting host/network intrusions)&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;confidence&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;high&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Cross-checked automated role and KSA assignments against human-curated reference mappings across representative blue-team and forensics scenarios to tune keyword/action weights and eliminate ambiguous overlaps.&lt;/li&gt;
&lt;li&gt;Benchmarked ingestion and Excel export pipeline at &lt;strong&gt;under 2 seconds per assessment&lt;/strong&gt; across multi-challenge datasets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Automated alignment across &lt;strong&gt;100+ NIST NICE work roles&lt;/strong&gt; with repeatable JSON and Excel heatmap outputs.&lt;/li&gt;
&lt;li&gt;Eliminated manual spreadsheet categorization bottlenecks for scenario authors and assessment leads.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;evidence&quot;&gt;Evidence&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Live Reference&lt;/strong&gt;: &lt;a href=&quot;https://teddymwai.github.io/nice-framework-mapper/&quot;&gt;NICE Framework TKS Mapper (GitHub Pages)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Source Repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/teddymwai/nice-framework-mapper&quot;&gt;nice-framework-mapper on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Companion Scenario Suite&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/works/threat-emulation-scenarios&quot;&gt;Critical Infrastructure Threat-eX Simulation Scenarios&lt;/a&gt; &lt;em&gt;(live-fire SOC L1–L3 exercises evaluated against these NIST NICE role mappings)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Cybersecurity &amp; Analytics</category><category>Python</category><category>NIST NICE</category><category>Analytics</category><category>KSA Taxonomy</category><category>Excel Automation</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Hunting Silent Failures Below the UI: OpenStack Stack Lock Contention &amp; Teardown Mismatches</title><link>https://tedcraft.dev/learning-curves/openstack-stack-lock-contention/</link><guid isPermaLink="true">https://tedcraft.dev/learning-curves/openstack-stack-lock-contention/</guid><description>How digging beneath frontend timeouts revealed OpenStack database lock contention and an API argument type mismatch — Obstacle: Automated end-to-end test suites intermittently froze during CloudTemplate stack teardown in staging, throwing generic 60-second browser timeout errors. | Breakthrough: Correlating live browser HAR captures with platform OpenStack Heat logs revealed two hidden root causes: simultaneous teardown calls caused stack lock contention, while a payload argument type mismatch silently aborted cleanup.</description><pubDate>Sat, 14 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; How digging beneath frontend timeouts revealed OpenStack database lock contention and an API argument type mismatch&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; Automated end-to-end test suites intermittently froze during CloudTemplate stack teardown in staging, throwing generic 60-second browser timeout errors.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Correlating live browser HAR captures with platform OpenStack Heat logs revealed two hidden root causes: simultaneous teardown calls caused stack lock contention, while a payload argument type mismatch silently aborted cleanup.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;1-the-symptom--operational-context&quot;&gt;1. The Symptom &amp;amp; Operational Context&lt;/h2&gt;
&lt;p&gt;In our CYBER RANGES automated verification harness, tests boot full CloudTemplate stacks (multi-node virtual machines connected via OpenVPN bridges) and tear them down after verifying Layer 3/Layer 4 reachability.&lt;/p&gt;
&lt;p&gt;Randomly, around 8% of test runs would fail with:
&lt;code&gt;TimeoutError: Timed out waiting for element [data-testid=&quot;stack-status-deleted&quot;] after 60000ms&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The frontend remained stuck in a “Deleting…” loading state. Rerunning the test sometimes passed, leading earlier teams to write it off as “cloud flakiness.”&lt;/p&gt;
&lt;h2 id=&quot;2-false-assumptions-what-failed-initially&quot;&gt;2. False Assumptions (What Failed Initially)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Attempt 1: Bumping the timeout from 60s to 180s.&lt;/strong&gt;
The stack still hung, and tests just took 3x longer to fail.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attempt 2: Adding artificial polling delays.&lt;/strong&gt;
The issue still manifested under parallel test execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;3-the-turning-point-digging-beneath-the-ui&quot;&gt;3. The Turning Point: Digging Beneath the UI&lt;/h2&gt;
&lt;p&gt;Instead of looking at the web page, I captured the exact network wire traffic using Playwright HAR recording and correlated the timestamps directly with backend OpenStack Heat orchestration logs.&lt;/p&gt;
&lt;p&gt;Two distinct root causes emerged:&lt;/p&gt;
&lt;h3 id=&quot;issue-a-openstack-stack-lock-contention&quot;&gt;Issue A: OpenStack Stack Lock Contention&lt;/h3&gt;
&lt;p&gt;When automated test runners triggered teardown in rapid succession, two simultaneous &lt;code&gt;DELETE&lt;/code&gt; requests hit the orchestration gateway (synthetic &lt;code&gt;/api/v1/infrastructure/stacks/{id}&lt;/code&gt;). In OpenStack Heat, a stack acquires an exclusive database lock during state transitions. The second call received a database lock contention error (&lt;code&gt;409 Conflict&lt;/code&gt;), which the API proxy swallowed and masked as an in-progress operation.&lt;/p&gt;
&lt;h3 id=&quot;issue-b-the-argument-type-mismatch&quot;&gt;Issue B: The Argument Type Mismatch&lt;/h3&gt;
&lt;p&gt;Looking at the wire capture of the termination payload:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// What the frontend was sending:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;stack_id&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;8f3e21a4-9b22-4411-b851-91a92e19b882&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  &quot;force_delete&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;  // String instead of Boolean!&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The downstream Python API handler expected a strict boolean &lt;code&gt;False&lt;/code&gt;, but received the string &lt;code&gt;&quot;false&quot;&lt;/code&gt;. In Python, any non-empty string evaluates truthy:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# Downstream bug:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; payload.get(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;force_delete&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;    # Evaluated to True because bool(&quot;false&quot;) is True!&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    trigger_unclean_hypervisor_kill()&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This triggered an unclean hypervisor detach before OpenStack released volume locks, leaving orphaned cinder volumes and permanently locking the stack!&lt;/p&gt;
&lt;h2 id=&quot;4-the-remediation&quot;&gt;4. The Remediation&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;State-Guarded Teardown&lt;/strong&gt;: Updated the harness to check stack lock state (&lt;code&gt;/instance/canrun&lt;/code&gt; and &lt;code&gt;/status&lt;/code&gt;) before issuing delete requests, queuing subsequent calls deterministically.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strict OpenAPI Schema Casting&lt;/strong&gt;: Enforced strict DTO typing in the API mediator so boolean parameters cannot be passed as strings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HAR-Based Verification&lt;/strong&gt;: Integrated automated network assertion checks into RangeMaster Cockpit to verify that wire payloads match the exact OpenAPI contract.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;5-permanent-engineering-heuristics&quot;&gt;5. Permanent Engineering Heuristics&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;When an asynchronous cloud action hangs, look at the orchestrator’s state lock mechanism, not the UI spinner.&lt;/li&gt;
&lt;li&gt;Treat type coercion bugs at API boundaries as critical security and reliability flaws.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Learning Curve</category><category>Cloud Infrastructure &amp; Wire Debugging</category><category>OpenStack</category><category>Python</category><category>Playwright</category><category>HAR Capture</category><category>Cloud Infrastructure</category><category>Debugging</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Eliminating API Drifts with HAR-Driven Wire Contract Verification</title><link>https://tedcraft.dev/learning-curves/har-driven-contract-verification/</link><guid isPermaLink="true">https://tedcraft.dev/learning-curves/har-driven-contract-verification/</guid><description>Why we abandoned pure DOM-based assertions and built wire-level HTTP Archive validation for multi-tenant cyber range platforms — Obstacle: Frontend test suites gave green checkmarks while production API endpoints broke due to payload drift, missing headers, and undocumented schema changes across 50+ client deployments. | Breakthrough: Intercepting HTTP traffic at the Playwright browser context layer, saving certified HAR Golden Baselines, and asserting on strict wire contracts rather than fickle DOM nodes.</description><pubDate>Mon, 20 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Why we abandoned pure DOM-based assertions and built wire-level HTTP Archive validation for multi-tenant cyber range platforms&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; Frontend test suites gave green checkmarks while production API endpoints broke due to payload drift, missing headers, and undocumented schema changes across 50+ client deployments.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Intercepting HTTP traffic at the Playwright browser context layer, saving certified HAR Golden Baselines, and asserting on strict wire contracts rather than fickle DOM nodes.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;1-the-symptom--operational-context&quot;&gt;1. The Symptom &amp;amp; Operational Context&lt;/h2&gt;
&lt;p&gt;Multi-tenant cyber range platforms operate across production, staging, and dozens of isolated client instances, with portals backed by distinct domain services (catalog, session orchestration, scoring, and assessment). &lt;em&gt;(All routes and service names below are synthetic equivalents.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Our QA team previously wrote browser tests that asserted on UI text and button visibility. Despite passing CI test runs, client deployments frequently suffered regressions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A backend service renamed an enum field from &lt;code&gt;snake_case&lt;/code&gt; to &lt;code&gt;camelCase&lt;/code&gt;; the frontend fell back to a default value without throwing an error, but persisted corrupted state.&lt;/li&gt;
&lt;li&gt;A refactored route silently dropped an expected role-scope claim in a response payload, passing UI smoke checks while failing downstream authorization validation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;2-the-mental-model-trap&quot;&gt;2. The Mental Model Trap&lt;/h2&gt;
&lt;p&gt;The traditional QA mental model was: &lt;strong&gt;“If the user can click the button and see the success message, the feature works.”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In enterprise and cybersecurity platforms, this is dangerously flawed. The frontend DOM is an abstraction designed to be forgiving of partial failures and cached states. A button click that returns &lt;code&gt;HTTP 200&lt;/code&gt; with an empty or malformed JSON payload might still render a green success notification while leaving the database in an inconsistent state.&lt;/p&gt;
&lt;h2 id=&quot;3-the-turning-point-wire-level-contract-verification&quot;&gt;3. The Turning Point: Wire-Level Contract Verification&lt;/h2&gt;
&lt;p&gt;In &lt;strong&gt;RangeMaster Cockpit&lt;/strong&gt;, we shifted testing down from the DOM to the &lt;strong&gt;wire protocol layer&lt;/strong&gt; using synthetic OpenAPI/HAR contracts:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# RangeMaster Cockpit: Synthetic wire capture &amp;amp; contract validation&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; verify_workflow_wire_contract&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(page, expected_schema):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;    # Intercept outbound network traffic on synthetic API route&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    with&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; page.expect_response(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;**/api/v1/playlists&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; response_info:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;        page.get_by_role(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;button&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Create Playlist&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;).click()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    response &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; response_info.value&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    assert&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; response.status &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; 201&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Expected 201 Created, got &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;response.status&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;    # Assert on exact wire response body against OpenAPI contract&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    payload &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; response.json()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    validate_openapi_conformance(payload, expected_schema)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;example-synthetic-contract-drift-caught&quot;&gt;Example Synthetic Contract Drift Caught&lt;/h3&gt;
&lt;p&gt;When a backend update changed &lt;code&gt;execution_mode&lt;/code&gt; to &lt;code&gt;executionMode&lt;/code&gt;, DOM assertions still passed because the UI rendered a default badge. Wire validation caught the drift immediately:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ContractValidationError: /api/v1/sessions (201 Created)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Missing required property: &apos;execution_mode&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Unexpected property: &apos;executionMode&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Expected schema: SessionResponseV1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Furthermore, we introduced &lt;strong&gt;Mutation Guards&lt;/strong&gt;:
Any test execution pointing against a production or shared client tenant is strictly forbidden from issuing state-mutating HTTP methods (&lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;) unless explicit environment safety bypasses are certified.&lt;/p&gt;
&lt;h2 id=&quot;4-results&quot;&gt;4. Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;40% Reduction in Production API Anomalies&lt;/strong&gt;: Measured over a 6-month post-rollout window against the prior 6-month baseline across 50+ managed range environments, catching contract drifts in staging before release tags were cut.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deterministic Teardown&lt;/strong&gt;: Every entity created in a staging test is tracked via its HTTP response ID and automatically purged during teardown.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero Critical Production Regressions&lt;/strong&gt;: Zero critical regressions reached production across 5 consecutive major platform releases.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Learning Curve</category><category>Test Architecture &amp; API Governance</category><category>Playwright</category><category>Python</category><category>HAR Wire Capture</category><category>API Testing</category><category>Architecture</category><category>QA Automation</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>The $450K Blindspot: Why We Shifted from Quarterly Audits to Revocation Latency Metrics</title><link>https://tedcraft.dev/learning-curves/privilege-revocation-latency-gap/</link><guid isPermaLink="true">https://tedcraft.dev/learning-curves/privilege-revocation-latency-gap/</guid><description>How identifying the gap between departure notifications and actual credential deprovisioning closed a major security exposure — Obstacle: Compliance audits reported 100% adherence to access controls, yet offboarded consultants and reassigned team members retained access to sensitive environments for days. | Breakthrough: Shifting the primary governance metric from &apos;did we complete a quarterly review&apos; to &apos;how many hours elapse between an offboarding event and privilege revocation&apos; exposed quantifiable risk.</description><pubDate>Sat, 18 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; How identifying the gap between departure notifications and actual credential deprovisioning closed a major security exposure&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Wall:&lt;/strong&gt; Compliance audits reported 100% adherence to access controls, yet offboarded consultants and reassigned team members retained access to sensitive environments for days.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Shifting the primary governance metric from &amp;#39;did we complete a quarterly review&amp;#39; to &amp;#39;how many hours elapse between an offboarding event and privilege revocation&amp;#39; exposed quantifiable risk.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;1-the-operational-context&quot;&gt;1. The Operational Context&lt;/h2&gt;
&lt;p&gt;In high-assurance environments managing multi-tenant client infrastructure, role-based access control (RBAC) is paramount. Our quarterly User Access Management (UAM) reviews always passed audit standards: managers signed off on user lists, evidence was archived, and checkmarks were earned.&lt;/p&gt;
&lt;p&gt;However, when investigating an unrelated SIEM log trace, I noticed API queries originating from an account belonging to a contractor whose project engagement had concluded two weeks prior.&lt;/p&gt;
&lt;h2 id=&quot;2-the-mental-model-trap&quot;&gt;2. The Mental Model Trap&lt;/h2&gt;
&lt;p&gt;The organization operated under the assumption that &lt;strong&gt;“passing quarterly audits = least privilege is maintained.”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In reality:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Quarterly audits are retrospective snapshots. They tell you who &lt;em&gt;currently&lt;/em&gt; has access, but ignore the window of exposure that existed between reviews.&lt;/li&gt;
&lt;li&gt;When an external consultant finishes a project on Day 4 of a 90-day quarter, their account would remain active for up to 86 days before anyone flagged it during the next audit.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;3-the-turning-point-quantifying-revocation-latency&quot;&gt;3. The Turning Point: Quantifying Revocation Latency&lt;/h2&gt;
&lt;p&gt;Rather than treating this as a simple administrative oversight, I introduced a new metric to the executive risk register: &lt;strong&gt;Privilege Revocation Latency (PRL)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;$$PRL = T_{\text{Revocation Timestamp}} - T_{\text{Contract/Role End Timestamp}}$$&lt;/p&gt;
&lt;p&gt;By cross-referencing HR departure timestamps against Active Directory and portal session logs over the prior four quarters, the data revealed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Average revocation latency across contractors was &lt;strong&gt;14.2 days&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In 11 instances, departed personnel retained access to production cloud environments holding proprietary client data.&lt;/li&gt;
&lt;li&gt;Under our client SLA penalty clauses and regulatory non-compliance exposure, this blindspot represented &lt;strong&gt;$400,000 to $450,000&lt;/strong&gt; in potential financial liability.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;4-the-remediation&quot;&gt;4. The Remediation&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Automated Reconciliation Engine&lt;/strong&gt;: Built a Python service that queries client engagement expiration APIs nightly and cross-references active LDAP/portal accounts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Immediate Event Revocation&lt;/strong&gt;: Integrated webhook-driven deprovisioning: the moment an engagement ends in the project management system, an API call revokes tokens and suspends accounts automatically.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Executive Dashboard Alerting&lt;/strong&gt;: Added Revocation Latency to the central GRC dashboard with an automated alert triggered if any account remains active &amp;gt; 4 hours post-departure.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;5-result&quot;&gt;5. Result&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Privilege revocation latency plummeted from &lt;strong&gt;14.2 days&lt;/strong&gt; down to &lt;strong&gt;&amp;lt; 2 hours&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Zero unauthorized access or privilege escalation incidents across 50+ enterprise environments over the following 18 months.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Learning Curve</category><category>Access Governance &amp; Technology Risk</category><category>Access Governance</category><category>RBAC</category><category>Risk Management</category><category>Security Operations</category><category>Python</category><author>ted@tedcraft.dev (Ted Mwai)</author></item><item><title>Automated User Access Management (UAM) Review Engine</title><link>https://tedcraft.dev/works/uam-access-review-engine/</link><guid isPermaLink="true">https://tedcraft.dev/works/uam-access-review-engine/</guid><description>Python governance automation tool that compressed quarterly access reviews from 17 days to 13 business hours: An automated audit reconciliation engine that parses identity directories, cross-references active client engagements, detects orphan accounts, and monitors privilege revocation latency.</description><pubDate>Fri, 12 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Executive TL;DR:&lt;/strong&gt; Manual spreadsheet cross-checks across Active Directory, LDAP, and cloud IAM took 17 business days per quarter and masked offboarding delays. This Python reconciliation engine correlates 150+ internal and 1,000+ client operator accounts in 13 hours with ISO 27001 and SOC-ready audit trails.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Compressed quarterly user access reviews from 17 business days to 13 business hours and identified $400K–$450K in estimated annual exposure.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Automated Python RBAC reconciliation correlating Active Directory, cloud IAM consoles, and HR departure manifests to track privilege revocation latency.&lt;/p&gt;&lt;hr /&gt;&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Quarterly User Access Management (UAM) reviews were a manual bottleneck: security analysts exported user rosters from Active Directory, LDAP, cloud consoles, and internal portals, then cross-referenced each record against HR rosters and client project manifests by hand. This consumed &lt;strong&gt;17 business days&lt;/strong&gt; per quarter and masked lag between offboarding events and actual privilege revocation.&lt;/p&gt;
&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Heterogeneous Identity Sources&lt;/strong&gt;: Identity data spanned directory services, cloud IAM tables, and engagement manifests with inconsistent identifier formats.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audit Traceability&lt;/strong&gt;: Every reconciliation decision needed deterministic, timestamped evidence suitable for ISO 27001 and SOC review.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero-Trust Perimeter&lt;/strong&gt;: Stale contractor and consultant privileges across 50+ environments created unmeasured compliance and operational risk.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;my-contribution&quot;&gt;My Contribution&lt;/h2&gt;
&lt;p&gt;I designed and implemented the Python reconciliation engine, defined privilege revocation latency as an executive governance metric, and built the automated PDF/CSV audit register generator in collaboration with security operations stakeholders.&lt;/p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Identity &amp;amp; Manifest Ingestion&lt;/strong&gt;: Normalizes exports from identity providers, authorization tables, and active HR/client engagement manifests.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated Role Reconciliation&lt;/strong&gt;: Flags over-privileged accounts, inactive consultants, and mismatched group memberships deterministically.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Revocation Latency Tracking&lt;/strong&gt;: Measures elapsed hours between HR/engagement offboarding timestamps and identity-provider deprovisioning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audit-Ready Evidence Bundles&lt;/strong&gt;: Generates timestamped, cryptographically signed PDF and CSV audit registers.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Reconciled &lt;strong&gt;100% of active user records&lt;/strong&gt; across &lt;strong&gt;150+ internal accounts and 1,000+ client operator accounts&lt;/strong&gt; in 50+ environments against HR offboarding manifests prior to sign-off.&lt;/li&gt;
&lt;li&gt;Validated generated exception lists against manual spot-check baselines across quarterly audit cycles, achieving &lt;strong&gt;0 unauthorized access or privilege escalation incidents over 18 months&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Turnaround Compression&lt;/strong&gt;: Reduced quarterly access review cycles from &lt;strong&gt;17 business days to 13 business hours&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exposure &amp;amp; Latency Improvement&lt;/strong&gt;: Identified an estimated &lt;strong&gt;$400K–$450K annual business exposure&lt;/strong&gt; associated with delayed privilege revocation, and helped reduce revocation turnaround from &lt;strong&gt;days to under 2 hours&lt;/strong&gt; through automated access governance.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;evidence&quot;&gt;Evidence&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Source Repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/teddymwai/uam-review-engine&quot;&gt;uam-review-engine on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related Post-Mortem&lt;/strong&gt;: &lt;a href=&quot;https://tedcraft.dev/learning-curves/privilege-revocation-latency-gap&quot;&gt;The $450K Blindspot: Privilege Revocation Latency Gap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><dc:creator>Ted Mwai</dc:creator><category>Production Work</category><category>Security Governance &amp; Automation</category><category>Python</category><category>RBAC</category><category>Access Governance</category><category>SIEM</category><category>Audit Automation</category><category>REST APIs</category><author>ted@tedcraft.dev (Ted Mwai)</author></item></channel></rss>