Appearance
Tutorial: Aionis Doc + Runtime Resume
Take a recovered Aionis Doc handoff and push it back into the live runtime path through context/assemble and tools/select.
Before you start
- You already completed Tutorial: Aionis Doc Quickstart, or you already have a saved
recover-result.json. - You have a running Aionis endpoint in
BASE_URL. - You know your
scope, and if auth is enabled you haveAIONIS_API_KEYor bearer auth ready.
What this tutorial is for
This tutorial explains the current public resume boundary for Aionis Doc.
Today, the runtime path is:
- recover native continuity from
aionis doc recover - feed
execution_state_v1andexecution_packet_v1intocontext/assemble - feed recovered continuity into
tools/select - let your runtime execute the selected action using the assembled context and recovered next action
This is not yet a one-command direct execution path from the document itself. It is the supported bridge into runtime execution.
What you will finish with
One recovered Aionis Doc handoff that becomes:
- runtime context input
- policy-governed tool selection input
- a real execution attempt with a stable
run_id
Input
Environment contract
Use these values across all steps:
BASE_URL = http://127.0.0.1:3001SCOPE = defaultDOC_DIR = .aionis-doc-quickstartRUN_ID = run_doc_resume_001
Files expected from the prior quickstart
$DOC_DIR/workflow.aionis.md$DOC_DIR/recover-result.json
If recover-result.json does not exist yet, create it first:
bash
npx @aionis/sdk@0.2.20 doc recover "$DOC_DIR/workflow.aionis.md" \
--base-url "$BASE_URL" \
--scope "$SCOPE" \
--api-key "$AIONIS_API_KEY" \
--compact > "$DOC_DIR/recover-result.json"If your environment does not use API auth, omit --api-key.
Step 1: Inspect the recovered continuity payload
bash
jq '{
recover_result_version: .recover_result_version,
anchor: .recover_response.data.anchor,
handoff_kind: .recover_response.data.handoff_kind,
current_stage: .recover_response.data.execution_state_v1.current_stage,
active_role: .recover_response.data.execution_state_v1.active_role,
next_action: .recover_response.data.execution_ready_handoff.next_action
}' "$DOC_DIR/recover-result.json"What to confirm:
recover_result_versionisaionis_doc_recover_result_v1execution_state_v1existsexecution_packet_v1existscontrol_profile_v1existsexecution_ready_handoff.next_actionexists orhandoff.next_actionexists
Step 2: Build a runtime resume request for context/assemble
Create a request that carries the recovered continuity into planner/runtime assembly:
bash
jq '{
tenant_id: "default",
scope: "'"$SCOPE"'",
query_text: "resume quickstart workflow",
context: {
intent: "doc_resume",
workflow_kind: "aionis_doc",
control_profile_v1: .recover_response.data.control_profile_v1
},
execution_state_v1: .recover_response.data.execution_state_v1,
execution_packet_v1: .recover_response.data.execution_packet_v1,
include_rules: false,
return_layered_context: true
}' "$DOC_DIR/recover-result.json" > "$DOC_DIR/context-assemble-request.json"Why both fields matter:
execution_state_v1carries the persisted continuity stateexecution_packet_v1carries the exact runtime packet, includingnext_actioncontext.control_profile_v1carries the recovered control posture into downstream policy surfaces
Step 3: Assemble resume-ready context
With API key auth
bash
curl -sS "$BASE_URL/v1/memory/context/assemble" \
-H "X-Api-Key: $AIONIS_API_KEY" \
-H 'content-type: application/json' \
-d @"$DOC_DIR/context-assemble-request.json" > "$DOC_DIR/context-assemble-response.json"Without API auth
bash
curl -sS "$BASE_URL/v1/memory/context/assemble" \
-H 'content-type: application/json' \
-d @"$DOC_DIR/context-assemble-request.json" > "$DOC_DIR/context-assemble-response.json"Inspect the runtime assembly result:
bash
jq '{
packet_source_mode: .execution_kernel.packet_source_mode,
execution_state_v1_present: .execution_kernel.execution_state_v1_present,
execution_packet_v1_present: .execution_kernel.execution_packet_v1_present,
selected_tool: .assembly_summary.selected_tool,
context_est_tokens: .assembly_summary.context_est_tokens
}' "$DOC_DIR/context-assemble-response.json"What to confirm:
execution_kernel.packet_source_modeispacket_inputexecution_state_v1_presentistrueexecution_packet_v1_presentistruelayered_contextexists if you requested it
What this means:
- the runtime accepted recovered continuity as execution kernel input
- the server did not have to rebuild the packet from state only
- the assembled context is now resume-aware
Step 4: Build a governed resume request for tools/select
Now push the same recovered continuity into the policy-governed selection surface:
bash
jq '{
tenant_id: "default",
scope: "'"$SCOPE"'",
run_id: "'"$RUN_ID"'",
context: {
intent: "doc_resume",
workflow_kind: "aionis_doc",
control_profile_v1: .recover_response.data.control_profile_v1
},
execution_state_v1: .recover_response.data.execution_state_v1,
candidates: [
"resume_patch",
"run_focused_smoke",
"request_review"
],
strict: true
}' "$DOC_DIR/recover-result.json" > "$DOC_DIR/tools-select-request.json"Step 5: Select the next action under recovered control state
With API key auth
bash
curl -sS "$BASE_URL/v1/memory/tools/select" \
-H "X-Api-Key: $AIONIS_API_KEY" \
-H 'content-type: application/json' \
-d @"$DOC_DIR/tools-select-request.json" > "$DOC_DIR/tools-select-response.json"Without API auth
bash
curl -sS "$BASE_URL/v1/memory/tools/select" \
-H 'content-type: application/json' \
-d @"$DOC_DIR/tools-select-request.json" > "$DOC_DIR/tools-select-response.json"Inspect the selection result:
bash
jq '{
selected_tool: .selection.selected,
decision_id: .decision.decision_id,
run_id: .decision.run_id,
control_profile_origin: .execution_kernel.control_profile_origin,
execution_state_v1_present: .execution_kernel.execution_state_v1_present,
current_stage: .execution_kernel.current_stage,
active_role: .execution_kernel.active_role
}' "$DOC_DIR/tools-select-response.json"What to confirm:
decision.run_idmatchesRUN_IDdecision.decision_idexistsexecution_kernel.execution_state_v1_presentistrueexecution_kernel.control_profile_originiscontinuity_deliveredwhencontrol_profile_v1is passed incontext
Step 6: What actually resumes after selection
At this point, your runtime has everything needed to continue the execution attempt:
layered_contextfromcontext/assembleexecution_packet_v1.next_actionfrom the recovered continuityselection.selectedfromtools/selectdecision.decision_idandrun_idfor replay continuity
The practical execution loop is:
- read
execution_packet_v1.next_action - run the selected tool or module in your runtime
- keep
run_idstable - persist the rest of the lifecycle through
tools/decision,tools/run, andtools/feedbackif your integration uses the full policy loop
What success looks like
- recover returns continuity payloads
context/assemblereportspacket_inputexecution-kernel modetools/selectreturns a realdecision_idunder the recovered execution state- your runtime can now continue work without reconstructing the task from scratch
Common failure and fix
Failure:
text
execution_state_v1 validation failedFix:
- confirm you are passing the recovered
execution_state_v1object unchanged - if you manually edited saved JSON, regenerate it from
aionis doc recover - prefer passing both
execution_state_v1andexecution_packet_v1to preserve exact continuity