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

SYSTEMATIC LEARNING / FOUR-LEVEL COURSE

Incident containment, evidence, and causal diagnosis

Two offline incident cases have the same 403 rate. Follow the events for a failed task in each case to find the first stage where it went wrong, then use the evidence to plan containment and reconcile in-flight work.

Learning objectives: Implement and explain denominator-correct metrics and first-stage diagnosis, preserve red-to-green evidence, then design containment and rollback without erasing business facts. Public checks do not prove authorship, semantic quality or real incident experience.

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

Choose a starting point based on your familiarity with this topic. Current level: Design · Explain the trade-offs. 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.

Incident containment, evidence, and causal diagnosis
Implement and explain denominator-correct metrics and first-stage diagnosis, preserve red-to-green evidence, then design containment and rollback without erasing business facts. Public checks do not prove authorship, semantic quality or real incident experience.

How does the mechanism work?

Step-by-step explanation
  1. How to monitor if the quality drops but HTTP 200 is normal?

    Incident assessment must check business quality beyond HTTP status.

  2. What to do with in-progress tasks after rollback?

    After containment and rollback, business operations still in flight require handling.

  3. What information should go into the incident log?

    Causal diagnosis requires reliable records and a clear separation of facts from hypotheses.

Design · Explain the trade-offs

Explain design trade-offs · Incident containment, evidence, and causal diagnosis

Objectives of this level: Design scoped containment, verified rollback and reconciliation for five in-flight operations.

Visual guide · From aggregate alarm to a task

From aggregate alarm to a task

Equal aggregate symptoms can have different causes. This fixture protocol finds an observed broken stage; missing observations remain unknown. Select the figure to open it at full size.

Containment and rollback have separate evidence

The previous layers diagnose authored read-only traces. This layer is a design exercise about high-impact writes, not an implemented merchant integration. Google SRE incident response supports explicit coordination, communication and control. Name an owner, record logical times, scope the pause and retain redacted facts before forming a final causal account. A task failure rate is not a monetary-loss calculation, and a source-code rollback is not a remote transaction rollback.

Complete in-flight ledger

Use the following new authored input at logical time 2000. The supplied merchant_lookup and bound receipts are independent business facts for this exercise. They are not outputs of incident_lab.py, provider results, measured production records or learner-created success claims.

{
  "source": "authored_design_fixture",
  "clock": "logical milliseconds",
  "incident_time_ms": 2000,
  "rollback_requested_version": "v1",
  "new_task_manifest": {
    "router": "v1",
    "context": "v1",
    "approval": "current"
  },
  "records": [
    {
      "task_id": "q",
      "tenant": "t1",
      "version": "v2",
      "at_ms": 1980,
      "local_state": "queued",
      "operation_key": null,
      "approved": false,
      "permission_epoch": 1,
      "merchant_lookup": "not_sent",
      "remote_effects": 0
    },
    {
      "task_id": "r",
      "tenant": "t1",
      "version": "v2",
      "at_ms": 1990,
      "local_state": "ready",
      "operation_key": "op-r",
      "approved": true,
      "approval_binding": "t1/order-r/10/proposal-r/epoch-1",
      "permission_epoch": 1,
      "merchant_current_epoch": 2,
      "merchant_allowed": false,
      "merchant_lookup": "not_sent",
      "remote_effects": 0
    },
    {
      "task_id": "u",
      "tenant": "t1",
      "version": "v2",
      "at_ms": 1995,
      "local_state": "unknown",
      "operation_key": "op-u",
      "approved": true,
      "merchant_lookup": "committed",
      "receipt": {
        "operation_key": "op-u",
        "tenant": "t1",
        "resource_id": "order-u",
        "amount": 10,
        "receipt_id": "receipt-u"
      },
      "remote_effects": 1
    },
    {
      "task_id": "c",
      "tenant": "t2",
      "version": "v1",
      "at_ms": 1970,
      "local_state": "completed",
      "operation_key": "op-c",
      "approved": true,
      "merchant_lookup": "committed",
      "receipt": {
        "operation_key": "op-c",
        "tenant": "t2",
        "resource_id": "order-c",
        "amount": 10,
        "receipt_id": "receipt-c"
      },
      "remote_effects": 1
    },
    {
      "task_id": "x",
      "tenant": "t1",
      "version": "v2",
      "at_ms": 1998,
      "local_state": "unknown",
      "operation_key": "op-x",
      "approved": true,
      "merchant_lookup": "unavailable",
      "remote_effects": null
    }
  ]
}

q has not been sent or approved. r was approved for epoch 1 but current merchant authority is denied at epoch 2. u has an unknown local result but a bound merchant receipt confirming one effect. c is already completed under v1. x has an unavailable lookup, so its external outcome remains unknown. An old local approval or a recovered average must not override current denial. A local timeout must not be relabeled “not sent.”

Your thirty-minute plan is a design artifact

Write incident-containment.md with a timestamped first action, owner, affected version/tenant/action scope, preservation of input/report hashes, and separate lanes for new requests and each in-flight operation. State what observation triggers a pause, fallback, rollback, resume or escalation. If stopping high-risk writes is necessary, specify what happens to queued ordinary reads instead of asserting that all services must stop. Verify the actual router/context manifest of new tasks after rollback; do not infer it only from a deploy label. A stable version still uses current permission checks.

For every ledger row, specify the next action, why it is allowed, the fact consulted, and resulting local state. For unknown operations preserve the original operation_key, reconcile a receipt against tenant/resource/amount, and retain uncertainty when lookup is unavailable. Never create a new key merely to repeat an unknown write. Preserve already committed facts; any compensation is a separate business action with fresh authority and its own binding. Explain who reconciles the user-visible status and when. You are not required to execute remote refunds in this exercise.

Resumption requires evidence and a scoped regression

List a version-controlled router/context fix hypothesis, the failed task IDs and the relevant boundary negative controls, who reviews policy/semantic evidence, and what controlled new-task observation would permit resumption. Keep correct denials, foreign-resource rejection and unknown-effect reconciliation as hard boundaries even if average acceptance rises. Separate mechanical fixture checks from semantic review, actual API integration and production monitoring. Missing provider usage/bills remain “unmeasured”; no fee estimate may be fabricated from round counts.

Submit the plan and the five per-operation decisions, a manifest verification example and one unavailable-lookup escalation. The reviewer checks the written decisions and changes one supplied condition, for example lookup becoming available with a mismatched tenant receipt. There is no automated design score or actual containment run in this lesson. Passing the public code checks is insufficient evidence for this layer, a real enterprise incident, or all-company interview readiness.

code example

Unknown local result with one committed remote effect

For u, merchant_lookup=committed and a receipt bound to op-u/t1/order-u/10 establish one remote effect. Reconcile the local state under the original key; do not create a second effect to make the local result look clear. For x, lookup unavailable keeps the result unknown.

Acceptance task for this level

Submit incident-containment.md: a timestamped scoped plan, five in-flight decisions, verified new-task manifest, original-key receipt reconciliation, unavailable-lookup escalation, resumption evidence and a changed-condition answer.

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

After rollback, lookup for x returns a receipt for a different tenant; may the local state become completed, or may you send a new key?

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.