automation
Technical notes on web development, DevOps, and AI integration.
52 articles
- 14:52tooling
Two-Tier Law in a Commit Hook at KotaPortal
A commit-hook script keeps two tiers of law: broken test-marker claims block the commit, while risky surfaces like auth paths or destructive migrations only earn a logged warning.
TL;DR: The commit script has two tiers: a test marker like "characterization" hard-blocks the commit unless an exact comment line is present, while risky surfaces such as auth code, destructive migrations, or dangerouslySetInnerHTML only log a warning. Hard-blocking everything would kill velocity, and hooks can be bypassed with --no-verify. The goal is raising the cost of carelessness, not building a wall.
#git#git-hooks#security - 14:00tooling
The Machine That Guards Review Claims in Commit Messages
A bash gate turns free-text Security-review claims into three machine-tested invariants on the commit-msg hook.
TL;DR: Review claims in commit messages are usually free text nobody checks, so one repo added a bash commit-msg gate turning them into machine-tested invariants. The script enforces exactly one Security-review: trailer, a fixed position above Co-Authored-By, and substance, matching "tests only" claims against a whitelist of changed paths. It's bypassable with --no-verify, but it cheaply catches honest mistakes.
#git#bash#security - 05:13backend
Scraping via the Preview Panel: The Session Is the Credential
The preview panel session is the scraping credential: rotating URL tokens, cosmetic click failures, CDP left dead.
TL;DR: When scraping Jakarta's court portal, external fetches only hit captcha walls because the browser session inside the panel carries the real credentials. Rotating tokens force click-driven navigation, and automation success flags lie, so verify via URL and DOM instead of auto-retrying. This approach harvested 4,828 bankruptcy cases across 242 pages, keeping sessions in-panel with checkpoints instead of URL replays.
#scraping#browser-automation#captcha - 04:24backend
Stealth Proxies Cannot Buy a Captcha That Measures the Browser
Stealth proxies beat WAF walls and die at browser-measuring captcha gates.
TL;DR: Stealth proxies hit captcha walls, not WAFs: Jakarta Selatan hid Cloudflare Turnstile, Jakarta Pusat ran reCAPTCHA v2. Real browsers cleared both—Chromium passed Turnstile untouched; a Firefox anti-detect profile solved reCAPTCHA with Tab plus Space, no solver service. Detail pages need live sessions, so the build now tiers access: proxies for WAFs, browsers for captchas, supervised runs for Jakarta Pusat.
#scraping#captcha#browser-automation - 03:26backend
A Daily Signal Ingest Pilot from Public Registries
Two registries passed probing: scrapers behind one seam, idempotency forced via content hash, and a daily 05:00 ingest with jitter.
TL;DR: A pilot ingests daily signals from the LKPP procurement blacklist and three courts' SIPP bankruptcy/PKPU case lists through a single SignalSource interface. Idempotency comes from content hashes and unique constraints, so re-runs never duplicate data, and one court failing doesn't kill the run. The job runs once daily via APScheduler under strict politeness rules, with privacy safeguards built in.
#scraping#open-data#automation - 02:35devops
Checking the gate with one command
What used to take four MCP round trips and an 86KB payload at session start is now one read-only script with semantic exit codes.
TL;DR: Checking status used to need four heavy MCP calls, and caching only created stale-data headaches. The fix was a lightweight read-only script that runs four checks in parallel with clear exit codes for ready, drift, or infra trouble. It handles quirks like Cloudflare blocks and rate limits while staying local for quick iteration and always-fresh data.
#python#plane#devops - 14:26ai
Designing Init Rules Skill: Layered Pack and Idempotency
A 199-line spec for the init-rules skill: layered universal + per-stack packs, CLAUDE.md as an index, and idempotent re-runs the Go generated-code and Copier way.
TL;DR: Starting from a bloated root CLAUDE.md, the author split rules into on-demand, path-specific files instead of one massive doc. The fix became a layered, harness-first skill pack with universal, stack-specific, and scaffold layers plus assert-based self-checks. To make reruns safe, the generator owns all artifacts like Go's generated-code marker, enabling idempotent smart merges that preserve local changes.
#ai-agents#tooling#automation - 06:26devops
KTM Joins Inventory: From Custom 0.5.81 to Vendor 0.5.86
KTM was invisible to Ansible until I added it to two inventory groups. One playbook run later, it swapped from custom 0.5.81 to vendor 0.5.86 with data intact.
TL;DR: Ansible skipped KTM because the host wasn't in inventory, so --limit couldn't target it until two group edits added it. The playbook then upgraded the container from a custom 0-5-81 build to vendor latest 0-5-86, now back in sync. Dashboard password persisted via bind-mounted datadir, while the old custom image remains on disk for later cleanup.
#docker#ansible#automation - 22:20tooling
When Browser Automation Selectors Break on Locale Switches
My automation browser profile leaked an id-ID locale, the UI rendered Tanya Qwen instead of Ask Qwen, and every exact-label selector quietly broke. Here is the two-layer fix.
TL;DR: An automation suite broke because the browser profile's id-ID locale made the target site render UI text in Indonesian, so exact-match selectors like "Ask Qwen" failed. The fix: regex alternation accepting both languages, plus pinning the locale via context emulation. A small assert-based test guards against regressions.
#automation#playwright#regex