Skip to content
From ReAct to Recoverable Runs: Engineering Agent Harness with KDC's Dual-Chain Model

From ReAct to Recoverable Runs: Engineering Agent Harness with KDC's Dual-Chain Model

This article presents a comprehensive engineering framework for production-grade AI agents, distinguishing domain reality, business judgment facts, and software runtime facts, and introduces a dual-chain architecture connecting business causality with runtime recoverability through Agent Harness, KDC, and explicit contracts for resumption, progress, and evaluation.

vivo Internet Technology
vivo Internet Technology
vivo Internet Technology

Introduction: The Refund Scenario

The article opens with a concrete refund scenario: a user asks an after-sales agent to check and process a refund. The agent queries the order, applies the refund policy, and prepares to call the refund capability. Because the refund changes order and fund state, the system requires user confirmation. Before the user clicks confirm, the page refreshes — the approval prompt disappears. The chat history shows the agent said "ready to refund," but the frontend no longer knows if the approval is still valid, the backend doesn't know if the user decided, and the capability runtime doesn't know whether to continue, pause, or cancel. Worse, if the refund request was already sent to the payment channel but the backend restarted before persisting the completion state, the system might re-invoke the refund interface, causing duplicate execution.

This illustrates that completing one ReAct loop (Thought → Action → Observation) does not equal running a product. Production systems must answer questions like: which run and turn is executing? What actions were proposed and authorized? What is the tool call status? Is the approval still valid after refresh? Where to recover after restart? Which artifacts belong to which goal? What does Stop actually stop? Has an external action already occurred? These cannot rely on model memory or UI guessing from chat text; they must become durable, referenceable, recoverable runtime facts.

Three Kinds of Facts That Must Not Be Mixed

The author distinguishes three fact layers:

Domain Reality — what actually happened in the real world (e.g., user received refund). Evidence: receipt, reconciliation, user confirmation.

Business Judgment Facts — why the system formed a conclusion and proposed an action (e.g., order eligible but requires confirmation). Basis: goal, order facts, knowledge version, risk, policy.

Software Runtime Facts — where the execution has reached (e.g., waiting for approval; tool dispatched; result pending). Basis: Runtime Event, State, Checkpoint, external call records.

They relate but cannot substitute each other: tool.call.completed ≠ refund received, pendingApproval = null ≠ user agreed, UI shows "completed" ≠ business goal achieved. Runtime can authoritatively declare a tool call completed, but that doesn't prove the user got the money. KDC and Agent Harness complement: Harness makes runtime facts trustworthy; KDC traces them back to business judgment and domain reality.

Two Chains That Must Connect

Business Causality Chain (KDC) : Reality → Knowledge/Memory → Reasoning → Skill → Capability → Policy Decision → Action → Feedback → Reality.

Runtime Fact Chain (Agent Product) : Runtime Event → State → View → Checkpoint → Resume; User Control → Runtime Event.

Both chains need stable identities to connect:

runId, turnId, reasoningObjectId, skillId, capabilityId, policyDecisionId, approvalId, toolCallId, artifactId, feedbackId

. These let the system know which approval belongs to which judgment, which tool call comes from which capability, which artifact supports which goal, and which feedback corrects which action.

ReAct, Harness, and KDC Solve Different Problems

ReAct / Model Loop : Core question — What does the model do next given current Observation? Does not solve alone: State recovery, cross-device consistency, business authorization, reality validation.

Agent Harness : Core question — How do model behaviors become recoverable, controllable software runtime facts? Does not solve alone: Why knowledge is trustworthy, why action has business qualification, whether reality goal is met.

KDC : Core question — How do reality, knowledge, judgment, governance, action, feedback form a business causality loop? Does not solve alone: Does not prescribe a fixed agent framework or state schema.

Relationship: ReAct lets the model continuously decide the next step; Harness turns those steps into reliable software runtime facts; KDC lets runtime facts trace back to business goals, knowledge basis, action qualification, and reality results.

Public Practices Converge on the Same Questions

