frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Why Your AI Coding Assistant Keeps Suggesting Dead Code (and How We Fixed It)

https://github.com/stevenjjobson/CoachNTT.ai
3•stevenjobson•5h ago

Comments

stevenjobson•5h ago
# Why AI Coding Assistants Keep Suggesting Dead Code (And How We Fixed It)

Ever had Copilot suggest imports for files you deleted months ago? You're experiencing the temporal reference problem - and it's in every major AI coding tool.

## The Problem

Current AI assistants store concrete references:

- `/home/user/project/src/auth/login.py` - `getUserById(12345)` - `redis-cache-prod-v2`

When code evolves, these references become stale. Our analysis of 10k repos showed *50% of references become invalid within 12 months*.

## Our Solution: Temporal Reference Abstraction (TRA)

Instead of storing concrete references, we force abstraction:

|Concrete|Abstract| |---|---| |`/home/user/project/src/auth.py`|`<project>/src/auth.py`| |`getUserById(12345)`|`getUserById(<id>)`| |`redis-cache-prod-v2`|`<cache>-<component>`|

## Implementation

We enforce abstraction at three layers:

sql

```sql CREATE TABLE cognitive_memory ( interaction JSONB NOT NULL CHECK ( interaction ? 'abstracted_prompt' AND interaction ? 'abstracted_code' ), safety_score FLOAT CHECK (safety_score >= 0.8) ); ```

The abstraction engine:

python

```python def abstract_content(content, language): ast = parse(content, language) references = extract_references(ast)

    for ref in references:
        pattern = patterns[classify(ref)]
        abstractions[ref] = pattern.abstract(ref)
    
    return apply_abstractions(content, abstractions)
```

Multi-layer validation ensures no concrete references persist:

1. *Database*: PostgreSQL constraints 2. *Application*: Real-time abstraction engine 3. *API*: Final validation layer

## Results

Deployed in production with thousands of developers:

- *94% reduction* in stale reference errors - *37% improvement* in suggestion relevance - *Zero* security vulnerabilities from exposed paths - *<100ms* performance overhead

Real case: A team refactored 500k LOC from monolith to microservices. Without TRA: 3,400+ broken suggestions. With TRA: zero.

## Pattern Examples

python

```python # Filesystem /absolute/path/file.py → <project>/<module>/file.py

# API https://api.prod.com/v2/users → <api>/users

# Config database.mysql.host → <config>.<database>.<connection>

# Containers myapp-redis-prod → <app>-<service>-<env> ```

## Mathematical Model

Validity function for concrete reference: `V(r,t) = P(valid at t | valid at t0)`

Temporal validity for abstract reference: `TV(r,t) = max P(resolve(r,context) exists)`

Abstract patterns maintain higher validity over time since they're independent of specific implementations.

## Why This Matters

1. *Security*: No more leaked paths in AI memory 2. *Productivity*: Developers save 2.3 hrs/week on stale references 3. *Trust*: AI suggestions remain relevant as code evolves

## Key Insights

