SShortSingh.
Back to feed

diffdiet: A CI Gate That Scores AI Coding Agents' Diffs for Bloat

0
·3 views

An AI coding agent fixing a one-line greeting bug can produce a correct fix that adds unnecessary code, such as new modules, abstractions, and dependencies, which tests and linters don't catch. The author built diffdiet, a zero-dependency Python tool that grades unified diffs with a transparent 0-100 score and enforces a budget gate in CI. Its companion rules pack for agent config files discourages single-use abstractions, unneeded dependencies, and commented-out dead code. The repository includes a lean and a bloated version of the same fix, which score 100 and 57 respectively, with only the lean one passing the default gate of 60. The tool is MIT-licensed, requires Python 3.10+, and its budgets are tunable through a configuration file.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Federated Learning Averages Model Updates, But Heterogeneous Data Can Break It

Most machine learning assumes all data is centralized, yet real data often lives on phones, in hospitals, banks, and factories where moving it is costly or restricted. Federated learning instead sends the model to the data: each client trains locally and returns only an update, which a server combines into a new global model. The standard method, Federated Averaging (FedAvg), forms this global model as a weighted average of client models, with weights based on dataset size. The approach generally works because every client starts each round from the same model, keeping local models close enough that their average stays sensible, but this breaks down when clients train for too long. The main difficulty is non-IID data, since different clients see different distributions, which makes local updates less representative of the whole population.

0
ProgrammingDEV Community ·

Matter over Thread vs Tuya ZigBee: What Changes in 2026

Matter and ZigBee are often compared as if they were equivalent, but they operate at different layers: Matter defines device behavior, while Thread and ZigBee handle the underlying mesh radio. The practical choice is therefore between Matter over Thread and the Tuya stack running on ZigBee or Wi-Fi. Matter offers multi-admin support, local-first control and strict design intent, though it exposes only a fixed set of clusters, so vendor extras like power monitoring may disappear. Thread also requires a border router such as a recent smart speaker or hub, which is easy to overlook before buying. Overall, Tuya ZigBee remains adequate for mains-powered switches, while Matter is preferable for locks and battery sensors, and existing Tuya devices do not convert automatically to Matter.

0
ProgrammingDEV Community ·

Adding Tuya Smart Switches to Home Assistant: Three Integration Paths and Their Trade-offs

Tuya devices can connect to Home Assistant in three ways, depending on whether they use Tuya's cloud platform, Wi-Fi firmware, or a ZigBee profile. The cloud-based Tuya integration works with nearly all Tuya devices and survives firmware updates, but it relies on polling, causing delays and failing when the internet is down. Local Tuya communicates directly over the LAN for faster, offline control, but requires a per-device local key and often fails with newer firmware or unresponsive devices. Some ESP-based plugs can be reflashed with ESPHome or Tasmota for fully local control, though this is advised against for mains wall switches due to safety and certification concerns. Tuya ZigBee switches pair with coordinators like Zigbee2MQTT or ZHA for reliable basic on/off switching, while proprietary features such as scenes and energy monitoring typically do not map cleanly.

0
ProgrammingDEV Community ·

EchoLantern: A Local-First App for Writing Private Memory Keepsakes

EchoLantern is a local-first tool that helps users turn rough notes about everyday memories, people, pets, places, and traditions into editable keepsake cards. Users can optionally add a photo, and the app generates a reflective paragraph, a card inscription, and a gentle reflection question. Saved entries are kept in a searchable browser archive and can be exported as Markdown or JSON. In its local mode, the app uses the Gemma 3 1B model through Ollama, while the hosted demo falls back to templates labeled as such. The developer notes that generated text needs human review, and that browser storage is unencrypted and requires backups.