Appearance
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
StateGraphwith 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.
- Implements a
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:
- Planner Agent: Decomposes complex queries into search sub-goals.
- Executor / Retrieval Agent: Gathers facts and executes web/document searches.
- 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.
- Architecture: Supervisor orchestrator coordinating:
4. Durable Execution Proof β
- Objective: Provide empirical proof that checkpointer persistence enables seamless recovery from simulated application crashes.
- Requirements:
- Configures a durable checkpointer (
SqliteSaverorPostgresSaver). - Initiates an expensive multi-step workflow with a persistent
thread_id. - Simulates a process termination / crash at superstep
(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 superstepwithout re-running upstream steps. - Output:
durable_execution_proof.mddocumenting state persistence and checkpoint IDs.
- Configures a durable checkpointer (
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
CallbackHandlerconfigured for LangFuse. - Captures an end-to-end trace spanning multiple turns and an interrupt boundary under a single
thread_id. - Proves the trace contains:
- The agent's initial internal monologue and reasoning proposal.
- The exact interrupt superstep and human input decision.
- The post-resumption execution and final delivery.
- Delivers an audit screenshot or trace JSON verification report (
audit_trail_proof.json).
- Instruments the LangGraph workflow with