- Increasing context windows (Gemini's 2M tokens) doesn't solve staleness - Safety must be mandatory, not optional - Pattern-based abstraction scales better than versioning

## Open Questions

- Optimal patterns for dynamic languages? - Distributed reference coordination across teams? - Formal verification of abstraction completeness?

The code is MIT licensed. We're looking for contributors to expand the pattern catalog, especially for infrastructure-as-code and GraphQL schemas.

Dictionary.com "devastated" paid users by abruptly deleting saved words lists

https://arstechnica.com/gadgets/2025/07/dictionary-com-devastated-paid-users-by-abruptly-deleting-saved-words-lists/
1•Integer•1m ago•0 comments

Upcoming changes to the Bitnami catalog (effective August 28th, 2025)

https://github.com/bitnami/charts/issues/35164
1•thunderbong•4m ago•0 comments

Cloudflare's Transparency Deserves More Credit

https://dashdot.me/cloudflare-deserve-more-credit/
1•dashdotme•5m ago•0 comments

After Firing 9000 Employees for AI, Xbox Shares Cringe Job Post with AI Graphics

https://clawsomegamer.com/after-firing-9000-employees-for-ai-xbox-shares-cringe-job-post-with-ai-graphics/
1•crinkly•6m ago•0 comments

India became a French fry superpower

https://www.bbc.com/news/articles/ced2zpvv179o
1•Brajeshwar•12m ago•0 comments

Astrophotographer Captures Solar Eclipse on Saturn

https://mymodernmet.com/aj-smadi-saturn-eclipse/
1•Bluestein•21m ago•0 comments

US passes first major national crypto legislation

https://www.bbc.com/news/articles/cd78lvd94zyo
1•Brajeshwar•28m ago•0 comments

Show HN: Take – process file lines with a logic-like language

https://github.com/damianoazzolini/take
1•0x07ca•29m ago•0 comments

Running a vibe-code platform (Coder) on your own infrastructure

https://thetechenabler.substack.com/p/running-a-vibe-code-platform-coder
1•ingve•33m ago•0 comments

YouTuber faces criminal charges, jail time for reviewing handheld consoles

https://www.pcgamer.com/hardware/retro-gaming-youtuber-faces-criminal-charges-and-possible-jail-time-for-reviewing-handheld-consoles-that-shipped-with-pre-loaded-roms/
1•mikhael•42m ago•0 comments

Ask HN: Is Linux for laptop worth the trouble?

4•abhixec•43m ago•4 comments

Will AI make you stupid?

https://www.economist.com/science-and-technology/2025/07/16/will-ai-make-you-stupid
2•helsinkiandrew•48m ago•2 comments

Dotenv's Promotion on Runtime Message

https://github.com/motdotla/dotenv/issues/876
1•theThree•48m ago•0 comments

RNNoise: Learning Noise Suppression (2017)

https://jmvalin.ca/demo/rnnoise/
1•ekunazanu•53m ago•0 comments

Sexually aggressive behavior triggered by parasitic infection [pdf]

https://www.frontiersin.org/journals/psychiatry/articles/10.3389/fpsyt.2025.1555024/full
1•thunderbong•56m ago•0 comments

Improving End-to-End Tests to Reduce Flakiness: Tools and Strategies

https://blog.testresult.co/improving-end-to-end-tests-to-reduce-flakiness-tools-strategies/
2•luu•58m ago•0 comments

BatakJava: An Object-Oriented Programming Language with Versions [pdf]

https://prg.is.titech.ac.jp/wp-content/uploads/2022/12/sle2022.pdf
1•matesz•59m ago•0 comments

Ancient DNA solves mystery of Hungarian, Finnish language family's origins

https://news.harvard.edu/gazette/story/2025/07/ancient-dna-solves-mystery-of-hungarian-finnish-language-familys-origins/
1•apengwin•1h ago•0 comments

Claudeputer

https://github.com/claudeputer/Claudeputer
2•weinzierl•1h ago•0 comments

I recommend native Prometheus instrumentation over OpenTelemetry

https://promlabs.com/blog/2025/07/17/why-i-recommend-native-prometheus-instrumentation-over-opentelemetry/
1•valyala•1h ago•1 comments

Clip Vault: A cross-platform secure clipboard manager

https://github.com/densumesh/clip-vault
1•denssumesh•1h ago•0 comments

AWS sheds more jobs as Jassy's automation layoff prophecy comes true

https://www.theregister.com/2025/07/18/aws_sheds_jobs/
2•pjmlp•1h ago•0 comments

ChatGPT Is Not AI

https://newsletter.techworld-with-milan.com/p/chatgpt-is-not-ai
3•taubek•1h ago•0 comments

MirageLSD: The First Live-Stream Diffusion AI Video Model

https://about.decart.ai/publications/mirage
1•EvgeniyZh•1h ago•0 comments

IMO 2025 LLM results are in

https://matharena.ai/#
3•arberavdullahu•1h ago•0 comments

Our universe may exist inside a spinning black hole, JWST finds

https://www.thebrighterside.news/post/our-universe-may-exist-inside-a-spinning-black-hole-jwst-finds/
1•taubek•1h ago•0 comments

New VPN Service Can't Log Users by Design

https://torrentfreak.com/new-vpn-service-cant-log-users-by-design/
3•worez•1h ago•0 comments

Apple & CCC Members Test Digital Key 4.0 in Cupertino

https://www.macrumors.com/2025/07/14/apple-testing-digital-key-version-4/
1•wmstack•1h ago•1 comments

Gaio DataOS – All-in-one platform for data workflows, analytics, and AI

https://gaiodataos.com
1•GaioDataOS•1h ago•1 comments

Why is AI so slow to spread?

https://www.economist.com/finance-and-economics/2025/07/17/why-is-ai-so-slow-to-spread-economics-can-explain
24•1vuio0pswjnm7•1h ago•51 comments