The article surveys Long-Running Agent Harness, Managed Agents, LangGraph Persistence/Interrupts, Temporal Durable Execution, 12-Factor Agents, Agent Evals. Each addresses parts of production-grade agent responsibilities (cross-context progress, session/harness/sandbox decoupling, checkpoint/resume, unified execution state, trajectory/outcome grading) but they haven't formed a unified theory on whether state should be independently persisted or derived from thread context. KDC provides a higher-level business causality constraint: what judgment does the runtime scene connect to? What knowledge does the judgment rely on? Why does the capability have qualification? How is authorization formed? What reality feedback proves goal achievement? The contracts introduced later (Resume, Progress, Evaluation) attempt to connect public engineering experience to this business causality chain.

Harness Is Not a Monolith: Decouple Session, Harness, Execution Environment

Anthropic's Managed Agents practice splits: Session persists append-only run records; Harness drives model loop, context assembly, pause/resume, control commands; Sandbox executes code/commands/tools. They collaborate via stable interfaces without sharing lifecycles. Harness can be stateless; a new instance can rebuild the scene from externalized Session.

Extended with KDC, the runtime topology includes: Durable Session, Agent Harness, Capability Control Plane, Sandbox/Tool Runtime, KDC Business Runtime. Each has distinct responsibilities and explicitly excluded responsibilities:

Durable Session : Persists Event, Checkpoint, current State and object references. Must not replace domain reality or automatically become long-term memory.

Agent Harness : Selects context, drives model loop, handles pause/resume, submits control commands. Must not treat its in-process variables as authoritative state.

Capability Control Plane : Validates principal, policy, parameters, idempotency key, authorization scope. Must not let "model selected tool" equal "authorized to execute".

Sandbox / Tool Runtime : Executes code, commands, or external calls in a constrained environment. Must not hold unconstrained long-lived credentials.

KDC Business Runtime : Connects goal, knowledge, judgment, capability, policy, action, feedback. Must not prescribe a fixed model loop or execution framework.

Benefits: (1) Recovery no longer depends on the original Harness instance. (2) "Brain" and "hands" scale independently. (3) Security boundaries shift from prompt constraints to structural constraints — high-privilege credentials never enter model context or untrusted sandbox; capability proxy issues least-privilege credentials based on principal, capability, policy decision, expiry, and records

executionEnvironmentId, sandboxTrustLevel, credentialScope, credentialLeaseId, networkPolicy, dataAccessPolicy

.

Minimum Run Objects: Give the Scene Stable Ownership

Beyond KDC core objects (knowledge, memory, reasoning, skill, capability), production agents need engineering objects for runtime continuity: Run, Turn, Runtime Event, Checkpoint, Pending Approval, Artifact Reference, Sub-agent Reference, Control Command. Each has a minimal identity/relationship (e.g., Run: runId, goal, status, start/end time; Turn: turnId, runId, input, output refs). They need not be separate DB tables but must have clear owner, lifecycle, persistence boundary. Criterion: if a state affects recovery, approval, continued execution, cross-device consistency, audit, or result verification, it must not live only in chat text, prompt, component variables, or transient cache.

Session, Context, State, Memory, Knowledge Are Distinct Objects

"Let the agent remember" conflates five different things: save conversation, recover run, assemble model context, retain cross-task experience, provide governed knowledge. Google ADK separates Session (interaction thread + events), State (session-scoped transient data), Memory (cross-session retrieval). LangGraph distinguishes thread Checkpointer from cross-thread Store. KDC further separates Context and Knowledge:

Session Event Log : What happened in this interaction/run? Inputs, Runtime Events, commands, result refs. Persistent raw record of current task, auditable.

Runtime State : Where is execution now? Active run, approvals, tool calls, checkpoint. Derived from events or snapshot; authoritative runtime fact.

Context Projection : What does this model call see? Recent messages, summaries, knowledge snippets, tool results. Temporary, rebuildable, can change with window/policy.

View Projection : What should the UI show? Progress, approval bar, artifacts, error status. Derived from State; not authoritative source.

Memory Object : Which history still qualifies to influence future? User preferences, verified experiences, long-term task relations. Cross-session, but must have provenance, boundaries, lifecycle.

Knowledge Object : What can the system rely on for judgment? Rules, concepts, constraints, verified conclusions. For reasoning/action; needs evidence, version, applicability.

Key distinction: Session is the recoverable history source; Context is a selective projection of history for one model call. Context can be trimmed, compressed, reordered, regenerated. It must not be the sole place preserving approval, tool state, or external request identity. A context compression that drops "user already approved" must not revert approval to pending. A new model call that doesn't see the full trace must not change already-occurred external facts. To make context selection explainable, record:

