SShortSingh.
Back to feed

Why git checkout can't undo an AI agent's code changes, and a better checkpoint approach

0
·4 views

When an AI agent edits project files and breaks something, developers often reach for git checkout or git stash, but these answer a different question than the one they face. Git restores the last commit or a snapshot of tracked files, which mixes the user's uncommitted work with the agent's changes and ignores gitignored files. The osFoundry desktop app instead stores each file's prior bytes in a content-addressed store before the agent writes to it, enabling a precise rewind. In a timed test on a 4,686-file TypeScript tree, the checkpoint restore returned the project exactly to its pre-turn state, while all four git-based methods left leftover or lost files. The author also notes that git-based snapshots pollute the real index by staging all user work on every turn.

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
ProgrammingHacker News ·

FAA Begins Retiring Decades-Old Floppy Disks From Air Traffic Control Systems

The Federal Aviation Administration has started phasing out floppy disks that have been used in air traffic control operations for decades. Announced by Transportation Secretary Sean P. Duffy, the move is part of a broader effort to modernize aging agency technology. The article provided is only a link to an FAA newsroom release, so details such as the exact timeline, number of systems affected, and replacement technology are not available here. The story was shared on Hacker News, where it drew modest engagement.

0
ProgrammingDEV Community ·

Unchanged 39-of-40 test score hid a shift in which CSV parser case failed

An AI developer built 40 CSV fixtures with literal expected results and ran them through the csv-parse 6.1.0 library via a custom policy adapter. Under default settings one quote-handling case disagreed with its expectation, and relaxing quote handling fixed that case but broke another, so the score stayed at 39 of 40. The author kept the expectations fixed and documented both mismatches, arguing that matching pass totals can conceal a changed behavior contract. The piece recommends recording file acceptance or rejection, exact returned values such as leading-zero identifiers, and parser configuration separately from application import policy. It also notes that the injected-fault and cross-implementation checks give only partial assurance and do not cover production databases or security.

0
ProgrammingDEV Community ·

How Social Engineering Exploits Human Psychology and How to Defend Against It

Social engineering is a cybersecurity threat that targets people rather than software, using psychological manipulation to get victims to reveal confidential information or take harmful actions. Attackers often gather information about their targets first to make their deceptions more believable. Common tactics include creating false emergencies that pressure victims into acting quickly, and pretexting, where the attacker impersonates a trusted authority such as IT staff or an executive. Physical methods like baiting, for example leaving infected USB drives in workplaces, also exploit curiosity to bypass technical defenses. The article uses concrete workplace scenarios to show how these manipulations operate and how individuals can recognize them.

0
ProgrammingDEV Community ·

Why a Typeahead Trie Should Store the Top 10 Completions at Every Node

A system design interview question about search autocomplete asks what a service does when a user types a single character. The naive approach of collecting and sorting every query under a prefix's subtree on each keystroke is correct but too slow at scale. Latency limits of about 0.1 seconds, including network time, make precomputation necessary. Illustrative capacity estimates show reads vastly outnumber writes and that client-side debouncing and caching can cut request volume roughly fourfold. The recommended fix is to precompute the top 10 completions at every trie node during build time, so each lookup only walks the prefix and returns a ready list.