Skip to content

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 2
AI 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 3
Model 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.0
Model 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 2
Build-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 2
Deterministic 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 2
Failure 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 Completion
Failure 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 2
Operational 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.

Master AI Architecture Training Program