Appearance
Phase 5 Interactive Flashcards: Harness Engineering & MCP β
Master the architectural concepts of Phase 5 (Harness Engineering & Model Context Protocol) with interactive flashcards. Test your recall on the AI Harness concept, MCP Architecture, Build-Verify-Fix Loops, Loop Detection, Trace Failure Taxonomies, and Compulsory Operational Safety.
π Deck 1: The AI Harness Concept & Environment Onboarding β
Master the hypervisor mental model and LocalContextMiddleware:
ποΈ Deck 1: AI Harness & Onboarding
Card 1 of 2AI Harness ConceptClick or press Space to flip βΊ
What is an AI Harness and what architectural role does it fulfill?
AI Harness Concept β’ AnswerClick to flip back β»
The AI Harness is the deterministic software system built around a foundation model. Acting like an operating system kernel or hypervisor, it handles environment virtualization, dynamic context injection, deterministic middleware hooks, rate limiting, and telemetry.
π‘ Architect Takeaway: Treat the LLM as a CPU and the Harness as the OS kernel providing system calls and access controls.
π Deck 2: Model Context Protocol (MCP) Architecture & Consumption β
Master JSON-RPC 2.0, FastMCP, MultiServerMCPClient, and zero-trust tool consumption:
ποΈ Deck 2: MCP Protocol & Consumption
Card 1 of 3Model Context ProtocolClick or press Space to flip βΊ
How does the Model Context Protocol (MCP) eliminate the M Γ N integration bottleneck?
M clients Γ N services β M + N Open Protocol over JSON-RPC 2.0Model Context Protocol β’ AnswerClick to flip back β»
Instead of building custom point-to-point glue code between every LLM client and every data source, MCP standardizes how servers expose Tools, Resources, and Prompts over stdio or SSE/HTTP using JSON-RPC 2.0.
π‘ Architect Takeaway: MCP decouples AI agents from proprietary external API integration code.
π Deck 3: Aggressive Self-Verification & Build-Verify-Fix Loops β
Master programmatic test gates, closed-loop feedback, and eliminating vibe-based coding:
ποΈ Deck 3: Build-Verify-Fix Loops
Card 1 of 2Build-Verify-FixClick or press Space to flip βΊ
Why is 'vibe-based' code review by LLMs fundamentally flawed in production?
Build-Verify-Fix β’ AnswerClick to flip back β»
LLMs suffer from the 'hallucination of competence': after writing code, autoregressive completion biases them toward claiming success. Without programmatic execution, syntax errors, missing imports, and logic bugs go undetected.
π‘ Architect Takeaway: Strip the model of the authority to declare completion based solely on its own opinion.
π Deck 4: Deterministic Middleware Hooks (Loop Detection & Checklists) β
Master action hashing, breaking Doom Loops, and PreCompletionChecklistMiddleware:
ποΈ Deck 4: Deterministic Middleware Hooks
Card 1 of 2Deterministic MiddlewareClick or press Space to flip βΊ
What is a 'Doom Loop' and how does LoopDetectionMiddleware break it?
ActionHash = SHA-256(tool_name || canonical_json(args))Deterministic Middleware β’ AnswerClick to flip back β»
A Doom Loop occurs when an agent repeatedly executes the exact same failing tool call. LoopDetectionMiddleware maintains a sliding window of action hashes. If an identical call repeats β₯ 2 times, it aborts execution and injects an assertive replanning directive.
π‘ Architect Takeaway: Prevents runaway token burn by catching and breaking repetitive tool failures.
π Deck 5: Trace-Driven Failure Analysis & The Evaluation Data Flywheel β
Master the 4 failure taxonomies and converting LangFuse failure traces into automated Pytest regressions:
ποΈ Deck 5: Failure Analysis & Flywheel
Card 1 of 2Failure AnalysisClick or press Space to flip βΊ
What are the 4 primary agentic failure taxonomies identified via distributed tracing?
Reasoning | Tool Invocation | Context Insufficiency | Hallucination of CompletionFailure Analysis β’ AnswerClick to flip back β»
1. Reasoning Failure: Flawed logic despite complete context and valid tools. 2. Tool Invocation Failure: Schema mismatches, malformed JSON, or missing parameters. 3. Context Insufficiency: Missing background information or codebase context. 4. Hallucination of Completion: Declaring success without satisfying verification gates.
π‘ Architect Takeaway: Isolating failure taxonomy reveals whether to fix prompts, schemas, retrievers, or test gates.
π Deck 6: Compulsory Operational Safety (Rate Limiters & Circuit Breakers) β
Master AIRateLimiter (RPM/TPM/USD), cost caps, and ToolCircuitBreaker states:
ποΈ Deck 6: Operational Safety & Circuit Breakers
Card 1 of 2Operational SafetyClick or press Space to flip βΊ
Why must an AIRateLimiter enforce a multi-dimensional boundary (RPM, TPM, Budget USD)?
Operational Safety β’ AnswerClick to flip back β»
Counting HTTP requests alone ignores token volume: one request might consume 15 tokens while another consumes 100k tokens. A production limiter checks RPM (concurrency), TPM (provider limits), and daily USD spend (preventing Denial-of-Wallet).
π‘ Architect Takeaway: Multi-dimensional rate limiting prevents quota starvation and catastrophic runaway cloud bills.