contextBuildId, sourceEventRange, includedObjectRefs, omittedObjectRefs, compactionPolicyVersion, promptTemplateVersion, tokenBudget

.

State, View, Control Must Be Separated

Common failure: frontend infers runtime state from message text. Example: model outputs "Need user confirmation before refund." UI detects "need confirmation" and locally generates an approval button. This works short-term but doesn't answer: which run/turn/toolCall does this approval belong to? How to recover after refresh? Is backend really paused at a recoverable point? Who receives the decision when user clicks? What if policy changed or approval expired?

Therefore three responsibilities:

State = recoverable runtime facts (activeRun, currentTurn, checkpoint, pendingApprovals, toolCalls, artifactRefs, subagentRefs, runtimeStatus). Produced and persisted by Runtime or explicit business boundary.

View = display derived from facts (isBusy, canStop, approvalBanner, toolBadges, subagentProgress, artifactPanel). pendingApproval exists → show approval bar. activeRun running → allow Stop. View can change with interaction design but must not become authoritative source of runtime facts.

Control = commands, not direct state mutation (resume(approvalId, decision), stop(runId), retry(toolCallId), reload(threadId)). Control expresses "request system to do X", not "X happened". UI cannot mark Run stopped after user clicks Stop; Runtime receives command, handles cancellation boundaries, then emits new Event and State.

Boundary in one sentence: Runtime writes runtime facts, View reads runtime facts, Control submits commands, UI does not backfill runtime facts for Runtime.

Semantic Responsibilities Separate; Physical Storage Can Unify

Separating State, View, Control, Session, Memory doesn't require five databases on day one. 12-Factor Agents Factor 5 advocates unifying execution and business state where possible, deriving current progress from thread context — valuable for serialization, forking, replay, debugging, and reducing multi-store sync. But "unified storage" must not degrade to "guessing authoritative state from natural language messages." High-stakes states (approval.required, approval.granted, capability.authorized, tool.call.dispatched, tool.call.accepted, tool.call.result_unknown, feedback.success_criteria_met) must have explicit types.

Balanced approach: unified append-only event log with strongly typed events and projections for different semantics. Example event:

{ "eventId": "event-109", "eventType": "approval.required", "runId": "run-20260727001", "turnId": "turn-003", "producer": "policy-runtime", "reasoningObjectId": "reasoning-021", "capabilityId": "refund-order-v2", "correlationId": "refund-intent-031", "causationId": "event-108", "schemaVersion": 2, "occurredAt": "2026-07-27T16:42:10+08:00", "payload": { "approvalId": "approval-017", "risk": "high", "expiresAt": "2026-07-27T18:00:00+08:00" } }

Same log derives Runtime State, user View, audit record, eval trajectory — avoiding conflicting writes. But each projection keeps its own schema, owner, usage qualification. Approval state must reduce from approval events, not change because agent text says "user should agree"; business result state must check Feedback Contract for feedback source, evidence, success criteria, not flip because tool returned 200.

Engineering principle: Semantic responsibilities must separate; physical storage can unify; states deterministically reducible from events need not be rewritten; high-risk facts that cannot be reliably derived must be explicitly recorded.

A Minimal State Schema (Illustrative, Not KDC Standard)

The article provides a JSON structure showing three categories of information preserved together: runtime continuity (runId, status, checkpoint, approvals), business causality traceability (reasoning object, knowledge, capability, policy decision refs), side-effect control (toolCall status, idempotencyKey, external request, reconciliation).

If State only saved pendingApproval = true, it's insufficient. System must know: waiting for which action? From which judgment? Required by which policy? When does it expire? Where to resume execution? After tool dispatch, if payment channel may have accepted but response lost, State must not revert to "not called"; must retain same toolCallId and idempotencyKey, move to result_unknown, record externalRequestId, dispatchedAt, reconciliationStatus=pending. result_unknown is not a failure variant — it's a recovery boundary forbidding blind retry; runtime must first query/reconcile using external request identity, then decide complete, compensate, or hand off to human.

From Judgment to Execution: A Recoverable State Transition

The refund example is expanded into an 8-step path connecting business causality and runtime facts:

Form business judgment : Reasoning runtime identifies user goal, cites refund policy and order facts, produces reasoning object: eligible but requires confirmation.

