Skip to content
Agent Field Notes
Course contentsExpand a topic to choose a lesson.

SYSTEMATIC LEARNING / FOUR-LEVEL COURSE

Match orchestration abstractions to business responsibilities

Use state complexity, recovery requirements, tool contracts, and team constraints to make trade-offs, rather than choosing based on framework popularity.

Learning objectives: The framework should cover the control and recovery complexity that the task truly requires, rather than assuming non-existent guarantees for the business. Selection compares fault behavior, debugging costs, and state transition boundaries for the same task.

Content checked: 2026-10-03 · Each level has independent explanations, tasks and inspections

Choose a starting point based on your familiarity with this topic. Current level: Implementation · Build it. After completing the task, continue to the next level. Reading and self-checks alone do not establish mastery.

On this level

Review the prerequisites

Suitable for: Backend developers learning Agent applications.

Match orchestration abstractions to business responsibilities
The framework should cover the control and recovery complexity that the task truly requires, rather than assuming non-existent guarantees for the business. Selection compares fault behavior, debugging costs, and state transition boundaries for the same task.

How does the mechanism work?

Step-by-step explanation
  1. With an existing Java task platform, when is it worth introducing a Python graph orchestration service?

    Framework selection must consider the existing Java platform and team costs as well as abstractions.

  2. When the business process is fixed, why might there be no need for multiple agents?

    Establish the need for workflows and multiple agents separately.

  3. The framework upgrade changes the status format. How to migrate tasks that are waiting for approval?

    After persisting framework state, address upgrades and compatibility with old tasks.

Implementation · Build it

Implement the contract · Match orchestration abstractions to business responsibilities

Objectives of this level: Implement deterministic capability/language filtering and tie-breaking.

Visual guide · Filter fit before comparing cost

Filter fit before comparing cost

Capabilities and operating costs here are declared fixtures, not product benchmarks. No fit returns none; a framework name grants no business guarantee. Select the figure to open it at full size.

Same after-sales project

The after-sales Agent reads an order and policy, pauses for approval and resumes a return-application request. Compare an existing Java loop, a Java workflow and a Python graph using declared capability fixtures, not product reputation. A model SDK handles model I/O; orchestration owns control flow; business services still own authority and effects. Anthropic’s workflow/agent distinction motivates comparing task constraints; its tooling examples are version-sensitive.

The existing capstone main-return creates a return application; it does not execute a refund. These manifests are independent fictional extensions or policy/evidence/counting exercises. They do not add real refunds, publication, model calls or Java execution to the capstone runtime.

Complete function contract

Implement choose_orchestration(payload). Required fields: required is a unique string list drawn from durable/human_wait/branches/migration; language is a nonempty string; candidates is a list of records with unique nonempty id, unique capabilities from that same vocabulary, nonempty language, and nonnegative integer ops_cost. Empty lists are valid. Reject malformed fields, unknown capabilities or duplicate IDs with ValueError:input; booleans are not integers. Extra fields are ignored. A candidate qualifies only when every required capability is present AND its language matches. Return exactly {"choice": id_or_null, "rejected": [{"id": id, "missing": [strings]}]}. Select the eligible minimum (ops_cost, id) using ascending string order for ties. For each rejected candidate list absent required capabilities plus language:<required language> if mismatched, sorted ascending; rejected rows sort by id. Eligible non-winners are not rejected. This is a declared capability filter, not discovery of framework guarantees.

Every listed input key must exist; explicit null is not an absent key. All returns must be JSON-compatible fresh containers, with exact bool/int distinctions, and leave the input unchanged. Every invalid declared field uses exactly ValueError("input"); this includes malformed nested fields. Do not swallow NotImplementedError or return a self-declared passed flag.

Own blank implementation

Download the full local package, extract it and work in its lab_runner.py directory. Runner and this case manifest are alternatives: save the runner and cases/framework-selection.json with that exact directory layout. The manifest contains all public fixed inputs/expected outputs; it contains no general solution. It is not an unseen assessment. Python 3.9+ and standard library only; no model keys or network calls are needed while grading.

def choose_orchestration(payload):
    raise NotImplementedError("Implement the documented contract yourself")
python3 lab_runner.py scaffold --course framework-selection --out student.py
python3 lab_runner.py grade --course framework-selection --module student.py --out report.json

The untouched scaffold must exit 1. Fill the function yourself and rerun; all 10 public checks must pass for exit 0. Submit student.py, the generated report.json, your source diff and one additional condition-changing test. The runner imports and calls your function on each actual payload, compares exact output/error, checks input preservation and container independence, and records runner/cases/student SHA. A manual passed flag is not accepted. Its 5-second process timeout is a hang guard, not an enterprise latency requirement.

code example

Deliver your own function and report

Implement choose_orchestration(payload). Required fields: required is a unique string list drawn from durable/human_wait/branches/migration; language is a nonempty string; candidates is a list of records with unique nonempty id, unique capabilities from that same vocabulary, nonempty language, and nonnegative integer ops_cost. Empty lists are valid. Reject malformed fields, unknown capabilities or duplicate IDs with ValueError:input; booleans are not integers. Extra fields are ignored. A candidate qualifies only when every required capability is present AND its language matches. Return exactly {"choice": id_or_null, "rejected": [{"id": id, "missing": [strings]}]}. Select the eligible minimum (ops_cost, id) using ascending string order for ties. For each rejected candidate list absent required capabilities plus language:<required language> if mismatched, sorted ascending; rejected rows sort by id. Eligible non-winners are not rejected. This is a declared capability filter, not discovery of framework guarantees.

The exact function and complete inputs are in the main body. Implement from the blank starter, not by copying expected outputs into branches.

Acceptance task for this level

Implement the blank function and submit the real generated report, own code/diff and one changed-condition test; Java candidates additionally deliver their real Java patch/build. Contract: choose_orchestration(payload).

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

If two eligible candidates cost 2, can input order decide?

Further explanations and practice

When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.

All linked explanations and exercises (1 )

Sources and verification scope

The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.