automation
Technical notes on web development, DevOps, and AI integration.
52 articles
- 20:49devops
Two Constants, One Silent Lie: Catching Drift with ast Instead of Imports
A constant that projects from another constant drifts the day the source changes. ast.parse compares them without executing a line.
TL;DR: A new CLOSE_ACTIONS value slipped through deploys because the kernel's STATE_ACTIONS in another file never learned about it. Importing the wrapper risks side effects and copied comments rot, so a shell script parses both files as text using Python's ast module. It checks CLOSE_ACTIONS against the expected projection and flags any drift.
#python#testing#debugging - 20:47devops
The Launcher That Pays Twice: Three Guard Layers Before a Delegation Script Fires
Launching a delegation script twice burns the budget twice. flock, artifact check, and pgrep refuse before anything starts.
TL;DR: The author re-ran a Claude Code command thinking it was stuck, accidentally spawning a duplicate that burned the same budget in parallel. Their launcher now refuses to start using three pre-flight checks: flock -n on a file descriptor, a valid result JSON check, and pgrep -f for a live twin. Each refusal gets a distinct exit code.
#bash#devops#automation - 04:03devops
Event Log Integrity the Git Way: A Frame Tamper Story
A one-byte frame tamper taught me how content-addressed sidecars, an append-only event log, and disk-truth verification keep a pipeline recoverable.
TL;DR: When a corrupted frame triggered media-quarantine instead of a crash, the kernel proved it rebuilds state from events and verifies files from disk, never trusting recorded hashes. Content-addressed caption sidecars give free deduplication, while the append-only log enables clean recovery through full rebuilds. But hash chains prove tamper-evidence, not authenticity—integrity is an architecture, not a checksum ritual.
#git#event-sourcing#automation - 18:21devops
When Custom Docker Images Break Your Upgrade Playbook
Fleet-wide custom Docker images make digest-based upgrade playbooks obsolete; verification shifts to app endpoints, upgrade path becomes clone→build→transfer.
TL;DR: Locally built Docker images broke my Ansible upgrade playbook, since digest comparison needs a remote registry image that custom builds never have. Automation has permanently forked for these hosts. Upgrades are now manual: build locally, transfer via scp, docker load, then swap containers with about 15 seconds downtime while data mounts stay untouched.
#docker#ansible#automation - 21:24devops
The Debug Task That Only Fails When Nothing Changes
An Ansible dry run died on a harmless debug task. The skipped command tasks never filled their registered vars, and the trailing default filter never got a cha…
TL;DR: Running an Ansible playbook with --check can crash on a debug task even when the real tasks skip cleanly, because skipped tasks never register their variables. Filter chains run left to right, so last hits the undefined value before a trailing default can help. The fix is wrapping the value in default before later filters run.
#ansible#automation#devops - 14:23tooling
The Context Guard: Validating What Your Pipeline Sends
A prompt assembly failure can send a naked question to an AI chat and still pass as grounded synthesis. A cheap input-side guard keeps the chain honest.
TL;DR: The pipeline sent a naked question to the AI with zero context, yet the generic answer passed all validation because checks only ran on output, never input. The fix is a cheap context_present() gate requiring either 400 characters or a URL, tagging results as missing or ok. It warns without blocking, since harsh guards get deleted.
#python#automation#llm - 13:22tooling
AI Chat Scraper Audit: From False Positives to Precise Regex
A loose completion gate called a half-written answer done. One audit produced four fixes: pre-answer failure patterns, an anchored heading gate, probe-copy.
TL;DR: The scraper kept cutting AI answers short because loose completion gates matched "Sources" inside citation lines. The fix narrows trust: failure patterns only count before any answer text, and the completion gate requires a contracted final heading via a strict regex. Added a --probe-copy diagnostic and evidence logging; selftest grew from 72 to 79 asserts.
#python#regex#debugging - 02:28tooling
The .rejected File: When Human Decisions Beat Derived Status
My research registry only had derived statuses, until a .rejected file gave human decisions a seat in the precedence chain.
TL;DR: A dismissed research topic kept reappearing in the registry scan, so the author added a .rejected marker file that humans write and tools only read, storing the reason in a rejected_reason field. The article compares this to precedence chains in rustup, pyenv, nvm, and git. Key lessons: markers are human decisions, and overrides must be visible, never silent.
#python#automation#tooling - 11:31ai
Duplicate-Gate Blind Spot: Vector Coverage and 0.50
A cosine-similarity duplicate gate is only as good as its vector coverage. Lessons from a 32-article blind spot and a self-measured 0.50 cutoff.
TL;DR: I nearly trusted a duplicate check running on a half-populated index, since 164 of 196 articles had vectors and the missing 16% never showed up. The fix was a backfill plus a self-check confirming each article's own title returns its slug. The 0.50 cutoff isn't universal either; measure your corpus's own score distribution first.
#embedding#python#automation