Propose capability call : Agent selects refund skill, proposes refund-order-v2 call — still a proposal, not execution authorization.

Control plane demands confirmation : Policy returns requires_confirmation based on capability risk, user goal, evidence. Runtime emits approval.required event, writes Pending Approval, creates Checkpoint.

View shows approval : UI derives approval bar from Pending Approval. After refresh, bar restores from durable State, no need to re-parse chat text.

User submits Control : Frontend sends resume(approvalId, allow). Runtime validates approval still valid, principal consistent, capability version and preconditions unchanged.

Capability runtime executes : Authorization passes, capability runtime invokes underlying tool. Request carries stable idempotencyKey, records external request identity.

Runtime records execution result : Tool returns, Runtime emits tool.call.completed or tool.call.result_unknown, updates State and Checkpoint. On result_unknown, system must not simply revert to "not executed".

Reality feedback closes business loop : Payment channel status, reconciliation result, or user confirmation enter Feedback Contract. Only with valid evidence meeting success criteria can system express "refund received", retaining evidence source and verification time.

This path connects "why business allows it" with "where software has reached".

Checkpoint ≠ Durable Execution

Persisting Checkpoint only tells where to resume; doesn't guarantee external actions happen once, nor that recovery code path matches pre-interruption. LangGraph Interrupt persists state at pause, resumes via same Thread but re-executes the node from start — so pre-Interrupt side effects must be safely replayable. Temporal Event History persists workflow lifecycle, rebuilds logic state by replaying history, delegates external side effects to controlled Activities.

Both show Checkpoint needs three companions:

Command : What system intends to happen, not proof it happened. Refund example: Request payment channel refund.

Activity / Tool Call : Controlled boundary executing external side effects. Refund example: Call refund interface and await result.

Event : What system observed and recorded. Refund example: Channel accepted, result unknown, got receipt confirmation.

Model generating "execute refund" only produces action proposal. After policy passes, Runtime creates Capability Command; capability runtime schedules Tool Call; external result observed and verified, then system appends Event. Separating command, execution, fact lets recovery know whether to replay logic, query external state, or forbid re-execution.

Critical time window:

refund request accepted by payment channel → backend hasn't written tool.call.completed → process restarts → local state still shows running

. Recovery blindly retrying may duplicate refund. Production must at least: generate stable idempotency keys for high-impact calls; distinguish "command sent", "external system accepted", "business result confirmed"; on result_unknown, query/reconcile first, not blindly retry; use transactional outbox or equivalent to reduce window between local state and event publish; record capability retry/compensation/manual handoff policies; ensure same Approval cannot be consumed twice; re-validate changed permissions, policies, business preconditions on resume.

These rules belong in a testable, executable Resume Contract covering: Replay Boundary, Side-effect Boundary, Idempotency, Reconciliation, Authorization Revalidation, Version Compatibility, Compensation, Completion Evidence.

For high-impact actions, execution status and outcome verification status should be managed separately:

Action Execution Status: proposed → authorized → dispatching → accepted → completed/failed; dispatching/accepted → result_unknown → reconciling → completed/failed/manual_handoff Outcome Verification Status: not_observed → pending → confirmed_success/confirmed_failure/inconclusive

Execution status answers where Capability Command and Tool Call are; verification status answers whether feedback evidence meets business success criteria. Connected via toolCallId, feedbackId, goal ref but not sharing a single terminal state. Run can end while external work reliably handed off, result still pending; later Feedback updates business result state. result_unknown is not ordinary failure — it means insufficient evidence to judge if external action occurred; default retry may expand risk. Should enter query, reconciliation, or manual handoff, not roll back to authorized and re-dispatch. Similarly, Stop is not an instant boolean: system may stop model generation but cannot cancel external tool. Needs distinction:

stop.requested, model.cancelled, tool.cancellation_requested, tool.cancelled, external_action_irreversible, run.stopped

.

After Run Ends: Which Facts Leave Session?

Checkpoint, Pending Approval, Active Run serve recovery of the same task. Memory objects let history influence future tasks under governed conditions. After a refund Run ends: Checkpoint can be archived/cleaned, Pending Approval must close, short-lived credentials revoked. Runtime Events retained per audit/privacy/compliance, but "retained" ≠ "future agent can retrieve and use". Content enters future via explicit promotion path:

