Review the prerequisites
Suitable for: Backend developers learning Agent applications.
- A controlled task chain from evidence to publication
- Enterprise tasks should be recorded separately for reading evidence, generating drafts and publishing results, and then connecting them with versions and authorizations. Durable orchestration restores control flow but does not automatically guarantee consistent evidence or that external writes occur only once.
How does the mechanism work?
Step-by-step explanation
- Reports involve multiple documents that are constantly updated. How to define a consistent snapshot of evidence?
Reports draw on multiple changing sources, so explain the scope of evidence consistency.
- The worker crashes after a successful release. How to avoid repeated releases during recovery?
Durable-task recovery must handle the window where an external action succeeds but is not recorded locally.
- When the user cancels the task, how to handle the external requests that have been sent?
The task chain must define how cancellation relates to an irreversible commit.
Debugging · Diagnose failures
Diagnose failures · A controlled task chain from evidence to publication
Objectives of this level: Locate unsafe resend and revoked-authority transitions on fixed evidence.
Visual guide · Publish from current facts
This planner only recommends a next step. Check current authority first; stale approval cannot turn committed or unknown receipts into a fresh send. Select the figure to open it at full size.
Same after-sales project
The after-sales Agent publishes a reviewed refund-policy notice. A stored checkpoint is control-flow data; current publishing authority, current document version, approval binding and the external receipt are separate facts. This local planner recommends a next step; it does not commit a database transaction, publish remotely or prove enterprise readiness.
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.
Same-input fault reproduction
In a copy, treat unknown receipts as none. On the exact unknown-receipt payload the first wrong transition is reconcile → publish. Record the operation key, expected/actual next step and source diff; fix the transition before adding retries. A second negative control revokes current authority while retaining the old approval.
{
"current": {
"tenant": "t1",
"version": "v2",
"can_publish": true
},
"document": {
"tenant": "t1",
"version": "v2"
},
"approval": {
"tenant": "t1",
"version": "v2",
"expires_at": 101
},
"receipt": {
"status": "unknown",
"operation_key": "publish-42-v2"
},
"operation_key": "publish-42-v2",
"now": 100
}
Use this expected result from the foundation sample, unchanged:
{
"expected": {
"next": "reconcile",
"reason": "unknown_receipt",
"operation_key": "publish-42-v2"
},
"error": null
}
Evidence before repair
After implementing, preserve a faulty student-before.py. Run the before command, inspect its first actual mismatch, then repair student.py and rerun the after command. Keep both reports, source hashes/diff, an evidence→hypothesis→distinguishing-evidence note and the named negative control. Reports may contain an earlier first mismatch than the named probe; explain both. The public suggested fault is a reproducible exercise, not an unannounced incident or unseen test.
python3 lab_runner.py grade --course enterprise-agent-design --module student-before.py --out before-report.json
python3 lab_runner.py grade --course enterprise-agent-design --module student.py --out report.json
import json
from pathlib import Path
report = json.loads(Path("before-report.json").read_text())
first = next((row for row in report["checks"] if not row["passed"]), None)
print(json.dumps(first, indent=2, ensure_ascii=False))
Optional retrospective after evidence
Query the authoritative target by the original operation key; a timeout log alone cannot distinguish them.
code example
Preserve the same-input red/green repair
In a copy, treat unknown receipts as none. On the exact unknown-receipt payload the first wrong transition is reconcile → publish. Record the operation key, expected/actual next step and source diff; fix the transition before adding retries. A second negative control revokes current authority while retaining the old approval.
Acceptance task for this level
Freeze a faulty copy, submit evidence and competing hypotheses, reproduce the same-input failure, repair it and preserve red/green reports plus a negative control. Contract: plan_publication(payload).
Reading this browser’s record…
Hide the answer and check your understanding
Which evidence distinguishes timeout-before-write from receipt-lost-after-write?
Expand reference derivation
Query the authoritative target by the original operation key; a timeout log alone cannot distinguish them.
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.
- LangGraph: Persistence and Thread Checkpointing
- Temporal: Activity retry, receipt and cancellation
- MCP:Authorization
- PostgreSQL: Transaction Isolation and Consistent Snapshots
- AWS: Transactional outbox and duplicate delivery
- Public fixed contract inputs
- Local pure-function checker
- Extended Agent local practice package