The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Controlling Spec Drift with Living Intent Graphs
Minimum price
$19.00
$29.00
About the Book
We are living through the AI Velocity Paradox.
Never in the history of computer science has it been so easy to produce thousands of lines of syntax in minutes. Modern coding agents—Cursor, Claude Code, OpenAI Codex, and OpenCode—can scaffold microservices, generate boilerplate, refactor functions, and synthesize suites of unit tests before an engineer has finished their coffee.
Yet, beneath this staggering burst of apparent productivity lies an insidious defect crisis: silent specification drift.
When an autonomous agent writes code without a formal, machine-readable boundary of human intent, it operates in a cognitive vacuum. It relies on vector embeddings and probabilistic pattern-matching—heuristic proximity rather than normative obligation. When asked to write tests, an agent commits the cardinal sin of software verification: circular testing. It writes unit tests that assert against its own hallucinated assumptions rather than the business invariants of the system. The tests pass, the PR is merged, and the system imperceptibly drifts away from what its architects intended.
Compiling code and passing tests is no longer proof of correctness. In an era where probabilistic models write code, we must construct deterministic fences.
This book provides the architectural blueprint to solve this crisis.
Instead of treating software specifications as dead documentation in Confluence, Jira, or static Word documents, we treat human intent as an executable, versioned graph in Git. By combining two cutting-edge open-source tools—StrictDoc (for modeling requirements as code) and Tracey 2.x (a high-performance, Tree-sitter-backed Rust verification engine)—we construct a Software Intent Graph.
Using the Model Context Protocol (MCP), we expose this intent graph directly to AI coding agents. We force agents to inspect requirements before touching code, bind their functions to explicit requirement identifiers, annotate test evidence with verifiable anchors, and submit their work to non-negotiable CI/CD merge gates.
This is not a book about fighting artificial intelligence or drowning development in bureaucracy. It is a book about governance. It teaches you how to leverage AI’s speed while maintaining the structural and architectural integrity demanded by production systems.
Across twenty comprehensive, code-backed chapters, this volume equips you with an end-to-end framework for governing AI coding assistants:
.sdoc):@relation(..., role=Verifies) and Tracey's concise r[impl] / r[verify] markers.+N version suffixes and automated stale-reference detection.tracey ai).tracey query validate --deny warnings).tracey pre-commit and tracey bump).
This book is engineered as a modular field manual and reference architecture, not a linear narrative essay. While it follows an end-to-end progression from foundational specification modeling to an enterprise gateway capstone, you do not need to read it cover-to-cover from page 1 to page 600 in a single sitting.
Software engineering under autonomous coding agents introduces distinct operational challenges depending on your role and your immediate priorities. Whether you need to stop an AI agent from hallucinating test suites this afternoon, configure a Model Context Protocol (MCP) server for your team by tomorrow, or design a multi-year safety-critical traceability pipeline, this guide is structured so you can jump directly to the relevant solution.
Every single chapter in this volume follows an identical, highly predictable five-part structure. Once you understand this layout, you can navigate any chapter in seconds:
To maximize your return on investment, choose the path that mirrors your immediate engineering objective:
Path 1: The Software Architect & Tech Lead
Goal: Establish formal boundaries around AI velocity, understand intent graphs, and design system topologies that do not rot.
Path 2: The DevOps & Platform Engineer
Goal: Build automated, unbypassable gates that halt spec drift in pull requests and enforce repository hygiene.
tracey query validate --deny warnings).
Path 3: The AI & Tooling Engineer
Goal: Wire coding assistants directly to living intent graphs using the Model Context Protocol (MCP).
tracey ai)..cursor/mcp.json, and Editor LSP Clients).
Path 4: The Hands-On Pragmatist ("Show Me the Code")
Goal: Copy production-grade, compilable TypeScript contracts, Vitest test suites, and configuration templates directly into your project.
r[impl], r[verify], @relation).Table of contents
Chapter 1: The AI Velocity Paradox - How Fast Code Generation Causes Silent Spec Drift
Chapter 2: Git-Native Requirements - Structuring Machine-Readable Specifications with StrictDoc (.sdoc)
Chapter 3: Eliminating Ambiguity - Writing Falsifiable Invariants with EARS Syntax and Stable MIDs
Chapter 4: Modeling System Topologies - Parent-Child Trees, Relation Roles, and Multi-Document Hierarchies
Chapter 5: Living Specifications - Static Dashboards, Web Reviews, and Multi-Document Composition
Chapter 6: Beyond String Matching - Real-Time Code AST Inspection and Spec Parsing with Tracey 2.x
Chapter 7: Anchoring Code to Intent - In-Source Reference Grammars (@relation vs r[...] Syntax)
Chapter 8: Making Test Evidence Explicit - Linking Automated Suites to Requirements via r[verify]
Chapter 9: Detecting Stale References - Managing Spec Evolution with +N Suffixes and Impact Analysis
Chapter 10: Low-Latency Verification - Background Daemons (.tracey/daemon.sock), Web Dashboards, and LSP Feedback
Chapter 11: Bridging Context Gaps - Complementing Vector Search with Deterministic Intent Graphs
Chapter 12: The Agent Inspection Toolkit - Discovery, Audit, and Workspace Configuration Tools in Tracey MCP
Chapter 13: Spec-Guided Terminal Workflows - Configuring Claude Code and Codex CLI via tracey ai
Chapter 14: IDE Tooling & LSP - Live Intent Context in Cursor (.cursor/mcp.json) and Editor LSP Clients
Chapter 15: Open-Source Autonomous Agents - Wiring OpenCode to Tracey MCP for Headless Verification Loops
Chapter 16: Hard Merge Gates in CI/CD - Automated Validation of Specs and Coverage
Chapter 17: Pre-Commit Spec Hygiene - Halting Silent Drift and Enforcing Atomic Version Bumps in Git
Chapter 18: Safety-Critical Realities - Lessons from Zephyr RTOS Tracing and DO-178C Structural Templates
Chapter 19: Agentic Remediation - Directing Coding Assistants to Close Missing Evidence Gaps
Chapter 20: Capstone Project - Architecting, Implementing, and Governing an Enterprise Service with StrictDoc, Tracey, and Cursor
If printed, this ebook would span over 800 pages. The book was created with the help of AI.
About the Author
A veteran software engineer with 20 years of experience, I have dedicated my career to the art of automation. My philosophy is simple: programming should eliminate repetitive chores to unlock human creativity. This journey began early on with the development of custom code-generation tools and has evolved into a deep mastery of LLMs and their APIs. Today, I specialize in architecting AI-driven solutions that handle everything from complex coding and security tasks to advanced knowledge retrieval, transforming the way we interact with technology
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.