Runtime Event/Feedback → Candidate Experience → source & reality result verification → applicability, principal, timeliness judgment → Memory Object → multi-verification & abstraction → Knowledge Candidate

.

Example: "this refund API took 18s" stays runtime record; "user explicitly wants refund progress only via SMS" becomes time-bounded user memory; "channel returns accepted but still needs reconciliation event to confirm receipt" after multi-verification, clear boundaries, governance may become knowledge/rule for future reasoning.

Seven questions to test Memory/Knowledge connectivity: (1) What experience is this memory from? (2) Why can it still influence current task? (3) Which memories support this candidate knowledge? (4) What verification did this knowledge undergo? (5) Which feedback reinforced or overturned it? (6) What judgments/actions can it currently support? (7) When reality changes, will system downgrade, replace, or stop using it? If system only answers "where content lives, how recalled" but not these, it's still a storage/retrieval system, not a connected Memory/Knowledge runtime capability.

Therefore:

persisted State ≠ formed Memory; recoverable Run ≠ history can influence future; saved all Events ≠ gained organizational experience

. Mixing them lets temporary runtime state pollute user profiles long-term, and drowns truly reusable experience in event logs. Conversely, deleting all Sessions on task end prevents forming verified experience from real results. Key is not "save all" or "forget all" but explicit usage qualification, retention period, deletion mechanism, promotion path per object.

Logs and Traces Still ≠ Runtime State

Logs, Traces, Events each have distinct roles: Trace reconstructs request flow across components with latency/errors; Event expresses a state change occurred; State expresses current recoverable facts; Checkpoint saves position and context needed to continue. System can rebuild State from full Event Log, or persist State Snapshot with incremental events. Choice depends on scale, recovery latency, audit needs, infra capability. Regardless, runtime signals must carry stable business causality refs: runId, reasoningObjectId, capabilityId, policyDecisionId, toolCallId, feedbackId. Otherwise teams only know a tool failed at some time, not what goal it served, what knowledge it used, why it was allowed, whether error belongs to reasoning, governance, capability implementation, or external system.

Long-Running Tasks Need a Progress Contract

Some agent tasks span multiple context windows, model calls, even work days. Persisting full Session isn't enough — the next agent taking over may not quickly judge if current baseline is usable, what's verified vs attempted, what's the safest next step. Anthropic's long-running harness research found context compression alone leads to overestimating progress, re-modifying working parts. Their engineering: initialization agent, structured feature list, progress file, version history, environment bootstrap script, one verifiable increment per session.

Generalized to business agents: Progress Contract — structured handoff surface for current work scene, not free-text log. Fields:

Goal : What reality state this long task aims to change.

Completion Criteria : What verifiable feedback represents completion, not just "Agent replied".

Work Items : Planned items with not_started/in_progress/verified/blocked status.

Verified Baseline : Last tested or human-confirmed stable state.

Current Change : What this session modifies, what's unverified.

Evidence : Test results, query results, artifacts, approvals, reality feedback refs.

Environment Bootstrap : How to restore env, connections, minimal context.

Risks and Blockers : Open risks, external dependencies, forbidden actions.

Next Safe Action : Minimal executable step for next handoff.

Ownership : Current owner, takeover rules, timeout policy.

Example: "assist supplier onboarding" across material collection, compliance check, manual supplement, approval, system account creation. Progress Contract shouldn't just say "materials mostly done"; must specify: business license verified, tax info awaiting manual confirmation, compliance approval not yet occurred, onboarding capability therefore unavailable; next step only request supplement, not repeat supplier creation.

Progress Contract differs from: Checkpoint (where to resume execution), Runtime State (current machine state), Memory (which history qualifies to influence future), Knowledge (what future judgments can rely on). At session start, Harness restores env, reads Progress Contract, verifies baseline; before end, closes incomplete side effects, updates work items, attaches evidence, leaves executable next step. Handoff no longer relies on next model guessing scene from hundreds of thousands of tokens of history.

Agent Harness Itself Needs an Evaluation Contract

Agent completing a demo ≠ Harness bearing production responsibility. Model, prompt, context selection, recovery logic, capability descriptions, policy proxy jointly determine behavior — cannot evaluate model alone. Anthropic's agent eval separates Agent Harness from Evaluation Harness, and distinguishes Transcript/Trajectory (path taken) from Outcome (actual environment state at task end). Aligns with KDC core: a pretty reasoning trajectory cannot substitute reality feedback; "refund successful" text cannot substitute receipt fact.

