Skip to content

Phase 6 Lab Guide: Building the Deliverables ​

Curriculum Source: docs/plan/06_phase6_stateful_graphs_hitl.md
Evaluation Skill: lab-evaluator


🎯 Required Deliverables Specification ​

When you are ready to write the implementation code for Phase 6, you will implement the following 5 deliverables:


1. The Stateful Essayist ​

  • Objective: Build a stateful writing and editorial workflow using LangGraph 1.0 with a cyclic review loop and native human interrupt.
  • Requirements:
    • Implements a StateGraph with a typed shared state (EssayState).
    • Drafts an essay based on a topic outline.
    • Halts execution at an editorial checkpoint via interrupt({"draft": draft_content}).
    • Resumes execution via Command(resume={"action": "APPROVED" | "REWRITE", "critique": "..."}).
    • If approved, transitions to the final formatting node and terminates; if rejected, cycles back to the drafting node to incorporate the human critique.
    • Verified with automated tests asserting both immediate approval and multi-turn iterative rewrite paths.

2. The Privileged Action Gatekeeper ​

  • Objective: Construct a security-hardened agent that blocks irreversible, high-impact tool calls until an authorized human supervisor approves the action.
  • Requirements:
    • Intercepts privileged tools: financial transactions (refunds, transfers) or destructive operations (database drops, user account deletion).
    • Enforces RBAC / ABAC policy checks and contextual validation.
    • Pauses execution and surfaces a structured PrivilegedActionProposal.
    • Verifies cryptographic HMAC/RSA supervisor authorization signatures before tool invocation.
    • Verified by automated red-teaming tests proving that forged tokens or unauthorized calls are rejected and escalated.

3. The Multi-Agent Research Pipeline ​

  • Objective: Construct a multi-agent system coordinated by a Supervisor Agent managing at least three specialized worker agents.
  • Requirements:
    • Architecture: Supervisor orchestrator coordinating:
      1. Planner Agent: Decomposes complex queries into search sub-goals.
      2. Executor / Retrieval Agent: Gathers facts and executes web/document searches.
      3. Critic / Synthesizer Agent: Reviews factual consistency and compiles the final technical report.
    • Employs "return-ticket" interactions where workers report progress back to the Supervisor.
    • Shares a typed global state object with channel reducers.
    • Delivers an end-to-end multi-agent synthesis verified by an automated test suite.

4. Durable Execution Proof ​

  • Objective: Provide empirical proof that checkpointer persistence enables seamless recovery from simulated application crashes.
  • Requirements:
    • Configures a durable checkpointer (SqliteSaver or PostgresSaver).
    • Initiates an expensive multi-step workflow with a persistent thread_id.
    • Simulates a process termination / crash at superstep K (e.g. immediately after drafting).
    • Re-instantiates the application in a new process, reloads the thread state via thread_id, and verifies that execution resumes from superstep K+1 without re-running upstream steps.
    • Output: durable_execution_proof.md documenting state persistence and checkpoint IDs.

5. Audit Trail Proof (LangFuse Verification) ​

  • Objective: Generate a verifiable LangFuse trace demonstrating complete session continuity, internal reasoning monologues, and human-in-the-loop decisions.
  • Requirements:
    • Instruments the LangGraph workflow with CallbackHandler configured for LangFuse.
    • Captures an end-to-end trace spanning multiple turns and an interrupt boundary under a single thread_id.
    • Proves the trace contains:
      1. The agent's initial internal monologue and reasoning proposal.
      2. The exact interrupt superstep and human input decision.
      3. The post-resumption execution and final delivery.
    • Delivers an audit screenshot or trace JSON verification report (audit_trail_proof.json).

Master AI Architecture Training Program