Preventing Agents from Rewriting Contracts: A Three-Layer Architecture
haandol-_- · reddit · 2026-08-27
The author identifies the risk of 'abstraction inversion' in agent development, where agents update Architecture Decision Records (ADRs) based on current code, effectively rewriting the contract. To solve this, a three-layer architecture is proposed:
- Requirements: Describes the user problem and expected results.
- ADRs: Describes durable decisions and contracts that future implementations must preserve.
- Code: Owns the implementation details.
The key is treating ADRs as 'contract-complete' and implementation as 'implementation-open'. The author uses open-source plugins alps-writer and adr-writer to enforce this, preventing implementation details from flowing backward and redefining the contract. This also allows stable contracts to serve as reusable Context. The author seeks feedback on handling this in MCP systems.
More from coding & agent
- Build Agent Infrastructure with Engineering, Not Puppetry — intellectronica · 2026-08-27
- HQ Explained: An Operating System for Mixed Teams of Humans and AI Agents — jacob_posel · 2026-08-27
- Workflow Case: AI Employee Extracts Call Highlights to Generate Drafts — thisdudelikesAI · 2026-08-27
- User Laments Lack of Long-term Memory in AI Agents — davidfromkansas · 2026-08-27
- Agent Architecture Insight: Compressing History vs. Real-time Updates — curious_vii · 2026-08-27
- How, When and Why to Use Agentic AI in Neuroscience Labs — KordingLab · 2026-08-27