For KDC engineering, at least four Grader types:

Trajectory Grader : Evaluates reasoning & action path. Typical questions: Cited applicable knowledge? Used qualified capability? Bypassed approval?

Runtime/Recovery Grader : Evaluates software runtime facts. Typical questions: After refresh/restart/timeout/duplicate callback, is State consistent? Duplicate side effects?

Outcome Grader : Evaluates business result & evidence. Typical questions: Receipt, permission effective evidence meets success criteria? Goal only partially met?

Governance Grader : Evaluates risk & responsibility boundaries. Typical questions: Principal, policy, permission, evidence, human confirmation, audit record satisfied?

Graders combine deterministic code checks, model judgment, human review. High-risk invariants should use code/authoritative data (e.g., "same approval consumed once", "no refund capability call without authorization"); expression quality, explanation completeness can use model/human eval.

An Evaluation Contract includes: taskDefinition, initialEvidenceSnapshot, successFeedbackCriteria, forbiddenOutcomes, requiredCapabilities, forbiddenCapabilities, interruptionInjections, trajectoryGraders, recoveryGraders, outcomeGraders, governanceGraders, trialCount, versionMatrix, releaseThresholds. initialEvidenceSnapshot freezes reality representation, source, version at trial start — not a direct copy of Reality. interruptionInjections must actively cover hardest-to-demo issues: refresh before approval, network loss after external acceptance, kill Harness before tool returns, upgrade policy before resume, duplicate callback delivery, delay sub-agent return.

Agent runs are non-deterministic; multiple trials needed to see success rate and risk distribution. Capability exploration uses harder tasks to find system ceiling; continuous release needs fixed regression suite to prevent model/Harness/capability upgrades from reintroducing fixed issues. Evaluation results shouldn't be prematurely compressed into a single score — one duplicate refund risk cannot be offset by ten more naturally phrased answers. KDC cares whether each key responsibility meets threshold, and where failure occurred: knowledge, reasoning, governance, runtime recovery, capability execution, or reality feedback.

Harness Assumptions Have a Lifecycle

Harness isn't write-once infrastructure. As model capability improves, fixed flows added to compensate for model defects may constrain new models. When model, context algorithm, or tool behavior changes, old Checkpoints may not recover cleanly under new versions. Runtime events and eval results should at least correlate: modelVersion, harnessVersion, promptTemplateVersion, contextPolicyVersion, stateSchemaVersion, skillVersion, capabilityVersion, policyVersion, knowledgeVersion, evaluationSuiteVersion.

Version records serve four engineering decisions: (1) Does old Checkpoint need migration, old Runtime recovery, or direct human handoff? (2) Can new model remove outdated orchestration patches without breaking business constraints? (3) After capability/policy upgrade, which pending approvals must be re-judged? (4) Was production regression caused by model, Harness, context, knowledge, or external dependency change?

Safer upgrade: keep Session/Harness/Sandbox interfaces stable, run Evaluation Contract on version combinations, canary then gradual rollout; retain rollback, pause, manual takeover for high-risk capabilities. System must govern not only agent actions but also Harness's own assumptions about model and runtime environment.

Don't Build a Giant Harness Platform First

Like other KDC runtimes, Agent Harness is a set of engineering responsibilities, not necessarily a standalone platform from day one. V1 picks one high-impact flow and completes: stable Run/Turn/ToolCall identities; out-of-process Session Event and recoverable State; durable Pending Approval; one recoverable Checkpoint; State/View/Control boundaries; explicit Resume Contract (replay, idempotency, reconciliation, version compatibility); high-risk call idempotency and result verification; model-visible context isolation from execution credentials/sandbox; reasoning/capability/policy/feedback correlation keys; Evaluation Contract with fault injection and multi-grader for refresh/restart/duplicate/result-unknown scenarios.

When multiple agent products repeat handling approval, recovery, artifacts, sub-agents, run control, then abstract into shared Harness or Agent Runtime. Abstraction order: real failures & business risks → explicit runtime facts → minimal state protocol → verify recovery & governance boundaries → then form shared platform capabilities.

Practice: Run Recovery Drills on One Agent Flow

Pick a task with real-world impact (refund, send message, create order, modify permission, submit approval). Test not just happy path but at least these failure scenarios:

Refresh while awaiting approval — same Approval can restore, still points to original judgment and capability.

Backend restart while awaiting approval — Runtime recovers from Checkpoint, doesn't bypass approval.

User double-clicks confirm — Approval consumed once, high-risk call not re-executed.

Tool executed but response lost — State enters result_unknown and actively reconciles, no blind retry.

User clicks Stop during tool execution — System distinguishes model stop, tool cancellation, irreversible external action.

Artifact generated then page refresh — Artifact still locatable via stable ref to original Run and Tool Call.

Sub-agent returns after main process restart — Result still associates to parent Run, Turn, goal.

Policy/permission changes during wait — Resume re-validates, doesn't reuse stale authorization premises.

Interface returns success but reality result didn't happen — Run can end, business goal stays pending or exceptional.

Context compression drops history — Authoritative State unchanged, new Context can still reference necessary objects/events.

Harness process permanently lost — New instance recovers from Durable Session, no dependency on old process variables.

Sandbox compromised by untrusted code — High-privilege long-lived credentials still invisible, call scope limited by capability proxy.

Restore old Checkpoint with new version — System runs compatibility check, migration, or human handoff, not silent replay under new logic.

Long task cross-session handoff — Incoming party verifies baseline, understands unfinished items, executes explicit next step.

Swap model/Harness version — Fixed regression suite detects trajectory, recovery, governance, reality outcome regressions.

After drills, produce five minimal artifacts: (1) State & Event Schema — what state must persist, who produces, how reduced; (2) Resume Contract — replay boundary, idempotency, reconciliation, compensation, version rules per interruption type; (3) Security Boundary Map — trust relationships between model, Harness, capability proxy, sandbox, data, credentials; (4) Progress Contract — how long tasks verify baseline, handoff scene, determine next step; (5) Evaluation Contract — fault injection + multi-grader verifying trajectory, recovery, governance, reality outcome.

If team still needs to read chat text, check multiple logs, ask on-call engineer to judge whether an action was authorized, executed, retryable — then runtime facts haven't become stable production capability.

From "What Model Did" to "What System Can Believe"

Production-grade agent difficulty isn't just better model plans or more tools. System must simultaneously answer three question groups:

Business Causality : Why this judgment? Based on what knowledge? Who authorized action? Did action achieve reality goal?

Runtime Continuity : Where is execution? What state recoverable? What commands still valid? Which external effects already occurred?

Verification & Evolution : Can we safely continue after interruption? Can next session reliably take over? Did final environment really reach target state? Did model/Harness/capability upgrade cause regression?

Agent Harness mainly fills runtime continuity; Evaluation Harness checks runtime path and reality results; KDC attempts to connect all three to a single responsibility chain. When business causality chain and runtime fact chain have stable identities, clear owners, recovery contracts, verifiable boundaries, an agent becomes more than "completed one model loop" — it becomes a software system that continues to bear engineering responsibility across interruption, recovery, handoff, approval, failure, upgrade, and reality feedback.

Theoretical Boundaries and Open Questions

Article treats Agent Harness as external engineering reference, not new KDC core term. Run, Turn, Checkpoint, Pending Approval, Artifact Reference, Control Command are candidate runtime objects; their minimal structure, state machines, persistence, cross-framework protocols need validation via implementation. Session/Harness/Sandbox three-layer topology, Resume/Progress/Evaluation Contracts are Derived engineering models combining public practices — not industry unified standards. Dual-chain structure (business causality + runtime facts) is also a current Derived model; precise boundaries with event sourcing, durable execution, workflow engines, saga, state machines, agent frameworks, observability systems need further comparison. Open questions: can unified event store meet performance, privacy, deletion, audit, cross-region in concrete business? How do old Checkpoints recover across model/Harness versions? Which context projection metadata worth long-term retention? Article does not advocate full persistent/sandbox/audit structure for all low-risk Q&A — necessity grows with action impact, execution length, human wait, irreversibility of external side effects. Implementation should be risk-tiered, not mechanically replicate full topology on every model call.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

State ManagementReactAI Agent EngineeringAgent HarnessKDCDurable ExecutionEvaluation ContractsRecovery Contracts
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.